Terahertz lightweight capsule type network-based dangerous chemical detection method

Through the detection method based on the terahertz lightweight capsule network, the target absorbance characteristics of chemical hazardous products are extracted and classified, which solves the problem of low detection accuracy of existing deep learning models, achieving higher detection accuracy and lower risk of overfitting.

CN120084751APending Publication Date: 2025-06-03NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510246106.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

Existing deep learning models have low accuracy in detection of chemical hazardous goods and are prone to problems such as reduced model generalization ability and overfitting.

Method used

Using a detection method based on a terahertz lightweight capsule network, the target absorption spectral data of the object to be tested is obtained, the target absorbance characteristics are extracted, and the target absorbance characteristics are input into the terahertz lightweight capsule network model trained through the sample data set for classification, and the predicted probability value is output to determine the detection result.

Benefits of technology

It improves the accuracy of chemical hazardous products detection, avoids the risk of reduced model generalization ability and overfitting, and enhances the ability to identify chemical hazardous products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120084751A_ABST
    Figure CN120084751A_ABST
Patent Text Reader

Abstract

The invention discloses a hazardous chemical detection method based on a terahertz lightweight capsule network, and relates to the technical field of terahertz spectrum detection.The method comprises the steps that target absorption spectrum data of a to-be-detected article are obtained, and target absorbance characteristics of the target absorption spectrum data are extracted; inputting the target absorbance characteristics into a terahertz lightweight capsule type network model trained based on a sample data set; classifying the target absorbance characteristics through the terahertz lightweight capsule type network model, and outputting a prediction probability value that the to-be-detected article corresponding to the target absorbance characteristics is classified into each type of dangerous chemical article; and outputting the type of the dangerous chemical with the maximum prediction probability value as a detection result of the to-be-detected article. According to the method, the problem that the detection accuracy is low when an existing deep learning model is used for detecting dangerous chemicals is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of terahertz spectroscopy detection, and in particular to a method for detecting chemical dangerous goods based on a terahertz lightweight capsule network. Background Art

[0002] With the development of social science, the chemical industry has also been vigorously developed. The storage and transportation of chemical dangerous goods are essential links in the chemical industry chain. How to safely, accurately, and real-time detect chemical dangerous goods under concealed conditions is of great significance for air transportation safety, border inspection, and security inspection; in addition, accurately finding concealed chemical explosives is an essential task for public safety and production safety. Since terahertz waves have a high spectral bandwidth, strong penetration, short pulses, no radiation to the human body, can achieve non-destructive detection of samples while ensuring accuracy, and can penetrate non-metallic packaging materials such as plastics and wood, terahertz waves can be used for detecting chemical dangerous goods under naked or packaging material coverage, effectively realizing "non-opening" safety inspection of chemical dangerous goods.

[0003] With the development of artificial intelligence technology, combining terahertz spectroscopy with artificial intelligence can make it easier to identify objects by spectra. In the prior art, the research on using deep learning models to process terahertz spectra relies on a large amount of simulated spectral data, creating a noise-free training environment for the models, which greatly reduces the generalization ability of the models and increases the limitations of spectral detection. In addition, although some research has obtained relatively limited measured spectral data, when training deep learning models, there is a risk of model overfitting. Therefore, the existing solutions for detecting chemical dangerous goods using deep learning models have the problem of low detection accuracy. Summary of the Invention

[0004] The present invention provides a method for detecting chemical dangerous goods based on a terahertz lightweight capsule network, which solves the problem of low detection accuracy in detecting chemical dangerous goods by existing deep learning models.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] In a first aspect, the present invention provides a method for detecting chemical dangerous goods based on a terahertz lightweight capsule network, the method comprising:

[0007] Obtain target absorption spectral data of an item to be measured, and extract target absorbance features of the target absorption spectral data; the target absorbance features are peak or valley features of the target absorption spectral data;

[0008] The target absorbance feature is input into a terahertz lightweight capsule network model trained based on a sample data set; the sample data set includes measured spectral data of multiple types of hazardous chemicals, and the measured spectral data of each type of hazardous chemicals includes multiple measured absorbance features;

[0009] Classifying the target absorbance feature by using the terahertz lightweight capsule network model, and outputting a predicted probability value of the object to be tested corresponding to the target absorbance feature being classified as each type of hazardous chemical;

[0010] The type of hazardous chemical with the largest predicted probability value is output as the detection result of the object to be detected.

[0011] In a possible implementation, before inputting the target absorbance feature into a terahertz lightweight capsule network model trained based on a sample data set, the method further includes:

[0012] According to the capsule network and the Mamba model, an original terahertz lightweight capsule network model is constructed; the probability output of the Mamba model is integrated into the capsule network through the Mamba dynamic routing algorithm layer of the capsule network; the probability output is the probability that the measured absorbance feature is identified as each type of chemical hazardous substance by the Mamba model.

[0013] In a possible implementation, an original terahertz lightweight capsule network model is constructed based on the capsule network and the Mamba model, specifically including:

[0014] Synchronously receiving the measured absorbance feature through the capsule network and the input end of the Mamba model;

[0015] Integrating the probability output of the Mamba model for the measured absorbance feature into the Mamba dynamic routing algorithm layer through the output end of the Mamba model;

[0016] The capsule network outputs the predicted value through the output terminal of the capsule network according to the measured absorbance feature and the probability output, wherein the measured absorbance feature is classified into the predicted probability value of each type of chemical hazardous substance.

[0017] In a possible implementation, the capsule network further includes an input layer, an initial capsule layer, a capsule classification layer, and a Softmax layer, and the input layer, the initial capsule layer, the Mamba dynamic routing algorithm layer, the capsule classification layer, and the Softmax layer are connected in sequence;

[0018] The input layer is used to receive the measured absorbance features and transmit the measured absorbance features to the initial capsule layer;

[0019] The initial capsule layer uses convolutional operations to extract key features from the measured absorbance features;

[0020] The Mamba dynamic routing algorithm layer is used to guide the dynamic routing selection between the capsule classification layer and the initial capsule layer according to the probability output;

