Hyperspectral non-smoke substance detection method and system
By combining hyperspectral imaging technology with a fusion convolution model, the problem of low detection accuracy of non-tobacco substances in tobacco leaves was solved, achieving higher detection accuracy and tobacco leaf purity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TOBACCO HUNAN IND CORP
- Filing Date
- 2024-01-30
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the detection accuracy of non-tobacco substances mixed in during tobacco processing is low, resulting in poor purity of tobacco leaves and poor performance of traditional detection models.
Using hyperspectral imaging technology, a fusion convolutional model is constructed and trained by processing the original hyperspectral images. This model includes a central difference convolutional residual module, a fast Fourier convolutional residual module, and a standard convolutional layer. By combining weighted cross-entropy loss and Dice loss, the detection and type identification of non-smoke substances can be achieved.
It improved the detection accuracy of non-smoke substances, enhanced the overall performance of the detection model, and improved the purity of tobacco leaves.
Smart Images

Figure CN121937833A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tobacco industry testing technology, and in particular to a method and system for detecting hyperspectral non-smoke substances. Background Technology
[0002] During the harvesting, transportation, and processing of tobacco leaves, non-tobacco substances inevitably become mixed in. These non-tobacco substances significantly impact the usability of the tobacco raw materials and the quality of cigarette products. Non-tobacco impurities refer to various substances other than those found in tobacco leaves, generally divided into two categories: the first category is primary impurities, which are non-tobacco substances mixed in during harvesting and transportation, including weeds, stones, insects, and hemp rope; the second category is secondary impurities, which are non-tobacco substances mixed in during production, including metals, belts, plastics, and paper scraps. The contamination of non-tobacco substances not only affects equipment used for threshing and re-drying tobacco leaves, but the harmful substances produced during combustion also seriously affect human health. To ensure the safety of cigarette consumption, the tobacco industry has imposed strict control requirements on the impurity content in tobacco leaves.
[0003] In cigarette production lines, non-tobacco substances are typically removed using methods such as wind and magnetic removal. However, both wind and magnetic removal methods rely on automated non-tobacco substance detection algorithms. Research on visual non-tobacco substance detection based on visible light cameras has received considerable attention, and many visual detection models have been proposed. However, the recognition performance of these models is unsatisfactory, exhibiting high false alarm and false negative rates. With the tobacco industry's increasing demands for the accuracy and reliability of impurity removal systems, researchers have recently discovered that the limited visible spectrum is a significant factor restricting performance improvement. With the rapid development of hyperspectral imaging technology, they have begun to focus on the introduction of multi-spectral bands.
[0004] Currently, the performance of hyperspectral imaging devices has greatly improved. For example, linear pushbroom hyperspectral imagers can horizontally acquire spectral information, display the position of spectral pixels, provide spatial distribution information of objects, and achieve real-time visual imaging of different measured objects. Furthermore, while the spectral bands of hyperspectral cameras are constantly being enriched, resolution and acquisition speed have also been guaranteed. Therefore, hyperspectral imagers are receiving increasing attention in the tobacco industry, for example, in identifying tobacco leaf moisture content, identifying tobacco mosaic virus, and determining tobacco leaf maturity. However, current traditional methods for detecting non-tobacco substances still suffer from low detection accuracy and poor overall performance of detection models, leading to low purity of tobacco leaves.
[0005] Therefore, providing a method and system for detecting hyperspectral non-smoke substances that can effectively solve the above problems is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a method for detecting hyperspectral non-smoke substances. This method is logically clear, safe, effective, reliable and easy to operate. It can improve the detection accuracy of non-smoke substances and the overall performance of the detection model, thereby improving the purity of tobacco.
[0007] Based on the above objectives, the technical solution provided by the present invention is as follows:
[0008] A method for detecting hyperspectral non-smoke substances includes the following steps:
[0009] Process the original hyperspectral image to obtain a processed hyperspectral image;
[0010] Construct the initial fused convolutional model;
[0011] Train the initial fused convolutional model to obtain the trained fused convolutional model;
[0012] The processed hyperspectral image is input into the trained fusion convolutional model to obtain the detection results.
[0013] Preferably, the process of processing the original hyperspectral image to obtain a processed hyperspectral image includes the following steps:
[0014] The original hyperspectral image is radiometrically corrected to obtain a corrected hyperspectral image;
[0015] The corrected hyperspectral image is denoised to obtain the processed hyperspectral image.
[0016] Preferably, the formula for radiation correction is as follows:
[0017]
[0018] Where R is the corrected hyperspectral image; I is the original hyperspectral image; B is the black calibration image; and W is the white calibration image.
[0019] Preferably, the initial fusion convolutional model includes: a central difference convolutional residual module, a fast Fourier convolutional residual module, and a standard convolutional layer;
[0020] The central difference convolution residual module is used to obtain the difference feature map between non-smoke substances and normal tobacco leaves;
[0021] The Fast Fourier Convolution Residual Module is used to extract global features in the space-spectral dimension in the global feature extraction branch.
[0022] The standard convolution is used to extract local features in the space-spectral-pass dimension in the local feature extraction branch;
[0023] The construction of the initial fused convolutional model includes the following steps:
[0024] The center-split convolutional residual module is added to the downsampling segment of the Unet model;
[0025] The Fast Fourier Convolution Residual Module is added to the middle section of the Unet model;
[0026] A regular convolutional layer is added to the upsampling segment of the Unet model.
[0027] Preferably, the difference feature map between non-smoke substances and normal tobacco leaves is obtained through the central difference convolution residual module, specifically as follows:
[0028] The central difference convolutional layer and the standard convolutional layer are weighted and fused together.
[0029] A standard convolutional layer is introduced before the central difference convolution and at the residual connection, respectively.
[0030] The formula for the central difference is:
[0031] f(x,y)=∑ (i,j) w (i,j) (F (x+i,y+i) -F (x,y) );
[0032] Where x and y are the current centers, and R is the size of the convolution window;
[0033] The formula for weighted fusion of the central difference convolution and the standard convolutional layer is as follows:
[0034] CDC(x,y)=θ×∑ (i,j) w (i,j) (F (x+i,y+i) -F (x,y) )+(1-θ)∑ (i,j) w (i,j) F (x+i,y+i) );
[0035] Where θ∈(0,1) is the scaling factor between the central difference convolution and the standard convolution.
[0036] Preferably, global features are extracted through the Fast Fourier Convolution Residual Module, specifically as follows:
[0037] Global features are extracted using the Fourier convolution module;
[0038] By introducing residual connections into the Fourier convolution module, a fast Fourier residual module is obtained.
[0039] The step of extracting global features using the Fourier convolution module includes the following steps:
[0040] In the Fourier convolution module, a two-dimensional fast Fourier transform is performed to convert the difference feature map from the spatial domain to the frequency domain;
[0041] The real and imaginary parts of a complex number are concatenated along the channel dimension and treated as real numbers in two channels.
[0042] Convolution, normalization, and activation function operations are performed in the frequency domain;
[0043] The complex number inverse transformation of combining real numbers from two channels into a single channel is transformed into the spatial domain.
[0044] Perform a Fast Fourier Transform to obtain the global features.
[0045] Preferably, training the initial fused convolutional model to obtain the trained fused convolutional model specifically involves:
[0046] Based on the preset classification task, the initial fusion convolutional model is trained using weighted cross-entropy loss and Dice loss.
[0047] The preset classification tasks include: binary classification and multi-class classification;
[0048] The cross-entropy loss function for binary classification tasks is as follows:
[0049]
[0050] The cross-entropy loss function for multi-class classification tasks is as follows:
[0051]
[0052] Among them, y i p represents the category label of normal tobacco or non-tobacco substances for sample i. i This represents the probability that sample i is predicted to be normal tobacco leaf, M is the total number of categories including all non-tobacco substance categories and normal tobacco leaf categories, and y ic p is a sign function indicating whether the true class of sample i is equal to class c. ic Let be the predicted probability that sample i belongs to category c.
[0053] Preferably, the weighted cross-entropy loss includes the following steps:
[0054] The summation term in the cross-entropy loss formula is divided into non-smoke debris pixels and background pixels according to pixel category;
[0055] The loss value after summing the background pixels is assigned a first weight;
[0056] A second weight is assigned to the loss value after summing the non-smoke debris pixels;
[0057] Wherein, the first weight is less than the second weight.
[0058] Preferably, the formula for the Dice loss is as follows:
[0059]
[0060] Wherein, TP indicates that both the model prediction and the actual result are positive examples; FP indicates that the model prediction is positive examples but the actual result is negative examples; FN indicates that the model prediction is negative examples but the actual result is positive examples; and TN indicates that both the model prediction and the actual result are negative examples.
[0061] A hyperspectral non-smoke substance detection system, comprising:
[0062] The processing module is used to process the original hyperspectral image to obtain the processed hyperspectral image;
[0063] Build modules are used to construct the initial fused convolutional model;
[0064] The training module is used to train the initial fused convolutional model to obtain the trained fused convolutional model;
[0065] The detection module is used to input the processed hyperspectral image into the trained fusion convolutional model to obtain detection results.
[0066] This invention provides a method for detecting hyperspectral non-smoke substances, which involves processing the input raw hyperspectral image to obtain a processed hyperspectral image; constructing an initial fusion convolution model; training the initial fusion convolution model to obtain a trained fusion convolution model; and inputting the processed hyperspectral image into the trained fusion convolution model to obtain the detection result.
[0067] Compared to existing technologies, this invention processes the original hyperspectral image to construct and train a fusion convolution module. By combining the trained fusion convolution model with the processed hyperspectral image, it can detect and identify non-smoke substances in the hyperspectral image, effectively improving the detection accuracy of non-smoke substances and the overall performance of the detection model, thereby improving the purity of tobacco.
[0068] The present invention also provides a hyperspectral non-smoke substance detection system, which, since it belongs to the same technical concept as the method and solves the same technical problem, should have the same beneficial effects, and will not be described in detail here. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0070] Figure 1 A flowchart illustrating a method for detecting hyperspectral non-smoke substances provided in an embodiment of the present invention;
[0071] Figure 2 A flowchart of step S1 provided in an embodiment of the present invention;
[0072] Figure 3 This is a flowchart of extracting global features using a Fourier convolution module, provided in an embodiment of the present invention.
[0073] Figure 4 A flowchart of the weighted cross-entropy loss provided in an embodiment of the present invention;
[0074] Figure 5 This is a schematic diagram of a hyperspectral non-smoke substance detection system provided in an embodiment of the present invention. Detailed Implementation
[0075] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0076] The embodiments of this invention are written in a progressive manner.
[0077] This invention provides a method and system for detecting hyperspectral non-smoke substances. It primarily addresses the technical problems of low detection accuracy and poor overall performance of detection models in existing traditional non-smoke substance detection methods, which result in low purity of tobacco leaves.
[0078] like Figure 1 As shown, a method for detecting hyperspectral non-smoke substances includes the following steps:
[0079] S1. Process the original hyperspectral image to obtain a processed hyperspectral image;
[0080] S2. Construct the initial fused convolutional model;
[0081] S3. Train the initial fused convolutional model to obtain the trained fused convolutional model;
[0082] S4. Input the processed hyperspectral image into the trained fusion convolutional model to obtain the detection results.
[0083] In step S1, the original hyperspectral image is processed by correction, followed by denoising to obtain the processed hyperspectral image.
[0084] In steps S2 and S3, the convolutional fusion model uses Unet as the basic skeleton model. Unet performs well in extracting hyperspectral features; considering that the clutter targets in this project are relatively small, Unet has proven to be a suitable skeleton model for detecting weak targets; Unet is a fully convolutional network with fewer parameters than other mainstream skeleton model paradigms, resulting in fast inference speed. The fusion of various types of convolutional operations is used to improve the Unet network structure and enhance the model's ability to extract clutter identification features.
[0085] In step S4, the input hyperspectral image is segmented using a fully trained multi-type convolutional fusion model, and non-smoke substances in the test image are identified. Depending on the task requirements, it is supported to treat all non-smoke substances as one class and form a binary classification model with the background class. Alternatively, typical impurity categories in non-smoke substances can be further identified to form multiple classification models. For each impurity region output by the multi-type convolutional fusion model, its area is compared with a pre-set area threshold. Noise regions with an area less than or equal to the area threshold are filtered out, and the remaining regions are all reported as impurity regions.
[0086] like Figure 2 As shown, preferably, step S1 includes the following steps:
[0087] A1. Perform radiometric correction on the original hyperspectral image to obtain the corrected hyperspectral image;
[0088] A2. Denoise the corrected hyperspectral image to obtain the processed hyperspectral image.
[0089] Preferably, the formula for radiation correction is as follows:
[0090]
[0091] Where R is the corrected hyperspectral image; I is the original hyperspectral image; B is the black calibration image; and W is the white calibration image.
[0092] In practical applications, hyperspectral imaging systems are easily affected by external factors, such as uneven illumination and dark current in camera lenses. Therefore, in order to obtain more accurate and stable hyperspectral image data, radiometric correction is required for hyperspectral images. Due to the non-uniformity of the light source and the technological characteristics of the internal components of hyperspectral cameras, hyperspectral images are subject to noise interference, so further noise reduction processing is required after radiometric correction.
[0093] The hyperspectral image is denoised using a Savitzky-golay smoothing filter, which adaptively obtains filter parameters using polynomial fitting on the spectral dimension of each pixel, and then uses the filter to remove noise from the spectral data.
[0094] Preferably, the initial fused convolutional model includes: a central difference convolutional residual module, a fast Fourier convolutional residual module, and a standard convolutional layer;
[0095] The central difference convolution residual module is used to obtain the difference feature map between non-smoke substances and normal tobacco leaves;
[0096] The Fast Fourier Convolution Residual Module is used to achieve global feature extraction in the space-spectral dimension in the global feature extraction branch.
[0097] Standard convolution is used to extract local features in the space-spectral-pass dimension in the local feature extraction branch;
[0098] Step S2 includes the following steps:
[0099] A center-split convolutional residual module is added to the downsampling segment of the Unet model;
[0100] Add a Fast Fourier Convolution Residual Module to the middle section of the Unet model;
[0101] Add a regular convolutional layer to the upsampling segment of the Unet model.
[0102] In practical applications, a specific hybrid of central difference convolution residual modules, fast Fourier convolution residual modules, and conventional convolutional layers is used in the downsampling, intermediate, and upsampling segments of the Unet model to achieve high-quality non-smoking debris segmentation results, enabling the localization and type identification of non-smoking substances. The central difference convolution residual module, along with standard convolution, effectively extracts information such as color, shape, and texture from two-dimensional images by considering a weighted combination of neighboring pixel features, achieving good image recognition. However, for non-smoking debris detection tasks, the feature extraction performance of standard convolution is limited. Since most non-smoking impurities are relatively small, their features are easily overwhelmed during the Unet downsampling process, leading to undetectable non-smoking impurities. To avoid missed detections due to oversampling, this embodiment uses central difference convolution to highlight the differences between non-smoking substances and normal tobacco leaves. Central difference convolution first calculates the feature differences between the central pixel and the surrounding pixels of the convolution kernel, and then performs convolution on this basis, thereby guiding the network model to learn the difference features. Since the feature differences between non-smoke substances and normal tobacco leaves are greater than the feature differences between normal tobacco leaves, the contrast of non-smoke substances is improved to a certain extent.
[0103] The most significant advantage of non-smoke substance detection based on hyperspectral images is that it acquires more detailed spectral channels, thus providing more effective information for identifying non-smoke substances. However, the extraction of this effective information places higher demands on the model's information mining or feature extraction capabilities.
[0104] Although the Unet model uses central difference convolution, it doesn't specifically consider feature extraction in the spatial and spectral dimensions compared to a typical visible light image with only three channels. Therefore, this embodiment employs Fast Fourier Convolution (FFT) to compensate for this deficiency. FFT divides the feature map output from the encoder into two branches: local feature extraction and global feature extraction. The local feature extraction branch uses standard convolution for detail extraction in the spatial and spectral dimensions, while the global feature extraction branch uses Fourier units to extract global features in the spatial and spectral dimensions. A shortcut link facilitates information exchange between the two branches. Finally, the local and global branches are concatenated along the channel dimension to obtain a feature map containing both local and global information.
[0105] The specific implementation process is as follows: For each FFC, the feature map is divided into two parts according to the channel. The local features are first passed through two standard convolutions, while the global features are passed through one standard convolution and one Fourier unit. The output features are merged with the two local features that have passed through standard convolutions, and then passed through BN and ReLU in sequence to obtain the output of FFC.
[0106] Preferably, the difference feature map between non-smoke substances and normal tobacco leaves is obtained through the central difference convolution residual module, specifically as follows:
[0107] Weighted fusion of central differential convolutional and standard convolutional layers;
[0108] A standard convolutional layer is introduced before the central difference convolution and on the residual connection, respectively;
[0109] The formula for the central difference is:
[0110] f(x,y)=∑ (i,j) w (i,j) (F (x+i,y+i) -F (x,y) );
[0111] Where x and y are the current centers, and R is the size of the convolution window;
[0112] The formulas for weighted fusion center differential convolution and standard convolution layers are:
[0113] CDC(x,y)=θ×∑ (i,j) w (i,j) (F (x+i,y+i) -F (x,y) )+(1-θ)∑ (i,j) w (i,j) F (x+i,y+i) );
[0114] Where θ∈(0,1) is the scaling factor between the central difference convolution and the standard convolution.
[0115] In practical applications, the larger the ratio factor between central difference convolution and standard convolution, the higher the proportion of central difference convolution. The window size used to calculate the difference is generally set to the kernel size. The receptive field of the central difference convolution module will obtain multi-level contrast information as the network propagates forward, helping the network to identify non-smoke debris of different sizes.
[0116] Although the central difference convolutional layer supplements multi-scale contrast features, it is more complex to learn than the standard convolution. In order to facilitate learning and maximize its performance, a residual module is added on the basis of the central difference convolution, and the central difference convolution residual module is designed.
[0117] Preferably, global features are extracted using a Fast Fourier Transform (FFT) convolutional residual module, specifically as follows:
[0118] Global features are extracted using the Fourier convolution module;
[0119] By introducing residual connections into the Fourier convolution module, a fast Fourier residual module is obtained.
[0120] like Figure 3As shown, global features are extracted using the Fourier convolution module, including the following steps:
[0121] B1. In the Fourier convolution module, a two-dimensional fast Fourier transform is performed to convert the difference feature map from the spatial domain to the frequency domain;
[0122] B2. Concatenate the real and imaginary parts of the complex number along the channel dimension and treat them as real numbers in two channels;
[0123] B3. Perform convolution, normalization, and activation function operations in the frequency domain;
[0124] B4. Combine the real numbers from two channels into a complex number from one channel and inversely transform it into the spatial domain;
[0125] B5. Perform a Fast Fourier Transform to obtain global features.
[0126] In practical applications, in this embodiment of the Fourier unit, the input features are first transformed from the spatial domain to the frequency domain using a Fast Fourier Transform. Since each point in the frequency domain is always related to all points in the spatial domain, a small kernel is sufficient for convolution operations in the frequency domain to affect all points in the original spatial-spectral domain. Therefore, this embodiment can obtain a receptive field the same size as the feature map. Finally, an inverse Fourier transform is used to obtain a feature map containing global information. The flow of the Fourier unit is as follows:
[0127] (1) Use two-dimensional fast Fourier transform to transform the input feature map from the spatial domain to the frequency domain:
[0128]
[0129] (2) And concatenate the real and imaginary parts of the complex number along the channel dimension, treating it as a real number in two channels:
[0130]
[0131] (3) Apply convolution, normalization, and activation function operations in the frequency domain:
[0132]
[0133] (4) Combine two real channels into one channel using the inverse complex transformation to the spatial domain:
[0134]
[0135] (5) Inverse Fast Fourier Transform:
[0136]
[0137] Similarly, the introduction of Fast Fourier Convolution (FFT) increases the learning burden on the model. Therefore, this embodiment further introduces residual connections into the FFT, transforming it into a FFT residual module. This not only facilitates model learning but also, as experiments show, further improves model performance. Furthermore, experiments have found that processing the hyperspectral features after the entire encoder has been processed using FFT residual convolution layers is most effective. Therefore, this embodiment places the FFT residual convolution module in the middle stage of the entire skeleton.
[0138] Preferably, step S3 specifically includes:
[0139] Based on the preset classification task, an initial fusion convolutional model is trained using weighted cross-entropy loss and Dice loss.
[0140] The preset classification tasks include: binary classification and multi-class classification;
[0141] The cross-entropy loss function for binary classification tasks is as follows:
[0142]
[0143] The cross-entropy loss function for multi-class classification tasks is as follows:
[0144]
[0145] Among them, y i p represents the category label of normal tobacco or non-tobacco substances for sample i. i This represents the probability that sample i is predicted to be normal tobacco leaf, M is the total number of categories including all non-tobacco substance categories and normal tobacco leaf categories, and y ic p is a sign function indicating whether the true class of sample i is equal to class c. ic Let be the predicted probability that sample i belongs to category c.
[0146] In practical applications, the model training uses a combination of weighted cross-entropy and the Dice loss function to ensure that the model achieves good performance after sufficient training. First, the cross-entropy loss function is used for model training, and binary and multi-class classification are employed depending on the classification task.
[0147] (1) Binary classification
[0148] In the binary classification scenario, the model ultimately needs to predict only two outcomes: normal tobacco leaves and non-tobacco products. The predicted probabilities for each category are p and 1-p.
[0149] Where: y i This represents the category label for sample i, with 1 for normal tobacco and 0 for non-tobacco substances. i Let represent the probability that sample i is predicted to be normal tobacco leaf, with log base e.
[0150] (2) Multiclassification
[0151] Multi-class classification is an extension of binary classification;
[0152] Where M is the total number of categories including all non-tobacco substances and normal tobacco leaves (9 categories in this embodiment), y ic p is a sign function, which means that if the true class of sample i is equal to class c, it takes the value 1; otherwise, it takes the value 0. ic Let be the predicted probability that observed sample i belongs to category c.
[0153] like Figure 4 As shown, preferably, the weighted cross-entropy loss includes the following steps:
[0154] C1. Divide the summation term in the cross-entropy loss formula into non-smoke clutter pixels and background pixels according to pixel category;
[0155] C2. Assign the first weight to the loss value after summing the background pixels;
[0156] C3. Assign a second weight to the loss value after summing the non-smoke debris pixels;
[0157] The first weight is less than the second weight.
[0158] Preferably, the formula for Dice loss is as follows:
[0159]
[0160] Wherein, TP indicates that both the model prediction and the actual result are positive examples; FP indicates that the model prediction is positive examples but the actual result is negative examples; FN indicates that the model prediction is negative examples but the actual result is positive examples; and TN indicates that both the model prediction and the actual result are negative examples.
[0161] In practical applications, due to the significant difference in spatial proportion between non-smoke debris and background (tobacco leaves and conveyor belt), directly using cross-entropy loss will cause the model to focus on the background pixels with a large spatial proportion, while ignoring the misclassification loss of non-smoke debris, resulting in the missed detection of non-smoke debris.
[0162] Therefore, the summation term in the cross-entropy loss formula is divided into two parts based on pixel category: non-smoke clutter and background. A lower weight is assigned to the summed loss value of background pixels, while a higher weight is assigned to the summed loss value of non-smoke clutter pixels. This is called the weighted cross-entropy loss L. WCE .
[0163] The experiment found that weighting the weighted cross-entropy loss and the Dice loss in equal proportions yielded the best results, i.e., L = L. WCE +L DiceHowever, using one or more of these loss functions alone does not achieve the same effect as the above combination.
[0164] Step S4 is implemented as follows: The MCFnet model is fully trained using the training dataset and the previously designed weighted loss function. The model's hyperparameters are optimized using the validation set. The final model is used to segment and identify non-smoke substances in test images for performance evaluation. Post-processing of debris regions: For the output image of the MCFnet model, connected component analysis is performed according to the category of non-smoke debris. Connected regions of all categories are then collected together. This is to avoid the error of misidentifying two different categories of non-smoke debris as a single non-smoke debris. The area of each connected region is compared with a pre-set area threshold (set to 2 in the test, equivalent to a 10mm × 10mm physical area). Noise regions with an area less than or equal to this area threshold are filtered out, and the remaining regions are all considered as non-smoke debris.
[0165] like Figure 5 As shown, a hyperspectral non-smoke substance detection system includes:
[0166] The processing module is used to process the original hyperspectral image to obtain the processed hyperspectral image;
[0167] Build modules are used to construct the initial fused convolutional model;
[0168] The training module is used to train the initial fused convolutional model in order to obtain the trained fused convolutional model.
[0169] The detection module is used to input the processed hyperspectral image into the trained fusion convolutional model to obtain the detection results.
[0170] In practical applications, this invention also discloses a detection system for hyperspectral non-smoke substances. The system consists of a processing module that processes the original hyperspectral image to obtain a processed hyperspectral image; a construction module that constructs an initial fusion convolutional model; a training module that trains the initial fusion convolutional model to obtain a trained fusion convolutional model; and a detection module that inputs the processed hyperspectral image into the trained fusion convolutional model to obtain the detection result.
[0171] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms.
[0172] Furthermore, in the various embodiments of the present invention, each functional module can be fully integrated into a processor, or each module can be a separate device, or two or more modules can be integrated into a device; each functional module in the various embodiments of the present invention can be implemented in hardware or in the form of hardware plus software functional units.
[0173] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, they perform the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0174] It should be understood that the use of terms such as "system," "device," "unit," and / or "module" in this application is merely one method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0175] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "a," and / or "the" are not specifically singular and may include the plural. Generally, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements. An element defined by the phrase "comprising an..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes the element.
[0176] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0177] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0178] The above provides a detailed description of a method and system for detecting hyperspectral non-smoke substances provided by the present invention. The above description of the disclosed embodiments enables those skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting hyperspectral non-smoke substances, characterized in that, Includes the following steps: Process the original hyperspectral image to obtain a processed hyperspectral image; Construct the initial fused convolutional model; Train the initial fused convolutional model to obtain the trained fused convolutional model; The processed hyperspectral image is input into the trained fusion convolutional model to obtain the detection results.
2. The method for detecting hyperspectral non-smoke substances as described in claim 1, characterized in that, The process of processing the original hyperspectral image to obtain the processed hyperspectral image includes the following steps: The original hyperspectral image is radiometrically corrected to obtain a corrected hyperspectral image; The corrected hyperspectral image is denoised to obtain the processed hyperspectral image.
3. The method for detecting hyperspectral non-smoke substances as described in claim 2, characterized in that, The specific formula for radiation correction is as follows: Where R is the corrected hyperspectral image; I is the original hyperspectral image; B is the black calibration image; and W is the white calibration image.
4. The method for detecting hyperspectral non-smoke substances as described in claim 1, characterized in that, The initial fusion convolutional model includes: a central difference convolutional residual module, a fast Fourier convolutional residual module, and a standard convolutional layer; The central difference convolution residual module is used to obtain the difference feature map between non-smoke substances and normal tobacco leaves; The Fast Fourier Convolution Residual Module is used to extract global features in the space-spectral dimension in the global feature extraction branch. The standard convolution is used to extract local features in the space-spectral-pass dimension in the local feature extraction branch; The construction of the initial fused convolutional model includes the following steps: The center-split convolutional residual module is added to the downsampling segment of the Unet model; The Fast Fourier Convolution Residual Module is added to the middle section of the Unet model; A regular convolutional layer is added to the upsampling segment of the Unet model.
5. The method for detecting hyperspectral non-smoke substances as described in claim 4, characterized in that, The difference feature map between non-smoking substances and normal tobacco leaves is obtained through the central difference convolution residual module, specifically as follows: The central difference convolutional layer and the standard convolutional layer are weighted and fused together. A standard convolutional layer is introduced before the central difference convolution and at the residual connection, respectively. The formula for the central difference is: f(x,y)=∑ (i,j) w (i,j) (F (x+i,y+i) -F (x,y) ); Where x and y are the current centers, and R is the size of the convolution window; The formula for weighted fusion of the central difference convolution and the standard convolutional layer is as follows: CDC(x,y)=θ×∑ (i,j) w (i,j) (F (x+i,y+i) -F (x,y) )+(1-θ)∑ (i,j) w (i,j) F (x+i,y+i) ); Where θ∈(0,1) is the scaling factor between the central difference convolution and the standard convolution.
6. The method for detecting hyperspectral non-smoke substances as described in claim 4, characterized in that, Global features are extracted using the Fast Fourier Convolution Residual Module, specifically as follows: Global features are extracted using the Fourier convolution module; By introducing residual connections into the Fourier convolution module, a fast Fourier residual module is obtained. The step of extracting global features using the Fourier convolution module includes the following steps: In the Fourier convolution module, a two-dimensional fast Fourier transform is performed to convert the difference feature map from the spatial domain to the frequency domain; The real and imaginary parts of a complex number are concatenated along the channel dimension and treated as real numbers in two channels. Convolution, normalization, and activation function operations are performed in the frequency domain; The complex number inverse transformation of combining real numbers from two channels into a single channel is transformed into the spatial domain. Perform a Fast Fourier Transform to obtain the global features.
7. The method for detecting hyperspectral non-smoke substances as described in claim 1, characterized in that, The process of training the initial fused convolutional model to obtain the trained fused convolutional model specifically involves: Based on the preset classification task, the initial fusion convolutional model is trained using weighted cross-entropy loss and Dice loss. The preset classification tasks include: binary classification and multi-class classification; The cross-entropy loss function for binary classification tasks is as follows: The cross-entropy loss function for multi-class classification tasks is as follows: Among them, y i p represents the category label of normal tobacco or non-tobacco substances for sample i. i This represents the probability that sample i is predicted to be normal tobacco leaf, M is the total number of categories including all non-tobacco substance categories and normal tobacco leaf categories, and y ic p is a sign function indicating whether the true class of sample i is equal to class c. ic Let be the predicted probability that sample i belongs to category c.
8. The method for detecting hyperspectral non-smoke substances as described in claim 7, characterized in that, The weighted cross-entropy loss includes the following steps: The summation term in the cross-entropy loss formula is divided into non-smoke debris pixels and background pixels according to pixel category; The loss value after summing the background pixels is assigned a first weight; A second weight is assigned to the loss value after summing the non-smoke debris pixels; Wherein, the first weight is less than the second weight.
9. The method for detecting hyperspectral non-smoke substances as described in claim 7, characterized in that, The formula for the Dice loss is as follows: Wherein, TP indicates that both the model prediction and the actual result are positive examples; FP indicates that the model prediction is positive examples but the actual result is negative examples; FN indicates that the model prediction is negative examples but the actual result is positive examples; and TN indicates that both the model prediction and the actual result are negative examples.
10. A hyperspectral non-smoke substance detection system, characterized in that, include: The processing module is used to process the original hyperspectral image to obtain the processed hyperspectral image; Build modules are used to construct the initial fused convolutional model; The training module is used to train the initial fused convolutional model to obtain the trained fused convolutional model; The detection module is used to input the processed hyperspectral image into the trained fusion convolutional model to obtain detection results.