Report Tarp

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

REVIEW III

Wearable Gas Monitoring Safety Device with ML powered


Trend Prediction

SIMRAN GOEL (20BEE0359)


PRAKRITI DEY (20BEE0006)
AMOS RAYAN (20BEI0082)

COURSE - Technical Answers to Real-World Problems


COURSE CODE - EEE1901
SLOT - TE2
Under the guidance of - DR. MATHEW M. NOEL
ABSTRACT

There are many work environments that humans are required to work in that
contain hazardous amounts of dangerous gasses in dangerous ppms. Many
serious health related issues and even deaths have occured to negligence to
proper safety standards and carelessness. We aim to design a device that offers,
a live feed of the person wearing the device , an alarm when exposed to
dangerous levels of harmful gas, location of the person wearing the device and
using monitored data fed into an ML algorithm to train a model that would learn
and predict future trends for learning as well as safety purposes.

Keywords: Machine Learning, Hazardous Work Environments, Harmful Gasses

INTRODUCTION
In environments characterized by heightened asphyxiation risks such as Sour
Gas fields, mines, wells and other hazardous work environments, individuals face
frequent exposure to diverse hazardous gases across multiple field locations. To
address these challenges, our objective is to develop a comprehensive device
integrating safety measures and monitoring capabilities.

During the project design phase, the emphasis focused on fixed facilities and
protection at these facilities. However, the possibility of an unexpected gas
release and exposure in areas away from the fixed facilities and while in transit
within the field soon became apparent. The challenge was to provide for the
safety of personnel from the time they entered the field to the time they exited it.

We aim to design a device that offers the following safety and monitoring
features:

1
Live Video Feed Integration:
The device will facilitate real-time streaming of the wearer's environment,
providing a live visual feed for continuous monitoring and situational awareness
as well as training purposes.

Gas Exposure Alert System: It will include a sophisticated alarm system capable
of promptly detecting and signaling the presence of dangerous levels of harmful
gases. This feature is crucial for immediate response and mitigation of potential
health hazards.

AI System Development: Leveraging the trained ML algorithm, an AI system will


be developed to autonomously analyze incoming data in real-time. The AI
system's primary objective is to identify evolving trends in gas concentration,
forecast potential risks, and provide actionable insights for improved safety
protocols and decision-making.

Location Service: This device will also have an ip address enabled location
service to provide accurate location data in large hazardous areas for quick
emergency response.

2
FLOWCHART

3
Hardware

(Gas sensor and ESP32 setup)

4
Code

(Initializing the gas sensors)

(Gas sensor code, with server and csv implementation)

5
(csv file snippets)

(sensor detecting values with location)

6
Live feed video integration:

Within our advanced gas sensor module, the inclusion of live video
streaming stands as a fundamental safety measure. This feature ensures
continuous monitoring, providing real-time insights for workers in high-risk
zones. Additionally, users can swiftly capture snapshots during
emergencies.
These snapshots are instantly retrievable, enabling rapid analysis and
empowering quick, informed decisions when responding to urgent
situations. This enhancement plays a vital role in fortifying worker safety by
offering comprehensive monitoring and swift incident response
capabilities.

Hardware setup:

7
Code:

8
9
ALGORITHM:

Software:
We have used time-series analysis that uses the method of RNN (LSTM) for the
system to predict the increase and decrease, trends for the gases released in a
week’s time.

RNNs can only connect recent previous information and cannot connect
information as the time gap grows. LSTMs are a type of RNN that remember
information over long periods of time.

Time series analysis is a specific way of analyzing a sequence of data points


collected over an interval of time. Additionally, time series data can be used for
forecasting—predicting future data based on historical data. Time series analysis
helps organizations understand the underlying causes of trends or systemic
patterns over time. Using data visualizations, business users can see seasonal
trends and dig deeper into why these trends occur. With modern analytics
platforms, these visualizations can go far beyond line graphs.

Many to one RNN : Many to one architecture refers to an RNN architecture where
many inputs are used to give one output.
Example: Say we take 3 inputs as 1,2, and 3. The model takes these inputs as one
batch and predicts the next number in the sequence. The process repeats for
other inputs like shown below.

The data collected on various gas levels must be input into a predictive modeling
algorithm. The algorithm can provide alerts about potential leaks and elevated
gas levels in the future.

10
In our project, the data collected has been divided into a 50:50 ratio for training
and testing. Preprocessing is done using the method of MinMax scaler.
MinMax Scaler shrinks the data within the given range, usually from 0 to 1. It
transforms data by scaling features to a given range. It scales the values to a
specific value range without changing the shape of the original distribution.

Figure: Division of dataset into training and testing dataset

