This repository contains a deep learning model that can detect water leakage in water distribution systems in cities by analyzing water sounds. The model uses audio data collected from various parts of the distribution network to identify potential leaks and alert maintenance teams for timely repair and prevention of water wastage.
Fun Fact : A year later I found myself taking a signal processing course and understanding many of the elements here that I could not fully understand while doing the project.
- Background
- Dataset
- Data Preprocessing
- Model Architecture
- Usage
- Installation
- Training
- Evaluation
- Contributing
- License
Water leakage in urban water distribution systems is a significant problem leading to water loss and increased utility costs. This deep learning model aims to leverage audio signals generated from water pipes and other distribution components to identify potential leaks. By using sound-based detection, the model can quickly analyze vast amounts of data, making it an efficient and cost-effective solution.
The dataset used to train and validate the model consists of audio recordings captured from different parts of the water distribution network. It includes both positive samples (audio segments with confirmed leaks) and negative samples (normal functioning audio segments). The Dataset can be found here.
The audio dataset is transformed to mathematical arrays representing MFCC(Mel Frequency Cepstrum Coefficients) and saved in the JSON file. The libraries numpy and librosa were used for this part. Here is the preprocessing python code preprocessing.py.
The deep learning model is based on a deep neural network (DNN) architecture, which has shown promising results in audio analysis tasks. The DNN model is trained on the audio spectrogram representations of the sound data. The detailed architecture and model hyperparameters can be found in the model.py file.
To use the trained model for water leakage detection, follow these steps:
- Clone this repository:
git clone https://github.com/DevAli00/SMARTDETECTOR.git
- Install the required dependencies:
pip install -r requirements.txt
- Prepare the audio data for detection (either record new sound or use existing audio files).
- Preprocess the audio data to generate spectrograms.
- Load the trained model weights using
model.load_weights('model_weights.h5')
. - Use the model for water leakage detection on new audio samples.
To set up the development environment for training and evaluation, follow these steps:
- Clone the repository:
git clone https://github.com/DevAli00/SMARTDETECTOR.git
- Install the required dependencies:
pip install -r requirements.txt
- Download the dataset and place it in the Dataset directory.
Evaluate the model's performance on the test dataset using the evaluate.py script. This will generate various evaluation metrics and visualize the model's predictions.
We welcome contributions to improve the model's performance or add new features. To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your changes:
git checkout -b feature/your-feature
- Make the necessary changes and commit them:
git commit -m "Add your message here"
- Push the changes to your forked repository:
git push origin feature/your-feature
- Submit a pull request to this repository.
This project is licensed under the MIT License - see the LICENSE file for details.
By Ali