[0021] The capsule classification layer is used to classify the measured absorbance features according to the extracted key features and the probability output of the Mamba model, and obtain the predicted probability values that the measured absorbance features are predicted to be each type of chemical dangerous goods;

[0022] The Softmax layer is used to output the predicted probability values.

[0023] In a possible implementation, after constructing the original terahertz lightweight capsule network model, the method further includes:

[0024] Constructing a sample data set according to the measured spectral data of multiple types of chemical dangerous goods;

[0025] Training the original terahertz lightweight capsule network model according to the sample data set until the terahertz lightweight capsule network model converges, and obtaining a trained terahertz lightweight capsule network model.

[0026] In a possible implementation, constructing a sample data set according to the measured spectral data of multiple types of chemical dangerous goods specifically includes:

[0027] Collecting the measured spectral data of multiple types of chemical dangerous goods under a terahertz time-domain spectroscopy system;

[0028] Preprocessing each of the measured spectral data and screening out multiple absorbance features included in each of the measured spectral data;

[0029] Using the type of each measured spectral data as the index label of the measured spectral data to construct the sample data set.

[0030] In a possible implementation, the sample data set includes a first sample set and a second sample set;

[0031] The first sample set includes the measured spectral data of multiple types of chemical dangerous goods directly exposed; the second sample set includes the measured spectral data of multiple types of chemical dangerous goods blocked by non-metallic packaging.

[0032] Second aspect, the present invention provides a chemical dangerous goods detection device based on a terahertz lightweight capsule network, and the device includes:

[0033] A data preprocessing unit, configured to obtain target absorption spectrum data of an item to be measured, and extract target absorbance features of the target absorption spectrum data; the target absorbance features are peak or valley features of the target absorption spectrum data;

[0034] A data transmission unit, configured to input the target absorbance features into a trained terahertz lightweight capsule network model based on a sample data set; the sample data set includes measured spectrum data of multiple types of chemical dangerous goods, and the measured spectrum data of each type of chemical dangerous goods includes multiple measured absorbance features;

[0035] A model prediction unit, configured to classify the target absorbance features through the terahertz lightweight capsule network model, and output prediction probability values that the item to be measured corresponding to the target absorbance features is classified as each type of chemical dangerous goods;

[0036] An output unit, configured to output the type of the chemical dangerous goods with the maximum prediction probability value as the detection result of the item to be measured.

[0037] In a possible implementation manner, the chemical dangerous goods detection device based on the terahertz lightweight capsule network further includes a model construction unit. Before inputting the target absorbance features into a trained terahertz lightweight capsule network model based on a sample data set, the model construction unit is configured to execute:

[0038] Construct an original terahertz lightweight capsule network model according to a capsule network and a Mamba model; the probability output of the Mamba model is incorporated into the capsule network through the Mamba dynamic routing algorithm layer of the capsule network; the probability output is the probability that the measured absorbance features are recognized by the Mamba model as each type of chemical dangerous goods.

[0039] In a possible implementation manner, when constructing the original terahertz lightweight capsule network model according to the capsule network and the Mamba model, the model construction unit is specifically configured to execute:

[0040] Synchronously receive the measured absorbance features through the input ends of the capsule network and the Mamba model;

[0041] Incorporate the probability output of the Mamba model for the measured absorbance features into the Mamba dynamic routing algorithm layer through the output end of the Mamba model;

[0042] Output through the output end of the capsule network, where the capsule network predicts according to the measured absorbance feature and the probability, and the measured absorbance feature is classified into the predicted probability values of each type of chemical dangerous goods.

[0043] In a possible implementation manner, within the model construction unit, the capsule network is further configured to include an input layer, an initial capsule layer, a capsule classification layer, and a Softmax layer, and the input layer, the initial capsule layer, the Mamba dynamic routing algorithm layer, the capsule classification layer, and the Softmax layer are connected in sequence;

[0044] The input layer is used to receive the measured absorbance feature and transmit the measured absorbance feature to the initial capsule layer;

[0045] The initial capsule layer uses convolution operations to extract key features from the measured absorbance feature;

[0046] The Mamba dynamic routing algorithm layer is used to guide the dynamic routing selection between the capsule classification layer and the initial capsule layer according to the probability output;

[0047] The capsule classification layer is used to classify the measured absorbance feature according to the extracted key features and the probability output of the Mamba model, and obtain the predicted probability values of the measured absorbance feature being predicted as each type of chemical dangerous goods;

[0048] The Softmax layer is used to output the predicted probability values.

[0049] In a possible implementation manner, after constructing the original terahertz lightweight capsule network model, the chemical dangerous goods detection device based on the terahertz lightweight capsule network further includes a sample data set construction unit and a model training unit;

[0050] The sample data set construction unit is used to construct a sample data set according to the measured spectral data of multiple types of chemical dangerous goods;

[0051] The model training unit is used to train the original terahertz lightweight capsule network model according to the sample data set until the terahertz lightweight capsule network model converges, and obtain a trained terahertz lightweight capsule network model.

[0052] In a possible implementation manner, when constructing a sample data set according to the measured spectral data of multiple types of chemical dangerous goods, the sample data set construction unit is specifically configured to execute:

[0053] Collect the measured spectral data of multiple types of chemical dangerous goods under a terahertz time-domain spectroscopy system;

[0054] Preprocess each of the measured spectral data, and screen out multiple absorbance features included in each of the measured spectral data;

[0055] Use the type of each of the measured spectral data as the index label of the measured spectral data to construct the sample data set.

[0056] In a possible implementation manner, within the sample data set construction unit, the sample data set is configured to include a first sample set and a second sample set;

[0057] The first sample set includes the measured spectral data of multiple types of chemical dangerous goods directly exposed; the second sample set includes the measured spectral data of multiple types of chemical dangerous goods blocked by non-metallic packaging.

[0058] In a third aspect, the present invention provides an electronic device, which includes: a processor and a memory. At least one instruction, at least one program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the chemical dangerous goods detection method based on the terahertz lightweight capsule network described in any one of the above.

[0059] In a fourth aspect, the present invention provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the chemical dangerous goods detection method based on the terahertz lightweight capsule network described in any one of the above.

