Abstract

The splendid technological inventions supersede many traditional agricultural monitoring systems. In the last decade, a variety of new techniques and tools are proposed to monitor storage areas, which provide more safe and secure storage for different crops. The term storage area monitoring is supposed to check and avoid fire hazards, whereas numerous other hazards also need attention. One such hazard to cotton storage is spontaneous combustion, a process by which an element having comparatively low ignition temperature (hay, straw, peat, etc.) starts to relieve heat. In the presence of spontaneous combustion and lack of oxygen, if cotton catches any sparks from bales or physicochemical heat to ignite, the combustion can convert in to smoldering, and it can last up to several days without being discovered. Consequently, the actual fire occurs, cotton silently smoldering which not only affects cotton quality but also became the reason of big fire event. Many researchers propose valuable tools and techniques based on laboratory methods and modern techniques as well for detection and prevention of security hazards in storages. However, there is no standalone efficient tool/technique to monitor the storage area for spontaneous combustion. In current research, we propose an efficient wireless sensor network (WSN) and machine learning- (ML-) based storage area monitoring system for early prediction of spontaneous combustion in the cotton storage area. The WSN is used to collect real-time values from storage field by different combinations of sensors and send this over the network, where data is processed to identify spontaneous combustion and distribute the prediction results to the end user. The real-time data collection and ML-based analysis make the system efficient and reliable. The efficiency of the current system is verified by presenting two groups of cotton stored with different conditions. The results showed that the proposed system is able to detect spontaneous combustion well in time with a 95% accuracy rate.

1. Introduction

Cotton is a widespread commercial nonfood crop in the world. It provides income to more than 250 million people worldwide and almost 7% labor employment of all labor in developing countries [1]. Almost half of all textiles depend on cotton. In 9 cotton storage areas, bulk of raw cotton is stored. The security and safety of these storage areas are necessary to improve, as any damage may ultimately result in the biggest loss of cotton [2, 3]. The cotton storage area faces two major safety challenges. (1)Fire hazard(2)Quality hazard

One major hazard for cotton is fire, although cotton is considered as an inflammable substance [2]. The 90% of cotton contains natural fiber and gases such as carbon along with oxygen, which contains 45% of it. This mixture makes cotton an inflammable substance. However, the cellulose content composition makes cotton likely to catch fire by external ignition. This can be avoided by protecting cotton from sparks, fire, naked lights, and lit cigarettes [3].

In addition to external ignition, cotton may also be likely to catch fire by spontaneous combustion. The term spontaneous combustion means a process which occurs when an element having comparatively low ignition temperature (hay, straw, peat, etc.) starts to relieve heat [4]. In the presence of spontaneous combustion, if cotton can catch any sparks from bales or any spark occurs by physicochemical heat to ignite cotton, the combustion can convert in to smoldering due to the lack of oxygen in the cotton, and it can last up to several days without being discovered. Hence, the actual fire occurs, cotton silently smoldering, which not only affects cotton quality but also became the reason of the big fire event [35].

The fire hazard in cotton storage holds significant importance due to several factors: (a)Combustibility: Cotton is highly combustible and can ignite easily under specific conditions such as high temperatures, exposure to sparks, or friction. Once ignited, it burns rapidly, leading to severe fires(b)Self-heating: Under certain circumstances, such as improper ventilation, high moisture content, or compaction, cotton can undergo self-heating. This process generates heat due to microbial or chemical reactions, potentially leading to spontaneous combustion and fire(c)Economic loss: Cotton fires can result in substantial economic losses, including damage to stored cotton, infrastructure, and machinery. Moreover, the fire’s impact often extends beyond the storage area, affecting neighboring properties and businesses as well(d)Health and safety risks: Fires in cotton storage release harmful gases, smoke, and particulate matter that pose health risks to workers, nearby residents, and emergency responders(e)Environmental impact: Cotton fires can cause environmental damage by releasing pollutants and hazardous substances into the air, soil, and water sources

In cotton, there are three possible types of self-heating by which spontaneous combustion can occur, as given below. (1)Thermal(2)Chemical(3)Microbial self-heating/spontaneous combustion

