Monday F. Ohemu1, Ambrose A. Azeta2, Ibrahim A. Adeyanju2, Chukwuemeka C. Obasi3
1Department of Electrical and Electronics Engineering, Airforce Institute of Technology, Kaduna, 800272, Nigeria
2Department of Software Engineering, Namibia University of Science and Technology, 10005, Namibia
3Department of Computer Engineering, Edo State University, Uzairue, 300213, Nigeria
Corresponding Author:Monday F. Ohemu (e-mail: monfavour@gmail.com)
DOI: https://doi.org/10.59461/ijdiic.v4i1.161
Article history: Received November 29, 2024, Revised January 15, 2025, Accepted January 24, 2025
ABSTRACT
Globally, the proliferation of explosives and terrorist attacks has caused significant harm to public areas and heightened security concerns. The majority of public places, such as trains, airports, and government buildings, are being targeted, endangering people's lives and property. These target sites must be shielded against terrorist attacks and explosives without putting human security workers in jeopardy. Animals have been used as one of various techniques to try and tackle the aforementioned issue. It has been demonstrated that machine learning models, however, offer superior results. Large volumes of data are necessary for machine learning models to be accurate, but certain specialized training methods have drawbacks of their own because they can be difficult to get. It is now essential to create systems that are highly adaptable to real-time data. This work focuses on the essence of deploying an Artificial intelligence model for effective explosive trace detection. The model used was adapted from deep learning technology trained with a large explosive trace data set that was collected from a sensor network. The dataset was converted to 2D data using serial data to an image generator. The model was developed to classify explosive gas based on the concentration of Carbon (C), Hydrogen (H), Oxygen (O), and Nitrogen (N) gases and was able to classify the gas combinations as either explosive or not. The adaptation of CNN was tested and validated using 10% of the explosive trace dataset with an accuracy of 98.2%, and an AUC of 1 was recorded. The result shows that the deep learning concept is a useful tool in explosive trace detection.
This is an open access article under the CC BY-SA license.