[0060] In actual application, the method for detecting hazardous chemicals based on a terahertz lightweight capsule network provided by an embodiment of the present invention first performs feature extraction on the acquired target absorption spectrum data of the object to be tested, and extracts the peak or trough features of the target absorption spectrum data as the target absorbance features; secondly, the target absorbance features are input into a terahertz lightweight capsule network model trained with measured spectrum data of multiple types of hazardous chemicals; thirdly, the target absorbance features are classified by the terahertz lightweight capsule network model to obtain a predicted probability value of the target absorbance features being classified as each type of hazardous chemical; finally, the type of hazardous chemical with the largest predicted probability value is output as the detection result of the object to be tested. The terahertz lightweight capsule network model of the present invention takes the target absorbance characteristics of the target absorption spectrum data as input. For each type of hazardous chemicals, the measured absorbance characteristics extracted from the measured spectrum data are used as sample data. The terahertz lightweight capsule network model is trained by a sample data set composed of the measured sample data. The model is trained by using the measured sample data set instead of a large amount of traditional simulated spectrum data, which avoids a reduction in the generalization ability of the model, reduces the limitations of spectrum detection, avoids the risk of overfitting of the model, and effectively improves the detection accuracy of the model for hazardous chemicals.

[0061] The terahertz lightweight capsule network model designed by the present invention combines the Mamba model with the capsule network. Its structure inherits the linear complexity of the Mamba model and can have high detection accuracy while maintaining lightweight. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A flowchart of a method for detecting hazardous chemicals based on a terahertz lightweight capsule network provided by an embodiment of the present invention;

[0063] Figure 2 A schematic diagram of the structure of a terahertz lightweight capsule network model in a chemical hazardous goods detection method based on a terahertz lightweight capsule network provided in an embodiment of the present invention;

[0064] Figure 3 An analysis curve diagram of measured spectral data of multiple types of hazardous chemicals in a hazardous chemical detection method based on a terahertz lightweight capsule network provided in an embodiment of the present invention;

[0065] Figure 4 A schematic diagram of the relationship between the computational time complexity of a terahertz lightweight capsule network model in a chemical hazardous goods detection method based on a terahertz lightweight capsule network provided in an embodiment of the present invention;

[0066] Figure 5Schematic diagram of a chemical dangerous goods detection device based on a terahertz lightweight capsule network provided by an embodiment of the present invention.

[0067] Reference numerals and descriptions:

[0068] 21. Capsule network; 211. Mamba dynamic routing algorithm layer; 212. Input layer; 213. Initial capsule layer; 214. Capsule classification layer; 215. Softmax layer; 22. Mamba model. Detailed implementation manners

[0069] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0070] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present disclosure, unless otherwise stated, the meaning of "a plurality" is two or more. Additionally, the use of "based on" or "according to" means open and inclusive, because a process, step, calculation, or other action "based on" or "according to" one or more of the stated conditions or values may in practice be based on additional conditions or values beyond those stated.

[0071] To solve the problem of low detection accuracy in detecting chemical dangerous goods by existing deep learning models, an embodiment of the present invention provides a method for detecting chemical dangerous goods based on a terahertz lightweight capsule network.

[0072] As Figure 1 shown, in a first aspect, an embodiment of the present invention provides a method for detecting chemical dangerous goods based on a terahertz lightweight capsule network, and the method includes:

[0073] Step 101: Obtain the target absorption spectrum data of the item to be tested, and extract the target absorbance feature of the target absorption spectrum data.

[0074] Among them, the target absorbance feature is the peak or valley feature of the target absorption spectrum data.

[0075] Among them, the item to be tested is chemical dangerous goods such as aluminum, carbon, sulfur, cryolite, potassium nitrate, CL-20, NTO, HMX, DNTF, ethanol, isopropanol, acetic acid, hydrogen peroxide, and methanol to be detected.

[0076] Absorption spectral data refers to the record of the degree of light absorption of the item to be measured at different wavelengths. This data is obtained by measuring with a spectrometer and can reflect the absorption characteristics of the item to be measured for light of specific wavelengths. Absorption spectral analysis is a technology applied in fields such as materials science, biomedicine, and environmental monitoring.

[0077] The basic principle of the absorption spectrum is that when the item to be measured absorbs photons, the electrons in it will transition from a low energy level to a high energy level. This process will cause the item to be measured to produce absorption peaks or absorption bands at different wavelengths, thus forming an absorption spectrum.

[0078] Specifically, the target absorbance characteristics include absorption peaks, absorption valleys, shoulder peaks, and end absorptions. An absorption peak refers to the wavelength position with the maximum absorption degree on the absorption spectrum, corresponding to the energy level transition of specific chemical bonds or elements in the item to be measured; an absorption valley refers to the wavelength position with a smaller absorption degree, usually located between absorption peaks; a shoulder peak refers to the wavelength position where the absorption degree gradually increases on both sides of the absorption peak; an end absorption refers to the wavelength position with a smaller absorption degree at the end of the absorption spectrum.

[0079] Step 102: Input the target absorbance characteristics into the trained terahertz lightweight capsule network model based on the sample data set.

[0080] Among them, the sample data set includes the measured spectral data of multiple types of chemical dangerous goods, and the measured spectral data of each type of chemical dangerous goods includes multiple measured absorbance characteristics.

[0081] The terahertz lightweight capsule network model is a lightweight network model based on the Capsule Network. This model significantly reduces the amount of calculation by introducing a depthwise separable convolution module to replace the traditional convolutional layer; this model can also reduce the overfitting phenomenon on a small data set; this lightweight capsule network is superior to the traditional deep learning network model in both recognition rate and operation speed.

[0082] Step 103: Classify the target absorbance characteristics through the terahertz lightweight capsule network model, and output the predicted probability values that the item to be measured corresponding to the target absorbance characteristics is classified as each type of chemical dangerous goods.

[0083] Specifically, the processing process of the terahertz lightweight capsule network model of the present invention for the target absorbance characteristics includes the reading of the target absorbance characteristics, the capsule processing of the read data, the capsule feature extraction, and the dangerous goods classification prediction. Among them, the capsule structure includes an initial capsule and a digital capsule corresponding to the capsule feature extraction and the dangerous goods classification prediction of the model respectively.

