ver 0.1.0
LSTM_IoT is an project using machine learning (LSTM) to predict over live IoT sensor data
For data scientist, to fetch real world data and user machine learning to find out "interesting" data. For ai resercher, to get more data to tweak LSTM machines or pipe the example to more advanced machine learning setup. For the rest of us, monitor some parameter (temperature, sound, humidity, lightness, movement, air pressor, color, rotation, particle count, gas, PH ...) on physical things through sensors, predict its trend and detect abnormity.
The project is largely inspired and based on depending on https://github.com/jaungiers/LSTM-Neural-Network-for-Time-Series-Prediction and http://wiki.seeedstudio.com/Grove_Beginner_Kit_for_Arduino/
Install requirements.txt file to make sure correct versions of libraries are being used.
- Python 3.5.x
- TensorFlow 1.10.0
- Numpy 1.15.0
- Keras 2.2.2
- pyserial
- Matplotlib 2.2.2
- Arduino IDE
- a host PC/server running Python3
- an Arduino compatible board like Seeeduino
- some Grove sensors http://wiki.seeedstudio.com/Sensor/
select right serial port, remember the port number(like COM7) to change host settings later. change
select the right pin target sensor is using. For grove modules, find the first silkscreen near connected Grove connctor.
sensorPin = A0; // set the pin to target sensor
open serial plot to validate the sensor data is alive ![serial plotter pic]
maker sure all the environment are prepared, exactly as the ver. Anaconda is recommended to create a dedicated version.
setup the serial port to Seeeduino
sensor_port = serial.Serial('COM7', 9600)
Yes, run.py will
- gather all the libraries
- load the configuration in config.json (important to tweak LSTM to fit your situation)
- Build the Neuron Network model
- setup serial port and other variables
- loop every 0.1 second
- fetch a group of sensor data
- plot for the live sensor data after a group of data
- every 0.5 seconds: predict with latest data
- every 10 seconds: train LSTM again with latest data
- Trim the sensor data to latest 100
Watch how prediction evolves over time. Try change the sensing objects and see how the LSTM neuron network adapt the new trend.
Sensing with Grove Light sensor: change the lightness around sensor to see the live data change. Prediction can't forecast sudden human interfernece (yet), but will catch up and predict following stablized situations.
Sensing with Grove Sound sensor: since raw loudness is more verstile without obivous patterns, LSTM is predicting the baseline increase as moving closer to speaker and ignored the peaks.
to Jakob Aungiers, Altum Intelligence ltd https://github.com/jaungiers/LSTM-Neural-Network-for-Time-Series-Prediction
With his code, An initial offline testing (as below) was done with actual stored sensor data was quick convincing, thus I'm confident in accomplish this project.