The problem
Water leaks in plumbing lines, campus hostels and industrial plants often run for weeks before anyone notices — the loss shows up only on the bill. A pressurized leak, however, produces a continuous high-frequency hiss as water escapes through a small opening, and that hiss is acoustically distinct from normal flow. This project turns that fact into a student-buildable TinyML device: an I2S MEMS microphone mounted near a pipe rig streams audio into a microcontroller, which computes log-mel spectrogram features and feeds them to a tiny autoencoder-style anomaly model running fully on-device. Sounds that reconstruct poorly — the leak-like hiss — score as anomalous and trigger the buzzer, LED and OLED alert. Training uses the real MIMII dataset of normal and anomalous machine sounds (valves, pumps, fans), the public benchmark from the DCASE 2020 challenge, rather than hand-made beeps. The demo rig is a simple PVC pipe loop with a needle valve the student cracks open to simulate a leak on demand.
MEMS microphone mounted near the pipe rig captures 16 kHz audio in short frames.
Follow the working sequence
How it works
- An INMP441 I2S MEMS microphone is mounted near the pipe rig; firmware captures audio at 16 kHz into short overlapping frames.
- Each frame is converted on-device to log-mel spectrogram features — the same representation the model was trained on.
- A tiny convolutional autoencoder (int8, TensorFlow Lite Micro) reconstructs each spectrogram patch; the reconstruction error is the anomaly score.
- Firmware smooths the score over a few seconds and compares it against the tuned threshold; sustained high scores declare a leak event.
- On detection, the buzzer sounds, the red LED lights and the OLED switches to LEAK SUSPECTED with the peak score; normal flow keeps the green NORMAL state.
- Training is done offline on MIMII normal/anomalous recordings processed through the identical feature pipeline; the student validates the deployed model by opening the needle valve and logging detections.
Tech stack:
- ESP32 (I2S audio + inference)
- INMP441 I2S MEMS microphone
- TensorFlow Lite Micro (int8 autoencoder)
- Python training pipeline (librosa-style features, TensorFlow)
- MIMII machine-sound dataset (training data)
- 0.96-inch OLED display, buzzer, LEDs
- PVC pipe demo rig with needle valve
- Arduino IDE / PlatformIO (C/C++ firmware)
Dataset & model details
- Dataset: MIMII (Machine Sound Dataset for Malfunctioning Industrial Machine Investigation and Inspection) — real factory recordings of four machine types (valve, pump, fan, slider), each with normal and anomalous segments, released as the development data for the DCASE 2020 Challenge Task 2 (unsupervised anomalous sound detection). Public research dataset.
- Task: Unsupervised acoustic anomaly detection — input = log-mel spectrogram patch of a short audio window, output = anomaly score (reconstruction error); leak-like hiss is the anomalous class at demo time.
- Model: Tiny convolutional autoencoder (design target ~30k–80k parameters), trained on normal sounds only, post-training quantized to int8 and deployed with TensorFlow Lite Micro. Features: log-mel spectrogram computed on-device.
- Metrics: AUC and partial-AUC per machine type on the MIMII evaluation split; detection performance is a design target reported from the actual training run in the delivered report — never claimed as measured in advance. On-device leak detection is characterized by the student's own needle-valve test procedure.
| Parameter | Value |
|---|---|
| Audio capture | 16 kHz via I2S MEMS microphone (design) |
| Feature | Log-mel spectrogram patches (design) |
| Model size | Under ~120 KB flash after int8 quantization (design target) |
| Inference latency | Tens of milliseconds per window on-device (expected) |
| Alert outputs | Buzzer + LED + OLED status |
| Demo rig | PVC pipe loop with needle-valve leak simulator |
| Power | 5 V USB or battery pack |
| Audio privacy | No raw audio stored or transmitted |
Project features
- [On-device acoustic anomaly detection] Log-mel spectrogram patches are scored by a quantized autoencoder running on the microcontroller — no audio is recorded, streamed or sent anywhere.
- [Real machine-sound training data] The model is trained on the MIMII dataset: real factory recordings of normal and anomalous valve, pump, fan and slider sounds from the DCASE 2020 challenge, not synthetic tones.
- [Leak-simulation pipe rig] A PVC pipe loop with a needle valve lets the student create a real pressurized hiss on demand, so detection is demonstrated with genuine acoustics, not a speaker playback.
- [Privacy-by-design audio] Inference consumes short audio windows in RAM and discards them; the device never stores or transmits raw audio — an honest talking point for the viva.
- [Live anomaly score display] The OLED shows the running anomaly score, a rolling trend and NORMAL / LEAK SUSPECTED status with buzzer and LED alerts.
- [Tunable sensitivity] The anomaly threshold is a firmware constant the student tunes for their room's noise floor using the included procedure, demonstrating the false-alarm tradeoff directly.
- [int8 TinyML deployment] The model is quantized to 8-bit integers with TensorFlow Lite Micro, fitting the microcontroller's memory with per-window latency in the tens of milliseconds.
What is included
- Assembled acoustic sensing node (ESP32 + I2S microphone + OLED + buzzer)
- PVC pipe demo rig with needle valve and fittings
- Trained int8 TinyML autoencoder and the training notebook (MIMII pipeline)
- Firmware source with audio capture, feature extraction and inference
- Wiring diagram and threshold-tuning test procedure
- Project report PDF (theory, dataset, model, quantization, results)
- PPT presentation and viva Q&A document
Limitations & prerequisites
- The demo uses a simulated leak (needle valve hiss); a real hidden plumbing leak behind a wall has different acoustics and is not replicated.
- MIMII recordings come from factory machines, not water pipes — the model transfers the general "anomalous hiss/knock" concept, and the match to real pipe leaks is approximate.
- Detection scores are design targets from the training run, reported honestly after training — nothing is claimed as measured before the build.
- Loud ambient noise (traffic, machinery, music) raises the anomaly score and can cause false alarms; the threshold must be tuned per room.
- The device flags sustained anomalous sound; it cannot locate the leak along a pipe.
- Very slow seepage below the hiss threshold of the microphone may go undetected.
Frequently Asked Questions
Why the MIMII dataset for a water-leak project?
MIMII is the standard public benchmark for unsupervised anomalous sound detection, with real anomalous recordings of valves and pumps — the machine types acoustically closest to a pressurized leak hiss. Training on real anomalies beats training on synthetic beeps.
Does the device record or upload audio?
No. Each audio window is converted to features in RAM, scored, and discarded. Nothing is stored or transmitted — a deliberate privacy-by-design choice the report documents.
How does the student prove it works?
The buyer-run test procedure: run the pipe loop normally and log the baseline score, then crack the needle valve to create a real hiss and log the detections. The report template includes tables for the student's own measurements.
What is an autoencoder doing here?
It learns to reconstruct normal pipe sounds; when it meets a hiss it never learned, reconstruction fails and the error spikes. That error is the anomaly score — no labeled leak recordings are needed for training.
Can it find where the leak is?
No — a single microphone flags that a leak-like sound is present near the sensor. Localization needs multiple synchronized sensors and is listed as future scope.
Is this project suitable for a final-year project?
Yes — for AI & Machine Learning, Electronics and IoT programs. It combines audio signal processing, unsupervised learning, quantization and embedded deployment. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Electronics / E&TC and IoT & Embedded.
Components & software requirements
- ESP32 (I2S audio + inference)
- INMP441 I2S MEMS microphone
- TensorFlow Lite Micro (int8 autoencoder)
- Python training pipeline (librosa-style features, TensorFlow)
- MIMII machine-sound dataset (training data)
- 0.96-inch OLED display, buzzer, LEDs
- PVC pipe demo rig with needle valve
- Arduino IDE / PlatformIO (C/C++ firmware)
Dataset & model details
- Dataset: MIMII (Machine Sound Dataset for Malfunctioning Industrial Machine Investigation and Inspection) — real factory recordings of four machine types (valve, pump, fan, slider), each with normal and anomalous segments, released as the development data for the DCASE 2020 Challenge Task 2 (unsupervised anomalous sound detection). Public research dataset.
- Task: Unsupervised acoustic anomaly detection — input = log-mel spectrogram patch of a short audio window, output = anomaly score (reconstruction error); leak-like hiss is the anomalous class at demo time.
- Model: Tiny convolutional autoencoder (design target ~30k–80k parameters), trained on normal sounds only, post-training quantized to int8 and deployed with TensorFlow Lite Micro. Features: log-mel spectrogram computed on-device.
- Metrics: AUC and partial-AUC per machine type on the MIMII evaluation split; detection performance is a design target reported from the actual training run in the delivered report — never claimed as measured in advance. On-device leak detection is characterized by the student's own needle-valve test procedure.
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.
Download free synopsis (PDF)
Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.