[0084] That is to say, after receiving the target absorbance characteristics, the terahertz lightweight capsule network model outputs the predicted probability value of the object to be tested corresponding to the target absorbance characteristics being identified as each type of chemical hazardous substance.

[0085] Step 104: Output the type of hazardous chemical with the largest predicted probability value as the detection result of the object to be detected.

[0086] Specifically, the type of hazardous chemical with the largest predicted probability value output by the terahertz lightweight capsule network model in step 103 is compared and obtained, and the type of hazardous chemical is used as the detection result.

[0087] In actual application, the method for detecting hazardous chemicals based on a terahertz lightweight capsule network provided by an embodiment of the present invention first performs feature extraction on the acquired target absorption spectrum data of the object to be tested, and extracts the peak or trough features of the target absorption spectrum data as the target absorbance features; secondly, the target absorbance features are input into a terahertz lightweight capsule network model trained with measured spectrum data of multiple types of hazardous chemicals; thirdly, the target absorbance features are classified by the terahertz lightweight capsule network model to obtain a predicted probability value of the target absorbance features being classified as each type of hazardous chemical; finally, the type of hazardous chemical with the largest predicted probability value is output as the detection result of the object to be tested.

[0088] The terahertz lightweight capsule network model of the present invention takes the target absorbance characteristics of the target absorption spectrum data as input. For each type of hazardous chemicals, the measured absorbance characteristics extracted from the measured spectrum data are used as sample data. The terahertz lightweight capsule network model is trained by a sample data set composed of the measured sample data. The model is trained by using the measured sample data set instead of a large amount of traditional simulated spectrum data, which avoids a reduction in the generalization ability of the model, reduces the limitations of spectrum detection, avoids the risk of overfitting of the model, and effectively improves the detection accuracy of the model for hazardous chemicals.

[0089] like Figure 2 As shown, further, before inputting the target absorbance feature into the terahertz lightweight capsule network model trained based on the sample data set, the method also includes:

[0090] According to the capsule network11 and the Mamba model22, an original terahertz lightweight capsule network model is constructed.

[0091] Among them, the probability output of the Mamba model 22 is integrated into the capsule network 11 through the Mamba dynamic routing algorithm layer 211 of the capsule network 11; the probability output is the probability that the measured absorbance feature is identified by the Mamba model 22 as each type of chemical hazardous substance.

[0092] Specifically, the Mamba model 22 is a state space model (SSM) with linear computational complexity, capable of effectively modeling the input absorbance feature sequence with linear computational complexity. The Mamba model 22 shows great potential in processing long sequence data. The core of the Mamba model 22 lies in adjusting the SSM parameters in an input-dependent manner, and the running model selectively transmits or forgets information according to the current data. This mechanism solves the deficiencies of existing deep learning models in processing discrete and information-intensive data.

[0093] The present invention does not change the specific structure of the Mamba model 22, such as Figure 2 As shown, where Linear represents a fully connected layer, Conv ID represents a convolutional layer, Relu represents a rectified linear unit, Softplus represents an activation function layer, and Tensoroperations represents a tensor operation layer.

[0094] Furthermore, based on the capsule network 11 and the Mamba model 22, an original terahertz lightweight capsule network model is constructed, specifically including:

[0095] The measured absorbance features are synchronously received through the input ends of the capsule network 11 and the Mamba model 22.

[0096] The probability output of the Mamba model 22 for the measured absorbance features is incorporated into the Mamba dynamic routing algorithm layer 211 through the output end of the Mamba model 22.

[0097] The capsule network 11 outputs through its output end. The capsule network 11 predicts based on the measured absorbance features and the probability output, and the predicted probability values of the measured absorbance features being classified into each type of chemical dangerous goods are obtained.

[0098] In this embodiment, the Mamba model 22 is reconstructed based on one-dimensional measured spectral data. While the measured absorbance features of the measured spectral data enter the capsule network 11, the Mamba model 22 synchronously captures the state information of the measured absorbance data. Since the information transfer of capsules is involved in the capsule network 11, the Mamba model 22 captures the measured absorbance features and probabilizes its output to guide the dynamic routing selection of the capsules.

[0099] Specifically, the feature output after the capsule network 11 extracts features is selected for capsule information by the dynamic routing algorithm guided by the Mamba model 22, and the capsule information is transmitted to the feature classification stage of the capsule network 11 to achieve the classification of chemical dangerous goods.

[0100] When constructing a terahertz lightweight capsule network model, it is necessary to determine the state space model of one-dimensional spectral data, that is, the Mamba model 22.

[0101] Specifically, in a three-dimensional dynamic system, let h(t) represent the latent state at time t, x(t) be the input target absorbance feature sequence, and y(t) represent the output sequence. Then the state equation is as follows:

[0102] h′(t) = Ah(t) + Bx(t) (1);

[0103] Among them, h′(t) represents the update of the state. Both A and B represent matrix parameters. According to the state transition equation, the output sequence can be obtained as follows:

[0104] y(t) = Ch(t) + Dx(t) (2);

[0105] Among them, C and D also represent matrix parameters, and h(t) is iteratively updated through formula (1) to obtain the output.

[0106] The original Mamba model uses the zero-order hold technique to make discrete data continuous and sampled.

[0107] The core of the zero-order hold technique is to retain the same discrete signal within a fixed period of time. Among them, this time is called the step size Δ and has learnability. On this basis, the signal is sampled according to Δ, and finally the continuous SSM is transformed into a discrete SSM. D in the formula is similar to a skip connection. Therefore, in the absence of a skip connection, formulas (1) and (2) are transformed as follows:

[0108]

[0109] y k = Ch k (4);

[0110] Among them, and represent the variables after zero-order hold processing; k represents the discrete time step at this time.

[0111] For fast inference, the discrete SSM is reformulated using a cyclic structure similar to RNN. For example, the output expansion at the 3rd time step can be expressed as follows:

[0112]

[0113] And so on, the output expansion at the kth time step can be expressed as follows:

[0114]

