CN-121978055-A - Fritillary powder layered adulteration detection method based on hyperspectral imaging
Abstract
The invention relates to the technical field of adulteration detection methods, in particular to a fritillary powder layering adulteration detection method based on hyperspectral imaging, which comprises the following steps of step 1, sample preparation and hyperspectral data acquisition, wherein the specific steps comprise sample preparation, hyperspectral image acquisition, black-and-white plate correction and spectrum extraction; in the invention, the sample preparation is attached to a real market adulterated scene, the hyperspectral acquisition is combined with the black-and-white plate correction and the spectrum extraction, the high-quality and interference-free original data are obtained, and the interference of equipment noise, light scattering and the like is eliminated by matching with the pretreatment steps of noise suppression, baseline correction and characteristic enhancement, so that the intrinsic spectrum difference of the sample is highlighted, and the problem of difficult discrimination caused by poor data quality in the traditional detection is solved.
Inventors
- DAI YUJIA
- DING HAOYUAN
- HUANG ZHIZHI
- Wang Zhangting
- ZHANG YILEI
- LIU ZIYUAN
Assignees
- 浙江农林大学
Dates
- Publication Date
- 20260505
- Application Date
- 20260112
Claims (7)
- 1. The fritillary powder layering adulteration detection method based on hyperspectral imaging is characterized by comprising the following steps of: step 1, sample preparation and hyperspectral data acquisition, wherein the specific steps comprise sample preparation, hyperspectral image acquisition, black-and-white plate correction and spectrum extraction; step 2, preprocessing spectrum data, which specifically comprises noise suppression processing, baseline correction and characteristic enhancement; Step 3, constructing and training a DLSM-CNN model, and constructing a double-task learnable spectrum mask convolutional neural network, wherein the network is an end-to-end deep learning framework and consists of three cascade functional modules, and model training optimization is realized by matching with a joint loss function; and 4, model reasoning and evaluation, which specifically comprises data set division, comparison experiment setting and evaluation index setting.
- 2. The method for detecting the layering adulteration of fritillary powder based on hyperspectral imaging according to claim 1, wherein in the step 1, the specific steps are as follows: sample preparation, namely preparing genuine fritillaria cirrhosa powder and common adulterants, wherein the adulterants comprise foreign matter adulterants and congeneric kindred species adulterants; All the samples are crushed and sieved, and mixed powder samples are prepared according to the mass ratio from 0% pure genuine products to 100% pure adulterants; Hyperspectral image acquisition acquiring original hyperspectral image of powder sample using near infrared hyperspectral imaging System ; Black and white plate correction, namely, carrying out reflectivity correction on an original image: ; Wherein, the The corrected spectral reflectivity image can truly reflect the spectral characteristics of the sample after eliminating interference; The original hyperspectral image acquired by the hyperspectral camera contains the spectral information of the sample but is affected by dark current and uneven illumination; The dark current reference image collected under the state that the lens cover is closed represents 0% reflectivity and is used for deducting the dark current noise of the equipment; White board reference image collected on standard polytetrafluoroethylene white board; And (3) spectrum extraction, namely randomly selecting a region of interest from the central region of the corrected image, calculating the average spectrum of all pixels in the region, and taking the average spectrum as representative spectrum data of the sample.
- 3. The method for detecting the layering adulteration of fritillary powder based on hyperspectral imaging according to claim 2, wherein in the step 2, the specific steps are as follows: noise suppression processing, namely inputting corrected original spectrum data into a Gaussian filter, and setting standard deviation parameters Smoothing the spectrum curve; baseline correction and characteristic enhancement, namely taking the smoothed spectrum data as input, carrying out Savitzky-Golay first derivative transformation, setting the size of a filtering window to be 15, and setting the fitting order of a polynomial to be 3.
- 4. The method for detecting the layering adulteration of fritillary powder based on hyperspectral imaging according to claim 3, wherein in the step 3, the specific steps are as follows: The method comprises the steps of constructing a dual-task learnable spectrum mask convolutional neural network, wherein the network is an end-to-end deep learning framework, and consists of three cascade functional modules, and model training optimization is realized by matching with a joint loss function, and is as follows: The module A is a learnable spectrum mask module, realizes automatic characteristic wave band screening through a soft gating mechanism, and specifically calculates the logic as follows: first defining a learnable weight vector identical to the input spectral dimension ; Input spectrum After entering the layer, a mask is generated by a Sigmoid activation function The formula is: ; Wherein, the Representing Sigmoid activation functions, which function is to vector weights Is constrained to the (0, 1) interval to make the mask The element value of (2) is between 0 and 1; Then performing element-wise multiplication operation to obtain weighted spectrum The formula is: ; Wherein, the In order to input the spectral data, The mask generated for the Sigmoid function, Representing an element-wise multiplication operation. The key function of the module is that the network automatically reduces the mask weight corresponding to the background noise wave band without information to 0 in the training process, and simultaneously increases the wave band weight containing key chemical fingerprints to 1 to realize end-to-end self-adaptive characteristic wave band screening; Module B, spectrum weighted by layered one-dimensional convolution backbone network Inputting the main network extraction characteristics, wherein the network comprises three stacked convolution blocks, and a pyramid convolution kernel design is adopted, wherein each convolution block comprises a convolution layer, a batch normalization layer, a ReLU activation layer and a maximum pooling layer: the convolution layer is used for carrying out convolution operation on spectrum data through convolution cores of different sizes and capturing local texture features of different scales; the batch normalization layer is used for carrying out normalization processing on the output of the convolution layer and accelerating the training convergence of the model; a ReLU activation layer, which introduces nonlinear transformation; The maximum pooling layer is used for downsampling convolution characteristics, reducing data dimension while keeping key characteristics, and reducing calculation cost; and a module C, namely flattening deep features extracted from a backbone network of the dual-task prediction head, and then shunting to two independent task heads to realize qualitative and quantitative collaborative detection: The classification head is used for qualitative identification, mapping the deep features through the full-connection layer, outputting the probability that the sample belongs to 'genuine', 'foreign matter adulteration' or 'near-edge species adulteration' by utilizing a Softmax function, and completing adulteration type judgment; And the regression head is used for quantitative analysis, mapping the deep features through the full-connection layer, outputting the adulteration proportion by using the Sigmoid function, and realizing the accurate calculation of the adulteration content.
- 5. Model training and optimization, namely designing a joint loss function to realize double-task collaborative optimization and feature selection sparsity constraint, wherein a loss function formula is as follows: ; Wherein, the Cross entropy loss is used for optimizing classification tasks, minimizing the difference between classification prediction results and real labels and improving qualitative identification accuracy; smoothing L1 loss, which is used for optimizing regression tasks, reducing errors between quantitative predicted values and real adulteration proportion, and improving quantitative analysis precision; regularization coefficient, which is used for balancing the weights of regularization item and other loss items; LSM weight vector The L1 regularization term of (2) has the effect of forcing Becoming sparse.
- 6. The method for detecting the layering adulteration of fritillary powder based on hyperspectral imaging according to claim 4, wherein in the step 4, the specific steps are as follows: the data set division comprises the steps of collecting a plurality of independent spectrum samples in an experiment, wherein the independent spectrum samples comprise a foreign body adulteration data set and a near-edge seed adulteration data set; And (3) setting a comparison experiment, namely comparing the DLSM-CNN model with a traditional partial least square method, support vector regression, a standard one-dimensional convolutional neural network without an LSM module, a two-way long-short-term memory network and a random forest.
- 7. And evaluating indexes, namely evaluating qualitative identification performance by using classification accuracy and evaluating quantitative analysis performance by using a decision coefficient and root mean square error.
Description
Fritillary powder layered adulteration detection method based on hyperspectral imaging Technical Field The invention relates to the technical field of adulteration detection methods, in particular to a fritillary powder layering adulteration detection method based on hyperspectral imaging. Background Fritillary bulb is an important traditional Chinese medicine with the effects of relieving cough, reducing sputum, resisting inflammation and easing pain, wherein the fritillary bulb has excellent curative effect, and the market price is obviously higher than that of other varieties, so that the phenomena of secondary filling and adulteration are frequent in the market. Common adulteration means comprise mixing organic starch, inorganic talcum powder and other foreign matters, or using fritillary bulbs, fritillary bulbs and other similar species with highly similar chemical components to impersonate, and fritillary bulbs circulate in powder form, and visual characteristics are similar after adulteration, so that the conventional morphological identification is difficult to work. Although the traditional physicochemical identification method (such as microscopic examination and chromatographic mass spectrometry) is accurate, the method is destructive, time-consuming and labor-consuming, and cannot meet the requirements of large-scale, rapid and nondestructive field detection. To solve this problem, non-contact nondestructive testing technology based on hyperspectral imaging (HSI) is becoming a research hotspot, and the prior art combines chemometrics methods (such as partial least squares PLS, support vector machines SVM) or conventional deep learning models (such as one-dimensional convolutional neural networks 1D-CNN, long-term memory networks LSTM) and screens characteristic wavelengths through competitive adaptive re-weighted sampling (CARS), continuous projection algorithm (SPA). However, the prior art has obvious defects that firstly, a characteristic wave band selection method lacks self-adaptability and chemical robustness, is easy to be interfered by environmental noise, tends to select a water related wave band instead of a substance intrinsic chemical fingerprint wave band, and causes the model to lose effectiveness when the environmental humidity or the water content of a sample changes, secondly, a conventional deep learning model has a black box problem, a detection result lacks interpretability, the traceability requirement of food and medicine supervision is difficult to meet, thirdly, qualitative identification and quantitative analysis fracture modeling are carried out, the internal correlation of the qualitative identification and the quantitative analysis fracture modeling is ignored, the detection precision is insufficient under a complex level adulteration scene, and a unified comprehensive detection model cannot be constructed. Disclosure of Invention Aiming at the technical problems in the background technology, the invention provides a fritillary powder layering adulteration detection method based on hyperspectral imaging. The technical scheme adopted by the invention is that the fritillary powder layering adulteration detection method based on hyperspectral imaging specifically comprises the following steps: step 1, sample preparation and hyperspectral data acquisition, wherein the specific steps comprise sample preparation, hyperspectral image acquisition, black-and-white plate correction and spectrum extraction; step 2, preprocessing spectrum data, which specifically comprises noise suppression processing, baseline correction and characteristic enhancement; Step 3, constructing and training a DLSM-CNN model, and constructing a double-task learnable spectrum mask convolutional neural network, wherein the network is an end-to-end deep learning framework and consists of three cascade functional modules, and model training optimization is realized by matching with a joint loss function; and 4, model reasoning and evaluation, which specifically comprises data set division, comparison experiment setting and evaluation index setting. In one embodiment, the following is specific in step 1: sample preparation, namely preparing genuine fritillaria cirrhosa powder and common adulterants, wherein the adulterants comprise foreign matter adulterants and congeneric kindred species adulterants; All the samples are crushed and sieved, and mixed powder samples are prepared according to the mass ratio from 0% pure genuine products to 100% pure adulterants; Hyperspectral image acquisition acquiring original hyperspectral image of powder sample using near infrared hyperspectral imaging System ; Black and white plate correction, namely, carrying out reflectivity correction on an original image: ; Wherein, the The corrected spectral reflectivity image can truly reflect the spectral characteristics of the sample after eliminating interference; The original hyperspectral image acquired by the hyperspectral c