The thermal heating arises due to abnormal temperature, and chemical heating arises due to moisture, fats/oils, and action of acids, such as nitric or sulfuric acid, or by contact with oxidizing agents and with goods with a tendency to self-heating. Microbial heating occurs through the presence of microbes in wet cotton bales that may produce small amounts of methane gas.

The quality hazard is also linked with cotton’s internal chemical composition and biological processes. These processes can interrupt environmental markers necessary to maintain a healthy storage environment, i.e., ambient temperature, moisture content, and relative humidity, and as a result, cotton quality detroits. The cotton quality is identified by its color and spinning quality, cotton grade, staple length, and micronaire reading. Cotton grade is accessed by color, preparation (smoothness), and trash content. Staple length measures fiber length. The long staple length is considered good for cotton quality as compared to the shorter length. Micronaire is the measurement of fiber fineness and maturity [68]. The color of cotton becomes light gray and dark gray if cotton’s internal temperature and moisture level distress, and similarly, moisture level disturbance also becomes the reason of wet cotton that ultimately damages cotton fineness and maturity of fiber. The internal reactions of cotton turn its bright white color into yellow, which will be considered as bad quality which will not be considered good for fine fiber. The internal dust particles increase the ratio of trash in cotton and ultimately lower its quality. The presence of insects and fungus as a result of microbial heating has become the reason of spotted cotton for which also indicates its bad quality. The above discussion came up with the given research challenges. (1)Prevention and mitigation of fire hazards in cotton storage are crucial. Implementing proper storage techniques to prevent big fire outbreak cause by internal self-heating of cotton/spontaneous combustion, maintaining optimal moisture levels, ensuring adequate ventilation, using fire-resistant materials, and employing monitoring systems like IoT-enabled circuits can help minimize the risk of fire incidents in cotton storage(2)The second challenge is the preservation of cotton quality during long storages. Spontaneous combustion can not only lead to a big fire outbreak, but it can also affect cotton quality factors, i.e., it can change cotton color, damage seeds on raw cotton and spotted cotton, and damage cotton fineness and maturity of fiber [6, 7]

We came to know after a detailed literature survey that many researchers proposed storage monitoring system based on detection and prevention of fire events cause by external ignition such as sparks, light, temperature, humidity, and smoking. However, there is a big research gap in detection and prevention of cotton smoldering, spontaneous combustion, and cotton quality maintenance during storages. The major motivations for current research are listed below, also shown in Table 1. (1)The previous cotton storage area security systems focused on external ignition factors(2)The previous systems for cotton storages used IoT-based mechanism to detect only external factors, i.e., spark light, and can send a fire notification once it occurs(3)The previous systems did not investigate and integrate the phenomena of spontaneous combustion in their proposed architecture(4)In the past few years, very limited research done in domain of cotton quality, most authors studied only factors and risk of combustion in cotton [3, 9, 10], the igniting behavior of cotton contaminated with oil [5], comparative studies of cotton and flame combustion [6], the flammability of cotton bales that was evaluated [7], and research done to investigate IoT role in the cotton warehousing environment [11]. Some authors also investigate iconic gases produced during the low-temperature heating process of cotton [12], which helps to identify major gases produced during cotton heating. Some authors also proposed solutions to measure and control external weather conditions in the storage area only, and they aim to improve safety mechanisms there [3, 8, 11]

The current research provides a wireless sensor network (WSN) and machine learning- (ML-) based models for cotton storage monitoring which provides (1)Efficient real-time sensing of major factors contributing to spontaneous combustion using WSN(2)ML-based analysis which detects cotton self-heating for early prediction of spontaneous combustion. A basic sketch of the proposed self-heat detection for cotton storage is depicted in Figure 1, which shows the overall functional part of the proposed system framework for fire avoidance

The rest of the paper is structured as follows: Section 2 discusses state-of-the-art algorithms and approaches presented in the agriculture domain, which study combustion and cotton storage monitoring systems using efficient techniques. Section 3 describes the architecture of the proposed approach and elaborates the proposed approach component design. Section 4 describes the experiment design. Section 5 describes results and discussions to show the performance testing, outcomes, and limitations of the presented approach.

In the current section, we discussed a literature survey of cotton storage security domain. There are many systems proposed for cotton storage area security which only provide prevention and control of fire events. We discussed the key features of related work in Table 2, and limitations are discussed in Table 3.