[0115] The feature extraction of two-dimensional data is performed using a convolution operation, and its convolution kernel provides the fundamental basis for the convolution operation. In formula (6), the coefficients of x can be represented in matrix form, and this extracted matrix can be regarded as a kernel, that is The advantage of doing this is that parallel training can be carried out through the neural network method, that is, an RNN structure is used for inference and a CNN structure is used for training.

[0116] On the one hand, the Mamba model 22 adds state selectivity to effectively enhance the retention of useful information. On the other hand, it realizes the parallel scanning of the previous state. In the present invention, an innovative conversion is made between the state of the Mamba model 22 and the capsule network 11. In order to better serve the capsule network 11 and adapt to the dynamic selection between capsules, the output of the Mamba model 22 is capsuleized with reference to the output dimension of the initial capsule layer 213.

[0117] In the embodiment of the present invention, it includes three Mamba blocks, and the three Mamba blocks perform the same operation, and the output of the Mamba block is capsuleized, that is, the state form of the feature is converted into the capsule form.

[0118] Furthermore, the capsule network 11 further includes an input layer 212, an initial capsule layer 213, a capsule classification layer 214, and a Softmax layer 215. The input layer 212, the initial capsule layer 213, the Mamba dynamic routing algorithm layer 211, the capsule classification layer 214, and the Softmax layer 215 are connected in sequence.

[0119] Among them, the input layer 212 is used to receive the measured absorbance features and transmit the measured absorbance features to the initial capsule layer 213.

[0120] The initial capsule layer 213 uses a convolution operation to extract key features from the measured absorbance features.

[0121] The Mamba dynamic routing algorithm layer 211 is used to guide the dynamic routing selection between the capsule classification layer 214 and the initial capsule layer 213 according to the probability output.

[0122] The capsule classification layer 214 is used to classify the measured absorbance features according to the extracted key features and the probability output of the Mamba model 22, and obtain the predicted probability values of the measured absorbance features being predicted as each type of chemical dangerous goods.

[0123] The Softmax layer 215 is used to output the predicted probability values.

[0124] Specifically, when guiding the dynamic routing of the capsule network 11 at the output end of the Mamba model 22, the capsule network 11 consists of various capsules that perform specific tasks. The input and output of each capsule are vectors, and the transmission of its feature information depends on the dynamic selection between high-level and low-level capsules. A non-linear function called "squashing" is used to process vectors of different lengths and limit them within the range of 0 to 1. A single capsule is defined as follows:

[0125]

[0126] Among them, v j represents the output of capsule j, while s j represents its total input; is obtained by the ratio of s j to its modulus length. For s j , except for the capsules in the first layer, the s j of all other layers of capsules is equal to the weighted sum of the output vector of the adjacent lower-layer capsule and the weight.

[0127]

[0128] Among them, W ij υ i is equal to the predicted vector of the lower-layer capsule. c ij is the coupling coefficient during the iteration process, and the sum of the coupling coefficients between capsule i and the lower-layer capsules is 1, which is determined by a softmax function. Taking the output of Mamba as the initial prior condition of the dynamic routing algorithm further enhances the high selectivity of the dynamic routing. Specifically, the state output of Mamba is transformed into a capsule layer, that is, local vectorization of Mamba. Finally, the transformed output mij of Mamba is transmitted to the dynamic routing algorithm.

[0129]

[0130] In actual operation, as the capsule information is continuously transmitted, c ij is also updated, and then b ij is updated. The routing algorithm of the entire capsule terminates until the set number of iterations is reached.

[0131] The Mamba model 22 in the present invention can capture global information while maintaining linear complexity, which is both efficient and effective. Based on the dynamic routing algorithm guided by the Mamba model 22, the initial capsule layer 213 of the capsule network 11 and the dynamic routing selection of the capsule network 11 layer are realized, thereby designing the terahertz lightweight capsule network model of the present invention. This model inherits the linear complexity of the Mamba model 22 and has high detection accuracy while maintaining lightweight.

[0132] Further, after constructing the original terahertz lightweight capsule network model, the method further includes:

[0133] Constructing a sample data set according to the measured spectral data of multiple types of chemical dangerous goods.

[0134] Training the original terahertz lightweight capsule network model according to the sample data set until the terahertz lightweight capsule network model converges, and obtaining a trained terahertz lightweight capsule network model.

[0135] Further, constructing a sample data set according to the measured spectral data of multiple types of chemical dangerous goods specifically includes:

[0136] Collecting the measured spectral data of multiple types of chemical dangerous goods under a terahertz time-domain spectroscopy system;

[0137] Preprocessing each measured spectral data and screening out multiple absorbance features included in each measured spectral data;

[0138] Using the type of each measured spectral data as the index label of the measured spectral data to construct a sample data set.

[0139] Further, the sample data set includes a first sample set and a second sample set;

[0140] The first sample set includes the measured spectral data of multiple types of chemical dangerous goods directly exposed; the second sample set includes the measured spectral data of multiple types of chemical dangerous goods blocked by non-metallic packaging.

[0141] Among them, the non-metallic packaging includes polyethylene, cardboard, wood board, envelope, rubber and foam board.

[0142] That is to say, in the present invention, the first sample data set corresponds to the first data scenario of multiple types of chemical dangerous goods directly exposed, and the second data set corresponds to the second data scenario of multiple types of chemical dangerous goods blocked by non-metallic packaging.

[0143] Collecting the absorption spectra of two types of chemical dangerous goods under a terahertz time-domain spectroscopy system, and ensuring that each measured spectral data is correctly matched with the type label of its corresponding chemical dangerous good.

[0144] Specifically, select more than a dozen basic chemical dangerous goods as the research objects and configure test samples; then use the terahertz time-domain spectroscopy system to measure the measured absorption spectral data of each test sample; finally, analyze and preprocess the measured absorption spectral data of each test sample, screen out the measured absorbance features included in each absorption spectral data, and store the measured absorbance features in CSV format.

[0145] When performing model training, the first sample set and the second sample set are respectively divided into a training set and a test set for the training and evaluation of the terahertz lightweight capsule network model. Among them, the first sample set and the second sample set are divided into a training set and a test set according to a ratio of 7:3. The training set is used for the training of the terahertz lightweight capsule network model, and the test set is used for the evaluation of the terahertz lightweight capsule network model.

