Titre : | Deep prediction of water quality using IoT |
Auteurs : | GUEDDOUH Fouad, Auteur ; OUAMANE Hafidha, Auteur ; Sihem Slatnia, Directeur de thèse |
Type de document : | Mémoire magistere |
Editeur : | Biskra [Algérie] : Faculté des Sciences Exactes et des Sciences de la Nature et de la Vie, Université Mohamed Khider, 2025 |
Format : | 1 vol. (77 p.) / ill.couv.ill.encoul / 30 cm |
Langues: | Anglais |
Langues originales: | Anglais |
Résumé : |
Water quality is a critical public health concern that affects human well-being, economic activities, and environmental sustainability. Traditional Water quality monitoring methods are often slow, manual, and lack real-time capabilities. This thesis presents an innovative realtimeWater quality prediction system using the Internet of Things (IoT) and Artificial Intelligence (AI). The proposed solution integrates multiple sensors deployed in water distributionsystems to collect key physicochemical parameters such as pH, turbidity, temperature,conductivity, etc. These real-time data streams are processed using advanced machine learning algorithms, including Multi-Layer Perceptron (MLP), Deep Neural Network (DNN),Random Forest (RF), Logistic Regression (LR), and K-Nearest Neighbors (KNN) to predict water potability. A mobile application was also developed to visualize results and sendalerts. The results show that combining IoT and deep learning provides an efficient, scalable,and accurate framework for proactive Water quality monitoring, contributing to safer water distribution and improved public health outcomes |
Sommaire : |
Fundamentals of Water Quality and Treatment Processes 3
1 Introduction . . . . . . . . . . . . . . . 2 Physical treatment . . . . . . . . . . . . . . . . . . . . . . 4 2.1 Pretreatment . . . . . . . . . . . . . . . . . . . . 4 2.2 Screening . . . . . . . . . . . . . . . . . . . . . . . 4 3 Physicochemical treatment . . . . . . . . . . . . . . . 5 3.1 Pre-chlorination . . . . . . . . . .. . . . . . . . . 5 3.2 Clarification . . . . . . . . . . . . . . . . . . . . . . 5 3.2.1 Coagulation . . . . . . . . . . .. . . . . . . . . 5 3.2.2 Flocculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.2.3 Sedimentation ( Settling) . . . . . . . . . . 6 3.2.4 Filtration . . . . . . . . . . . . . . . . . 6 4 Chemical treatment . . . . . . . . . . .. . . . . . . . 6 4.1 Post-chlorination (disinfection) . . . . . . . . . . . . . . 6 4.2 Water storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 5 General Characteristics of Human Consumption and Drinking Water . . . . . . 7 6 Water Requirements in Various Industries . . . . . . . . . . . . . . . . . . . . . 7 6.1 Medical & Healthcare Requirements . . . . . . . . . . . . . . . . . . . . . 8 6.2 Uses in Industry and Medicine . . . . . . . . . . . . . . . . . . . . . . . . 8 6.3 Hydration for Sports and Performance . . . . . . . . . . . . . . . . . . . 8 7 Specific Parameters Governing Drinking Water Quality . . . . . . . . . . . . . . 8 7.1 Organoleptic Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 7.1.1 Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7.1.2 Odor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7.2 Physicochemical Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 9 7.2.1 pH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7.2.2 Hardness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 7.2.3 Solids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 7.2.4 Chloramines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 7.2.5 Sulfate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 7.2.6 Conductivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2.7 Organic Carbon . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 7.2.8 Trihalomethanes . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7.2.9 Turbidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7.2.10 Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 7.2.11 Ultrasonic water level Sensor . . . . . . . . . . . . . . . . . . . 14 7.2.12 Chemical contaminants . . . . . . . . . . . . . . . . . . . . . . 15 8 Conclusion . . . . 15 II Techniques and methods used to assess water quality 16 1 Introduction . . . 16 2 Traditional methods . .17 2.1 Water Quality Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3 Modern techniques . . . 18 3.1 Artificial intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2 Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2.1 Supervised learning: learning by example . . . . . . . . . . . . 19 3.2.2 Unsupervised learning: learning by exploring . . . . . . . . . . 19 3.3 Deep learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.3.1 Multi-Layer Perceptron (MLP) . . . . . . . . . . . . . . . . . . 20 3.3.2 Convolutional Neural Network (CNN) . . . . . . . . . . . . . . 21 3.3.3 Deep Neural Network (DNN) . . . . . . . . . . . . . . . . . . . 22 3.4 Random Forest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.5 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.6 K-nearest Neighbors (KNN) . . . . . . . . . . . . . . . . . . . . . . . . . 24 4 Intelligent Systems . . 25 4.1 Internet of Things (IoT) . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.1.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.1.2 How IoT Works . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.1.3 IoT and Continuous Water Quality Assessment . . . . . . . . . 26 5 Application Mobile . . . . . . . 27 6 Related Works . 27 7 Conclusion . . 29 III Design 31 1 Introduction . .31 2 System Architecture . .31 3 Hardware Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.1 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.1.1 Ph Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.1.2 Hardness Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.1.3 Solid Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.1.4 Chloramines Sensor . . . . . . . . . . . . . . . . . . . . . . . . 34 3.1.5 Sulfate Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.1.6 Conductivity Sensor . . . . . . . . . . . . . . . . . . . . . . . . 35 3.1.7 Organic Carbon Sensor . . . . . . . . . . . . . . . . . . . . . . 35 3.1.8 Trihalomethanes (THMs) Sensor . . . . . . . . . . . . . . . . . 35 3.1.9 Turbidity Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.2 Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.3 Communication Module (LoRa) . . . . . . . . . . . . . . . . . . . . . . . 37 3.4 Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.5 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.5.1 Multi-Layer Perceptron (MLP) . . . . . . . . . . . . . . . . . . 37 3.5.2 Deep Neural Network (DNN) . . . . . . . . . . . . . . . . . . . 38 3.5.3 Random Forest . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 3.5.4 Logistic regression . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.6 K-Nearest Neighbors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 4 User . . . . . . 42 5 Conclusion . . . 42 IV Methodology and Implementation 43 1 Introduction . . . . . . . . 43 2 Environment and Tools Used . . . . . .43 3 Dataset Preparation . .48 3.1 Dataset Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 3.2 Data Augmantation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 3.3 Preprocessing Script: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4 Backend API Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.1 API Design and Functionality . . . . . . . . . . . . . . . . . . . . . . . . 50 4.2 Model and Scaler Loading . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.3 Firebase Firestore Integration . . . . . . . . . . . . . . . . . . . . . . . . 51 4.4 Prediction Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.5 Auxiliary Endpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.6 Code Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.7 Code Example Snippet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5 Implementation of Machine Learning Models . . . . . . . . . . . . . . . . . . . 53 5.1 MLP – Hyperparameter and Implementation Details . . . . . . . . . . . 53 5.2 DNN – Hyperparameter and Implementation Details . . . . . . . . . . . 54 5.3 Logistic Regression (LR) . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.4 Random Forest – Hyperparameter and Implementation Details . . . . . . 57 5.5 K-Nearest Neighbors (KNN) – Hyperparameter and Implementation Details 59 6 Presentation of the mobile Application . . . . . . . . . . 60 6.1 Sign-up interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 6.2 Login interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 6.3 Main page interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 6.4 Analytics Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 7 Setting Interface . . . 65 8 Results and Evaluation . . 66 8.1 Multilayer Perceptron: . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 8.2 Deep Neural Network (DNN): . . . . . . . . . . . . . . . . . . . . . . . . 67 8.3 Random Forest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 8.4 Logistic Regression: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 8.5 K-Nearest Neighbours . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 9 Conclusion . . . . 71 Bibliography |
Type de document : | Mémoire master |
Disponibilité (1)
Cote | Support | Localisation | Statut |
---|---|---|---|
MINF/939 | Mémoire master | bibliothèque sciences exactes | Consultable |