Embien works with various industrial OEMs helping them design and develop numerous equipment. For one of them, we helped develop and manufacture electromagnetic flowmeters. The customer wanted to explore the smart city initiative where the technological trends were being utilized to better the quality of human life and optimize resource utilization. For that, the customer wanted to implement a water leakage detection system, by which the water distribution network had to be monitored at the local level.
There were two primary challenges in the system – price and usability. Since the system was targeted for local water distribution, the number of systems needed was huge. Having a computationally powerful system or a continuous subscription model for cloud-based connectivity was ruled out. The users would be local government workers who were not tech savvy and would need a simple mechanism to indicate potential leakage. Embien worked on the problem, identified the solution, and implemented the same via low-cost prototyping successfully.
There are few methods to detect leakages in water distribution networks, of which Embien's team zeroed in on two approaches - Demand Pattern-Based detection and Off-Peak Demand-Based detection method.
This method relies on analyzing the demand pattern within the water distribution network. By studying variations in water consumption over specific time intervals, anomalies or irregularities can be identified. Sudden deviations from the expected demand pattern may indicate the presence of leaks or other issues within the network. This approach leverages historical data and statistical analysis to detect abnormal consumption patterns that may signal the occurrence of leaks.
The behavior of flow systems can vary widely, from steady to unsteady laminar flow. Steady laminar flow maintains a constant fluid velocity over time, characterized by a consistent and predictable pattern. Conversely, unsteady laminar flow introduces fluctuations in velocity, following specific sequences or patterns. Regardless of the flow type, accurate measurement and monitoring of flow rate are essential for ensuring optimal system performance. Over a 24-hour period, data is collected at regular intervals to capture the nuances of flow behavior. Importantly, only normal data, free from leaks or anomalies, was utilized to train predictive models.
An autoencoder TensorFlow algorithm was employed to train the data and identify anomalies occurring within regular patterns. The diagram below captures the overall mechanism.
Demand pattern-based leakage detection
The EPANET software was used to build a fundamental pipeline system during development and perform simulations. This model was converted into TensorFlow lite and ran in STM32 based tinyML framework with a memory consumption of about 15.27kB of RAM and 819.04kB of Flash.
This method focuses on periods of lower water demand, such as nighttime when overall consumption tends to decrease. During these off-peak hours, the background noise in the water distribution system is reduced, making it easier to detect minor variations. Monitoring and analyzing water flow and pressure during less demand times can reveal subtle changes that might signify leaks. This approach capitalizes on the quieter periods to enhance the sensitivity of leak detection systems, making it possible to identify even minor anomalies that may not be apparent during high-demand hours.
In the off-peak demand-based method, the One-Class Support Vector Machine (SVM) machine learning algorithm was employed to train the data and identify leaks. The high-level block diagram of the Off-peak demand-based method is captured below.
Off-peak demand pattern-based leakage detection
During development, the WNTR python package was used to build a fundamental pipeline system and perform simulation. This model was converted into C header and ran on tinyML framework on STM32 with memory consumption of 2.39kB for RAM and 26.2kB for Flash.
Embien's hardware design team identified STM32L4R5 for the development of the Water Leakage detection system. The data from flowmeter was acquired locally over the RS485 based Modbus protocol. The system had LED and buzzer to indicate if any potential leakage was detected. Embien's ML engineers acquired the data during both demand times as well as the off-peak demand times. Collected over 3 months at multiple locations with dedicated data loggers, the quantum of data was quite high system. Our ML team then fine-tuned the data by filtering out noises and then trained both the models. The trained data was then deployed on to the TinyML model in the STM32.
The water flow data input from the system was first validated along with basic filtering and pre-processing. Based on the flow level, the system detected if the distribution was on or off. If it was on, the Demand pattern-based method was activated. If the algorithm detected leakage, the buzzer as well as LED indications were on periodically. If the flow was below a threshold, the Off-peak demand-based method was activated, and similar indications shown on potential leakage detection. The output from the detection algorithms were also suitably processed and filtered before the indications were shown in the Water Leakage detection system.
Embien provided a few prototypes with the said algorithms and helped the customer to identify leakage in the water distribution system.
Embien’s embedded machine learning expertise helped build the Water Leakage detection system for the customer with the following advantages.
While leakages in water distribution system through pipelines are the major issue faced across the globe, inspections by human resources to find leakage are difficult practically and not effective. This system detected the leak as soon as any damage is made to the pipelines due to several factors such as the pipe’s age, improper installation, and natural disasters. The use of AI technologies enhanced the efficiency and accuracy of Water Leakage detection system, enabling early identification and proactive management of water losses. Embien is proud to be associated in such an environmentally conscious project helping humankind save precious water!