[0146] The training process includes absorption spectrum data normalization, loss value change of the loss function, gradient backpropagation, and gradient optimization update. During the training process, observe the changes in the loss value and accuracy of the terahertz lightweight capsule network model until the terahertz lightweight capsule network model reaches a convergence state and stops training.

[0147] Among them, when the loss value and accuracy of the terahertz lightweight capsule network model are relatively unchanged, it is regarded that the training of the terahertz lightweight capsule network model reaches convergence.

[0148] Specifically, use the terahertz frequency-domain spectroscopy system platform to measure the absorption spectrum data of chemical dangerous goods, perform spectral signal analysis, and divide the training set and the test set. The terahertz lightweight capsule network model is trained using the Adam optimizer, and the Margin Loss function is selected as the loss function.

[0149] The terahertz lightweight capsule network model designed in the present invention combines the Mamba model 22 and the capsule network 11. Its structure inherits the linear complexity of the Mamba model 22 and can have high detection accuracy while maintaining light weight.

[0150] In the embodiment of the present invention, the construction process of the sample data set is as follows:

[0151] First, combine the first scenario data and the second scenario data to obtain the measured spectrum data of chemical dangerous goods.

[0152] Among them, the first data scenario includes 14 unobstructed samples directly exposed outside, namely aluminum, carbon, sulfur, cryolite, potassium nitrate, CL-20, NTO, HMX, DNTF, ethanol, isopropanol, acetic acid, hydrogen peroxide, and methanol. CL-20, NTO, HMX, and DNTF are four solid energetic materials.

[0153] The second data scenario includes 24 occluded sample data of the four chemical dangerous goods CL-20, NTO, HMX, and DNTF in the first sample data set under six types of packaging occlusions, namely polyethylene, cardboard, wood board, envelope, rubber, and foam board.

[0154] At a temperature of 25°C and a pressure of 101.325 kPa, 200 measured absorption spectrum data were measured for 14 unoccluded samples and 24 non-occluded samples in the frequency range of 0 to 5 THz. A total of 7,600 measured spectrum data were obtained, and a sample dataset was constructed based on the 7,600 measured spectrum data.

[0155] Secondly, the same preprocessing is performed on all the measured spectrum data in the sample dataset.

[0156] Among them, the preprocessing refers to denoising, which is implemented based on the Fourier filtering method. Taking the 14 unoccluded samples in the first data scenario as an example, after preprocessing, the measured absorption spectra of the 14 directly exposed unoccluded samples are visualized, as Figure 3 shown. According to the characteristics of the measured absorption spectra of the unoccluded samples, the entire measured spectrum signal is divided into "specific signals" and "defect signals". In the frequency range of 0.1 THz to 3 THz, the measured spectrum signals of the 14 unoccluded samples have obvious differences and obvious peak and valley characteristics; while in the frequency range of 3 THz to 5 THz, the measured spectrum signals of the 14 unoccluded samples are disorderly and completely have no distinguishable absorbance characteristics.

[0157] Therefore, for the measured spectrum data of all unoccluded samples, when extracting the measured absorbance characteristics, the measured spectrum data in the frequency range of 0.1 THz to 3 THz are selected. And each measured spectrum data contains a total of 176 measured absorbance characteristics. The processing method for the 24 non-occluded samples in the second data scenario is the same as that of the unoccluded samples.

[0158] Finally, a first dataset is constructed according to the measured absorbance characteristics extracted from the 14 unoccluded samples, and a second dataset is constructed according to the measured absorbance characteristics extracted from the 24 non-occluded samples. The sample dataset includes the first dataset and the second dataset.

[0159] Specifically, for the first dataset, it contains 14 categories and 2,785 measured spectra; for the second dataset, it contains 24 categories and 4,320 measured spectra. In the first dataset and the second dataset, the measured spectrum data are saved in CSV format. Each CSV file contains two columns, where one column stores the frequencies from 0.1 THz to 3 THz, and the other column stores the absorbance characteristics corresponding to each column of frequencies.

[0160] In the embodiment of the present invention, the processing of the absorbance characteristics by the terahertz lightweight capsule network model all includes a capsule conversion stage, a spectral feature extraction stage, and a classification stage. Among them, the spectral feature extraction stage is implemented by the initial capsule layer 213, and the classification stage is implemented by the classification capsule.

[0161] Specifically, the input layer 212 is a one-dimensional convolutional layer with 176 input channels and 256 output channels. This convolutional layer converts one-dimensional absorbance features into tensors, followed by a Dropout layer and an activation function Relu layer.

[0162] The initial capsule layer 213 is mainly used to realize the encapsulation and feature extraction of the input absorbance features. Specifically, the initial capsule layer 213 contains 4 capsules, and each capsule performs its function through a one-dimensional convolution. The number of input channels of this one-dimensional convolution is 256, and the number of output channels is 32. Through the structure of the initial capsule layer 213, feature extraction is performed on the input spectral data, and 4 capsule features of the same level are output. These features are concatenated in the batch dimension. Finally, the features output by the initial capsule layer 213 are compressed by formula (7). While the initial capsules process the input spectral data, this spectral data enters the Mamba model 22 for capturing dependency relationships. The probability data output by the Mamba model 22 enters the Mamba dynamic routing algorithm layer 211 to further guide the directivity of the initial capsule layer 213. Finally, the capsule classification layer 214 summarizes the received features and realizes selective class prediction.

[0163] In the embodiment of the present invention, the loss function of the terahertz lightweight capsule network model is the margin loss loss eg , which is used for the backpropagation of gradients and the update of the training posture during the training process. Among them, loss eg is expressed as follows:

[0164]

[0165] Among them, v 1 = max(0, up - ||v i ||), v r = max(0, ||v i || - lower);

[0166] k represents the number of classes; λ is a coefficient used to control the change of the loss, and 0.5 is selected in this embodiment; up and lower represent the upper and lower boundaries, and 0.9 and 0.1 are selected respectively in this embodiment; label represents the index corresponding to the class.

