Inspiration Project Story

After the hackathon started, me and my team were searching for a critical problem to solve with our project, and this was initially the main reason we participated. We started researching problems that have a negative effect on the world, but this was not just a research question; it was about what problem with a negative impact on the world we could solve with an AI solution in 7 days.

After 5 hours of brainstorming and research , we noticed the fact that, according to the U.S. EPA WaterSense program, U.S. schools lose 15–25% of treated water every year due to undetected leaks, creating a major hidden environmental and financial problem. The American Water Works Association estimates that a single leak can add about $2,000 per year to a school’s water bill, and this scales to millions across school districts. The U.S. Department of Energy also highlights that wasted water increases energy use, where every 1,000 liters lost requires about 0.5 kWh of electricity, adding unnecessary carbon emissions. And all of this can be avoided if only we could fix the leak at an early stage. The problem is not that the maintenance manager does not have the ability to fix the leak, but that he cannot detect it because the vast and complex network of hidden pipes, coupled with the sheer size of campus facilities, makes human inspection physically impossible and economically inefficient to perform on a daily basis. Of course, he will not check every pipe in the school daily, and relying on all of this, we decided to build HydroSentinel-AI to empower facility managers with the real-time visibility they deserve, replacing manual guesswork with precise, automated insights that identify leaks the moment they occur.

What it does?

The AI-Driven Diagnostic Engine HydroSentinel-AI is a Physics-Informed Machine Learning (PIML) pipeline. We do not just process data; we treat the school’s plumbing as a dynamic physical system where the AI acts as the governing intelligence that enforces physical conservation laws in real-time.

  1. Physics-Informed Input Analysis Instead of treating sensor data as raw noise, our pipeline maps every data point to the Continuity Equation (Sum of mass in = Sum of mass out + Rate of change of mass in the system).

The Physics: We model the school as a network of control volumes.

The AI Layer: Our pipeline uses a custom preprocessing module to normalize flow and pressure sensors against occupancy data. By incorporating these physical constraints, the AI learns to distinguish between a "legitimate high-flow event" (e.g., student breaks) and a "physically impossible anomaly" (e.g., a hidden pipe burst).

  1. The Core Intelligence: Isolation Forest (Deep Anomaly Detection) While traditional systems use rigid If-Else thresholds (which fail to adapt to complex occupancy patterns), our AI uses an Isolation Forest algorithm to detect anomalies in a high-dimensional feature space.

Why Isolation Forest? Unlike density-based models, Isolation Forest explicitly "isolates" anomalies by randomly partitioning features. In our system, this allows the AI to identify leaks as "outliers" that violate the learned physical relationships between Pressure (P), Velocity (v), and Flow Rate (Q).

Physics-AI Fusion: The AI is trained to recognize the "Pressure Signature" defined by Bernoulli’s Principle (P + 0.5 * rho * v^2 + rho * g * h = constant). When a leak occurs, the AI observes a specific non-linear drop in pressure that deviates from the energy-loss profile expected by the Darcy-Weisbach equation. It flags this as a structural failure rather than a consumption spike.

  1. Explainable AI (XAI): From Prediction to Reasoning We utilize Explainable AI (XAI) to bridge the gap between model predictions and human action. When our model flags a leak, it generates an Explainability Card that tells the maintenance manager exactly why it was flagged:

Anomaly Score: A probabilistic value quantifying how much the current physical state deviates from the established "normal profile."

Contextual Reasoning: The model identifies whether the deviation was a "Mass Balance Violation" (Continuity) or a "Pressure Signature Anomaly" (Bernoulli).

Impact Quantification: The output automatically converts physical units (Liters/sec) into Financial ($) and Environmental (CO2e) impacts using the Water-Energy Nexus coefficients.

Why this outperforms "If-Else": If-Else logic is deterministic; it breaks when conditions change (e.g., unexpected school closures or peak seasons). HydroSentinel-AI is probabilistic and adaptive. It learns the school’s physical fingerprint over time. If a new pipe section is added or usage patterns shift, the AI automatically updates its baseline, ensuring zero false alarms and maximum diagnostic precision.

How we built it?

