- Overview
- Features
- Project Structure
- Installation & Setup
- Model Architecture
- Hardware Requirements
- Reference Video
- Data Preprocessing & Model Training
- Results & Performance
- Future Improvements
- License
Embedded AI is a project focused on implementing a machine learning model for power consumption prediction on an STM32F407G Discovery board. The workflow includes training a neural network using TensorFlow, converting the model to TensorFlow Lite (TFLite), and deploying it onto the microcontroller. The embedded system then predicts future power consumption based on historical data.
- Trains a neural network model using TensorFlow
- Converts the model to TensorFlow Lite for deployment
- Implements AI inference on an STM32F407G Discovery Board
- Uses UART communication for debugging and data visualization
- Predicts power consumption trends for the upcoming month
- Optimized for TinyML and Edge AI processing
/project-root
βββ /notebooks # Jupyter Notebooks for data analysis & model training
βββ /src # Source code for embedded implementation
βββ /models # Trained models and TFLite conversions
βββ /docs # Documentation and reports
βββ /images # README images
βββ README.md # Project Documentation
βββ requirements.txt # Python dependencies
βββ LICENSE # License information- Ensure Python 3.8+ and TensorFlow 2.x are installed.
- Clone the repository and navigate to the project directory:
git clone https://github.com/yourusername/EmbeddedAI.git cd EmbeddedAI - Install the required dependencies:
pip install -r requirements.txt
- Run the Jupyter Notebook:
jupyter notebook
- Train the model and save the final
.tflitefile.
- In the provided notebook, use:
converter = tf.lite.TFLiteConverter.from_keras_model(model) tflite_model = converter.convert()
- Save the converted model for deployment.
- Install STM32CubeMX and X-CUBE-AI.
- Use STM32CubeIDE to compile and flash the firmware.
- Load the model onto the microcontroller and validate using UART communication.
The neural network architecture used for power consumption prediction is based on a 1D CNN + Dense Layers model. The structure is optimized for edge deployment and efficiency in embedded environments.
- STM32F407G Discovery Board
- USB-to-TTL Module (for UART debugging)
- Power Consumption Sensor (optional for real-time data)
- Computer with STM32CubeIDE installed
For a detailed step-by-step implementation, watch the following video:
The dataset consists of historical power consumption values.
- Feature Engineering:
- Removed unnecessary columns
- Extracted time-based features (day, month, year)
- Normalized data between [0,1]
- Model Training:
- Used a 1D CNN + Dense Layers architecture
- Optimized using Adam optimizer
- Evaluated using RMSE, MAE, and MAPE
- Prediction RMSE: 0.000667201
- Memory Usage: 795.91 KiB
- Power Consumption: 14.68 KiB
- Improve prediction accuracy by tuning the CNN architecture
- Integrate real-time power consumption monitoring
- Optimize memory usage using quantization techniques
- Expand dataset for more accurate trend analysis
This project is licensed under the MIT License - see the LICENSE file for details.






