Inspiration

Given that the topic for this hackathon was smart cities, we wanted to create a project that would be applicable at tackling problems cities handle at a large scale. Water waste at large was one problem that came to mind, so we did some research and iterated upon works that had previously been completed on what is known as the L-Town Dataset. It was an old project, and we figured there were several features and improvements we could make to the model.

What it does

AquaGuard is an intelligent anomaly detection system designed to safeguard water distribution networks. Utilizing advanced Graph Neural Networks (specifically Graph Attention Networks, or GAT), it continuously analyzes complex topological data alongside live flow and pressure readings to pinpoint leaks with high accuracy. By processing physical network maps (such as the L-TOWN benchmark) and mapping out spatial dependencies, AquaGuard flags anomalous patterns indicative of pipe bursts, providing utility operators with an interactive, real-time visualization of exactly where water loss is occurring.

How we built it

Our backend leverages Python and FastAPI to manage sensor data pipelines and model inference. For the machine learning engine, we used PyTorch and PyTorch Geometric to implement a custom Graph Attention Network (GATv2Conv) autoencoder. To accurately simulate hydraulic physics and generate validation data, we utilized the WNTR library. The frontend provides a seamless interactive experience built with React 19, Vite, Tailwind CSS, and Plotly.js for rendering massive network graphs. To accelerate our development process, we leveraged Gemini coding agents using Anti-Gravity.

Challenges we ran into

A big challenge for us entering into it was the dense amount of preexisting research behind some of the methods we were using like GNNs and Graph Attention Networks. We ran into some issues with ground truth localization and spatial bias as well, since initially our prediction models were spatially skewed toward specific clusters in the network, missing active leaks occurring elsewhere. We also needed mock flow data, so we implemented water physics using the WNTR library and EPANET engine so that our synthetic data mimicked real flow data.

Accomplishments that we're proud of

We are proud of successfully training a graph-based model of this magnitude. We are also proud to have successfully integrated real hydraulic physics into our pipeline using WNTR to simulate mock flow scenarios. Researching, understanding, and successfully deploying Graph Attention Networks was also a massive leap for us.

What we learned

We learned how to represent a physical water grid as a computational graph, mapping physical junctions to nodes and pipes to edges. We discovered how the attention mechanism allows our model to dynamically weigh the importance of neighboring nodes, understanding exactly how a pressure drop in one area affects distant, connected pipes.

What's next for AquaGuard

There are some features we didn't have time to add, such as adaptive thresholding and usage of more datasets from real towns, larger cities and more innovative neural network techniques, so that is something we would look forward towards adding in the future.

Built With

Share this project:

Updates