Building HydroSentinel-AI in just 7 days was a challenge in "Efficient Engineering." We focused on a modular architecture that allowed us to move from concept to prototype rapidly without sacrificing technical depth.

  1. Rapid Prototyping & Workflow (The 20-Minute Micro-task System) To maintain momentum, we implemented a strict "Micro-tasks" productivity workflow. By breaking the 7-day timeline into 20-minute focused sprints, we were able to run concurrent development cycles:

Data Simulation Layer: While one team member worked on the AI model architecture, another synthesized realistic telemetry data based on standard school consumption profiles to train the model in the absence of hardware.

Model Pipeline: We utilized Scikit-learn for the Isolation Forest implementation. By prioritizing a "pipeline-first" approach, we ensured that data preprocessing, feature engineering, and inference were integrated on Day 3.

  1. The Architecture (Integration, not Invention) We didn't reinvent the wheel; we integrated high-performance AI tools to build a robust diagnostic engine:

The AI Core: We chose Isolation Forest because of its efficiency in high-dimensional anomaly detection. We optimized the training process to ensure it could learn a facility’s "baseline" in minutes, not hours.

Physics Integration: We hard-coded the Continuity Equation and Bernoulli’s Principles into our data validation module. This acted as a "physical filter" that checked the AI's output against real-world laws, ensuring that our anomaly detection was scientifically sound.

Dashboarding: We used Streamlit to build our UI. This allowed us to iterate on our "Explainability Cards" and data visualizations in real-time, focusing on the user experience for facility managers.

  1. "Fail Fast, Learn Faster" (The Iteration Cycle) We treated the first 3 days as the "Data Understanding" phase. We purposefully tested our model with "noisy" data to identify where it would trigger false positives. By analyzing these failures, we tuned our hyper-parameters and refined our Event Mode logic, allowing the system to handle complex, real-world variables like school events.

  2. The Team Synergy We operated with clear role delegation:

Data Engineering: Managed the simulated sensor stream and the preprocessing pipeline.

AI & Physics Modeling: Focused on hyper-parameter tuning and embedding physical constraints into the logic.

UX & Integration: Handled the Streamlit frontend and the logic for the "Explainability Cards."

In summary, our success came from combining rapid software development practices with a strong physics-first design philosophy. We didn't just build a model; we built a system designed for reliability and real-world application.

Challenges we ran into

Building an AI-driven infrastructure system in a 7-day hackathon presented several non-trivial obstacles. Our greatest challenge, however, was the "Data Availability Gap."

  1. The Data Accessibility Challenge Accessing real-time IoT water telemetry from a school campus is impossible within a 7-day timeframe due to hardware installation delays and privacy protocols. We lacked a live sensor feed, which is the "lifeblood" of any AI model.

  2. The Engineering Solution: Synthetic Data Simulation Instead of stalling, we pivoted to Synthetic Data Generation. We constructed a robust CSV-based simulation pipeline that modeled real-world school plumbing behavior.

The CSV Engine: We didn't just generate random numbers. We built a high-fidelity CSV dataset that simulated 24-hour cycles, incorporating physical constraints such as:

Temporal Variance: Different usage patterns for mornings, lunch breaks, and nighttime.

Stochastic Noise: Natural variations in pressure due to pipe friction and building usage.

Controlled Anomalies: We injected synthetic "leak events" with varying flow rates and pressure drops to validate our model’s detection sensitivity.

Why this matters: This CSV simulation allowed us to train our Isolation Forest model under "perfect" and "noisy" conditions simultaneously. It acted as a digital twin, proving that our AI could detect leaks even in the presence of natural, non-leaking fluctuations—something a simple If-Else logic would never handle.

  1. Balancing Physics and Statistics A major challenge was ensuring that the AI’s "anomaly scores" aligned with physical reality. Initially, the model flagged high-usage periods (like school lunch hours) as anomalies because the flow rate was significantly higher than the baseline.

The Fix: We implemented a "Contextual Preprocessing Layer." We introduced occupancy data into our feature set, essentially teaching the model that "high flow + high occupancy = normal." This refined the model’s ability to differentiate between a physical leak and a high-demand scenario.

  1. Time Constraints & Modular Integration With only 7 days, debugging a complex ML pipeline is risky. We mitigated this by building a Modular Pipeline. We separated the data ingestion, the AI logic, and the UI into independent units. This allowed us to debug the physics-informed logic in the backend while simultaneously refining the Streamlit dashboard in the frontend.