A few components of the data were obtained to see ambiguities and trends of
the dataset. The first graph seen below shows the original dataset followed by
the second graph defines whether, over a period, data values increase or
decrease.

The third graph defines a pattern that repeats over a period. After we extract
level, trend, and seasonality/cyclicity, what is left is noise. Noise is a completely
random fluctuation in the data.

11
Figure: Components of Time series data

The input is 7 as we will be taking inputs from each of a week and predicting the
next's day gas level output. A generator is created with inputs and verified as
seen. The model is designed as a sequential model i.e., for each input there is an
output and the model works layer by layer. The layers include LSTM, an activation
'relu' layer and a dense layer.

Figure: Model summary


A random set of inputs from the training batch is tested to check the model's
accuracy. The actual output is 0.675 and the tested output is 0.679.

Figure: First set of prediction

12
RESULT

Software:

We have trained the model and run it with 50 epochs and we can see that the
loss is much less. By the end of the 50th epoch, the error loss is just 0.0041.

Figure: Visualized error losses for each epoch

Figure: Prediction with testing batch

13
The predictions made for the first testing batch were not exactly accurate. Hence,
the Scaler.inverse_transform method was used. It is a method that reverses a
transformation applied to a series or a sequence of series. It can be used to
restore the original values of the data after scaling, standardizing, or normalizing
them.

The predictions performed by the model vs the actual productions are plotted in
the graph below as follows.

Figure: Production vs Predictions

CONCLUSION
The values of air quality, methane and CO obtained from the gas sensors is
further sent to a web server hosted by the ESP32 and then along with real
time values, it keeps a log of these values in a separate csv file and then
these values are used in the RNN model.

The model is a simple time-series forecasting model using RNN due to its
property of storing values. The model has a layer of LSTM that is used to
store the released gas sensor values for about 7 days. Hence, after storing
the values for a week, it predicts the value of gas that can be released on
the 8th day. Hence, the model studies the trend, sees the predictive values

14
and if it goes beyond the threshold limit, accordingly, it sends the device an
alert through a buzzer which notifies the workers to use safety devices
before working in the sour field.

The error was calculated using mean square error. The Mean Squared Deviation
(MSD) of an estimator measures the average of error squares i.e. the average
squared difference between the estimated values and true value.

The root mean square error after the calculation is 21.979868022594538.


Hence, the model works perfectly with less error, predicts the gas values and
shows the trends for the week.

The live video streaming works efficiently to provide information on what and
who is present at the high-risk zone and allows the user to take snapshots.
This kind of monitoring helps the safety of the workers and employees from
collapsing and other health hazards.

Thus, we managed to develop a real-time gas detection safety system and trend
prediction AI using ESP32 and Python, with training models.

FUTURE WORK

This project has successfully developed a prototype showcasing the


intended functionalities of the envisioned device. Further refinement
involves transitioning this prototype into a fully functional product through
the implementation of a Printed Circuit Board (PCB) design.

While the gases utilized in this project differ from pure H2S, future
iterations will incorporate actual H2S exposure to refine and optimize the
device's performance. This integration aims to augment the device's
capabilities by aligning it more closely with real-world scenarios, enhancing
its accuracy and responsiveness in detecting and mitigating H2S-related
risks

15
REFERENCES

[1] Rajesh Rayan, Senior Engineer, ADNOC Sour Gas, Abu Dhabi
[2] Senior Engineers at Emerson Dubai
[3] BW Clip Series | Honeywell
[4] https://www.electronicoscaldas.com/datasheet
[5]https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-cam
era-home-assistant/
[6]https://lastminuteengineers.com/getting-started-with-esp32-cam/

[7] Z. Liu, Z. Zhu, J. Gao and C. Xu, "Forecast Methods for Time Series Data: A
Survey," in IEEE Access, vol. 9, pp. 91896-91912, 2021, doi:
10.1109/ACCESS.2021.3091162.
[8] Lim Bryan and Zohren Stefan 2021 Time-series forecasting with deep learning: a
surveyPhil. Trans. R. Soc. A.3792020020920200209
[9] Problems Associated with Sour Gas in the Oilfield Industry and Their Solutions
Melissa J. Goodwin, Osama M. Musa, and Jonathan W. Steed
Energy & Fuels 2015 29 (8), 4667-4682
[10] Onerhime, Anthony , Kveps, Andy , and Elie Daher. "Addressing Safety Challenges
of Operating in Sour Gas Fields: A Case Study from the Middle East." Paper presented
at the SPE Middle East Health, Safety, Environment & Sustainable Development
Conference and Exhibition, Doha, Qatar, September 2014.

16

You might also like