Project Description
GLAD (Gas Leak Aerial Detector) is an IoT-based aerial inspection system designed to safely monitor, localize, and report hazardous gas emissions in high-risk industrial environments such as oil refineries, pipelines, chemical plants, and mining facilities.
The platform combines a manually piloted quadcopter with onboard gas sensing, computer vision, and machine learning to detect atmospheric anomalies while keeping human personnel entirely out of harm's way.
The system leverages a distributed edge-computing architecture: an ESP32 handles real-time, low-latency sensor acquisition (NDIR gas and MLX thermal arrays), while an onboard Raspberry Pi 4 acts as the main brain for computer vision and machine learning-driven sensor fusion. Telemetry is streamed wirelessly via an MQTT pipeline to a live web dashboard, allowing operators to monitor gas concentrations, leak confidence scores, environmental metrics, and live visual feeds in real time.
Features & Completed Functionality
- Edge AI Inference: Raspberry Pi 4 edge computing for machine learning inference without cloud dependence.
- Multi-Modal Sensor Fusion: Intelligent algorithms combining gas, temperature, and vision data.
- Remote Inspection Video: Live digital camera stream enabling safe structural and infrastructure inspection.
- Vegetation Chlorosis Detection: Automated computer vision pipeline (OpenCV) evaluating aerial imagery.
- Leak Confidence Score: Generation of a definitive hazard metric fusing deterministic hard thresholds with ML insights.
- Zero Worker Exposure: Drone-based inspection eliminating direct worker exposure to hazardous environments.
Technology Stack & Hardware
Software & Protocols
- Embedded System: ESP32 (C++)
- Edge Computing: Raspberry Pi 4 (Python)
- Communication Protocols: MQTT, WebSockets
- Computer Vision: OpenCV
- Machine Learning: PyTorch (Sensor Fusion / CNN / MobileNetV2)
- Frontend: HTML, CSS
Drone Hardware & Propulsion
- Airframe: Custom Quadcopter Frame
- Motors: Holybro 2216-880KV Brushless Motors
- ESCs: 30A Electronic Speed Controllers
- Propellers: 10×4.5 Propellers
Sensors & Vision
- Primary Sensors: NDIR Gas Sensor, MLX Thermal Sensor
- Onboard Vision: Raspberry Pi Camera Module
System Architecture Diagram
The system operates via a distributed data pipeline, shifting heavy processing loads to the edge computer while keeping the data collection layer lightweight and rapid:
System Architecture
1. Data Acquisition
The ESP32 continuously acquires gas concentration and temperature data from onboard sensors. These sensor readings are dynamically packaged into lightweight JSON messages to minimize network overhead.
2. Communication Layer
Telemetry is transmitted over Wi-Fi using the publish-subscribe MQTT protocol, ensuring reliable data delivery with low communication overhead.
3. Edge Processing
The Raspberry Pi serves as the core processing hub:
- Processes live camera footage using OpenCV.
- Visual analysis identifies vegetation chlorosis as a secondary indicator of underground gas leakage.
- Gas sensor readings, thermal information, and computer vision outputs are fused using a machine learning model to generate a Leak Confidence Score.
4. Visualization
Processed telemetry is streamed to a browser-based dashboard via WebSockets. Operators receive live gas concentration graphs, environmental readings, and hazard notifications instantly.
Machine Learning Model
The project utilizes a CNN-based image classification model specifically trained for chlorosis detection in vegetation to identify prolonged gas exposure.
- Architecture: Built using MobileNetV2 with transfer learning in PyTorch.
- Function: Analyzes aerial images captured by the onboard camera to identify vegetation stress caused by prolonged gas exposure. The model output is fused with gas concentration and temperature data to generate a leak confidence score.
- Performance: Achieved 80.56% validation accuracy and 82.08% test accuracy on a custom dataset of 5,348 banana leaf images.
- Documentation: Detailed information on the dataset, model architecture, training process, and evaluation metrics is available in the
ML_Modeldirectory.
3D Hardware & Frame Design
Below are the Fusion360 renders and schematics detailing the custom quadcopter frame assembly and sensor arrays:
Demo Images
Setup & Installation
1. Prerequisites
Ensure you have the following installed:
- PlatForm Io
- Python 3.10+
- Visual Studio Code
- MQTT Broker (Mosquitto)
- Raspberry Pi
- OpenCv
- Torch Vision
2. Clone the Repository
git clone [https://github.com/]/<username>/GLAD.git
cd GLAD
ESP32 Firmware Setup (PlatformIO)
- Open Visual Studio Code.
- Install the PlatformIO IDE extension.
- Open the
Drone Gas Leak/srcfolder. - Wait for PlatformIO to initialize.
- Connect the ESP32 via USB.
- Build the firmware:
pio run
or click Build in PlatformIO.
- Upload firmware:
pio run --target upload
- Monitor Serial Output
pio device monitor
Raspberry Pi Setup
Install dependencies:
pip install opencv-python
pip install paho-mqtt
pip install flask
pip install numpy
pip install torch torchvision
Run processing:
python sensor_fusion.py
Dashboard Setup
cd Dashboard
Open
python -m http.server 8000
http://localhost:8000/Dashboard.html
System Workflow
- Power on ESP32.
- Boot Raspberry Pi.
- Start Mosquitto Broker.
- Run
main.py. - Launch dashboard.
- Start drone.
- Monitor telemetry.
Comments