CN-121978054-A - Sparse representation scanning imaging-based method for detecting foreign matters in cigarette
Abstract
The invention discloses a cigarette internal foreign matter detection method based on sparse representation scanning imaging, which comprises the steps of performing sparse sampling on a cigarette sample to be detected by using a terahertz time-domain spectrum experiment system to obtain sparse sampling data, inputting the acquired sparse sampling data into an image reconstruction model constructed based on sparse representation to obtain a reconstructed cigarette terahertz imaging image, and performing feature analysis on the reconstructed cigarette terahertz imaging image to obtain a foreign matter identification result. According to the method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging, the imaging quality is guaranteed while the detection speed is improved through the sparse representation scanning imaging technology, the accurate detection of the foreign matters in the cigarette is realized, an effective technical support is provided for quality control of the cigarette, the scanning point number is reduced through sparse sampling, the imaging speed is improved, the imaging quality is guaranteed by combining with a self-adaptive soft threshold shrinkage algorithm, and the accurate detection of the foreign matters is realized.
Inventors
- YANG MINGQUAN
- LI XIANGLI
- YANG LEI
- CHEN FANGRUI
- YIN ZHIJIANG
- CHEN JINXIONG
- Li Shaopan
- LI KUI
- ZHANG XIAOSHI
- YE XIANGRUI
- TIAN LIMEI
- LI CHAO
- CHENG LONGYUAN
- YANG XIN
- WANG QINGHUA
- FAN DUOQING
- GUO LIJUAN
- ZHU SHIHUA
- CHEN JIANHUA
- YE LING
- YANG YANPING
Assignees
- 云南中烟工业有限责任公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260209
Claims (10)
- 1. A method for detecting foreign matters in a cigarette based on sparse representation scanning imaging is characterized by comprising the following steps: sparse sampling is carried out on a cigarette sample to be detected by using a terahertz time-domain spectrum experiment system, so that sparse sampling data are obtained; inputting the acquired sparse sampling data into an image reconstruction model constructed based on sparse representation to obtain a reconstructed terahertz imaging image of the cigarette; and performing feature analysis on the reconstructed terahertz imaging image of the cigarette to obtain a foreign matter identification result of a cigarette sample.
- 2. The method for detecting the foreign matters in the interior of the cigarette based on sparse representation scanning imaging according to claim 1, wherein the sparse sampling is performed on the cigarette sample by using a terahertz time-domain spectroscopy experiment system to obtain sparse sampling data, and the method comprises the following steps: preparing a cigarette sample to be detected, and setting scanning parameters of a terahertz time-domain spectroscopy experiment system, wherein the scanning spectrum range is 0-3THz, the spectrum resolution is 12.5GHz, the average scanning times are 1024 times, the test environment temperature is 21+/-1 ℃ and the relative humidity is 4+/-1%; The method comprises the steps of fixing a cigarette to be detected on a sample stage of a three-dimensional scanning frame of a terahertz time-domain spectrum experiment system, enabling an axis of the cigarette to be perpendicular to a terahertz wave light path, controlling the relative movement of the cigarette and a terahertz wave beam through the three-dimensional scanning frame, and collecting cigarette scanning data in a sparse sampling mode, wherein sampling intervals in the horizontal direction and the vertical direction are 1mm.
- 3. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging according to claim 2, wherein the sparse sampling mode is realized through a sparse sampling matrix M, the sampling process satisfies that Y=MX+N (1), Wherein X represents a cigarette image to be restored, Y represents collected sparse sampling data, and N represents additive Gaussian noise.
- 4. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging according to claim 1, wherein the step of inputting the acquired sparse sampling data into an image reconstruction model constructed based on sparse representation to obtain a reconstructed terahertz imaging image of the cigarette comprises the following steps: and inputting the acquired sparse sampling data into an image reconstruction model constructed based on sparse representation, wherein the image reconstruction model adopts an inverse biorthogonal wavelet base rbio 4.4.4 to carry out 4-layer wavelet decomposition, and carries out image reconstruction by combining a self-adaptive soft threshold contraction algorithm with a Nesterov acceleration algorithm.
- 5. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging according to claim 4, wherein in the image reconstruction process of the image reconstruction model, the regularization parameter lambda is dynamically adjusted according to the median absolute deviation of residual errors and is expressed by the following formula: λ=1.4826×k×W×MAD(R) (2), wherein k takes a value of 1, W represents an adaptive weight matrix, R represents a residual error, and MAD (R) represents a median absolute deviation of the residual error.
- 6. The method for detecting foreign matters in the interior of a cigarette based on sparse representation scanning imaging according to claim 5, wherein the adaptive weight matrix W is adaptively adjusted according to a transform domain coefficient amplitude, wherein the weight is inversely proportional to the coefficient amplitude and satisfies the following relationship W=ε/(ε+|α|) (3), Where ε=max (βε, sil (R)), β represents the attenuation coefficient, sil (R) represents the standard deviation estimate of residual R.
- 7. The method for detecting the foreign matter inside a cigarette based on sparse representation scanning imaging according to claim 4, wherein the iterative process of the adaptive soft threshold shrinkage algorithm comprises: initializing parameters; calculating residual errors and updating self-adaptive regularization parameters; Performing soft threshold shrinkage on the detail coefficient after wavelet decomposition, reserving an approximation coefficient, and updating an image by combining with Nesterov acceleration parameters; iterating until the relative error delta is less than or equal to the preset value setting a threshold value or the iteration number to reach a set value.
- 8. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging according to claim 4, wherein the construction process of the image reconstruction model comprises the following steps: under various bases, images are sparsely represented and expressed by the following formulas: (4) wherein X represents an image of a cigarette to be restored, The sparse representation is presented as a sparse representation, Representing the transformed sparse representation; Because of physical constraints, X is a real-number domain image, and the element values are not negative, solving the sparse representation problem can be converted into the following optimization problem: (5); equation (5) may be further written in the form of the following Lagrangian multiplier method: (6) Wherein, the The p-norm is represented by the term, As an indicator function, for representing the projection of X onto the positive real number domain; Adopting an ADMM algorithm and adopting an analysis sparsity form to solve the formula (6) so as to carry out explicit expression on the analytic solution of each sub-problem, wherein each sub-problem is not required to be solved through internal iteration, only one layer of iteration is required, and the specific iteration steps are as follows: (7) Wherein, ψ † represents the wavelet transform, ψ represents the wavelet inverse transform, And Representing iteration steps, all related to Li Puxi z constants; Solving by the following formula And : (8) Where norm (M, 2) represents the 2-norm of the matrix, Representing projections in the non-negative real number domain, = max(x,0), Represents soft threshold shrink, λ represents a threshold; The soft threshold shrinkage is calculated by the following formula : (9) The Nesterov acceleration algorithm is adopted in the soft threshold contraction algorithm, and the specific steps are as follows: (10) Wherein t and Z represent intermediate variables of the Nesterov acceleration algorithm; And processing the sparse coefficient by adopting a re-weighted L1 norm frame, and changing an optimization equation into a W weight: (11) The adaptive weight coefficient is determined by equation (12) or equation (13): (12) (13) Wherein, the 。
- 9. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging of claim 8, wherein the sparse representation of the image based on a plurality of bases comprises: and combining a plurality of groups of orthogonal transformation bases into a group by adopting a sparsity average strategy so as to meet the sparsity requirement of different object imaging, and expressing by the following formula: (14) (15) where q represents the number of radicals.
- 10. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging according to claim 1, wherein the feature analysis is performed on the reconstructed terahertz imaging image of the cigarette to obtain a foreign matter identification result of a cigarette sample, and the method comprises the following steps: And after the reconstructed terahertz imaging image of the cigarette is obtained, carrying out foreign matter identification on a cigarette sample by comparing the difference of the image characteristics of terahertz transmission intensity of an abnormal area and that of a normal cigarette area so as to identify and mark the position and type of the foreign matter in the cigarette, wherein the image characteristics of the foreign matter when the foreign matter is a plastic sheet are clear-boundary transmission intensity weakening dark spots, the image characteristics of the foreign matter when the foreign matter is a thin needle are slender high-contrast strips, and the image characteristics of the foreign matter when the foreign matter is a tobacco stem are blocky or strip-shaped contrast changes.
Description
Sparse representation scanning imaging-based method for detecting foreign matters in cigarette Technical Field The invention relates to the technical field of nondestructive detection of cigarette quality, in particular to a detection method of foreign matters in a cigarette based on sparse representation scanning imaging. Background In the cigarette production process, the inside foreign matters such as plastic sheet, thin needle, tobacco stalk that probably mixes of cigarette seriously influence product quality and consumer health, consequently need carry out accurate detection to the inside foreign matters of cigarette. The traditional detection method such as manual sorting, X-ray detection and the like has the problems of low detection efficiency, radiation risk or insufficient sensitivity for identifying low-contrast foreign matters. The terahertz time-domain spectroscopy technology has the advantages of high penetrability, no ionization damage and high signal-to-noise ratio, and is suitable for nondestructive detection of the internal structure of the cigarette. However, the traditional terahertz scanning imaging needs to collect a large amount of data, and the scanning takes a long time (usually several hours), so that the requirement of rapid detection on a cigarette production line is difficult to meet. If the number of scanning points is simply reduced, the imaging quality is reduced, and foreign matters cannot be accurately identified. Therefore, a method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging is needed. Disclosure of Invention The invention aims to provide a method for detecting foreign matters in a cigarette based on sparse representation scanning imaging, so as to solve the problems in the prior art and achieve both imaging speed and imaging quality. The invention provides a method for detecting foreign matters in a cigarette based on sparse representation scanning imaging, which comprises the following steps: sparse sampling is carried out on a cigarette sample to be detected by using a terahertz time-domain spectrum experiment system, so that sparse sampling data are obtained; inputting the acquired sparse sampling data into an image reconstruction model constructed based on sparse representation to obtain a reconstructed terahertz imaging image of the cigarette; and performing feature analysis on the reconstructed terahertz imaging image of the cigarette to obtain a foreign matter identification result of a cigarette sample. According to the method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging, preferably, the terahertz time-domain spectrum experimental system is used for sparse sampling of the cigarette sample to obtain sparse sampling data, and the method comprises the following steps: preparing a cigarette sample to be detected, and setting scanning parameters of a terahertz time-domain spectroscopy experiment system, wherein the scanning spectrum range is 0-3THz, the spectrum resolution is 12.5GHz, the average scanning times are 1024 times, the test environment temperature is 21+/-1 ℃ and the relative humidity is 4+/-1%; The method comprises the steps of fixing a cigarette to be detected on a sample stage of a three-dimensional scanning frame of a terahertz time-domain spectrum experiment system, enabling an axis of the cigarette to be perpendicular to a terahertz wave light path, controlling the relative movement of the cigarette and a terahertz wave beam through the three-dimensional scanning frame, and collecting cigarette scanning data in a sparse sampling mode, wherein sampling intervals in the horizontal direction and the vertical direction are 1mm. The method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging, which is described above, is characterized in that the sparse sampling mode is preferably realized through a sparse sampling matrix M, the sampling process satisfies that Y=MX+N (1), Wherein X represents a cigarette image to be restored, Y represents collected sparse sampling data, and N represents additive Gaussian noise. According to the method for detecting the foreign matters in the cigarette based on sparse representation scanning imaging, preferably, the acquired sparse sampling data are input into an image reconstruction model constructed based on sparse representation, and a reconstructed terahertz imaging image of the cigarette is obtained, and the method comprises the following steps: and inputting the acquired sparse sampling data into an image reconstruction model constructed based on sparse representation, wherein the image reconstruction model adopts an inverse biorthogonal wavelet base rbio 4.4.4 to carry out 4-layer wavelet decomposition, and carries out image reconstruction by combining a self-adaptive soft threshold contraction algorithm with a Nesterov acceleration algorithm. According to the met