Keywords: Explosive Trace Detection, Artificial Intelligence, Machine Learning, Deep Learning
Terrorist attacks on individuals and sensitive locations have grown to be a global threat, forcing governments, security services, and educational institutions to take all necessary precautions to protect citizens and vital infrastructure. Attacks using explosives against vital infrastructure, personnel, schools, and the government have increased recently because these weapons are simple to make and use and have the potential to cause significant harm [1]. This has made the development of various kinds of explosives for destroying innocent people and properties very common. The area of interest includes learning institutions, airports, government properties and military bases, which can be monitored through sensor networks. The sensor network, which comprises different types of sensors, is designed and deployed continuously to detect and identify explosive traces within specific threat locations in an environment. Trace elements, compounds, or chemical residues associated with explosives, such as TNT (trinitrotoluene), RDX (hexahydro-1,3,5-trinitro-1,3,5-triazine), known as the Royal Demolition Explosive or PETN (pentaerythritol tetranitrate) can be detected. This information collected in real-time by the sensor network can be processed either by the sensor note or by a remote server using advanced algorithms for data analysis. This has led to the development of Artificial intelligence (AI) based systems to accurately detect explosives before causing havoc in an environment. This will eliminate the manual ways of screening by human security systems to monitor and secure target environments that further expose human beings to potential attacks in volatile areas [2]. This work focuses on how to effectively use AI-based technology to secure and effectively monitor a target environment identified as a terrorist potential attack area using a sensor networks system.
Two known methods that have been deployed in explosive detection are the bulk explosive detection method and the trace explosive detection method. Meanwhile, the bulk explosive method uses methods such as X-rays and other electromagnetic imaging methods such as the recent computer tomography. This method is based on visual, optical and thermal characteristics of explosive substances that require advanced image processing applications for the implementation of thermo-optical sensors to achieve better results. Contrary to the bulk explosive detection methods, the trace explosive detection approach is based on chemical property traces of explosive materials [3], with most high explosives having the general formula of Ca Hb Nd Ok, where the subscript a, b, d, k are numbers of atom associated with each element. The sample containing oxidizer (O) and the fuel (C, H) of different degrees before the explosive will be formed, as in the case of RDX (Cyclotrimethylenetrinitramine, C3H6 N6O6) [2]. Each chemical has distinctive characteristics that may alter its environmental composition by altering some chemical or physical characteristics in the environment. Special sensors are designed to observe these changes often associated with wireless sensor network (WSN) systems applied for the detection of explosive substances. The main properties considered for explosive detection procedures include the chemical characteristics, mechanical nature, and physical nature of the material. The chemical nature of the explosive substance does change the chemical nature of the material in its environment, resulting in an alteration in the environmental composition of the surroundings. Sensors that have either chemical or physical ability to detect these changes are usually used to respond to these chemical and mechanical changes. It should be noted that the mechanical nature of substances is physically related to the motion of substances, such as the pressure and speed of these explosive substances and are easily detected using mechanical sensors [4].
The focus of current technological advancement in the study area is towards early detection of explosives, and the trace detection method is a faster approach to achieve such an objective. ML models will be used to analyze several amounts of data from multiple sensors to identify subtle patterns indicative of explosive traces with the ability to filter out environmental noise to improve the precision of detection. The main focus of this work is to explore the best ML model in explosive trace detecting for possible integration with edge computing to enable near-instantaneous processing and prediction, which is critical for time-sensitive applications in security and defence.
This work is divided into various sections, section one introduces the work, section two providing the literature review where basic concept such as machine learning approach in explosive trace detection (ETD), wireless sensor network (WSN) and explosive trace detection were discusses before related work were considered. Section three focuses on the methodology and section four presented the results of the findings.
The animal olfactory system is the oldest method of explosive detection [5]. Animal methods have proved to exceed technological approaches in explosive trace detection, especially the fact that they can detect multiple traces of explosives concurrently, and this is what sensor array network technology is finding difficult to achieve. Animals such as dogs, rats, pigs and honeybees are used to detect explosive traces [6]. Even though several animals are being used, dogs are commonly used to demonstrate the efficacy of dogs in explosive trace detection. In similar research on explosives, dog-handler teams have used trace detection to detect landmines [5]. The dogs recorded average detection of location accuracy of over 80%, with several teams averaging 90% correct location. Dog training is quite costly because it takes a lot of time and effort to train them well. Animals are generally only useful for a few hours a day and have a tendency to become fatigued and distracted. This is a downside to their utilization. When they simultaneously detect explosive odours from multiple sources, they can become confused [7]. The honeybee colony was used to cover a wider area that had different media, such as land, water, air, and plants. As they moved, they came in contact with pollutants in the air, on plants, and on water, which were in gaseous, particulate, or liquid form. These contaminants are used to train the bees; in the process, chemicals such as 2,4,6-trinitrotoluene (TNT) have been used. Honeybees have been used to collect samples, locate contaminated areas, and indicate anomalies in the area. In the experiment, they set up a sugar-water feeder close to the honeybee's colony and positioned explosive trace substances very close to it. The honeybees were not only attracted to the sugar water but also the explosive odour, so wherever such substance is present in the future, it will gather there, thereby detecting explosive traces. In their work, they achieved an accuracy of 98%. Honeybees were used as biosensors since pesticides could affect their usage; they are then used to collect contaminants within the environment [8]. Once there are changes in the environment, honeybees will behave differently, and that can be a sign to predict explosive substances. Although honeybee training is less and could cover more areas in the detection of explosives traces like TNT, C4 and TATP explosives at parts-per-trillion levels, weather and night conditions can easily affect the operation of the honeybees and may not also be deployed in areas where human beings are present [9].
An analytical approach for explosive trace detection is another popular method. Due to the unique nature of the chemical constituents of explosive substances, it is possible to analyze explosive contents as was presented in the work [10]. The technique has helped with the design of sensors and the strategy for using these systems to detect explosive traces. Thin-layer chromatography, gas chromatography (GC), high-pressure liquid chromatography (LC), capillary electrophoresis, and ion chromatography are all included in this so-called chromatographic method. Optical or spectroscopic techniques like infrared, ion mobility spectrometry (IMS), and mass spectrometry (MS) are then employed. In [11], it was suggested that a negative ion mobility spectrometer, in conjunction with an ionization source, be used to detect explosives. In the investigation, an explosive trace was detected using negative ion base thermal ionization while operating in the air. In order to detect the mobility particles of typical explosion compounds like TNT and RDX in the air, the ionization was enhanced by doping a chlorine chemical for the negative ion. It was determined that IMS is a highly regarded and frequently used technology in the majority of US airports for the detection of traces of nitro-organic explosives on carry-on luggage and bags. One challenge is that since most explosives yield negative ions and most operate in the negative mode, they fail to detect traces on certain compounds, e.g., TATP traces. To solve this problem of IMS not being able to detect certain traces from some compounds, the dual-tube IMS could detect both negative and positive ions [11]. Under IMS, sample vapours are often transformed into ions at atmospheric pressure, and the characteristics of those ions under mild electric fields are their gas phase nobilities. However, the vapour concentration dependency of the ion mobility spectrum and the seemingly erratic response caused by memory and humidity effects impeded the quick development of IMS, and this problem was solved by developing an in-field analyzer that can best be represented by the handheld Chemical Agent Monitor [12]. This development has made IMS to be found in most airports for screening against explosive substances. A flexible drift tube IMS system that is not expensive was developed, the system that was constructed using a single printed circuit board was used to analyse common explosive substances such as RDX, TNT and PETNT and was found to have a detection limit of few nomograms and this make IMS device to be close to the substance meant to be screened [13]. This had earlier been established by the work of in [14], where qualitative analysis of a real explosion residue and an explosive sample taken from a suspect was carried out and the explosive material and trace were identified successfully. It recorded the detection of explosives at Nano-gram levels and about six seconds response times; even with the little advantage of high speed in detection because it took only a few seconds to detect explosive traces, its low selectivity was a serious drawback.
A mass spectrometry (MS) system can be deployed in the field for security applications [15] based on membrane inlet systems and hybrid gas chromatography. The system demonstrated enhanced selectivity and quick detection. The use of Mass Spectrometry (MS) for the detection of explosive traces was based on the masses of the atoms and the molecule of the explosive substance [15]. The mass-to-charge ratio (m/e) is determined from the time and space of the charged substance in a force field. Since ions have different m/e ratios, they recorded different times of flight [16]. A system was proposed to detect traces of explosive residues on aircraft boarding. The work focuses on how to detect traces of explosive residue on passengers that may have made contact with explosive substances and such substances would have been left on their bodies. The amounts of explosive residues found on previously used boarding cards were examined. The residues are transferred to the boarding pass by touch after being picked up by the system before the traveller enters the aeroplane. The produced vapours were collected using a triple quadrupole mass spectrometer (MS/MS), and selective reaction monitoring (SRM) was employed to study them. Corona discharge is used to ionize the material. One of the produced ions is chosen to enter the collision cell and react with the nitrogen molecules there, producing a series of product ions. Precursors adduct ions are seen for RDX, PETN, and NG when an additive, such as dichloromethane, is added to the MS. Every hour: the system could process one thousand boarding passes. Background research on the amounts of explosive residues on 2,000 boarding passengers served as the basis for this conclusion. An explosive detection personnel portal [15] is a walk-through system for rapidly checking employees for explosive traces at places such as federal buildings or airports. This is yet another way that IMS is used in explosives detection. The Syagen Guardian MS-ETD Portal was built using a mass spectrometer detector [32]. The following explosives were discovered: Tetryl, ammonium nitrate fuel oil (ANFO), triacetone triperoxide (TATP), hexamethylene triperoxide diamine (HMTD), RDX, HMX, PETN, EGDN, NG, and TNT. Analysis time is less than 15 seconds. MS showed a gain in selectivity, but a restriction was the big, costly devices needed for broad-scale sensor deployment in the wake of the growing number of terror acts occurring around the world [3].
In [17][15], a method for explosive trace detection called "colourimetric optical Nanosensors for trace explosive detection using metal nanoparticles" was proposed. The system is based on the work in [18] that colour reactions lead to the production of a product that can be identified by its colour, and this is a form of chemical reaction that is used to know the type of compound used. So, when you treat an explosive compound with the right reagent, it can produce a unique colour that can be used to identify the constituent elements. Based on this technology, a number of systems have been created, such as colourimetric and fluorescent sensors for the selective detection of TNT and TNP explosives in aqueous media, as suggested by [19]. TNP and TNT substances were quickly detected by the sensor-based colourimetric method. One of the well-known techniques for identifying explosive traces is the fluorescence colourimetric method. The most widely used method is still fluorescence quenching. The primary drawback of the colourimetric method is its low specificity when used for explosives analysis; many non-explosive chemicals might generate the same colour. Hence, the colourimetric approach is combined with a system to get the best results. It could only effectively work for specific explosives or particular explosive compounds designed to detect; for a wider range of field operations, multiple colourimetry sensors have to be designed.
Remote detection of explosive traces using Raman Technology was presented in [20]. The technology was based on focusing on Laser Beam. They used two enhanced Raman spectroscopy methods to improve the low sensitivity observed in existing Raman Technology and detect explosive traces from a distance. In their method, which used a convex lens to converge the laser beam while collecting the Raman signal, the plasmonic spray was used to prevent Raman scattering along the surface. This enhanced approach achieved remote Raman detection of up to thirty meters of different types of explosives with about 1 μg/cm2 of consecration. It was an improved version of Raman technology that was based on exciting a sample with a monochromatic light-like laser; the explosive chemical composition radiates light at different frequencies that can be differentiated from what exists in the environment. Raman spectroscopy is then used to collect the Roman spectra scattered light of the sample from a distance as a means of detecting substances that contain explosive traces [21]. This system involves the use of different types of lasers that are hazardous to human safety, especially the safety of the eyes. The setback of the Raman technology is that fluorescent light interferes with its operation or when a strongly absorbing substance is being used. Its operation fails on metals, and it does not cover a large area [22].
Part of the advances witnessed in the development of electronics in the last few decades was the technology known as the electronic nose, its basic components, chemical sensor array and an artificial neural network [7]. Because of its special characteristics, this sensor array can identify explosive traces of the target aroma. An adaptive pattern recognition analysis of the signatures using methods such as artificial neural networks is used to identify explosive traces, and the pattern recognition procedure enables the identification of a specific explosive. In [23], many electronic noses in the array, such as a fluorophore array, were utilized for explosive chemical detection and discrimination. A quick reaction was achieved from a tiny amount of sample after array units were combined into a single multichannel platform. Another example was the colourimetric electronic nose, which was demonstrated for vapour phase detection and explosives classification and was based on a handheld scanner and a cross-reactive array. The multichannel platform uses quantum dots as fluorescent probes to detect and differentiate between five explosives: TNT, DNT, Tetryl, PETN, and RDX [24]. With a discriminating error rate of less than 1%, the array consisting of 40 colourimetric response sensors and 16 explosives, including conventional explosives, characteristic explosive components, and homemade explosives, was able to distinguish between 14 classes. Nonetheless, it is currently generally accepted that electronic noses are insufficient to identify the minute amounts of chemicals that dogs consume.
The sensor network technology tries to solve the problem of multiple sensing of explosive trace and also solve the problem of monitoring a localized environment against explosive trace. The sensor network is applicable to all the types of sensors used in the detection of explosive traces. Laser-based atmospheric trace-gas sensors for distributed Wireless Sensor Networks (WSN) for long-term, real-time, maintenance-free environmental monitoring were proposed in [25]. The ultimate goal was the development of a laser-based chemical sensing technology that used wide-area autonomous wireless sensor networking. The prototype sensor is a battery-operated, handheld device that monitors ambient oxygen content. It has a sensitivity of 0.02% in 1 second, weighs less than 0.4 kg without batteries, is inexpensive, has a high specificity, and is robust enough for long-term sensing applications. It was shown how to locate and measure a gas plume using a prototype three-node sensor network. The system is modular and has very high specificity for a variety of environmentally significant chemicals, including methane, .
A reliable security threat warning system for public spaces like train stations, enabling security personnel to respond quickly to bomb threats, was designed according to [26]. Using a multi-phase wireless sensor network, the technology offered a means of accurately and quickly detecting explosives in order to decrease, control, and alert people to impending terrorist action. The chemical makeup of explosives was determined using a number of wireless sensor nodes that were integrated with various kinds of sensors. The system dynamically collected data from the sensing nodes using several orthogonal strategies, aggregated the data, and forwarded it to the sink node for additional analysis. In order to verify the suspected items, a mobile node was subsequently added, improving the target tracking system and lowering the frequency of false alarms. In [26], a multi-phase wireless sensor network design solution for monitoring was proposed. In order to lower the amount of false alarms, the system makes use of several wireless sensor nodes that are integrated with various sensor kinds and target tracking mechanisms. In order to respond quickly to bomb threats, this system offers an efficient warning mechanism for security risks in public areas. In [27], research on the development and deployment of a wireless electronic nose (WEN) system that could identify and quantify the quantities of the flammable gases methane). Two wireless sensor nodes in the system can function as either a slave or a master node. A digital signal processor (DSP) system processes and samples sensor array data in real-time, a wireless transceiver unit (WTU) relays the detection results to the master node connected to a computer, and a gas sensing array detects flammable gases. A gas sensor type that is resistant to environmental effects and insensitive to humidity is created. On a DSP, a threshold-based least square support vector regression (LS-SVR) estimator is used for concentration and classification calculations. The findings of the experiments verify that LS-SVR outperforms standard support vector regression (SVR) in terms of accuracy and convergence rate, outperforming artificial neural networks (ANNs). Gas mixture analysis is accomplished efficiently and in real-time using the WEN system that was built. The system has limited application to be extended to other types of gases, particularly those associated with explosive traces.
The work in [28] tried to establish the need to have a simple and effective network that can monitor an area against anti-social elements such as explosive actions. They developed a detecting system that can detect explosives reliably and accurately. In their work, a comprehensive framework that has all the ingredients to detect explosives is integrated with a wireless sensor network (WSN). It was used to detect RDX and TNT explosives components. Explosive Detection Algorithm (EDA) was developed and proved to be effective. The simulation results show great improvement over existing methods. Their work was not used to test other types of explosive components to show overall improvement.
In another development, explosive detection in border areas that handles threats from people and detect terrorist activities, they used PIR sensors for detecting person and metal detector was used for detecting explosives respectively, whereas a camera at a distant station was used to continuously watch the situation. They researched the various technologies used in the system. Among them are infrared and Bluetooth technologies. They used these three tools to implement a simulation study in Visual Basic [29].
To address the challenge of wider coverage of the sensor presented, a study on the detection of explosives using a wireless sensor network was presented [30]. Explosive detection requires the use of specialized sensors that are compatible with wireless sensor networks. The three primary axes of wireless sensor systems covered in this study are as follows: the first axis concerns the scalability of wireless sensors in explosives detection technologies. The connectivity and mobility of these networks and sensors are the second axes of the WSN explosives detection system. He discussed the need to use a hyper-sensor type that contains a bundle of sensors for different simultaneous sensing. The challenge in WSN is the issue of sensor security and latency; the WSN generally experiences delays in transmitting information.
The introduction of AI-based technology in explosive trace detection mainly enhances the selectivity and sensitivity of the sensors and also tries to solve the problem of latency in sensor networks to achieve faster response time. Different work has been done in this field. It was shown that relevant features and a high analyte detection rate can be obtained by combining a probabilistic classifier with a data-driven machine-learning technique that uses dimensionality reduction. Moreover, the probabilistic machine learning methodology offers an automatic way to detect measures that are incorrect and may result in inaccurate predictions. In [4], using a wireless sensor network modified with machine learning, this work provided a new approach to magnetic explosive detection. Because of their ease of manufacture, improvised explosive devices, or IEDs, are regarded as a serious threat. Nonetheless, scientific research is moving in the direction of using information technology to create explosives detection systems. They concentrated on the use of magnetic explosives, a subset of IEDs typically employed to target automobiles. A wireless sensor network system called a Magnetic Explosives Detection System (MEDS) uses a network of magnetic sensors to identify magnetic fields created by magnetic effectors and classify them as potentially dangerous. The system's studies demonstrate its capacity to identify changes in the magnetic field brought on by the magnets piled beneath the car. In this paper, the neural network approach is primarily used to identify the greatest reading among a set of readings in order to pinpoint the precise location of the threat. The neural network method in the MEDS generated excellent results, allowing the system to learn and recognize the necessary data type.
In [31], a Machine learning approach to improving trace explosive selectivity, which was applied to Nitrate-Based Explosives, was proposed. In the work, machine learning methods were utilized to examine the extent of improvement in IMS selectivity for the detection of nitrate-based explosives. The work considered five classes: ammonium nitrate (AN), a ∼95:5 mixture of AN and fuel oil (ANFO), urea nitrate (UN), nitrate due to environmental pollution, and samples that did not contain any explosive (blanks). The preliminary results clearly show that the incorporation of machine learning methods can lead to a significant improvement in IMS selectivity [7]. In a further development, the application of a convolutional neural network (CNN) to facilitate IED detection was proposed in [32]. An autonomous sensor array was utilized in related research to find the devices in areas that were too dangerous for a person to survey. CNN and its training approach are appropriate for using the sensor system in this work. In real-time, this convolutional neural network can detect and discriminate between natural features of the surrounding undergrowth and a potential IED. In well-lit environments, the CNN was able to identify the IEDs with 98.7% accuracy because of the training process. The suggested CNN performs better than its rivals, including the deterministic approach, when the results are compared to those of other convolutional neural networks and a deterministic algorithm. The limitation of his work is that the environment must be well illuminated before high accuracy can be recorded and what happens if the attack takes place in a dark environment. A method for identifying an appropriate categorization method to be used in an electronic nose in order to mimic sniffer dogs' detection of explosive chemicals was carried out [33]. Eight distinct classification methods—Logistic Regression, Support Vector Machine (SVM), Decision Tree, Random Forest (RF), Adaptive Boosting, K-Nearest Neighbors, Gaussian Naive Bayes, and Multilayer Perceptron—are compared in terms of detection accuracy using both binary and multi-class gas sensor array open-source datasets. With average scores of 99.66 and 98.93, respectively, the experimental results demonstrate that the RF and SVM models outperform the others. Further development in [34] suggested an innovative method for detecting the presence of one of the three harmful gases—CO, NO2, or O3—either alone or in mixes; a multi-support Vector Machine model is trained and validated using the features that were chosen. The system was able to detect and classify the various gases with high accuracy, but with the use of a multi-support Vector model, computation time was high.
The implementation of ETD using an AI technology model follows the conceptual framework shown in Figure 1, which has three distinct phases. The perception phase engages in the collection of data through the sensor network and recorded data from the environments. In phase 2, data preprocessing was done by cleaning the collected data, data conversion, and image augmentation. The last phase concerns itself with the development of the CNN model, which involves the design of the convolution layer, the fully connected layer, and the output layer.

