.
Overview.
There are may ways to do flood monitoring and prediction, eg. using the computation model and accurate measurement method. Of course lately the AI models are being implemented to perform the tasks.
In this project, an intelligent model built with SensiML tools will be deployed to a QuickFeather Development Board and it will detect if there is a flood happening.
.
.
Setup hardware and SensiML.
There is a very nice tutorial describing how to setup the hardware and SensiML system. Follow this to setup the development environment.
.
Build the Quickfeather Simple Streaming Interface AI Application Project.
I followed the instructions of the project and built the app successfully.
.
.
Data Capture with Data Capture Lab.
I created two labels (no flooding
and flooding
) and two classes ( test
and train
). With Data Capture Lab, I recording few datasets for various combinations between (no flooding, flooding) and (test, train).
.
.
.
Clense the datasets.
To clense the data, I labeled the data with more pricise labeling of data segments. You can do this by opening any data files. Then you can right click and drag over the segments you want to keep and label the segments.
.
.
Build model with Analytics Studio.
At the Prepare Data
tab, add and setup a query. At the Build Model
tab, add a pipeline and click Optimize to build the model.
.
.
Explore the Model.
At the Explore Model
, you can view several charts such as Model Visualization, Confusion Matrix, Feature Summary and a few other summaries.
.
.
Test the Model.
At the Test Model
tab, you can test the model and view the results.
.
.
Deployment.
This is the last step. I downloaded the model as a Knowledge Pack. Knowledge Pack comes in the forms of binary
, libary
or source
. For this project, I first downloaded the model in the form of binary and flashed it to the QuickFeather board.
.
.
I flashed the binary file to QuickFeather board and connected a terminal to the COM port:
.
.
Later, I downloaded it as library as my account does not allow me to access the source version of the model. Based on the classification value, it will turn the red LED on ( classification value is 1 when 'flood' ) and off ( classification value is 2 when 'noflood') ). Unzip the library and update the Knowledge Pack (as library) into existing qf_ssi_ai_app
app. I added the corresponding code change to the src/sml_output.c
file:
// if flood, then turn red LED on
if ((int)classification == 1) {
HAL_GPIO_Write(GPIO_6, 1);
} else {
HAL_GPIO_Write(GPIO_6, 0);
}
.
And change this at app_config.h
:
#define S3AI_FIRMWARE_IS_COLLECTION 0 /* Enable sensor data collection */
#define S3AI_FIRMWARE_IS_RECOGNITION 1 /* Enable knowledgepack recognition */
.
Here is a short video which shows the red LED is turned on ( when it is 'flood' ) and off ( when it is 'noflood' ).
.
Summary (next steps).
This is an over-simplified project with barebone components. The final product is a float buoy with a enclosure consists of the QuickFeather board installed with the AI model. A solar powered battery will be used to provide the power to the unit.
.
More datasets should be collected and analyzed in order to build a more accurate model for the flood detection.
.
With additional low-power, long-range LoraWAN device, critical alerts can be relayed to nearby monitoring station for prompt and responsive actions.
.
References.
Lee, J.; Kim, B. Scenario-Based Real-Time Flood Prediction with Logistic Regression. Water 2021, 13, 1191. https://doi.org/10.3390/w13091191
.
Chang, D.-L.; Yang, S.-H.; Hsieh, S.-L.; Wang, H.-J.; Yeh, K.-C. Artificial Intelligence Methodologies Applied to Prompt Pluvial Flood Estimation and Prediction. Water 2020, 12, 3552. https://doi.org/10.3390/w12123552
.
Alireza Shamkhalchian & Gustavo A. M. De Almeida (2020) Upscaling the shallow water equations for fast flood modelling, Journal of Hydraulic Research, DOI: 10.1080/00221686.2020.1818316
.
Echeverribar, Isabel, Morales-Hernández, Mario, Brufau, Pilar, and García-Navarro, Pilar. Wed. "2D numerical simulation of unsteady flows for large scale floods prediction in real time". United States. doi:https://doi.org/10.1016/j.advwatres.2019.103444.https://www.osti.gov/servlets/purl/1606813.
.
M. Morales-Hernández, P. García-Navarro, J. Burguete, P. Brufau, A conservative strategy to couple 1D and 2D models for shallow water flow simulation, Computers & Fluids, Volume 81, 2013, Pages 26-44, ISSN 0045-7930, https://doi.org/10.1016/j.compfluid.2013.04.001.
.
Comments