An investigation was done by Xia in the year 2013 [5]. He did a comparative study on the combustion characteristics between smoldering and burning of cotton. He found that more carbon monoxide is produced during smoldering than burning; hence, the CO rate is higher for smoldering. Therefore, the early fire detection systems could be based on the detection of CO levels. In the presence of higher CO levels, one may set an alarm for early fire detection to avoid loss in cotton storage areas.

Horrocks et al. in 1991 [6] investigated cotton self-heating. He identifies that bales of raw cotton and piles of cotton cloth during processing and laundering accumulate self-heating which instigates spontaneous ignition. This may occur due to the fact that the internal temperatures of cotton fall in the 300–350°C which becomes the reason for self-ignition. Their research showed that contamination of pure cotton with refined cotton, peanut, and rapeseed oils can promote ignition. They also did thermal analyses (DTA and TGA), to highlight the fact that this internal exothermic activity is oxygen-dependent.

An intelligent inspection system for cotton storage areas was proposed based on the RFID [8]. It constitutes of two parts, i.e., system hardware design and software design. The hardware part applies the sensor in real-time mode with the help of wireless transmission technology in storage. This hardware can monitor the circulation temperature and humidity in the cotton stack storage warehouse. Then, based on real-time monitoring, the bale information is then uploaded to the platform in real-time. The system is developed by RFID intelligent inspection terminal, which integrates RFID positioning technology and wireless temperature and humidity monitoring technology into the system platform. They used the particle swarm optimization (PSO) algorithm, optimizing the artificial neural network (ANN) method for data analysis, based on Gaussian filter processing. Their experiments and results showed that the monitoring system could provide efficient management of the entire cotton bale storage.

Another study on the cotton smoldering process was proposed in 2020, which gives generation laws of the iconic gas compositions during cotton smoldering Su et al., [12]. They used a minitube furnace for heating the cotton sample which was collected from Xinjiang, China. They applied a gas chromatography mass spectrometer (GC/MS) for identification and analysis of produced organic and inorganic gas composition. They did the experiment at different low temperatures and applied different concentrations of gases. They come up with a given conclusion. (1) The heating process produces alkanes, furans, alkenes, aldehydes, hydrazine, and acids. The methane has the highest proportion, being nearly 99% in the organic gas composition. Moreover, a little hydrogen and carbon monoxide were also produced. (2) Methane was produced continuously during the heating process. Hydrogen is produced at 95°C, as a midproduct. Along with hydrogen, acetone is also produced at 125°C, and carbon monoxide is produced at 145°C, showing that the smoldering was at the early stage. (3) If smoldering happened, methane and hydrogen are both produced, which means that they can be used as indicators of smoldering. Hence, their research on the iconic gas compositions will provide a significant basis for the prevention of cotton self-heating.

In another study [9], the authors used a C80 microcalorimeter connected with a high-pressure atmosphere control panel, to investigate the thermal behavior of cotton and for the calculation of its self-heating oxidation temperature (SHOT). They took three types of cotton samples and heated them and applied the Semenov model and Frank-Kamenetskii theory to calculate the oxidation of cotton in air through thermodynamics and kinetics parameters. Their study concluded that higher heating a rate results in a larger heat reaction and lower SHOT.

The cotton storage areas require more efficient monitoring, as only such systems can decrease fire and other damage in cotton storage areas. Early fire detection can only be provided by investigation of all such factors and events that contribute to the formation of fire. The research on the formation mechanism of fire at cotton place is fruitful to designing early fire detection systems. One such investigation was carried out by Gu [10]. He did a comprehensive analysis on the physical and chemical properties and combustion conditions of cotton and concluded that smoldering was the main cause of cotton fire and of cotton. He did experiments to determine the important factors that may contribute to smoldering; he found two important factors affecting cotton smoldering, which are temperature and humidity. Thus, cotton smoldering produces some smoke.

The smoldering process is influenced by many environmental factors, i.e., temperature, humidity, gases from air, presence of smoke, etc. [11]. These are not the only factors that instantiate cotton smoldering in the environment but also include many other factors which not only contribute to cotton smoldering but also became the reason of cotton burning. Hence, more investigation and analysis are required to fill in the research gap in early fire detection of cotton storage.

3. Proposed Methods