Figure 1. Conceptual Development Framework
The dataset used represents the concentration of gas traces, originally a one-dimensional (non-spatial) data consisting of 1 X 5 features for a total of 69 514 samples, with input features being C, N, O, and H, and output features being the target. The output state is either 1 or 0, where 1 represents a case when the combined concentrations of the input features suggest an explosive trace, and 0 represents a case of a non-explosive trace. However, since this dataset is on-spatial in nature, whereas deep learning and CNN, in particular, perform well on spatial or image data, the source data was converted to form a 2-dimensional data (10.17632/wp7h98956m.1) a procedure which will map the vector samples into corresponding pixel equivalents as shown in Figure 2, where the feature vector x is mapped or transposed to the feature vector for each target sample.

Figure 2. Data to Image Conversion
The preprocessing approach starts with data normalization which involves the process of ensuring that all the feature data are within same range of 0 and 1. This process is important for ensuring that dataset does not overfit or underfit the model during training.
Each data point in the dataset was scaled by re-computing a new value using Equation 1 (MIN – MAX scaling technique). The scaled value was used to replace old values before moving to the next step.

Where xmax = the largest value of the feature
xmin = the smallest value of the feature
if x is minimum, x – xmin = 0 hence x’ = 0
if x is maximum, x – xmin = xmax – xmin hence x’ = 1
if x is between max and min value, x’ is between 0 and 1
The dataset used consists of 10,000 data points or samples. The data were in two categories, namely explosive and non-explosive categories. Figure 3 shows the distribution of the dataset based on these categories. The dataset was preprocessed after checking to determine if there were any missing values, and the dataset balance between the two classes was done.
Figure 3 show the distribution of data categorize into explosive and non-explosive image that is as a result of numeric data conversion to create the image. During this process, the numerical values were read row by row, and using the row matrix to form a new 2x2 matrix. Each value in the matrix was used as a pixel value representing a shade of images.