[0167] In the embodiments of the present invention, the terahertz lightweight capsule network model is implemented based on PyTorch. The evaluation of this model relies on a computing platform equipped with a CPU of model Intel i7-14700KF and a graphics card of model NVIDIA GeForce RTX4090 24GB, and its training and testing are both carried out on CUDA. The main hyperparameters of the terahertz lightweight capsule network model are that the batchsize is 8 / 16, the learning rate is 0.00001 / 0.0025, and the loss function is loss eg , and the optimization function for backpropagation is Adam.

[0168] According to the categories of the dataset, the number of classification output capsules of the terahertz lightweight capsule network model is 14 and 24 respectively. When evaluating the terahertz lightweight capsule network model, the evaluation metrics uniformly adopt accuracy, precision, recall, F1 score, confusion matrix, and ROC curve.

[0169] As Figure 4 shown, the execution efficiency of this model is estimated by the number of floating-point operations per second.

[0170] After evaluating the computational complexity of the terahertz lightweight capsule network model, compared with existing models, the terahertz lightweight capsule network model in the present invention achieves the fastest computational efficiency while maintaining the least number of parameters.

[0171] Among them, the existing models include AlexNet model, ResNet-34 model, ResNet-50 model, EfficientNet model, DenseNet-121 model, MLP-Mixcr model, DenseNet-161 model, and Vgg-19 model.

[0172] The present invention can be applied to various types of terminals for the control fields of key chemical dangerous goods such as security inspection and border inspection. The terahertz lightweight capsule network model in the present invention ensures the detection accuracy while maintaining extreme light weight. In addition, the present invention can also discover potential chemical dangerous goods under occluding materials in real time and can effectively screen out dangerous packages.

[0173] As Figure 5 shown, in the second aspect, the embodiments of the present invention also provide a chemical dangerous goods detection device based on the terahertz lightweight capsule network. This device includes:

[0174] A data preprocessing unit 301, configured to obtain the target absorption spectrum data of the item to be measured and extract the target absorbance features of the target absorption spectrum data.

[0175] Wherein, the target absorbance feature is a peak or trough feature of the target absorption spectrum data;

[0176] The data transmission unit 302 is used to input the target absorbance characteristics into the terahertz lightweight capsule network model trained based on the sample data set.

[0177] The sample data set includes measured spectral data of multiple types of hazardous chemicals, and the measured spectral data of each type of hazardous chemicals includes multiple measured absorbance features.

[0178] The model prediction unit 303 is used to classify the target absorbance characteristics through the terahertz lightweight capsule network model, and output the predicted probability value of the object to be tested corresponding to the target absorbance characteristics being classified as each type of chemical hazardous substance.

[0179] The output unit 304 is used to output the type of hazardous chemical with the largest predicted probability value as the detection result of the object to be detected.

[0180] Optionally, the chemical hazardous goods detection device based on the terahertz lightweight capsule network further includes a model building unit. Before inputting the target absorbance feature into the terahertz lightweight capsule network model trained based on the sample data set, the model building unit is configured to execute:

[0181] According to the capsule network and Mamba model, an original terahertz lightweight capsule network model is constructed; the probability output of the Mamba model is integrated into the capsule network through the Mamba dynamic routing algorithm layer of the capsule network.

[0182] Among them, the probability output is the probability that the measured absorbance characteristics are identified as each type of chemical hazardous substance by the Mamba model.

[0183] Optionally, when constructing the original terahertz lightweight capsule network model according to the capsule network and the Mamba model, the model construction unit is specifically configured to execute:

[0184] The measured absorbance features are received synchronously through the input of the capsule network and the Mamba model.

[0185] The probability output of the Mamba model for the measured absorbance characteristics is integrated into the Mamba dynamic routing algorithm layer through the output end of the Mamba model.

[0186] Through the output of the capsule network, the capsule network predicts the measured absorbance characteristics and the probability output, and the measured absorbance characteristics are classified into the predicted probability value of each type of chemical hazardous substance.

[0187] Optionally, within the model construction unit, the capsule network is further configured to include an input layer, an initial capsule layer, a capsule classification layer, and a Softmax layer, and the input layer, the initial capsule layer, the Mamba dynamic routing algorithm layer, the capsule classification layer, and the Softmax layer are connected in sequence.

[0188] Among them, the input layer is used to receive the measured absorbance features and transmit the measured absorbance features to the initial capsule layer.

[0189] The initial capsule layer uses convolution operations to extract key features from the measured absorbance features.

[0190] The Mamba dynamic routing algorithm layer is used to guide the dynamic routing selection between the capsule classification layer and the initial capsule layer according to the probability output.

[0191] The capsule classification layer is used to classify the measured absorbance features based on the extracted key features and the probability output of the Mamba model, and obtain the predicted probability values that the measured absorbance features are predicted to be each type of chemical dangerous goods.

[0192] The Softmax layer is used to output the predicted probability values.

[0193] Optionally, after constructing the original terahertz lightweight capsule network model, the chemical dangerous goods detection device based on the terahertz lightweight capsule network further includes a sample data set construction unit and a model training unit.

[0194] Among them, the sample data set construction unit is used to construct a sample data set according to the measured spectral data of multiple types of chemical dangerous goods;

[0195] Among them, the model training unit is used to train the original terahertz lightweight capsule network model according to the sample data set until the terahertz lightweight capsule network model converges, and obtain the trained terahertz lightweight capsule network model.

[0196] Optionally, when constructing a sample data set according to the measured spectral data of multiple types of chemical dangerous goods, the sample data set construction unit is specifically configured to execute:

[0197] Collect the measured spectral data of multiple types of chemical dangerous goods under the terahertz time-domain spectroscopy system.

[0198] Preprocess each measured spectral data and screen out multiple absorbance features included in each measured spectral data.

[0199] Use the type of each measured spectral data as the index label of the measured spectral data to construct a sample data set.

[0200] Optionally, within the sample data set construction unit, the sample data set is configured to include a first sample set and a second sample set.

[0201] Among them, the first sample set includes the measured spectral data of multiple types of chemical dangerous goods directly exposed; the second sample set includes the measured spectral data of multiple types of chemical dangerous goods blocked by non-metallic packaging.

