{"id":19947842,"url":"https://github.com/aarryasutar/pipe_leak_estimation_predictor_model","last_synced_at":"2026-04-15T10:32:06.537Z","repository":{"id":250898771,"uuid":"835796696","full_name":"aarryasutar/Pipe_Leak_Estimation_Predictor_Model","owner":"aarryasutar","description":"The project builds a Bayesian Network using pressure sensor data to detect pipe leaks, employing probabilistic reasoning to determine the likelihood of leaks based on sensor readings. It involves loading dataset, defining network structure, calculating CPDs, adding them to model, and using Variable Elimination algorithm for inference","archived":false,"fork":false,"pushed_at":"2024-07-30T15:13:49.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T05:40:59.541Z","etag":null,"topics":["bayesian-networks","cpd","csv","dag","data-frames","inference","model-verification","numpy","pandas","pgmpy","pressure-sensors","probabilistic-graphical-models","probability","python","variable-elimination-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aarryasutar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T14:46:30.000Z","updated_at":"2024-08-08T18:36:46.000Z","dependencies_parsed_at":"2024-07-30T18:52:52.106Z","dependency_job_id":null,"html_url":"https://github.com/aarryasutar/Pipe_Leak_Estimation_Predictor_Model","commit_stats":null,"previous_names":["aarryasutar/pipe_leak_estimation_predictor_model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarryasutar%2FPipe_Leak_Estimation_Predictor_Model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarryasutar%2FPipe_Leak_Estimation_Predictor_Model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarryasutar%2FPipe_Leak_Estimation_Predictor_Model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aarryasutar%2FPipe_Leak_Estimation_Predictor_Model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aarryasutar","download_url":"https://codeload.github.com/aarryasutar/Pipe_Leak_Estimation_Predictor_Model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241375121,"owners_count":19952656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian-networks","cpd","csv","dag","data-frames","inference","model-verification","numpy","pandas","pgmpy","pressure-sensors","probabilistic-graphical-models","probability","python","variable-elimination-algorithm"],"created_at":"2024-11-13T00:37:36.980Z","updated_at":"2026-04-15T10:32:01.511Z","avatar_url":"https://github.com/aarryasutar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bayesian Network for Pipe Leak Detection\nThis project aims to detect pipe leaks using a Bayesian Network built from pressure sensor data. Bayesian Networks are probabilistic graphical models that represent a set of variables and their conditional dependencies via a directed acyclic graph (DAG). This approach allows us to model the relationship between pressure sensors and the likelihood of a pipe leak.\n\n## Overview\nA Bayesian Network is constructed using pgmpy, a Python library for working with probabilistic graphical models. The network structure consists of two pressure sensors (PS1 and PS2) as parent nodes and a leak node (Leak) as the child node. The project involves the following steps:\n\n### Data Preparation:\n\nLoad the dataset containing pressure sensor readings and leak status.\nCalculate the probability distributions for each pressure sensor and the conditional probabilities for leaks given the sensor readings.\nBayesian Network Construction:\n\n### Define the structure of the network.\n\nCreate Conditional Probability Distributions (CPDs) for each node based on the dataset.\nAdd these CPDs to the Bayesian Network model.\nVerify the model to ensure consistency and correctness.\n\n### Inference:\n\nUse the Variable Elimination algorithm to perform inference on the network.\nQuery the network to determine the probability of a pipe leak given specific sensor readings.\nDetailed Steps\nLoading Data:\n\nThe dataset, typically in CSV format, is loaded into a pandas DataFrame. This dataset contains columns for the pressure sensor readings (PS1 and PS2) and the leak status (Leak).\nDefining Network Structure:\n\nThe structure of the Bayesian Network is defined with two parent nodes (PS1 and PS2) and one child node (Leak). This structure reflects the assumption that the leak status depends on the readings from both pressure sensors.\n\n### Calculating CPDs:\n\nFor each pressure sensor, a CPD is calculated. This represents the probability distribution of the sensor's readings.\nFor the leak node, a conditional CPD is calculated. This represents the probability of a leak given the readings from both pressure sensors. The values are derived from the dataset by grouping data and normalizing leak counts.\nAdding CPDs to the Model:\n\nThe calculated CPDs are added to the Bayesian Network model. This step ensures the network is equipped with the necessary probabilistic information.\n\n### Model Verification:\n\nThe network model is checked for consistency using an assertion. This step ensures that all CPDs are correctly defined and compatible with the network structure.\nInference:\n\nVariable Elimination is used for inference in the Bayesian Network. This algorithm allows querying the network to find the probability of specific outcomes.\nIn this project, the network is queried to determine the probability of a pipe leak given specific readings from the pressure sensors.\nResult Interpretation:\n\nThe result of the inference is a probability distribution over the leak node, given the evidence from the pressure sensors. This provides the likelihood of a pipe leak under the specified conditions.\n\n### Usage\nTo use this code:\n\nEnsure the required libraries (pgmpy, pandas, and numpy) are installed.\nLoad your dataset, replacing 'pipe leak-dataset.csv' with the path to your file.\nRun the script to build the Bayesian Network and perform inference.\nThe Bayesian Network model is a powerful tool for detecting pipe leaks, leveraging probabilistic reasoning to infer the likelihood of leaks based on sensor data. This approach can be extended to include more sensors and additional variables, providing a robust framework for various leak detection applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faarryasutar%2Fpipe_leak_estimation_predictor_model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faarryasutar%2Fpipe_leak_estimation_predictor_model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faarryasutar%2Fpipe_leak_estimation_predictor_model/lists"}