EcoCompress is an open-source, low-power AI/ML-based data compression toolkit designed for resource-constrained edge devices and IoT sensors. It enables efficient, adaptive, and high-fidelity compression of time-series sensor data using lightweight neural networks, with a deployment-ready workflow for STM32 microcontrollers.
- Lightweight 1D Convolutional Autoencoder for time-series sensor data
- High compression ratios with tunable fidelity (MSE/PSNR metrics)
- Preprocessing pipeline: normalization, windowing, train/val/test split
- Model optimization: quantization, ONNX export, TensorFlow conversion
- Deployment-ready: STM32Cube.AI and STM32CubeIDE integration for STM32 MCUs
- Clear, modular Python scripts for every step
EcoCompress/ ├── data/ # Raw and processed datasets (.csv, .npy) ├── src/ # All Python scripts │ ├── preprocess_window.py │ ├── train_autoencoder_tuned.py │ ├── evaluate_autoencoder.py │ ├── optimize_model.py │ ├── onnx_to_tf.py ├── notebooks/ # (Optional) Jupyter notebooks for EDA/prototyping ├── docs/ # Documentation ├── firmware/ # STM32 deployment files and code ├── tests/ # Unit tests (optional) ├── requirements.txt # Python dependencies ├── README.md
git clone https://github.com/Paramveersingh-S/compressor.git cd compressor
python -m pip install -r requirements.txt
Place your sensor data CSV (e.g., AirQualityUCI.csv) in data/, then run:
python src/preprocess_window.py
python src/train_autoencoder_tuned.py
python src/evaluate_autoencoder.py
python src/optimize_model.py
python src/onnx_to_tf.py
- Use STM32Cube.AI to import the ONNX or TensorFlow model.
- Generate and integrate C code into your STM32CubeIDE project.
- Flash and run on your STM32 Discovery board!
- Compression Ratio: Achieves up to 10:1 (lossy, tunable)
- Fidelity: PSNR > 21 dB (can be increased with tuning)
- Model Size: < 50 KB after quantization (STM32-ready)
- Supported Hardware: STM32 Discovery and Nucleo boards
- STM32Cube.AI User Guide
- ONNX to TensorFlow Conversion
- Project Wiki (coming soon)
Contributions, bug reports, and feature requests are welcome!
- Fork the repo and submit a pull request.
- Open an issue for questions or suggestions.
This project is licensed under the MIT License. See LICENSE for details.
- UCI Air Quality Dataset
- PyTorch, ONNX, STM32Cube.AI
- Inspired by CERN’s Baler project and TinyML best practices.