In this section, we provide a comprehensive discussion on the theoretical background of cotton self-heating, factors part in self-heating, and SC relation with self-heating. We also discussed the functionality of the proposed system in two major parts, as given in Figure 2. (1)WSN of real-time self-heat monitoring(2)ML analysis

3.1. Self-Heating Theoretical Model

In this section, the theoretical model of cotton self-heating is discussed to highlight major types of self-heating, key elements in self-heating, and indicators of self-heating, as shown in Figure 3. There are three essential facts which provide the basis for the proposed system. (i)Types of cotton self-heating(ii)Root causes of self-heating(iii)Self-heating identification: factors and measurement

The cotton is liable to thermal, chemical, and microbial self-heating [4, 13, 14], as shown in Table 4.

All three types of cotton self-heating can be identified by the relevant factor, which emerges as an indicator of each subsequent self-heat type, as shown in Table 5.

3.2. Proposed WSN Model

The WSN is a collection of sensor nodes installed at various locations of the target site to sense real-time input, a highly efficient technique to sense real-time values in efficient system, i.e., IoT-enabled smart appliances [15] and smart lighting systems for smart cities were designed using IoT [16], and IoT is also used in smart farming applications [17]. The whitefly prediction system is also based on IoT [18], a fire detection system with IoT [19]. In the current scenario, the proposed system goal is sensing the self-heating mechanism for which the IoT sensing circuit node is designed by using differently. The details of the used sensor are given in Table 6, and the functionality of the sensor module is given below. (a)Deployment: The proposed IoT systems utilize various sensors strategically placed within the storage facility. These sensors include temperature sensors, moisture sensors, methane detectors, and Bluetooth module. These devices continuously collect data regarding the storage environment(b)Data transmission: The sensors are connected wirelessly to a central hub or gateway within the IoT system. This hub collects data from all deployed sensors and acts as a communication bridge(c)Data collection and processing: The central hub receives data streams from the sensors in real time. Then, this data is passed to GUI app via Bluetooth for further analysis and prediction of output(d)Predictive analytics: The system used ANFIS which is already integrated into the IoT system GUI to analyze the collected data. The ANFIS is trained on historical data to forecast the likelihood of spontaneous combustion based on current environmental conditions(e)Remote monitoring and control: The proposed system provides a user interface accessible remotely, allowing operators or managers to monitor the storage environment in real time. This interface could display sensor data, predictive results of spontaneous combustion, and alerts.

3.3. The ML Analysis Model

The proposed system used the adaptive neuro fuzzy inference system (ANFIS) for early prediction of spontaneous combustion. The ANFIS is a machine learning algorithm that combines the strengths of neural networks and fuzzy logic to model complex systems, making it particularly suitable for predicting phenomena like spontaneous combustion in cotton storage. There are potentially many reasons to select ANFIS for given system, i.e., ANFIS is a hybrid model that uses fuzzy rules to create a structure that mimics human decision-making processes while leveraging neural networks to learn and adapt from data.

The system is designed for identification of spontaneous combustion in cotton storage, which is influenced by various factors such as temperature, moisture levels, airflow, and microbial activity. ANFIS excels in modeling complex, nonlinear relationships between these factors, which may not be easily captured by traditional statistical methods. Moreover, the “adaptive” nature of ANFIS allows it to continuously adjust its parameters and fuzzy rules based on incoming data. This adaptability makes it suitable for dynamic environments like storage facilities where conditions can change over time.

The ANFIS is a combination of fuzzy inference and neural networks. The development of a fully functional fuzzy inference system depends upon the rule base, which is not always convenient to design. Hence, ANFIS adopts the idea of applying learning algorithms on fuzzy systems which supports automatic tuning of fuzzy rule sets and data [2022]. The ANFIS is composed of five layers, as shown in Figure 4. (1)The first layer maps the input variables to the membership function(2)In the second layer, the antecedent of the rule is calculated by the operator -norm(3)The third layer normalized rule strength(4)The fourth layer calculates the consequent of the rule(5)The fifth layer is the output layer which calculates the summation of all inputs to compute the output