[0202] The chemical dangerous goods detection device based on the terahertz lightweight capsule network provided by the embodiments of the present invention is used to execute the above-mentioned chemical dangerous goods detection method based on the terahertz lightweight capsule network, so the same effect as the above-mentioned chemical dangerous goods detection method based on the terahertz lightweight capsule network can be achieved.

[0203] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.

[0204] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory. At least one instruction, at least one program, a code set, or an instruction set is stored in the memory, and at least one instruction, at least one program, a code set, or an instruction set is loaded and executed by the processor to implement the chemical dangerous goods detection method based on the terahertz lightweight capsule network in the embodiments of the present invention.

[0205] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or an instruction set is stored, and at least one instruction, at least one program, a code set, or an instruction set is loaded and executed by the processor to implement the chemical dangerous goods detection method based on the terahertz lightweight capsule network in the embodiments of the present invention.

[0206] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).

[0207] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for detecting hazardous chemicals based on a terahertz lightweight capsule network, characterized in that: include: Acquiring target absorption spectrum data of the object to be tested, and extracting target absorbance characteristics of the target absorption spectrum data; The target absorbance feature is a peak or trough feature of the target absorption spectrum data; The target absorbance feature is input into a terahertz lightweight capsule network model trained based on a sample data set; the sample data set includes measured spectral data of multiple types of hazardous chemicals, and the measured spectral data of each type of hazardous chemicals includes multiple measured absorbance features; Classifying the target absorbance feature by using the terahertz lightweight capsule network model, and outputting a predicted probability value of the object to be tested corresponding to the target absorbance feature being classified as each type of hazardous chemical; The type of hazardous chemical with the largest predicted probability value is output as the detection result of the object to be detected.

2. The method for detecting hazardous chemicals based on a terahertz lightweight capsule network according to claim 1 is characterized in that: Before inputting the target absorbance feature into the terahertz lightweight capsule network model trained based on the sample data set, the method further includes: According to the capsule network and the Mamba model, an original terahertz lightweight capsule network model is constructed; the probability output of the Mamba model is integrated into the capsule network through the Mamba dynamic routing algorithm layer of the capsule network; the probability output is the probability that the measured absorbance feature is identified as each type of chemical hazardous substance by the Mamba model.

3. The method for detecting hazardous chemicals based on a terahertz lightweight capsule network according to claim 2 is characterized in that: According to the capsule network and Mamba model, the original terahertz lightweight capsule network model is constructed, including: Synchronously receiving the measured absorbance feature through the capsule network and the input end of the Mamba model; Integrating the probability output of the Mamba model for the measured absorbance feature into the Mamba dynamic routing algorithm layer through the output end of the Mamba model; The capsule network outputs the predicted value through the output terminal of the capsule network according to the measured absorbance feature and the probability output, wherein the measured absorbance feature is classified into the predicted probability value of each type of chemical hazardous substance.

4. The method for detecting hazardous chemicals based on a terahertz lightweight capsule network according to claim 3 is characterized in that: The capsule network further includes an input layer, an initial capsule layer, a capsule classification layer and a Softmax layer, wherein the input layer, the initial capsule layer, the Mamba dynamic routing algorithm layer, the capsule classification layer and the Softmax layer are connected in sequence; The input layer is used to receive the measured absorbance characteristics and transmit the measured absorbance characteristics to the initial capsule layer; The initial capsule layer uses a convolution operation to extract key features from the measured absorbance features; The Mamba dynamic routing algorithm layer is used to guide the dynamic routing selection between the capsule classification layer and the initial capsule layer according to the probability output; The capsule classification layer is used to classify the measured absorbance features according to the extracted key features and the probability output of the Mamba model, and obtain the predicted probability value of the measured absorbance features being predicted as each type of hazardous chemical; The Softmax layer is used to output the predicted probability value.

5. The method for detecting hazardous chemicals based on a terahertz lightweight capsule network according to claim 2, characterized in that: After constructing the original terahertz lightweight capsule network model, the method further includes: Construct a sample data set based on measured spectral data of multiple types of hazardous chemicals; The original terahertz lightweight capsule type network model is trained according to the sample data set until the terahertz lightweight capsule type network model converges to obtain a trained terahertz lightweight capsule type network model.

6. The method for detecting hazardous chemicals based on a terahertz lightweight capsule network according to claim 2, characterized in that: The sample dataset is constructed based on the measured spectral data of multiple types of hazardous chemicals, including: Collect measured spectral data of multiple types of hazardous chemicals under the terahertz time-domain spectroscopy system; Preprocessing each of the measured spectral data to screen out a plurality of absorbance features included in each of the measured spectral data; The type of each of the measured spectral data is used as an index label of the measured spectral data to construct the sample data set.

7. The method for detecting hazardous chemicals based on a terahertz lightweight capsule network according to claim 6, characterized in that: The sample data set includes a first sample set and a second sample set; The first sample set includes measured spectral data of multiple types of hazardous chemicals directly exposed to the outside; the second sample set includes measured spectral data of multiple types of hazardous chemicals blocked by non-metallic packaging.

8. A chemical hazardous goods detection device based on a terahertz lightweight capsule network, characterized in that: include: A data preprocessing unit, used to obtain target absorption spectrum data of the object to be tested, and extract target absorbance characteristics of the target absorption spectrum data; The target absorbance feature is a peak or trough feature of the target absorption spectrum data; A data transmission unit, used for inputting the target absorbance feature into a terahertz lightweight capsule network model trained based on a sample data set; the sample data set includes measured spectral data of multiple types of hazardous chemicals, and the measured spectral data of each type of hazardous chemicals includes multiple measured absorbance features; A model prediction unit, used to classify the target absorbance feature through the terahertz lightweight capsule network model, and output a predicted probability value of the object to be tested corresponding to the target absorbance feature being classified as each type of chemical hazardous substance; The output unit is used to output the type of the hazardous chemical with the largest predicted probability value as the detection result of the object to be detected.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the chemical hazardous goods detection method based on the terahertz lightweight capsule network as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the chemical hazardous goods detection method based on the terahertz lightweight capsule network as described in any one of claims 1-7.

Citation Information

Cited By

  • Pinellia ternate and processed product authenticity identification method and system based on hyperspectral imaging and transfer learning network

    CN122336547A