Figure 3. Distribution of the dataset categories
The distribution shows that the explosive category has a total of 5, 347 samples (53%), while the non-explosive category has 4,653 (47%) data samples. This distribution was a case of slight imbalance in the dataset, since there is the existence of majority and minority classes in the dataset. Such situation could lead to biased predictions and misleading accuracy. Therefore, this data must be balanced.
To create a balance in the dataset, the Synthetic Minority Oversampling Technique (SMOT) was used. This approach uses linear interpolation to create synthetic values of the minority class. Algorithm 1 below was used to implement the SMOT.
Algorithm 1
Let the minority class set = A, such that ( x ∈ A)
Loop:
Determine the k-nearest neighbor by computing the Euclidean distance between each x in set A
Set new x between each nearest neighbour such (x'∈A) that where (x'=x+rand(0,1)*| x-x_k |)
Fix new point as x' along the lines segments of the neighbours
Set N = N – 1
If N ≤ 0
Goto 5
Else Goto Loop
Stop
During this process, the numerical values were read row by row, and the row matrix was used to form a new 2x2 matrix. Each value in the matrix was used as a pixel value representing a shade of image, as shown in the information in Figure 4. In this way, images were formed from numerical data. The output images were separated and stored as JPEG files into folders based on their respective classes. The two main folders created for this purpose were "Explosive" and "Non-Explosive". Moreover, the data were divided into training, testing and validation subsets. The training subset was 70% of the whole dataset, the test subset was 20%, and the validation subset was 10%.