One big novelty of ANFIS is that it does not require expert knowledge to assign parameters of a fuzzy inference system, rather it tunes parameters by utilization of neural network learning algorithms (as shown in Figure 5). The basic architecture of a five-layer ANFIS is architecture with two inputs ( and ) and one output () discussed below (shown in Figure 6), also described by [23]. On each layer, there are two kinds of nodes, namely, adaptive (represented by squares) and fixed nodes (represented by circles). The adaptive node parameters are adjustable, whereas fixed nodes contain fixed parameters. To present the ANFIS architecture, two fuzzy IF-THEN rules based on the first-order Sugeno fuzzy inference system are considered: (a)Rule 1: if is and is , then (b)Rule 2: if is and is , then

and are inputs for fuzzy set, and is the output for fuzzy rules and is an index for fuzzy rules, and it ranges from (); the variables , , and are adaptive parameters. These parameters will be tuned by the training process. The first layer of the ANFIS node is of adaptive type. This layer is known as the fuzzification layer [24]. In this layer, the output is calculated by a fuzzy membership grade of input. This output is represented by the given

The second layer of ANFIS comes from the first layer using AND. This layer contains fixed nodes which are used to compute rule strengths. The output of this layer is represented by given in

The third layer performs the task of normalization by using fixed nodes. The output is represented by given in

The fourth layer computes the product of the normalized output and the first-order polynomial of inputs. This layer contains adaptive nodes like layer 1. The output of this layer is shown in

The fifth layer sums up all incoming signals by using one fixed node [20]. The output of this layer is represented by

3.4. Implementing Propose System

In the initial step, the proposed system collects real-time input from the cotton storage area using an IoT-enabled circuit. The cotton self-heat theoretical model highlighted major self-heat factors. Keeping in that view, we design an appropriate circuit to sense them (sketch is shown in Figure 6). Every sensor is quality with proper calibration code to work with an Arduino, and the complete code of all sensors is also shown in Figure 7.

This code execution showed real-time values of self-heat-causing factors which need to be placed on the file for analysis. Different options are available to store the output of Arduino code. In our current system, we store CSV files of this real-time data. Then, we provide this input ANFIS designer in .DAT format.

The analysis part of the proposed system used ANFIS, which is implemented with the MATLAB designer app [25, 26]. The implementation steps of ANFIS are described in Figure 8. It shows a training dataset first loaded on the MATLAB workspace, and a dataset variable is available to upload from the designer view of ANFIS as training input, after which FIS is generated automatically through a designer’s view as shown in Figure 9, and the neural layered structure of the proposed ANFIS is also shown in Figure 10.

The rule view of the proposed ANFIS is shown in Figure 11, in which the computed output (self-heating) for two different combinations of input variables (temperature, moisture, and methane) is shown. In the first combination, the output value is zero, showing that no self-heating is detected, whereas in the second combination of input values, the computed output of ANFIS is greater than one, i.e., self-heating detected for this combination.

4. Experiments and Results

To evaluate the performance of the proposed system, first, we design a basic experiment setup in which we prepare two groups of cotton storage with different experimental settings, as described in Table 7.

Both the controlled and experimental groups were exposed to weather conditions detailed in Table 7 for a duration of 60 days. Within the storage environment, an IoT circuit was integrated, and three IoT circuit nodes were strategically positioned around the storage area to observe and track self-heating indicators. After the 60-day period, the proposed IoT-enabled circuit was used to examine indicators related to self-heating. The sensor nodes specifically monitored internal moisture levels, the presence of methane, and temperature variations in the cotton to identify different forms of self-heating—thermal, chemical, and microbial. Elevated temperature beyond the cotton’s ignition point, increased moisture percentage encouraging chemical reactions, and heightened methane levels indicated the potential for self-heating, respectively, caused by temperature, moisture, and microbial presence within the cotton (see Table 5 for reference range).

We perform sensing on both controlled and experimental groups and repeat the experiment after every 20 days’ gap, initially started after 90 days of consecutive cotton storage. The obtained values from the IoT-enabled circuit were then passed to ANFIS for detection of cotton self-heating. A total of 100 experiments were done for each group with 20 days’ gap, collected 50 data values, and prepared the dataset separately for each group with 500 instances. The detailed description of the experiment data is shown in Table 8.

4.1. Experiment Analysis