Key Takeaway: This constraint was actually our biggest advantage. By generating our own synthetic datasets and physically validating our model, we built a system that is not dependent on a specific sensor brand or hardware configuration. HydroSentinel-AI is hardware-agnostic; it doesn't need to be "trained" on a specific school—it learns the physical fingerprint of any facility it is deployed in.

Accomplishments we’re proud of

  1. Physics-AI Fusion: We moved beyond "black-box" AI by embedding fundamental laws of physics (Continuity Equation & Bernoulli’s Principle) into our model. Our AI doesn't just calculate statistics—it understands the physical behavior of plumbing systems.

  2. Bridging the Data Gap: Faced with no access to live IoT hardware, we engineered a high-fidelity synthetic data simulator from scratch. This allowed us to train and stress-test our Isolation Forest model against thousands of complex, real-world scenarios.

  3. Actionable Sustainability: We successfully converted raw, noisy sensor data into a clear "Financial & Environmental Impact" report. We proved that we can translate technical anomalies into real-world savings (Dollars, Liters, and CO2e), making the data meaningful for non-technical stakeholders.

  4. Hardware-Agnostic Design: We built a modular, scalable pipeline that isn't tied to specific sensors. HydroSentinel-AI can "learn" the physical fingerprint of any facility, making it a truly deployable solution for any school or large building.

What we learned

Before this competition, I found coding intimidating and often felt lost in the technical syntax. This project completely changed my perspective. I learned that engineering isn't about memorizing lines of code—it’s about strategic planning and modular problem-solving.

By breaking complex challenges into focused micro-tasks and collaborating with AI tools, we achieved in seven days what I once thought would take months. I realized that when you pair a clear goal with the right mindset, you can build powerful, real-world solutions regardless of your experience level. I no longer see code as a barrier, but as a bridge to turn ideas into impact.

What’s Next for HydroSentinel-AI

To scale from a prototype to a production-grade facility management tool, we have identified three core development pillars:

  1. Live IoT Hardware Integration

The Goal: Transition from synthetic CSV data to real-time telemetry.

How: We will deploy low-power ESP32 microcontrollers equipped with ultrasonic flow meters and digital pressure sensors. These will transmit data via MQTT protocol to a secure cloud broker (like AWS IoT Core or HiveMQ), allowing the AI to analyze live, physical water flow instead of simulated data.

  1. Mobile Accessibility (Maintenance App)

The Goal: Put the "diagnostic power" in the hands of the maintenance team on the move.

How: We will develop a lightweight Flutter or React Native application. The app will receive real-time push notifications via Firebase Cloud Messaging (FCM) when an anomaly is detected. It will provide a "one-click" interface for the manager to verify a leak, log the repair, and view historical maintenance logs.

  1. Robust Deployment Infrastructure

The Goal: Move beyond the limitations of free platforms to ensure 24/7 reliability.

How: We will migrate from Streamlit Cloud to a Dockerized container environment deployed on a dedicated VPS (Virtual Private Server) (like DigitalOcean or Linode). We will use Nginx as a reverse proxy to manage SSL/TLS certificates and resolve DNS issues, ensuring the system is always accessible and secure.

  1. Advanced Predictive Maintenance (Future Growth)

The Goal: Predict leaks before they happen.

How: We will implement Recurrent Neural Networks (RNN/LSTM) to analyze long-term trends in pipe degradation. By spotting subtle changes in pressure signatures over months, the model will shift from "reactive leak detection" to "proactive infrastructure health monitoring," allowing for pipe replacement before a catastrophic burst.

A Note to Our Reviewers: Thank you for taking the time to explore the vision behind HydroSentinel-AI. We realize this documentation is extensive, but we felt it was essential to provide a transparent look into the physics-informed architecture, the engineering challenges, and the AI-driven logic that powers our solution. We didn't want to oversimplify a project that aims to solve such a critical real-world problem. Your time and feedback are deeply appreciated as we continue this journey.

Built With

Share this project:

Updates