Figure 4. Explosive Trace Images and Non-explosive Images
This stage according to Figure 5, involves loading and preprocessing image data from the subsets. This was done by first defining variables for holding the image path where the images were stored.

Figure 5. Initializing the preprocessing stage
When the images were loaded into the variables, the dimensions were further reshaped to ensure that they all maintain the same size. This was achieved using the following code in python.

This means that all the images will maintain height and width pixel dimensions of 24 x 24, 1 channel since the images are already in gray scale.
Data augmentation is process that ensured that our model generalized well. The Image Data Generator class in keras was used for this purpose. The process includes a series of random transformation of images such as rotation, flipping, zooming, cropping and brightness/contrast adjustment. In this context, our images were randomly rotated by 40 degrees, scaled by a factor of 1/255, horizontally and vertically skewed to 0.2, and zoomed by a factor of 0.2.
In this stage, the CNN model was developed with the development phase following the general structure of the CNN architecture. The stages involved the following layer development:
The convolution layer consists of the following:
The operation performed at this layer therefore is the convolution, Z(2x2) of X and f, which is the sum of the element-wise product of X and f, and this can be expressed in equation 2.

Our convolution layer with 3 D-sub layers was developed using keras. The first 2D convolution layer was designed with 32 filters, each being a 2x2 matrix filter, which uses the Rectified Linear Unit (ReLU) activation function. The output of the first convolution (Conv) layer was passed through a 2x2 Max Pooling operation before being fed to the next Conv layer. The second Conv layer had 64 2x2 filters with a ReLU activation function. The third Conv layer had 128 2x2 filters also with ReLU activation function.
This is a neural network layer and can only work with 1D data. This implies that the output of the last Conv layer, which is a 2D must be converted into a 1D image by flattening as shown in Figure 6, and was now to be fed into the fully connected layer. In the fully connected (FC) layer, linear and non-linear transformation operations were performed on the 1D data fed into it.

Figure 6. Conversion of 2D to 1D
The linear transformation operation is represented by equation 3.

X is a vector of the image feature extracted from Conv layers
w is a 4x2 matrix of weight (a matrix of randomly assigned values)
b is a vector of biases (a constant value)
The FC had 2 neurons to linearly transform 4 data points in the X image vector. Therefore, Z was given equation 4.

During the non-linear transformation, an activation function was chosen for the output of the FC. Sigmoid function in equation 5 was the best choice at this stage because we are dealing with binary classification.

The final task during the model development was to determine the method of optimization, a process that was used to update the learning rate of the model to ensure that all computations converge correctly. Adam gradient decent defined in equation 6 was used.

