Household water trackage has made great advances in recent years but currently, no conventional methods exist that do not require a lot of expenses, or insurance and do not require breaking into a water pipe. This is a problem because these factors make it less likely that homeowners would care to track their regular water usage which is a problem because this causes water to be wasted and houses run a risk of. To prove this over 900 billion gallons of water is wasted during leaks per year, and 6300 gallons of water per household is wasted per day, this causes 1 trillion dollars in water loss per year. The overarching question is, how does the sound created by water flowing correspond to the amount of water flowing? This work presents a validated artificial intelligence-based device that can track water using audio from around the water pipe. A device strapped around a water pipe with a microcomputing chip will be connected to a microphone to measure the decibel range of sound created when water flows through and will use supervised machine learning models to estimate the water flow quantity. I hypothesize that if devices exist that utilize machine learning models to measure water flow through household pipes, then homeowners will be able to save money on their water bills and become more concerned with their environmental impact. To do this a prototype of the physical tool must be built and be programmed to measure the volume of the water when water flows through. The data will be recorded into a CSV file. From there four machine learning models will be run on the training data and the best model will be chosen from their performance of the testing and implemented to predict the quantity of water flowing based on the sound.
Related Work
The tracking of water usage is not-trackable by household owners because there are no devices that exist that don’t require a complex network of sensors and are easy to install without interfering with the internals of a water pipe. A correlation between PSI (Pound-force per square) and water pressure exists but no correlation to the actual amount of water. The problem that the research is trying to address is to be able to track water usage in houses cheaply and easily using just one single device. This research is important because water usage is one of the few household necessities that are not easily traceable by homeowners so creating a device for this purpose will allow homeowners to be able to decrease money spent on water and monitor the resources they consume.
Materials
The following materials include both hardware tools and software tools that are used to complete the research. The first and most important tool is a microcomputing chip (MCC), to record all data and test and train the ML models whilst connected to a microphone. For prototype purposes, this is a Raspberry Pi. A microphone must be connected to MCC and used to record a decibel range of water flowing through. A 7” LED Screen to relay decibel range readings during the data collection phase. All this is put together by soldering and working onto a Velcro Adjustable Strap. The microphone would safely rest on the Strap and the microphone would hang 15 cm from the top of the pipe for optimal sound. The software tools are what will be used to code and design the project. All work was done in Visual Studio Code (VSCode). All machine learning models were tested here. The library was mainly used as Scikit-Learn to train, test,
Data Collection
The procedure for calculating water flow from the outside of a pipe is as follows. A microphone will be placed 15 cm on the outside of a standard household water pipe using a size adjustable strap. Water will go through the pipe in different quantities as denoted by the occupancy of the value(full, half, quarter, eight). The amount of water flowing and decibel range (max volume — min volume) will be recorded into a CSV file and used as data. The valve amount recorded was made known by having an actual industry psi water tracker on the inside of the pipe half a yard from the audio device. Using the data, supervised machine learning models can train on the data to be able to predict water flow from the decibel range in the testing phase. Once the error rate is low enough the model will be implemented and that would be the final device effectively making it possible to track all of a household water usage from one exterior device.
Data Full (1) Half (2) Quarter (3) Eight (4) 10.20 7.13 4.05 3.48 9.97 5.56 5.08 2.68 8.41 7.01 4.51 3.71 10.42 6.39 5.02 2.96 10.49 5.40 5.35 2.47 10.86 8.40 5.56 2.1 10.26 7.25 5.28 3.26 10.34 7.20 4.26 2.25 11.35 7.18 5.93 2.44 9.27 7.72 4.63 3.23 11.47 7.81 5.80 2.18 10.98 7.16 5.36 2.02 9.75 7.85 4.55 3.42 9.30 8.10 4.34 3.37 8.96 6.00 5.46 2.71 8.60 8.16 5.67 3.65 8.64 6.51 4.24 2.73 9.40 7.49 4.89 2.85 9.80 7.81 5.65 2.3 11.49 6.52 5.61 3.08 10.36 6.76 4.08 3.35 9.22 6.03 4.59 2.05 8.95 7.55 4.71 2.7
Models
To analyze the data, a correlation must be made between the recorded data of water flow and decibel range. By inputting the data in a CSV file, a customized Python program can be used to visualize the relationship and various machine learning models (Logistic Regression, Linear Regression, Neural Network, KNN) can be run on the data to determine the best mathematical correlation between water amount and decibel range, therefore allowing the device to measure household water flow without ever having to interfere with the pipes. All models were built and tested with the following accuracies. Multiple models were used in order to find the best possible model. All models had an accuracy between 93.22% to 98.3%, neural networks had the best accuracy at 98.3%, and the average of all models is 97.79. Neural Networks are based on the way that brains process information. In a brain, there are over 100 billion neurons and they are connected by a series of synapses that are used to process information.
Similarly, in a machine learning neural network, artificial neurons are used to precisely produce an output. The role of a synapse is to multiply the inputs and weights. The weights are the “strength” of the connection between neurons. Weights primarily define the output of a neural network. However, they are highly flexible. After, an activation function is applied to return an output. Each synapse has a weight and each neuron has a bias and activation function, which determines whether the neuron will be activated. Parameters fine-tuned for better accuracy: cost function, hidden layer layout, and type of activation function were fine-tuned in the process. After fine-tuning the model: The best cost function: Cross entropy Best activation function: Sigmoid function Best hidden layer layout: Two layers with four hidden nodes.
Equation of Neural Network: 𝑍 = 𝐵 + 𝑊1𝑋1 + 𝑊2𝑋2 +… + 𝑊𝑛𝑋𝑛 Z
Z is the Neural Network
W is the weights
X is the inputs
B is the bias
Equation of Gradient Descent: 𝐶 = − 1 𝑛 * 𝑋[𝑦 𝑙𝑛(𝑎) + (1 − 𝑦) * 𝑙𝑛(1 − 𝑎)] C
C is the Cost value
A is the final output
Y is the desired output
N is the number of the independent variables
X is the sum of input attributes.
Conclusion
A low-cost device can track water flow through pipes without interfering with pipes at a 98.3% accuracy using Neural Networks. This is better than traditional methods because it does not interfere with pipes, it is cheap, it has an easy setup, the accuracy is near 100%, the algorithm can always be improved and changed, it has a possibility for future expansion, and the data is easily obtainable and expandable. This will allow homeowners to track their water usage in order to save money and analyze their environmental impact.