We observed that cotton stored under extreme weather conditions and compressed format showed more instances with high values of methane, moisture level, and temperature as compared to the controlled group which showed fewer instances with high temperature, high moisture, and methane presence, as shown in Table 8. The comparison graphs for both group instances are shown in Figures 1217. Figure 12 shows methane levels of the experimental group, and Figure 13 shows methane levels of the controlled group. The -axis of both graphs showed no instances with high methane levels, and the -axis showed experiment day. Figure 12 shows that on experiment day 110, only 2 instances had high methane value and it increased gradually, i.e., 6 instances with high methane levels on day 290, whereas in the controlled group, as Figure 13 shows only 1 instance with high methane level at experiment day 230, a maximum of 3 instances with high methane level was recorded on day 290. This clearly depicted that the experimental group showed more instances of self-heat-causing factors, i.e., methane.

Figure 14 shows temperature levels of the experimental group, and Figure 15 shows temperature levels of the controlled group. The -axis of both graphs showed no instances with high-temperature levels, and the -axis showed experiment day. Figure 14 shows that it is clearly observed that on experiment day 110, the 2 instances have high-temperature value, and they are increasing gradually, i.e., 8 instances with high-temperature level on day 290, whereas this count is less in the controlled group as Figure 15 shows 1 instance with high-temperature level at experiment day 150, with maximum 3 instances with high-temperature level that were recorded at day 290. This clearly depicted that the experimental group showed more instances with self-heat-causing factors, i.e., ignition temperature.

Figure 16 shows moisture levels of the experimental group, and Figure 17 shows moisture levels of the controlled group. The -axis of both graphs showed no instances with high moisture levels, and the -axis showed experiment day. Figure 16 shows that it is clearly observed that on experiment day 110, it shows that 1 instance had a high moisture value, and it is increasing gradually, i.e., 7 instances with high moisture level on day 290, whereas this count is less in the controlled group as Figure 17 shows 1 instance with high moisture level at experiment day 210, with maximum 3 instances with high moisture level that were recorded at day 290. This clearly depicted that that experimental group showed more instances with self-heat-causing factors, i.e., moisture.

5. Discussion and Limitations

The proposed ANFIS is applied to the datasets gathered from the controlled and experimental groups. The obtained predictions are then evaluated by using efficient statistics of precision, recall, and accuracy mostly used to check the correctness and completeness of efficient systems [27, 28]; hence, we also used this on the proposed ANFIS. The formula for precision, recall, and accuracy is given in equations (6)–(8), respectively, and obtained results of precision and recall are shown in Table 9. where (i)True self-heated TSH: ANF predicted real self-heated class as self-heated(ii)False self-heated FSH: ANF predicted real normal class as self-heated(iii)True normal TN: ANF predicted real normal class as normal one(iv)False normal FN: ANF predicted real self-heated class as normal

The instances of experimental and controlled groups were either predicted as self-heated or normal by ANFIS. We checked the performance of ANFIS by applying precision, recall, and accuracy formulas on the obtained predicted classes. The obtained results given in Table 9 are also depicted in the statistical graph and confusion matrix as shown in Figures 18 and 19.

It is shown in Figure 20 that the proposed ANFIS predicted more of self-heated class in the experimental group, whereas fewer instances showed normal class prediction with ANFIS. However, the ANFIS predicted more normal class instances in the controlled group with fewer instances of self-heat class. These results support the research assumption that extreme weather conditions provoke more self-heating factors to rise above their normal range, which results in the accumulation of self-heating in cotton. The normal weather, apart from any external interference factor, kept self-heat-causing factors under their normal ranges and ultimately prevented overheat accumulation in cotton bales.

The performance of ANFIS is depicted in Figure 21, in which the precision, recall, and accuracy of proposed ANFFIS are shown graphically. The experiment and the controlled group both showed a 95% accuracy rate for predictions done by ANFIS, showing that the proposed ANFIS has satisfactory performance. The precision and recall of both groups range between 95% and 99%, showing that the proposed ANFIS has a good correctness and completeness rate.

5.1. Limitations of Proposed System

The proposed early prediction of spontaneous combustion is based on the IoT approach for prediction of self-heating/spontaneous combustion in cotton. The limitations of the proposed solution are described in Table 10. Table 11 presents a comparative analysis with similar research studies to underscore the applicability and relevance of our proposed research within the context of related studies.

6. Conclusion and Future Work