Where
θ1 is the New parameter
θ2 is the old parameter
α is the learning rate (a constant that determines the amount of change to be made to the old parameter)
The gradient is the change in classification error with respect to the parameter
This section shows the results and discussion of various machine learning models used in the work.
The result of the model deployed using Python 3.10 is shown in Figure 7, which shows the graph of loss against the epochs. The results show that during each epoch, the losses in the developed model were inversely proportional to the epochs. This means that errors that would produce misleading production were reduced sufficiently. This confirms that the model performed well with the dataset. The validation was done using a validation dataset. The result of the training performance evaluation is shown in Figure 8; it presents how the model performed during training. Accuracy was used as the metric of evaluation. From that graph, we see that during each iteration, the accuracy of the model was increasing and achieved a 98.2% accuracy score.

Figure 7. Training and Validation Losses Result
The confusion matrix was used to evaluate the system's performance during testing. This plot is shown in Figure 9. The result shows that all 32 samples used for the test were correctly classified. Out of that number, 18 samples were correctly classified as explosive, while the remaining 14 samples were also correctly classified as non-explosives. Also, the ROC curve in Figure 10 confirms that the model performed very well. For both classes, the model archived an area under curve (AUC) value as 1. This is the highest any model can achieve. The accuracy and other metrics are presented in Table 1. The model recorded an accuracy of 98% with an AUC of 1. Table 2 validated the model with other machine learning models, with CNN outperforming others. Figure 11 is the graphical representation showing that the current model is better in explosive trace detection compared with other traditional machine learning models.

Figure 8. Graph of Accuracy against Epochs Result

Figure 9. Confusion Metrix of the CNN after Training with 7000 data points
Table 1. Other performance Metrics of the CNN Model
ACC |
PRECISION |
RECALL |
F-1 SCORE |
SPECIFICITY |
FPR |
TPR |
AUC |
0.982 |
0.985 |
0.985 |
0.985 |
0.949 |
0.051 |
0.985 |
1.00 |

Figure 10. Receiver Operation Characteristic Curve (ROC)
Table 2. Metrics of the Benchmarking Results
|
ACC |
PRECISION |
RECALL |
F1 SCORE |
SPECIFICITY |
FPR |
TPR |
CNN |
0.982 |
0.985 |
0.985 |
0.985 |
0.949 |
0.051 |
0.985 |
SVM |
0.762 |
0.773 |
0.773 |
0.773 |
0.748 |
0.252 |
0.773 |
ImageNet |
0.773 |
0.798 |
0.798 |
0.798 |
0.742 |
0.258 |
0.798 |
RNN |
0.626 |
0.715 |
0.715 |
0.715 |
0.561 |
0.439 |
0.715 |
AlexNet |
0.671 |
0.699 |
0.699 |
0.699 |
0.640 |
0.360 |
0.699 |

