Inspiration

According to insurance claim records, the most common problem in building construction is water damage. Flooding incidents in residential and commercial buildings could cause up to $100M losses if not dealt with in time. However, the solutions to prevent and detect flooding really lack. Existing solutions require special hardware mounted on the water pipes.

What it does

Our system uses image data captured by the surveillance camera to detect flooding with computer vision algorithms. Once a flood is detected, our system automatically sends a warning email to the building owner with the latest flooding image. The system automatically increases the monitoring frequency on the incident building and stores flooding images on in the database for future records.

How we built it

First, we created a Spring boot project. We created some error classes and exception classes so that all the errors will be handled by Spring and the system won't crash. Then we tried a simple Hello World request and test if it is working. We assume that the images will be sent from the cameras using HTTP requests and the data will be a byte array. We created the controllers, models, services, and data access layers. If an image needs to be saved, it will first be put in a model, checked in the service class, then using the JPA repository to store in the MySql database. We use Java mail API in Spring framework and save the image in the server, then read and attach it in the email.

We use Google Vision APIs to check if the image in the request contains any flooding incident. If the answer is yes, the image will be saved in the database and attached to the alerting email. Our server also gives feedback to the surveillance camera in order to increase data collection frequency when flooding is detected.

Challenges we ran into

There is no dataset for indoor flooding. The common computer vision models for image classification can only recognize flooding caused by extreme weather. We have tried Google Vision APIs' classification and web detection methods and came up with a combined solution for better detecting residential floods. We also explore deep learning architectures that can be used once indoor flooding data is collected from insurance companies.

When we use the Google Cloud Vision API, we ran into an authentication issue. According to the documentation, we need to set an environment variable for the credential file. However, we tried all the methods in Google's document, but none of them worked. We found that the ways Google provides are not setting the environment variable permanently and once the command window is closed, it won't work. Setting the environment variable manually solved the problem.

Accomplishments that we're proud of

We are very proud that we have built a complete flooding alerting system within such a short period of time and just two of us. And we are also able to attend interesting workshops and tech fairs during the break of hacking.

What we learned

We have learned how to apply AI models to real-world problems and backend development using Spring.

What's next for Anti-Flooding

Request real indoor flooding data from the insurance companies and improve the AI algorithms to classify flooding scenes in higher accuracy and robustness.

Built With

Share this project:

Updates