In cotton storage area, the bulk of raw cotton is stored. The one major hazard for cotton is fire [2]. 90% of cotton contains natural fiber and gases such as carbon along with oxygen, which contains 45% of it. This mixture makes cotton an inflammable substance. However, the cellulose content composition makes cotton likely to catch fire by external ignition. This can be avoided by protecting cotton from sparks, fire, naked lights, and lit cigarettes [3]. In addition to external ignition, cotton may also likely to catch fire and compromise its quality due to spontaneous combustion, a process by which the internal temperature of an element (hay, straw, cotton, etc.) crosses its limit of the ignition point due to accumulation of heat produced by oxidation or bacterial fermentation in it. This internal heat can remain in cotton for months unnoticed, which, upon external instigation by sparks or any other source, may cause an outbreak. Hence, there must be some mechanism or technique to predict this process before it may occur and cause damage. In current research, we have focused on an early prevention of fire by presenting an intelligent and early prediction system to detect self-heating of cotton and ultimately contribute to an early prediction of spontaneous combustion in the cotton storage area. The process of spontaneous combustion is aided by many factors such as gases (methane, oxygen, phosphine, and diphosphine), the internal temperature of cotton, its moisture levels, environmental temperature, and humidity levels. The IoT-based hardware is used to detect self-heating factors and machine learning algorithms for early prediction of spontaneous combustion. The proposed system can sense self-heat-causing factors using an IoT-enabled circuit, which then passes real-time sensed values to an efficient adaptive neuro fuzzy system to predict spontaneous combustion/cotton self-heating from heat-causing indicator values. The performance of the proposed system is evaluated by experiments performed on two different cotton groups, i.e., controlled and experimental, groups stored with different environmental setups, and then, the proposed IoT circuit used to collect self-heat-causing factor values is then used as input for analysis module ANFIS. The detection results of the proposed ANFIS showed that more instances from experimental group showed self-heat indication as compared to controlled group; moreover, statistics applied on ANFIS showed an 85% accuracy rate. In our proposed approach, data analysis is performed with ANFIS. The proposed system showed satisfactory performance levels to provide security in cotton areas. There are many future perspectives of research which could be considered for enhancements to the proposed system, as discussed below. (1)In the future, cotton color might be regarded as a significant feature for exploring the impact of spontaneous combustion on the quality of cotton(2)In the future, the current system could be enhanced by considering more heat-causing factors for detection of self-heat(3)The proposed approach could also use camera images of cotton areas for prevention of fire if fire occurs as a result of self-heat(4)In the future, the proposed system could also be implemented by other machine learning and deep learning techniques to achieve more accuracy and better performance(5)In the future, more reliable hardware devices can be used to design real-time data collection circuit to get more reliable values

Data Availability

The data used to support the findings of this study are included within the supplementary information file(s).

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Authors’ Contributions

Umar Shafi contributes in article planning, design and modeling, IoT Circuit Building, data collection, analysis and interpretation of results, and manuscript writing. Dr. Waheed Anwar performs experiment, analysis and interpretation of results, and figure preparation. Dr. Imran Sarwar Bajwa takes part in planning, designing, and editing the manuscript. Dr. Hina Sattar contributes in IoT Circuit Building, analysis and interpretation of results, and manuscript writing of original draft. Dr. Shabana Ramzan and Ms. Iqra Yaqoob contribute in experiment design, data collection, and conduction of experiments. Ms. Aqsa Mahmood and Ms. Iqra Yaqoob perform experiments, figure preparation, and manuscript editing.

Acknowledgments

The completion of this research work could not have been possible without the assistance and support of Al-Noor Cotton Ginners and Oil Mills and M. Nazam Group of Industries. Their contributions are sincerely appreciated and gratefully acknowledged.

Supplementary Materials

Supplementary material has been included alongside the main text to enrich comprehension and facilitate the reproducibility of the findings outlined in this manuscript. The first supplementary file, labeled “Training Dataset,” comprises a table detailing the training dataset, while the second file, named “Testing Dataset,” presents a table showcasing the testing dataset. Additionally, the third supplementary file, titled “ADNFIS-Code,” encompasses the implementation code of the proposed adaptive neuro fuzzy inference system (ANFIS). (Supplementary Materials)