Figure 11. Comparing the accuracy and AUC of the Current Model with other models
This study has demonstrated the potential of machine learning approaches in predicting the presence of explosive traces of carbon, oxygen, hydrogen, and nitrogen in environmental conditions. The work was carried out on wireless sensor data with an improved prediction accuracy of the deep learning model over other traditional machine learning models. The model's superior performance highlights its ability to capture complex patterns and interactions among the environmental variables. These findings provide a robust framework for real-time monitoring and early detection of explosive substances, with implications for improving safety in industrial, military, and public domains. Future research could explore the optimization of sensor placement, integration of additional environmental factors, the deployment of the model in real-world scenarios to validate its effectiveness, and possible integration of edge computing for a scalable model. This study contributes to the growing body of knowledge on the application of intelligent systems in critical environmental monitoring and safety assurance. The system recorded an accuracy of 98.2% with an AUC of 1 when the deep learning base model (CNN) was used, and this was a better record compared to other traditional machine learning algorithms. This result shows that the machine learning model is a very useful concept when building an explosive trace detection system. Using modern AI will enhance explosive trace detection in public areas such as train stations, airports and government institutions.
DATA AVAILABILITY STATEMENT
The data that support the findings of this study are available at https://data.mendeley.com/datasets/wp7h98956m/1.
CONFLICTS OF INTEREST
The authors declare that they have no conflicts of interest in this work.
[1] C. Obasi et al., “Augmented Security Framework using Internet of Things for Tracking Improvised Explosive Devices,” in 2023 2nd International Conference on Multidisciplinary Engineering and Applied Science (ICMEAS), 2023, vol. 1, pp. 1–4. doi: 10.1109/ICMEAS58693.2023.10379302.
[2] M. F. Ohemu, A. A. Azeta, I. A. Adeyanju, and N. Maidoki, “Automated Area Based Explosive Trace Detection System,” in 2024 International Conference on Science, Engineering and Business for Driving Sustainable Development Goals (SEB4SDG), 2024, pp. 1–5. doi: 10.1109/SEB4SDG60871.2024.10629685.
[3] K. R. V. K. K. V. Kishore, N. G. Manthru, and Gudipati, “Wireless nano senor Network (WNSN) for trace detection of explosives: The case of RDX and TNT,” Instrum. Mes. Metrol., vol. 18, no. 2, pp. 153–158, 2019, doi: 10.18280/i2m.180209.
[4] A. J. Al-mousawi and A. J. Al-mousawi, “work and machine learning Magnetic Explosives Detection System ( MEDS ) based on wireless sensor network and machine learning .,” Measurement, p. 107112, 2019, doi: 10.1016/j.measurement.2019.107112.
[5] D. Command and F. Belvoir, “U.s. army mobility equipment,” security, 1978.
[6] A. J. AL-Mousawi and H. K. AL-Hassani, “A survey in wireless sensor network for explosives detection,” Comput. Electr. Eng., vol. 72, pp. 682–701, Nov. 2018, doi: 10.1016/j.compeleceng.2017.11.013.
[7] R. Liu, Z. Li, Z. Huang, K. Li, and Y. Lv, “Biosensors for explosives: State of art and future trends,” TrAC - Trends Anal. Chem., vol. 118, pp. 123–137, 2019, doi: 10.1016/j.trac.2019.05.034.
[8] S. Girotti, S. Ghini, E. Maiolini, L. Bolelli, and E. N. Ferri, “Trace analysis of pollutants by use of honeybees, immunoassays, and chemiluminescence detection,” Anal. Bioanal. Chem., vol. 405, no. 2–3, pp. 555–571, 2013, doi: 10.1007/s00216-012-6443-3.
[9] K. Chuen To, S. Ben-Jaber, and I. P. Parkin, “Recent Developments in the Field of Explosive Trace Detection,” ACS Nano, vol. 14, no. 9, pp. 10804–10833, Aug. 2020, doi: 10.1021/acsnano.0c01579.
[10] T. Wasilewski and J. Gębicki, “Emerging strategies for enhancing detection of explosives by artificial olfaction,” Microchem. J., vol. 164, no. December 2020, 2021, doi: 10.1016/j.microc.2021.106025.
[11] H. Shahraki, M. Tabrizchi, and H. Farrokhpor, “Detection of explosives using negative ion mobility spectrometry in air based on dopant-assisted thermal ionization,” J. Hazard. Mater., vol. 357, pp. 1–9, 2018, doi: 10.1016/j.jhazmat.2018.05.054.
[12] Gary and Eiceman, “working in an industrial or regulatory-based setting with limited appeal to academics.,” in Ion Mobility Spectrometry, 2nd ed., (New Mexico State University, Las Cruces, NM) and Zeev Karpas (Nuclear Research Center, Beer-Sheva, Israel).: CRC Press (an imprint of Taylor and Francis Group), 2006, pp. 5585–5588. doi: 10.1021/ja0598560.
[13] B. L. Smith, C. Boisdon, I. S. Young, T. Praneenararat, T. Vilaivan, and S. Maher, “Flexible Drift Tube for High Resolution Ion Mobility Spectrometry (Flex-DT-IMS),” Anal. Chem., vol. 92, no. 13, pp. 9104–9112, 2020, doi: 10.1021/acs.analchem.0c01357.
[14] L. Mokalled, M. Al-husseini, K. Y. Kabalan, and A. El-hajj, “Sensor Review for Trace Detection of Explosives,” Int. J. Sci. Eng. Res., vol. 5, no. 6, pp. 337–350, 2014.
[15] K. Evans-Nguyen, A. R. Stelmack, P. C. Clowser, J. M. Holtz, and C. C. Mulligan, “Fieldable Mass Spectrometry for Forensic Science, Homeland Security, and Defense Applications,” Mass Spectrom. Rev., vol. 40, no. 5, pp. 628–646, 2021, doi: 10.1002/mas.21646.
[16] J. Yinon, “Detection of explosives by mass spectrometry,” Counterterrorist Detect. Tech. Explos., pp. 41–59, 2007, doi: 10.1016/B978-044452204-7/50021-3.
[17] O. Adegoke and N. Nic Daeid, “Colorimetric optical nanosensors for trace explosive detection using metal nanoparticles: advances, pitfalls, and future perspective,” Emerg. Top. Life Sci., vol. 5, no. 3, pp. 367–379, May 2021, doi: 10.1042/ETLS20200281.
[18] J. Almog and S. Zitrin, “Colorimetric Detection of Explosives,” Asp. Explos. Detect., pp. 41–58, 2009, doi: 10.1016/B978-0-12-374533-0.00004-0.
[19] H. M. Junaid et al., “Fluorescent and colorimetric sensors for selective detection of TNT and TNP explosives in aqueous medium through fluorescence emission enhancement mechanism,” J. Photochem. Photobiol. A Chem., vol. 428, no. October 2021, p. 113865, 2022, doi: 10.1016/j.jphotochem.2022.113865.
[20] R. Hao, J. Zhao, J. Liu, H. You, and J. Fang, “Remote Raman Detection of Trace Explosives by Laser Beam Focusing and Plasmonic Spray Enhancement Methods,” Anal. Chem., vol. 94, no. 32, pp. 11230–11237, Aug. 2022, doi: 10.1021/acs.analchem.2c01732.
[21] K. L. Gares, K. T. Hufziger, S. V. Bykov, and S. A. Asher, “Review of explosive detection methodologies and the emergence of standoff deep UV resonance Raman,” J. Raman Spectrosc., vol. 47, no. 1, pp. 124–141, Jan. 2016, doi: 10.1002/jrs.4868.
[22] T. Regis, L. Cesar, M. Oliveira, and A. Chemical, “Recent Development of Explosive Trace Detection,” Am. Chem. Soc., vol. 10, no. 43, pp. 1–60, 2018, doi:10.1021/acsnano.0c01579.
[23] W. J. Peveler, A. Roldan, N. Hollingsworth, M. J. Porter, and I. P. Parkin, “Multichannel detection and differentiation of explosives with a quantum dot array,” ACS Nano, vol. 10, no. 1, pp. 1139–1146, 2016, doi: 10.1021/acsnano.5b06433.
[24] J. R. Askim, Z. Li, M. K. LaGasse, J. M. Rankin, and K. S. Suslick, “An optoelectronic nose for identification of explosives,” Chem. Sci., vol. 7, no. 1, pp. 199–206, 2016, doi: 10.1039/c5sc02632f.
[25] S. So, A. A. Sani, L. Zhong, F. Tittel, and G. Wysocki, “Laser Spectroscopic Trace-Gas Sensor Networks for Atmospheric Monitoring Applications,” ESSA Work. ’09, April 16, 2009, San Fr. California, USA, 2009.
[26] S. Simi and M. V Ramesh, “Wireless Sensor Network for Remote Detection of Explosives,” pp. 60–71, 2011, doi: 10.5220/0003116300600071.
[27] K. Song, Q. Wang, Q. Liu, H. Zhang, and Y. Cheng, “A wireless electronic nose system using a Fe2O3 gas sensing array and least squares support vector regression,” Sensors, vol. 11, no. 1, pp. 485–505, 2011, doi: 10.3390/s110100485.
[28] K. Rejeti, G. Murali, and B. S. Kumar, “An Accurate Methodology to Identify the Explosives using Wireless Sensor Networks,” SSRN Electron. J., no. 2003, pp. 2335–2347, 2019, doi: 10.2139/ssrn.3362178.
[29] M. Mohan and S. Shelly, “Border security robot,” Int. J. Cybern. Informatics, vol. 5, no. 2, pp. 275–283, Apr. 2016, doi: 10.5121/ijci.2016.5230.
[30] A. J. AL-Mousawi and H. K. AL-Hassani, “A survey in wireless sensor network for explosives detection,” Comput. Electr. Eng., vol. 72, pp. 682–701, 2018, doi: 10.1016/j.compeleceng.2017.11.013.
[31] D. Fisher, S. R. Lukow, G. Berezutskiy, I. Gil, T. Levy, and Y. Zeiri, “Machine Learning Improves Trace Explosive Selectivity: Application to Nitrate-Based Explosives,” J. Phys. Chem. A, vol. 124, no. 46, pp. 9656–9664, Nov. 2020, doi: 10.1021/acs.jpca.0c05909.
[32] S. Colreavy-Donnelly, F. Caraffini, S. Kuhn, M. Gongora, J. Florez-Lozano, and C. Parra, “Shallow buried improvised explosive device detection via convolutional neural networks,” Integr. Comput. Aided. Eng., vol. 27, no. 4, pp. 403–416, Sep. 2020, doi: 10.3233/ICA-200638.
[33] S. Wongwattanaporn and T. Phienthrakul, “Machine Learning for Explosive Detection from Electronic Nose Datasets,” in 2021 13th International Conference on Knowledge and Smart Technology (KST), IEEE, Jan. 2021, pp. 214–218. doi: 10.1109/KST51265.2021.9415845.
[34] O. Djedidi, M. A. Djeziri, N. Morati, J. Seguin, and M. Bendahan, “Sensors and Actuators : B . Chemical Accurate detection and discrimination of pollutant gases using a temperature modulated MOX sensor combined with feature extraction and support vector classification,” Sensors Actuators B. Chem., vol. 339, no. November 2020, p. 129817, 2021, doi: 10.1016/j.snb.2021.129817.
BIOGRAPHIES OF AUTHORS

