This project implements an Edge Server that leverages an offloading algorithm to manage computational load between IoT devices and the server. The Edge Server evaluates the MQTT requests from connected devices and decides whether to offload the computation or let the device handle it locally based on factors such as network bandwidth, server load, and device capabilities.
Clone and go in the repository:
git clone https://github.com/WJW02/edge-neural-network-offloading-mqtt.git
cd edge-neural-network-offloading-mqtt/Install python 3.10.12:
pyenv install 3.10.12- This is the python version used to test the project
- Newer versions of python, like 3.12.X, don't support the tensorflow version used in the project
Switch to python 3.10.12:
pyenv global 3.10.12- You can switch back after configuration by running
pyenv system global
Create virtual environment:
python3 -m venv venvActivate virtual environment:
source venv/bin/activateInstall project dependencies:
pip3 install .Configure the absolute path to project (e.g. /home/username/Documents/edge-neural-network-offloading-mqtt/):
cd $(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
echo /absolute/path/to/project > project.pth- Save your keras model as
test_model.h5insrc/models/test/test_model/ - Save your test images in
src/models/test/test_model/pred_data/ - Configure
InputDataFilesandInputDatainsrc/commons.pyas needed
- Configure
MqttClientConfiginsrc/mqtt_client/mqtt_configs.py
In root directory, run mosquitto broker:
docker compose upIn src/edge, run edge:
python3 run_edge.pyIn src/web, run webpage:
streamlit run webpage.py