Monday F. Ohemu is a Lecturer at the Department of Electrical and Electronics Engineering, Airforce Institute of Technology, Kaduna. He is currently the Faculty and Departmental Post Graduate Coordinator. Ohemu holds a Higher National Diploma in Electrical and Electronics Engineering from Federal Polytechnic Bauchi, a B.Tech in Computer Science Engineering from Mewar University, India, Post Graduate Diploma in Electrical and Electronics Engineering from Ahmadu Bello University, Zaria, M.Sc. in Information Technology from National Open University, Abuja; M.Sc. in Control Engineering from Ahmadu Bello University, Zaria; and Ph.D. in Artificial Intelligence from The African Centre of Excellence for Technology Enhance Learning (ACETEL) of the National Open University of Nigeria, Abuja. His research interests include Artificial Intelligence, the Internet of Things, Computer Vision, Machine/ Deep Learning, Smart Systems and Control Systems. He is a member of the Council for the Regulation of Engineering in Nigeria (COREN) and a member of the Practical Artificial Intelligence Development Foundation. He can be contacted at email: monfavour@gmail.com.

Ambrose A. Azeta is a full professor in the Department of Software Engineering, Faculty of Computing and Informatics, Namibia University of Science and Technology (NUST), Windhoek, Namibia. He has a Bachelor of Science (BSc), Master of Science (MSc) and PhD in Computer Science from the University of Benin, the University of Lagos and Covenant University Nigeria, respectively. His current research interests include Applied Software Engineering, Artificial Intelligence and Machine Learning. Professor Azeta has several articles in conferences, journals, and books that are indexed on Google Scholar, Scopus, and the Web of Science. He has received several awards and supervised several postgraduate students at master’s and PhD. He can be contacted at email: aazeta@nust.na.

Ibrahim A. Adeyanju is a Professor in the Department of Computer Engineering at Federal University, Oye-Ekiti (FUOYE), Nigeria and an adjunct Professor at the African Centre of Excellence for Technology Enhanced Learning (ACETEL), National Open University of Nigeria (NOUN) Abuja. He obtained a bachelor’s degree (B.Tech.) in Computer Engineering with a First class from Ladoke Akintola University of Technology (LAUTECH), Ogbomoso, Oyo state, Nigeria and his Masters (MSc.) degree in Computing Information Engineering and a Doctorate (PhD) degree in Computing from the Robert Gordon University (RGU), Aberdeen, United Kingdom. His PhD thesis was in the area of Artificial intelligence, Machine Learning and Natural Language Processing. He also did a one-year post-doctorate fellowship on an EPSRC project in the area of information retrieval at RGU. His research interest is in Intelligent Systems and Microprocessor Control/ Embedded Systems and he currently has several peer-reviewed journal articles and conference papers across different research areas of Computer Science and Engineering, including Microprocessor based systems, Pattern Recognition, Distributed Constraints Satisfaction, Artificial Intelligence, Information Retrieval, Information Systems and Machine Learning. He can be contacted at email: brahim.adeyanju@fuoye.edu.ng.

Chukwuemeka C. Obasi Completed a PhD in Digital Electronics and Computer Engineering from the University of Nigeria in Nsukka, Nigeria, in 2023, a Master of Engineering (M. Eng.) degree in Computer and Control Engineering from the Nnamdi Azikiwe University, Awka, Nigeria in 2016, and a bachelor's of engineering degree (B. Eng.) in Computer engineering from the Enugu State University of Science and Technology, Enugu, Nigeria. He is currently a senior lecturer at the Department of Computer Engineering, Edo University Iyamho, Edo State, Nigeria. His current research interests include robotics, cloud computing, biosensors, embedded systems, machine learning, human-centric Computing, intelligent systems, and the Internet of Things (IoT). He can be contacted at email: chukwuemeka.obasi@edouniversity.edu.ng.