Visual-assisted non-destructive testing method and device for water content of a cigarette
The vision-assisted non-destructive testing method for cigarette moisture content utilizes a honeycomb fixture reference characteristic spectrum and multi-angle rotation acquisition technology to solve the problems of destructiveness and large errors in existing testing methods, achieving efficient and accurate detection of cigarette moisture content.
Patent Information
- Application Number
- CN202611628570.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-20
AI Technical Summary
Existing methods for detecting tobacco moisture content in finished cigarettes suffer from problems such as being highly destructive, time-consuming, having large measurement errors, and being unable to meet the needs of continuous production. In particular, the drying method and microwave transmission method are insufficient in terms of accuracy and stability.
A vision-assisted non-destructive testing method for cigarette moisture content is proposed. By acquiring the reference characteristic spectrum of the honeycomb fixture and the effective field of view of the circle, and combining multi-angle rotation acquisition images and spectral data, spectral demixing and adaptive weighted fusion are performed to reduce fixture interference and improve detection accuracy and stability.
It achieves non-destructive testing, improves testing efficiency and sample reusability, reduces sampling deviation caused by differences in tobacco distribution and local reflection at a single angle, adapts to the needs of rapid batch testing of cigarettes, and improves the accuracy and stability of test results.
Smart Images

Figure CN123135745A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tobacco moisture detection technology, and more specifically, to a visually assisted non-destructive testing method and equipment for the moisture content of cigarettes. Background Technology
[0002] Moisture content of tobacco shreds is a crucial quality control indicator in cigarette production, directly affecting the tobacco's resistance to breakage and the quality of cigarette rolling. Low moisture content makes the tobacco shreds prone to breakage during rolling, increasing the rate of empty ends and rejects. Therefore, cigarette production requires testing the moisture content of both tobacco shreds and finished cigarettes to provide a basis for moisture control during production. With the increasing demands for continuous production and batch quality testing, finished cigarette testing needs to balance testing efficiency, measurement accuracy, and sample integrity.
[0003] Existing methods for detecting tobacco moisture content mainly include the drying method and the microwave transmission method. The drying method removes moisture from the sample by heating, and the moisture content is calculated based on the mass difference before and after drying. When used for testing finished cigarettes, the cigarette paper and filter need to be removed, and the tobacco shreds taken out for measurement. The microwave transmission method utilizes the absorption characteristics of moisture by microwave energy, determining the moisture content by detecting the signal change after microwaves pass through the tobacco sample. It features non-contact and rapid measurement and is mainly used for moisture detection in tobacco samples.
[0004] The methods described above have limitations in the testing of finished cigarettes. The drying method requires destroying the cigarette structure, is time-consuming, and the samples cannot be reused. Furthermore, the loss of volatile components due to high-temperature heating affects measurement accuracy, making it difficult to meet the high-frequency testing requirements of continuous production. The microwave transmission method is affected by factors such as tobacco bulk density, filling uniformity, temperature, and sample shape and placement, increasing measurement errors and calibration difficulty. In addition, when using a fixture to support the cigarette for end-face optical inspection, the fixture structure's obstruction, surface reflection, and diffuse material reflection interfere with the tobacco end-face signal. Single-angle sampling also suffers from insufficient local representativeness, affecting the accuracy and stability of moisture content detection. Summary of the Invention
[0005] The present invention provides a visually assisted non-destructive testing method and equipment for the moisture content of cigarettes, in order to improve at least one of the above-mentioned technical problems.
[0006] In a first aspect, the present invention provides a visually assisted non-destructive testing method for the moisture content of cigarettes, which includes steps S1 to S5.
[0007] S1, acquiring the pre-calibrated circular effective field of view and the reference characteristic spectrum of the honeycomb fixture in a smoke-free state. The honeycomb fixture carrying the cigarette bundle is rotated by a rotary stage, and images of the cigarette bundle end face and raw spectral data are acquired simultaneously at different rotation angles. Further, S1 specifically includes: The pre-calibration of the circular effective field of view specifically includes: placing a standard reflective white board on the plane where the end face of the cigarette stick is located, triggering the moisture meter to project the effective detection spot onto the standard reflective white board, acquiring an image through the image acquisition component, performing circular fitting on the bright circular area in the image, saving the fitted area as the circular effective field of view corresponding to the actual effective detection area of the moisture meter, and using it as a fixed region of interest for subsequent cigarette stick end face image processing.
[0008] The specific steps for obtaining the reference characteristic spectrum of the cellular fixture are as follows: with no cigarettes placed in the cellular fixture, drive the rotary table to rotate one revolution, continuously collect multiple frames of spectrum, perform dark current subtraction and light intensity normalization on each frame of spectrum, and then take the average to obtain the reference characteristic spectrum of the cellular fixture.
[0009] When synchronously acquiring images of the end face of the cigarette bundle and raw spectral data at different rotation angles, a frame number and timestamp are assigned to each frame of synchronously acquired data, so that the images of the end face of the cigarette bundle and the raw spectral data correspond one-to-one according to the frame number.
[0010] S2, dark current subtraction and light intensity normalization are performed on the original spectral data of each frame to obtain preprocessed spectral data. Within the circular effective field of view, the end face image of the corresponding tobacco bundle is segmented to obtain the effective signal area of the tobacco and the interference area of the clamp.
[0011] Furthermore, the corresponding frame of the cigarette bundle end face image is segmented within the circular effective field of view, including the following steps.
[0012] Based on the grayscale value, texture features, and edge geometric features of the image pixels, the pixels within the circular effective field of view are divided into the effective tobacco signal region, the occlusion region, the high reflectivity region, and the diffuse interference region, generating mutually exclusive effective tobacco signal masks, occlusion masks, high reflectivity masks, and diffuse interference masks.
[0013] According to the statistics of each mask, the first Effective signal area of the tobacco in the frame , Coverage area High reflective area and diffuse reflection interference area The sum of the obstruction area, the highly reflective area, and the diffuse reflection interference area is taken as the first... The clamping interference area of the frame. Among them, This represents the frame index of the synchronously acquired data.
[0014] S3: Determine the effective signal area weight of the tobacco shreds and the interference area weight of the clamp based on the area of each frame. Combine the spectral characteristics of the cellular clamp reference to perform spectral demixing on the preprocessed spectral data of the corresponding frame to obtain the clean end-face spectral data at each rotation angle. Further, S3 includes the following steps.
[0015] Let the total area of the effective field of view of the circle be . Only when At that time, according to the first The effective signal area of the tobacco shreds and the interference area of the fixture are used to determine the weight of the effective signal area of the tobacco shreds. and fixture interference area weight : .
[0016] .
[0017] The first Frame preprocessing spectral data , reference characteristic spectrum of honeycomb clamp Substituting the effective signal area weight of the tobacco shreds and the interference area weight of the fixture into the linear spectral mixing model: .
[0018] In the formula, Indicates the first Frame of pure end-face spectral data. This represents the wavelength variable in the near-infrared spectrum. Indicates the first Frame at wavelength The linear spectral mixing model residual at that location.
[0019] Only when At that time, the linear spectral mixing model is solved by the least squares method to obtain... .when At that time, the pure end-face spectral data of the frame is not obtained, and the frame is excluded from subsequent quality evaluation and adaptive weighted fusion.
[0020] S4: Determine the quality evaluation coefficient based on the interference area of each frame's fixture and the spectral signal-to-noise ratio of the pure end-face spectral data, screen the effective spectral frames, and perform adaptive weighted fusion of the effective spectral frames using the quality evaluation coefficients to obtain the comprehensive characteristic spectrum of the tobacco bundle. Further, S4 includes the following steps.
[0021] Preset signal wavelength set and baseline wavelength set For obtaining pure end-face spectral data, the first Frame, with exist The average spectral intensity within is used as With its in The standard deviation of spectral intensity within the range is used as Only when Calculate the spectral signal-to-noise ratio in real time : .
[0022] Will be able to calculate The set of all frame indices constitutes the frame index set to be evaluated. ,when When the current smoke bundle is not empty and the maximum spectral signal-to-noise ratio in a single multi-angle acquisition sequence is greater than 0, calculate the first... Frame spectral signal-to-noise ratio normalized score : .
[0023] In the formula, Represents the set of frame indices to be evaluated Spectral signal-to-noise ratio of each frame The maximum value. Indicates the set of frame indices to be evaluated The frame index used when taking the maximum value.
[0024] According to the Frame fixture interference area and spectral signal-to-noise ratio normalization score calculation quality evaluation coefficient : .
[0025] Set quality evaluation thresholds , will satisfy The spectral frame removal will satisfy The spectral frames are identified as valid spectral frames, and a valid spectral frame index set is formed. . .
[0026] When the sum of the quality evaluation coefficients corresponding to the effective spectral frames is greater than 0, adaptive weighted fusion is performed using the quality evaluation coefficients of each effective spectral frame as weights to obtain the comprehensive characteristic spectrum of the tobacco bundle. .
[0027] .
[0028] S5. Extract the spectral components of the characteristic wavelengths in the comprehensive characteristic spectrum that correspond to the pre-established moisture content prediction model, and input them into the moisture content prediction model to obtain the predicted moisture content of the tobacco bundle.
[0029] Furthermore, a moisture content prediction model is established in advance, including the following steps.
[0030] For the A group of cigarette samples were assembled into a cigarette bundle, and a composite characteristic spectrum was generated through S1 to S4. The cigarettes not used for cigarette bundle spectral acquisition were divided into two mixed tobacco samples. For the first The index of mixed tobacco samples within the group, for the first Group 1 The mass of the mixed tobacco shreds before drying was determined using the oven drying method. and the quality of dried tobacco Only when Calculate the reference moisture content measurement value. : .
[0031] When the reference moisture content of the two mixed tobacco samples is measured... and When all have been generated, calculate the first... True value label of moisture content for the only batch of group-grade tobacco bundles : .
[0032] Only when and Once both have been generated, a one-to-one correspondence is established between them to form a spectral-true value sample pair for training and validating the moisture content prediction model.
[0033] The SPXY algorithm is used to partition the spectral-true sample pairs, and the number of samples actually participating in the partitioning is denoted as the first. The and the first The comprehensive characteristic spectra of the individual cigarette bundle samples are as follows: and The corresponding group-level unique batch moisture content true value labels are as follows: and Calculate spectral distance Chemical distance of water content : .
[0034] .
[0035] remember The total number of cigarette bundles actually participating in the SPXY sample segmentation is [number]. and Normalization yields the combined distance : .
[0036] SPXY sample partitioning and generation of a calibration set and an independent validation set are performed only when the comprehensive distance can be calculated and both normalized denominators are greater than 0. The calibration set is used for establishing the water content prediction model, and the independent validation set is used for external validation of the water content prediction model.
[0037] Singular sample removal is performed on the calibration set, denoted as... For the set of sample indices of the calibration set, To correct the sample size, The mean vector and covariance matrix are calculated based on the spectral components of the comprehensive characteristic spectra of each sample in the calibration set at each discrete wavelength, and the first... The Mahalanobis distance of the composite characteristic spectrum of each calibration set sample relative to the center of the composite characteristic spectrum distribution of the calibration set. When the covariance matrix is not invertible, its Moore-Penrose generalized inverse is used for calculation. .
[0038] Calculate the first Spectrochemical distance inconsistency of a calibration set sample : .
[0039] In the formula, Indicates the correction set except for the first Index of other samples besides the one sample.
[0040] remember and Each of the generated correction sets The mean and standard deviation, and Each of the generated correction sets The mean and standard deviation are used to determine the threshold for Mahalanobis distance anomaly detection. Threshold for determining the inconsistency between spectral and chemical distance : .
[0041] .
[0042] When the The calibration set samples satisfy or When this happens, the sample in the calibration set is identified as an outlier and removed.
[0043] After removing outlier samples, the calibration set is used to select a subset of characteristic wavelengths from the discrete characteristic wavelengths output by the moisture meter using stepwise regression. The spectral components in the comprehensive characteristic spectrum corresponding to the subset of characteristic wavelengths are used as independent variables, and the corresponding group-level unique batch moisture content true value label is used as dependent variable. The partial least squares method is used to train the moisture content prediction model.
[0044] When the number of samples in the calibration set after outlier removal is not less than 3, leave-one-out cross-validation is used to determine the optimal number of latent variables for the moisture content prediction model. The model parameters are determined with the goal of minimizing the root mean square error of the cross-validation. Calculate the relative analysis error of internal cross-validation at the time. : .
[0045] In the formula, This represents the standard deviation of the true value label for the moisture content of a single batch at the correction group level. This represents the root mean square error of cross-validation.
[0046] The moisture content prediction model, validated through cross-validation, is used to predict the moisture content of the independent validation set. Let be the model name. The number of samples in the independent validation set. For the first Each independently verified sample of collected tobacco bundles has a unique, true-value label for the moisture content of each batch at the group level. For the moisture content prediction model, the first The predicted moisture content of an independently validated tobacco bundle sample. Calculate the coefficient of determination for each independent validation set, using the average true moisture content of the independent validation set. and the root mean square error of prediction : .
[0047] .
[0048] remember To independently verify the standard deviation of the true moisture content label for a single batch at the centralized group level, in Calculate the relative analysis error of the independent validation set at time. : .
[0049] Only when , and Once all parameters have been generated, a performance benchmark is performed. If both conditions are met... , and When the moisture content prediction model and its corresponding characteristic wavelengths are used for on-site detection, if any indicator fails to reach the corresponding threshold, the characteristic wavelength screening or outlier sample check is repeated until the threshold is met.
[0050] Secondly, the present invention provides a vision-assisted non-destructive testing device for the moisture content of cigarettes, used to perform the vision-assisted non-destructive testing method for the moisture content of cigarettes described in any paragraph of the first aspect. The vision-assisted non-destructive testing device for the moisture content of cigarettes includes a moisture meter, a rotating clamp assembly for placing cigarettes, an image acquisition assembly for capturing images of the cigarettes, and a processing and control unit. The rotating clamp assembly includes a honeycomb clamp for placing cigarettes and a rotating stage for driving the honeycomb clamp to rotate.
[0051] By adopting the above technical solution, the present invention can achieve the following technical effects: This invention employs near-infrared spectroscopy to detect diffuse reflectance at the end face of a cigarette bundle. This eliminates the need to remove the cigarette paper, filter, or damage the original structure of the cigarette, providing spectral information for moisture content prediction. This avoids the damage caused by traditional drying methods and improves detection efficiency and sample reusability. By rotating the cigarette bundle at multiple angles using a rotating stage and simultaneously acquiring end face images and spectral data at different rotation angles, complementary multi-angle detection information can be obtained. This reduces sampling bias and insufficient representativeness caused by differences in tobacco distribution, fixed obstructions, and local reflections at a single angle, resulting in a more comprehensive comprehensive spectral characteristic that reflects the overall spectral characteristics of the cigarette bundle.
[0052] Meanwhile, this invention calibrates a circular effective field of view corresponding to the effective detection area of the moisture meter. Within this area, it identifies the effective signal region of the tobacco shreds and the interference regions caused by the honeycomb fixture, including occlusion, high reflectivity, and diffuse reflection. It then combines this with a pre-obtained reference characteristic spectrum of the honeycomb fixture in a smoke-free state for spectral demixing, reducing the interference of the fixture structure on the tobacco end-face spectrum from both spatial and spectral information perspectives. After obtaining the pure end-face spectrum at each rotation angle, it further combines the fixture interference area and spectral signal-to-noise ratio for quality evaluation, effective spectral frame selection, and adaptive weighted fusion. This ensures that high-quality spectral data contributes more to the comprehensive characteristic spectrum, thereby improving the accuracy, stability, and anti-interference capability of the moisture content detection results. This also enables the invention to meet the application requirements of batch, rapid, and non-destructive testing of cigarettes. Attached Figure Description
[0053] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the specific embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some specific embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0054] Figure 1 This is an isometric drawing of a vision-assisted non-destructive testing device for the moisture content of cigarettes.
[0055] Figure 2 This is an isometric view of the rotary clamp assembly.
[0056] Figure 3 This is a schematic flowchart of the visual-assisted non-destructive testing method for the moisture content of cigarettes according to the present invention.
[0057] The markings in the diagram are: 1-rotary clamp assembly, 2-rotary stage, 3-honeycomb clamp, 4-moisture meter, and 5-image acquisition assembly. Detailed Implementation
[0058] The technical solutions of the present invention will now be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention.
[0059] Please see Figures 1 to 3 The first embodiment of the present invention provides a vision-assisted non-destructive testing method for the moisture content of cigarettes, which can be executed by a vision-assisted non-destructive testing device for the moisture content of cigarettes (hereinafter referred to as: non-destructive testing device for moisture content of cigarettes). In particular, it is executed by one or more processors in the non-destructive testing device for the moisture content of cigarettes to realize steps S1 to S5.
[0060] This embodiment of a vision-assisted non-destructive testing method for cigarette moisture content utilizes a moisture meter 4 to collect near-infrared spectral data of the cigarette bundle end face, and an image acquisition component 5 to simultaneously acquire images of the cigarette bundle end face. A rotating stage 2 drives a honeycomb clamp 3 carrying the cigarette bundle to rotate, performing multi-frame synchronous acquisition at different rotation angles. Based on the synchronously acquired cigarette bundle end face images, the effective signal area of the tobacco and the clamp interference area are identified. The corresponding frame spectra are demixed using a pre-acquired reference characteristic spectrum of the honeycomb clamp 3 in a cigarette-free state. Then, adaptive weighted fusion is performed based on the quality evaluation results of the multi-angle spectra to obtain a comprehensive characteristic spectrum for moisture content prediction.
[0061] like Figure 1 and Figure 2 As shown, the vision-assisted non-destructive testing equipment for cigarette moisture content using the above method includes a moisture meter 4, a rotating clamp assembly 1 for placing the cigarettes, an image acquisition assembly 5 for capturing images of the cigarettes, and a processing control unit. The rotating clamp assembly 1 includes a honeycomb clamp 3 for placing the cigarettes and a rotating stage 2 for driving the honeycomb clamp 3 to rotate. The image acquisition assembly 5 includes an industrial camera and a lens coupled to the industrial camera.
[0062] In this embodiment, the moisture meter 4 is a large-aperture moisture meter 4. The light source of the moisture meter 4 is an LED containing the near-infrared spectral characteristic wavelengths corresponding to the tobacco moisture content, and it is driven by a constant current source. After the near-infrared light emitted by the light source illuminates the end face of the tobacco bundle, the moisture meter 4 receives the diffuse reflectance spectral information of the sample end face, filters out non-target wavelengths through an internal filtering module, and then converts the corresponding electrical signal into spectral energy values through a photodetector and terminal computing components to form raw spectral data. .in, Indicates the first The raw spectral data corresponding to the frame-synchronized acquisition data, This represents the frame index of the synchronously acquired data. This represents the wavelength variable in the near-infrared spectrum.
[0063] The rotary table 2 is driven by a stepper motor and has a built-in angle encoder to provide feedback on the current absolute angle position. The system can perform a complete 0° to 360° rotation cycle as the acquisition loop, and triggers the synchronous acquisition of spectral data and tobacco bundle end face images at fixed rotation angles according to a preset angle step size. In one specific embodiment, the angle step size is set to once every 10°. The rotary table 2 can use a stepped speed regulation method to change the uniform rotation speed.
[0064] The honeycomb clamp 3 is cylindrical in shape, with a corresponding number of honeycomb holes inside according to the number of cigarettes. Each cigarette is placed in its corresponding honeycomb hole without the need for additional lateral clamping force. The bottom of the honeycomb clamp 3 has a concave structure, and the top of the rotating table 2 has a corresponding convex structure. The two form a concave-convex interlocking assembly, which allows the honeycomb clamp 3 to rotate synchronously with the rotating table 2 and reduces the squeezing deformation of the cigarettes during the clamping process.
[0065] The industrial camera in image acquisition component 5 is selected based on the requirements for field of view and image processing accuracy. In one specific embodiment, the minimum resolution required for image acquisition is 2400×1600 pixels, using a Hikvision MV-CS200-10GC industrial area array camera with a resolution of 5472×3648 pixels, employing a 1-inch target-area CMOS image sensor, and equipped with an industrial lens with a 50 mm focal length.
[0066] The processing control unit is equipped with moisture meter 4 acquisition software and industrial camera control software. Preferably, the processing control unit includes at least a terminal computing component. When a host industrial control computer is configured, the processing control unit also includes a host industrial control computer. The processing control unit is used to control the moisture meter 4, image acquisition component 5, and rotary table 2, and performs corresponding processing procedures in spectral preprocessing, image segmentation, area statistics, spectral demixing, quality evaluation, multi-angle adaptive weighted fusion, and moisture content prediction according to the equipment configuration.
[0067] To facilitate the explanation of the spectral processing procedure in this embodiment, the spectral data generated during the detection process are defined as follows. Original spectral data For the moisture meter 4 in the first The raw energy signal covering the end face of the cigarette bundle and the relevant area of the honeycomb clamp 3 obtained from the frame-synchronized acquisition data. Preprocessed spectral data. For the first The mixed spectrum is obtained by performing dark current subtraction and intensity normalization on the original frame spectral data. Pure end-face spectral data. For the first The spectrum of the cigarette bundle end face after spectral demixing of the preprocessed spectral data and removal of interference from the honeycomb clamp 3 was obtained. (Comprehensive characteristic spectrum) The overall spectral characteristics of the tobacco bundle are obtained by quality evaluation and adaptive weighted fusion of pure end-face spectral data from multiple rotation angles.
[0068] The specific steps of the non-destructive testing method for the moisture content of cigarettes in this embodiment are as follows.
[0069] S1. Obtain the pre-calibrated circular effective field of view and the reference characteristic spectrum of the honeycomb clamp 3 in the state without cigarettes. Drive the honeycomb clamp 3 loaded with cigarette bundles to rotate through the rotary table 2, and simultaneously acquire the end face image and raw spectral data of the cigarette bundles at different rotation angles.
[0070] Before detecting the cigarette bundle, the field of view of the image acquisition component 5 is first spatially calibrated. Specifically, a uniform standard reflective white board is placed on the plane where the cigarette end face is located. The moisture meter 4 is triggered to project the effective detection spot onto the standard reflective white board, and the corresponding image is acquired by the image acquisition component 5. The bright circular area in the image is then fitted with a circle, and the fitted area is saved as the circular effective field of view (EFOV) corresponding to the actual effective detection area of the moisture meter 4. This circular effective field of view is used as a fixed region of interest for processing subsequent frames of cigarette bundle end face images.
[0071] The standard reflective white plate is used to determine the location and range of the actual effective detection area of the moisture meter 4. In the subsequent light intensity normalization process, it is not necessary to measure the standard reflective white plate again for each frame of the smoke beam spectrum. In this embodiment, the moisture meter 4 has a built-in reference channel, through which changes in light source intensity are monitored in real time and light intensity normalization compensation is performed.
[0072] When acquiring the reference characteristic spectrum of the honeycomb fixture 3, no cigarette is placed in the honeycomb fixture 3. The rotating stage 2 is driven to rotate one revolution, and multiple frames of spectrum are continuously acquired. In specific implementation, more than 100 frames of spectrum can be acquired continuously. After performing the same dark current subtraction and light intensity normalization processing as the spectrum to be measured on each frame of spectrum, the average is taken to obtain the reference characteristic spectrum of the honeycomb fixture 3. .in, This represents the reference characteristic spectrum of the honeycomb clamp 3 obtained after preprocessing and averaging in a smokeless state. It includes spectral components such as high reflectivity and diffuse reflectance generated by the honeycomb clamp 3. Multi-frame averaging can reduce the influence of random noise on the reference characteristic spectrum of the honeycomb clamp 3.
[0073] During cigarette bundle testing, multiple cigarettes are placed in the honeycomb clamp 3 to form a cigarette bundle, with the cigarette end faces within the effective detection area of the moisture meter 4. The rotating stage 2 drives the honeycomb clamp 3 and the cigarette bundle within it to rotate. Since the cigarettes are placed in the honeycomb clamp 3 and move as a whole with the honeycomb clamp 3, a relative positional relationship is maintained between the cigarettes and the honeycomb clamp 3 during rotation.
[0074] During rotation, the moisture meter 4 and the image acquisition component 5 are triggered synchronously. The moisture meter 4 projects near-infrared light onto the end face of the cigarette bundle and acquires the diffuse reflectance spectrum of the end face, obtaining the raw spectral data corresponding to each rotation angle. Image acquisition component 5 acquires images of the cigarette bundle end face at the corresponding rotation angle at the appropriate time. The processing and control unit assigns a frame number and timestamp to each frame of synchronously acquired data, so that the cigarette bundle end face image and the original spectral data correspond one-to-one according to the frame number.
[0075] By using the above-mentioned multi-angle synchronous acquisition method, the same tobacco bundle can obtain images and spectral data from multiple rotation angles, thereby reducing the impact of tobacco distribution, honeycomb clamp 3 obstruction, and local reflection on the detection results at a single angle.
[0076] S2, dark current subtraction and light intensity normalization are performed on the original spectral data of each frame to obtain preprocessed spectral data. Within the circular effective field of view, the end face image of the corresponding tobacco bundle is segmented to obtain the effective signal area of the tobacco and the interference area of the clamp.
[0077] For the Frame raw spectral data First, dark current subtraction is performed. Then, light intensity normalization is performed using the light source intensity monitored by the built-in reference channel of the moisture meter 4 to reduce signal changes caused by dark current, light source fluctuations, and ambient temperature drift, thus obtaining the first... Frame preprocessing spectral data Since the moisture meter 4 in this embodiment outputs spectral energy values corresponding to discrete characteristic wavelengths, the preprocessing does not employ smoothing or derivative processing for continuous spectra. This preprocessing is completed before spectral demixing. As input for subsequent spectral unmixing.
[0078] Regarding the first The image of the tobacco bundle end face corresponding to the original spectral data of the frame is processed only within a pre-calibrated circular effective field of view. Based on the grayscale value, texture features, and edge geometry of the image pixels, the pixels within the circular effective field of view are divided into effective tobacco signal regions, occlusion regions, high reflectivity regions, and diffuse interference regions. Mutually exclusive masks for effective tobacco signal, occlusion, high reflectivity, and diffuse interference are then generated. Each pixel belongs to only one of these four regions.
[0079] In one implementation, a deep learning image segmentation algorithm, such as the U-Net image segmentation algorithm, can be used to perform the above-mentioned region segmentation. Occluded regions can be identified based on the geometric features of the edges of the cellular structure's solid frame and low-grayscale regions. High-reflectivity regions can be identified based on near-saturated high-grayscale pixels. Diffuse interference regions can be identified based on pixels with medium to high grayscale and few texture features. Effective tobacco signal regions can be identified based on the color range and texture features corresponding to the tobacco, and effective regions that do not belong to the first three types of interference regions can be determined as effective tobacco signal regions.
[0080] The four types of masks are respectively denoted as... , , and .in, This indicates the effective signal mask for tobacco. Indicates masking. Indicates a highly reflective mask. Indicates diffuse reflection interference mask. and These represent the horizontal and vertical coordinates of the image pixels within the circular effective field of view, respectively.
[0081] According to the statistics of each mask, the first Effective signal area of the tobacco in the frame , Coverage area High reflective area and diffuse reflection interference area .in, Indicates the first The area of the effective signal region of the frame of tobacco. Indicates the first The area of the frame occlusion region, Indicates the first The area of the high-frame reflective region, Indicates the first The area of the diffuse reflection interference region. , and The sum of as the first The clamping interference area of the frame.
[0082] S3. Based on the area of each frame, determine the effective signal area weight of the tobacco and the interference area weight of the clamp. Combine the reference characteristic spectrum of the cellular clamp 3 to perform spectral demixing on the preprocessed spectral data of the corresponding frame to obtain the pure end face spectral data of each rotation angle.
[0083] Let the total area of the effective field of view of the circle be . Only when At that time, according to the first The effective signal area of the tobacco shreds and the interference area of the fixture are used to determine the weight of the effective signal area of the tobacco shreds. and fixture interference area weight : .
[0084] .
[0085] in, This represents the total area of the effective field of view of the circle. Indicates the first The weight of the effective signal area of the frame tobacco in the total area of the circular effective field of view. Indicates the first The weight of the total area of the frame occlusion region, the highly reflective region, and the diffuse reflection interference region relative to the total area of the circular effective field of view.
[0086] The first Frame preprocessing spectral data 3. Reference characteristic spectrum of honeycomb clamp Effective signal area weighting of tobacco shreds and fixture interference area weight Substitute into the linear spectral mixing model: .
[0087] in, Indicates the first Frame preprocessing of spectral data, Indicates the first Frame of pure end-face spectral data, This indicates the reference characteristic spectrum of the cellular clamp 3. Indicates the first Frame at wavelength The linear spectral mixing model residual at that location.
[0088] Only when Then, the linear spectral mixing model is solved using the least squares method to obtain... .when At that time, the pure end-face spectral data of the frame is not obtained, and the frame is excluded from subsequent quality evaluation and adaptive weighted fusion.
[0089] Through the above processing, based on the effective area of the tobacco shreds and the area of the clamp interference reflected in the end face image of the tobacco bundle, and combined with the pre-obtained reference characteristic spectrum of the honeycomb clamp 3, the clamp spectral interference in the preprocessed mixed spectrum is separated to obtain the pure end face spectral data corresponding to different rotation angles.
[0090] S4. Determine the quality evaluation coefficient based on the interference area of each frame fixture and the spectral signal-to-noise ratio of the pure end face spectral data, screen the effective spectral frames, and perform adaptive weighted fusion of the effective spectral frames with the quality evaluation coefficient to obtain the comprehensive characteristic spectrum of the tobacco bundle.
[0091] Preset signal wavelength set and baseline wavelength set .in, This represents the set of wavelengths used to calculate signal strength. This represents the set of wavelengths used to calculate baseline noise.
[0092] For obtaining pure end-face spectral data, the first Frame, with exist The average spectral intensity within is used as ,by exist The standard deviation of spectral intensity within the range is used as .in, Indicates the first The average spectral intensity of the pure end-face spectrum within the signal wavelength set. Indicates the first The standard deviation of the spectral intensity of the frame-clean end-face spectrum within the baseline wavelength set. Only when Calculate the first Frame spectral signal-to-noise ratio : .
[0093] in, Indicates the first The spectral signal-to-noise ratio of a frame of clean end-face spectral data. When At that time, the frame is not counted. This frame will be excluded from the subsequent quality evaluation process.
[0094] Will be able to calculate The set of all frame indices constitutes the frame index set to be evaluated. .when If empty, the current signal-to-noise ratio normalization, quality evaluation, and adaptive weighted fusion will not be performed. When the maximum spectral signal-to-noise ratio in a single multi-angle acquisition sequence of the current cigarette bundle is greater than 0, for Calculate the first Frame spectral signal-to-noise ratio normalized score : .
[0095] in, Indicates the first Frame spectral signal-to-noise ratio normalized score, Represents the set of frame indices to be evaluated Spectral signal-to-noise ratio of each frame The maximum value, Indicates the set of frame indices to be evaluated The frame index used when taking the maximum value. When the maximum spectral signal-to-noise ratio is not greater than 0, no signal-to-noise ratio normalization is performed, and no subsequent comprehensive feature spectrum is generated.
[0096] According to the Frame fixture interference area and spectral signal-to-noise ratio normalization score calculation quality evaluation coefficient : .
[0097] in, Indicates the first The quality evaluation coefficient of the frame spectral data. This quality evaluation coefficient reflects both the proportion of the clamp interference region within the corresponding frame's circular effective field of view and the signal-to-noise ratio level of the clean end-face spectrum. Only when... Time calculation .
[0098] Pre-set quality evaluation thresholds In one specific implementation, Take 0.3. This will satisfy the condition. The spectral frame removal will satisfy The spectral frames are identified as valid spectral frames, and a valid spectral frame index set is formed. : .
[0099] in, Indicates the quality evaluation threshold. This represents the set of valid spectral frame indices. The number of valid spectral frames is denoted as... and satisfy .in, This indicates the number of valid spectral frames in the current multi-angle acquisition sequence.
[0100] When the sum of the quality evaluation coefficients corresponding to the effective spectral frames is greater than 0, adaptive weighted fusion is performed using the quality evaluation coefficients of each effective spectral frame as weights to obtain the comprehensive characteristic spectrum of the tobacco bundle. : .
[0101] in, This represents the comprehensive characteristic spectrum obtained after adaptive weighted fusion of the current cigarette bundle's spectra from multiple clean end faces. When the sum of the quality evaluation coefficients corresponding to the effective spectral frames is not greater than 0 or... At this time, the fusion will not be performed, nor will the comprehensive feature spectrum corresponding to the current acquisition sequence be generated.
[0102] Through the aforementioned quality evaluation and adaptive weighted fusion, the pure end-face spectrum with a higher quality evaluation coefficient is given a higher weight in the comprehensive feature spectrum. At the same time, spectral frames with a quality evaluation coefficient below the threshold are removed to reduce the impact of local occlusion and reflection on the final spectral features.
[0103] S5. Extract the spectral components of the characteristic wavelengths in the comprehensive characteristic spectrum that correspond to the pre-established moisture content prediction model, and input them into the moisture content prediction model to obtain the predicted moisture content of the tobacco bundle.
[0104] Specifically, when the comprehensive characteristic spectrum of the cigarette bundle to be tested is obtained... Then, according to the characteristic wavelength determined when establishing the moisture content prediction model, the corresponding spectral components are extracted from the comprehensive characteristic spectrum, and the spectral components are used as the model input. The moisture content prediction model outputs the overall moisture content prediction value of the corresponding tobacco bundle.
[0105] The moisture content prediction model can be pre-established according to the following process.
[0106] During sample preparation for modeling, the moisture meter 4 can be turned on and preheated for 30 minutes to allow the light source and detector gain to stabilize. The sample should be equilibrated under the same temperature and humidity conditions before spectral acquisition and reference moisture content determination.
[0107] In one specific calibration implementation, five groups of finished cigarettes, each containing 80 cigarettes, are taken from a constant temperature and humidity chamber. After each group is equilibrated under the same temperature and humidity conditions, 60 cigarettes are randomly selected from each group and placed into a honeycomb clamp 3 to form a cigarette bundle, with the end face of the cigarettes aligned with the effective detection area of the moisture meter 4. The remaining 20 cigarettes from each group serve as reference samples for moisture content determination of the corresponding cigarette bundle.
[0108] For each bundle of 60 cigarettes, the following steps are performed sequentially from S1 to S4: multi-angle synchronous acquisition, spectral preprocessing, image segmentation, area statistics, spectral unmixing, quality evaluation, and adaptive weighted fusion, to obtain the comprehensive characteristic spectrum corresponding to that bundle of cigarettes. .in, This indicates the index of the cigarette sample group. In the specific implementation described above, , Indicates the first The comprehensive characteristic spectrum of the group of cigarette branches.
[0109] For the Twenty cigarettes not used for cigarette bundle spectral acquisition were divided into two groups of 10 cigarettes each. Each group of cigarettes was then mixed and the tobacco shreds were separated to form two mixed tobacco shred samples. The reference moisture content of each sample was determined according to the oven drying method in GB / T 23357-2009.
[0110] remember For the first Index of blended tobacco samples within the group. For the first... Group 1 A sample of mixed tobacco shreds was tested to determine the weight of the tobacco shreds before drying. and the quality of dried tobacco Only when Calculate the reference moisture content measurement value. : .
[0111] in, , Indicates the first Group 1 The weight of the mixed tobacco shreds sample before drying. This indicates the mass of the mixed tobacco sample after drying. Indicates the first Group 1 Reference moisture content measured for a sample of mixed tobacco. When At that time, the moisture content calculation for the corresponding mixed tobacco sample is not performed, nor is the corresponding result generated.
[0112] When the reference moisture content of the two mixed tobacco samples is measured... and When all have been generated, calculate the first... True value label of moisture content for the only batch of group-grade tobacco bundles : .
[0113] in, Indicates the first The true value label for the moisture content of the unique batch corresponding to the group of cigarette bundles. When and If any one of the elements in the set is not generated, the set is not counted. .
[0114] Only when the first The group's comprehensive characteristic spectrum Group-level unique batch moisture content true value label Once both have been generated, a one-to-one correspondence is established between them, forming spectral-true value sample pairs for training and validating the moisture content prediction model. If either has not been generated, this group will not form a spectral-true value sample pair and will not proceed to the subsequent sample partitioning and modeling validation process. The collected data can be exported from the control software and archived to form a calibration experiment data package.
[0115] For the existing spectral-true value sample pairs, the SPXY algorithm is used to partition the samples. The number of samples in the calibration set and the independent validation set, or the partitioning ratio, can be preset according to the actual number of samples involved in the partitioning and the modeling requirements.
[0116] Record the number of samples actually involved in the sample partitioning The and the first The comprehensive characteristic spectra of the individual cigarette bundle samples are as follows: and The corresponding group-level unique batch moisture content true value labels are as follows: and . No. The first cigarette bundle sample and the first spectral distance between individual cigarette bundle samples for: .
[0117] in, and These represent the sample indices of the tobacco bundles that participated in the SPXY sample partitioning. The Euclidean distance between the combined characteristic spectra of the two cigarette bundle samples across all discrete wavelengths included in the SPXY sample partitioning is represented.
[0118] Chemical distance of moisture content between two tobacco bundle samples for: .
[0119] in, Indicates the first The first cigarette bundle sample and the first The absolute value of the difference between the true values of the moisture content labels of the unique batches corresponding to each tobacco bundle sample at the group level.
[0120] remember The total number of cigarette bundles actually participating in the SPXY sample segmentation is [number]. and Normalize each distance separately and obtain the combined distance. : .
[0121] in, This represents the total number of cigarette bundle samples that actually participated in the SPXY sample partitioning. Indicates the first The first cigarette bundle sample and the first The combined distance between individual tobacco bundle samples is determined by both the normalized spectral distance and the normalized moisture content chemical distance.
[0122] SPXY sample partitioning and the generation of a calibration set and an independent validation set are performed only when the comprehensive distance can be calculated and both normalized denominators are greater than 0. The calibration set is used for establishing the water content prediction model, and the independent validation set is used for external validation of the water content prediction model. If the comprehensive distance cannot be calculated, either normalized denominator is not greater than 0, or no corresponding partitioning result is generated, no calibration set or independent validation set is generated, and the current sample set does not proceed to the subsequent singular sample removal, feature wavelength screening, model building, and model validation processes.
[0123] After successfully generating the calibration set and independent validation set, outlier detection and removal are performed only on the calibration set. For the set of sample indices of the calibration set, To correct the sample size, The mean vector and covariance matrix are calculated based on the spectral components of the comprehensive characteristic spectra of each sample in the calibration set at each discrete wavelength, and the first... The Mahalanobis distance of the composite characteristic spectrum of each calibration set sample relative to the center of the composite characteristic spectrum distribution of the calibration set. .in, Indicates the first The Mahalanobis distances corresponding to the samples in the calibration set are calculated. When the covariance matrix is not invertible, its Moore-Penrose generalized inverse is used for calculation. .
[0124] Simultaneously calculate the first Spectrochemical distance inconsistency of a calibration set sample : .
[0125] in, Indicates the first The amount of spectral-chemical distance inconsistency among the calibration set samples Indicates the correction set except for the first Index of other samples besides the existing sample index Indicates the first The calibration set sample and the first spectral distance between each calibration set sample Indicates the first The calibration set sample and the first The chemical distance of water content between the calibration set samples. Only when And the calculation is performed when both normalized denominators are greater than 0. Otherwise, it will not be executed. The calculation does not generate corresponding results.
[0126] remember and Each of the generated correction sets The mean and standard deviation, and Each of the generated correction sets The mean and standard deviation are used to determine the threshold for Mahalanobis distance anomaly detection. Threshold for determining the inconsistency between spectral and chemical distance : .
[0127] .
[0128] in, This represents the threshold for Mahalanobis distance anomaly detection. This indicates the threshold for determining abnormalities in the spectral-chemical distance inconsistency. and Each represents a generated [item / group]. The mean and standard deviation, and Each represents a generated [item / group]. The mean and standard deviation.
[0129] For the A calibration set of samples, when and its corresponding All have been generated and satisfy ,or and its corresponding All have been generated and satisfy If the sample in the calibration set is deemed an outlier, it will be removed. For any metric, if the metric value or its corresponding threshold is not generated, that metric will not be used for outlier determination.
[0130] After removing outlier samples, the calibration set is used to select a subset of characteristic wavelengths related to moisture content from multiple discrete characteristic wavelengths output by the moisture meter 4 using a stepwise regression method. If the model performance does not meet the predetermined requirements, a genetic algorithm-partial least squares approach can be used for comparative optimization.
[0131] Using the spectral components corresponding to the characteristic wavelength subset in the comprehensive characteristic spectrum of each tobacco bundle sample in the calibration set after outlier removal as independent variables, and the corresponding group-level unique batch moisture content true value label as the dependent variable, a moisture content prediction model is trained using partial least squares. This model establishes a mathematical mapping relationship between the spectral components of the comprehensive characteristic spectrum corresponding to the characteristic wavelength and the moisture content of the tobacco bundle, and outputs the overall moisture content prediction value of the tobacco bundle. In other embodiments, other chemometrics or machine learning algorithms described in the document can also be used to establish a multivariate quantitative calibration model.
[0132] When the number of samples in the calibration set after outlier removal is not less than 3, leave-one-out cross-validation is used to determine the optimal number of latent variables for the partial least squares model, and the model parameters are determined with the goal of minimizing the root mean square error of cross-validation. The root mean square error of cross-validation is recorded simultaneously. and in Calculate the relative analysis error of internal cross-validation at the time. : .
[0133] in, This indicates the standard deviation of the true moisture content label for a single batch at the centralized group level. This represents the root mean square error of cross-validation. This represents the relative analysis error of internal cross-validation. When... At that time, no calculation was performed. When the number of samples in the calibration set after outlier removal is less than 3, leave-one-out cross-validation is not performed, and no data is generated. and .
[0134] The moisture content prediction model, validated through cross-validation, is used to predict the moisture content of the independent validation set. Let... The number of samples in the independent validation set. For the first Each independently verified sample of collected tobacco bundles has a unique, true-value label for the moisture content of each batch at the group level. For the moisture content prediction model, the first The predicted moisture content of an independently validated tobacco bundle sample. This represents the average true moisture content of the independent validation set.
[0135] Independent validation set determination coefficient for: .
[0136] in, This represents the coefficient of determination for the independent validation set. It is calculated only if the sum of squares of the deviations of the true moisture content of the independent validation set from its mean is greater than 0. Otherwise, this indicator will not be calculated.
[0137] Prediction root mean square error for: .
[0138] in, This represents the root mean square error of the prediction. In this formula... Represents the summation index of the independent validation set samples. Only when Time calculation Otherwise, the calculation will not be performed.
[0139] remember To independently verify the standard deviation of the true moisture content label for a single batch at the centralized group level. Calculate the relative analysis error of the independent validation set at time. : .
[0140] in, This represents the relative analysis error of the independent validation set. When... This indicator is not calculated at that time.
[0141] Only when , and Once all parameters have been generated, a performance benchmark is performed. If both conditions are met... , and When the moisture content prediction model and its corresponding characteristic wavelengths are used for on-site testing, if any indicator fails to reach the corresponding threshold, the characteristic wavelength screening or outlier sample check is re-executed, and the model is re-established and validated until the threshold is met. If any of the three evaluation indicators is not generated, the model performance threshold comparison is not performed, and the corresponding model is not deployed for on-site testing.
[0142] In the complete on-site detection mode, the cigarette bundle under test is subjected to multi-angle synchronous acquisition, spectral preprocessing, image segmentation within the circular effective field of view and generation of multiple types of masks, area statistics, spectral unmixing, spectral quality evaluation and multi-angle adaptive weighted fusion according to the aforementioned S1 to S4, to generate the comprehensive characteristic spectrum of the cigarette bundle under test. Subsequently, spectral components of characteristic wavelengths corresponding to the validated moisture content prediction model are extracted from the comprehensive characteristic spectrum and input into the moisture content prediction model to obtain the overall moisture content prediction value of the tobacco bundle to be tested.
[0143] By acquiring near-infrared diffuse reflectance spectra from the end face of the cigarette bundle without removing the cigarette paper and filter, and using multi-angle synchronous visual information to identify, demix, and evaluate the occlusion, high reflectance, and diffuse reflectance interference generated by the honeycomb clamp 3, a comprehensive characteristic spectrum for moisture content prediction can be obtained while maintaining the original physical structure of the cigarette. This also reduces the impact of single-angle sampling and clamp optical interference on the moisture content detection results of the cigarette.
[0144] The following section further explains the operation of the vision-assisted non-destructive testing equipment for cigarette moisture content under different computing resource configurations.
[0145] With a host industrial control computer configured, the computer controls the moisture meter 4, image acquisition component 5, and rotating stage 2 to perform synchronous data acquisition. It also performs spectral preprocessing, image segmentation for the circular effective field of view and generation of multiple masks, area statistics, spectral demixing, spectral quality evaluation, multi-angle adaptive weighted fusion, and moisture content prediction, directly outputting the predicted moisture content value for the corresponding tobacco bundle. In this configuration, the moisture content prediction model embedded in the terminal calculation component is not invoked.
[0146] When a host industrial control computer is not configured and the computing power of the terminal computing component meets the requirements of the complete detection mode, the spectral preprocessing algorithms or parameters, image segmentation and multi-class mask generation models or algorithms, area statistics algorithms, spectral unmixing parameters or algorithms, spectral quality evaluation and multi-angle fusion algorithms, moisture content prediction models, and corresponding characteristic wavelengths required for on-site detection are deployed to the terminal computing component. Image data acquired by image acquisition component 5 is transmitted to the terminal computing component. The terminal computing component executes the same complete detection process as under the host industrial control computer configuration and outputs the predicted moisture content value of the tobacco bundle. The moisture content prediction model deployed in the terminal computing component is a fixed copy of the moisture content prediction model after training and validation.
[0147] When a host industrial control computer is not configured and the computing power of the terminal computing component is insufficient to execute the complete detection mode, a low-computing-power fast detection mode can be adopted. In this mode, the water content prediction model and its corresponding characteristic wavelengths, which have already been trained and validated, are pre-deployed to the terminal computing component.
[0148] During rapid on-site testing, the terminal computing component processes the synchronously acquired raw spectral data. Perform dark current subtraction and light intensity normalization to obtain preprocessed spectral data. Simultaneously, a simplified visual processing method is used to process the image data transmitted by image acquisition component 5 to obtain the first... Effective signal area of the tobacco in the frame , Coverage area High reflective area and diffuse reflection interference area .
[0149] The terminal computing component determines the effective signal area weight of the tobacco shreds and the interference area weight of the clamp according to the area parameters and the same calculation relationship as in the complete detection mode, in order to preprocess the spectral data. As the input for spectral unmixing, a comprehensive feature spectrum is generated following the same spectral unmixing, quality evaluation, and multi-angle adaptive weighted fusion process as the complete detection mode. Subsequently, according to the feature wavelengths corresponding to the deployed moisture content prediction model, the corresponding spectral components are extracted from the comprehensive feature spectrum, and the spectral components are input into the moisture content prediction model to obtain the predicted value of the tobacco bundle moisture content.
[0150] Under the different equipment configurations mentioned above, the cigarette bundle is taken as the overall detection object, and the spectral component of the characteristic wavelength in the comprehensive characteristic spectrum that corresponds to the moisture content prediction model is used as the prediction input, so that the spectral processing method formed in the model training stage corresponds to the on-site detection stage.
[0151] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A visually assisted non-destructive method for detecting the moisture content of cigarettes, characterized in that, include: S1, acquire the pre-calibrated circular effective field of view and the reference characteristic spectrum of the honeycomb fixture in the smokeless state; The rotating stage drives the honeycomb clamp containing the cigarette bundle to rotate, and simultaneously acquires images of the cigarette bundle end face and raw spectral data at different rotation angles. S2, perform dark current subtraction and light intensity normalization on the original spectral data of each frame to obtain preprocessed spectral data; segment the end face image of the corresponding frame of tobacco bundle within the circular effective field of view to obtain the effective signal area of tobacco and the interference area of the clamp. S3. Determine the effective signal area weight of tobacco and the interference area weight of the fixture based on the area of each frame. Combine the reference characteristic spectrum of the cellular fixture to perform spectral demixing on the preprocessed spectral data of the corresponding frame to obtain the pure end face spectral data of each rotation angle. S4. Determine the quality evaluation coefficient based on the interference area of each frame and the spectral signal-to-noise ratio of the pure end face spectral data, screen the effective spectral frames, and perform adaptive weighted fusion of the effective spectral frames with the quality evaluation coefficient to obtain the comprehensive characteristic spectrum of the tobacco bundle. S5. Extract the spectral components of the characteristic wavelengths in the comprehensive characteristic spectrum that correspond to the pre-established moisture content prediction model, and input them into the moisture content prediction model to obtain the predicted moisture content of the tobacco bundle.
2. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 1, characterized in that, S1 specifically includes: The pre-calibration of the circular effective field of view specifically includes: placing a standard reflective white board on the plane where the end face of the cigarette stick is located, triggering the moisture meter to project the effective detection spot onto the standard reflective white board, acquiring an image through the image acquisition component, performing circular fitting on the bright circular area in the image, saving the fitted area as the circular effective field of view corresponding to the actual effective detection area of the moisture meter, and using it as a fixed region of interest for subsequent cigarette stick end face image processing. The specific steps for obtaining the reference characteristic spectrum of the cellular fixture include: driving the rotary table to rotate one revolution in the state where no cigarette is placed in the cellular fixture, continuously acquiring multiple frames of spectrum, performing dark current subtraction and light intensity normalization on each frame of spectrum, and then averaging them to obtain the reference characteristic spectrum of the cellular fixture. When synchronously acquiring images of the end face of the cigarette bundle and raw spectral data at different rotation angles, a frame number and timestamp are assigned to each frame of synchronously acquired data, so that the images of the end face of the cigarette bundle and the raw spectral data correspond one-to-one according to the frame number.
3. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 1, characterized in that, In S2, the corresponding frame of the cigarette bundle end face image is segmented within the circular effective field of view, specifically including: Based on the grayscale value, texture features, and edge geometric features of the image pixels, the pixels within the circular effective field of view are divided into the effective tobacco signal region, the occlusion region, the high reflectivity region, and the diffuse interference region, generating mutually exclusive effective tobacco signal masks, occlusion masks, high reflectivity masks, and diffuse interference masks. According to the statistics of each mask, the first Effective signal area of the tobacco in the frame , Coverage area High reflective area and diffuse reflection interference area The sum of the obstruction area, the highly reflective area, and the diffuse reflection interference area is taken as the first... The clamping interference area of the frame; where, This represents the frame index of the synchronously acquired data.
4. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 3, characterized in that, S3 specifically includes: Let the total area of the effective field of view of the circle be . Only when At that time, according to the first The effective signal area of the tobacco shreds and the interference area of the fixture are used to determine the weight of the effective signal area of the tobacco shreds. and fixture interference area weight : ; ; The first Frame preprocessing spectral data , reference characteristic spectrum of honeycomb clamp Substituting the effective signal area weight of the tobacco shreds and the interference area weight of the fixture into the linear spectral mixing model: ; In the formula, Indicates the first Frame-clear end-face spectral data; Represents the wavelength variable in the near-infrared spectrum; Indicates the first Frame at wavelength The linear spectral mixing model residual at the location; Only when At that time, the linear spectral mixing model is solved by the least squares method to obtain... ;when At that time, the pure end-face spectral data of the frame is not obtained, and the frame is excluded from subsequent quality evaluation and adaptive weighted fusion.
5. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 4, characterized in that, S4 specifically includes: Preset signal wavelength set and baseline wavelength set For obtaining pure end-face spectral data, the first Frame, with exist The average spectral intensity within is used as With its in The standard deviation of spectral intensity within the range is used as Only when Calculate the spectral signal-to-noise ratio in real time : ; Will be able to calculate The set of all frame indices constitutes the frame index set to be evaluated. ,when When the current smoke bundle is not empty and the maximum spectral signal-to-noise ratio in a single multi-angle acquisition sequence is greater than 0, calculate the first... Frame spectral signal-to-noise ratio normalized score : ; In the formula, Represents the set of frame indices to be evaluated Spectral signal-to-noise ratio of each frame The maximum value; Indicates the set of frame indices to be evaluated The frame index used when taking the maximum value; According to the Frame fixture interference area and spectral signal-to-noise ratio normalization score calculation quality evaluation coefficient : ; Set quality evaluation thresholds , will satisfy The spectral frame removal will satisfy The spectral frames are identified as valid spectral frames, and a valid spectral frame index set is formed. ; ; When the sum of the quality evaluation coefficients corresponding to the effective spectral frames is greater than 0, adaptive weighted fusion is performed using the quality evaluation coefficients of each effective spectral frame as weights to obtain the comprehensive characteristic spectrum of the tobacco bundle. ; 。 6. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 1, characterized in that, In S5, a moisture content prediction model is pre-established, specifically including: For the A group of cigarette samples were assembled into a cigarette bundle, and a composite characteristic spectrum was generated through S1 to S4. The cigarettes not used for cigarette bundle spectral acquisition were divided into two mixed tobacco samples; [recorded / recorded]. For the first The index of mixed tobacco samples within the group, for the first Group 1 The mass of the mixed tobacco shreds before drying was determined using the oven drying method. and the quality of dried tobacco Only when Calculate the reference moisture content measurement value. : ; When the reference moisture content of the two mixed tobacco samples is measured... and When all have been generated, calculate the first... True value label of moisture content for the only batch of group-grade tobacco bundles : ; Only when and Once both have been generated, a one-to-one correspondence is established between them to form a spectral-true value sample pair for training and validating the moisture content prediction model.
7. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 6, characterized in that, The SPXY algorithm is used to partition the spectral-true sample pairs, and the number of samples actually participating in the partitioning is denoted as the first. The and the first The comprehensive characteristic spectra of the individual cigarette bundle samples are as follows: and The corresponding group-level unique batch moisture content true value labels are as follows: and Calculate spectral distance Chemical distance of water content : ; ; remember The total number of cigarette bundles actually participating in the SPXY sample segmentation is [number]. and Normalization yields the combined distance : ; SPXY sample partitioning is performed and a calibration set and an independent validation set are generated only when the comprehensive distance can be calculated and both normalized denominators are greater than 0; wherein, the calibration set is used for establishing the water content prediction model and the independent validation set is used for external validation of the water content prediction model.
8. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 7, characterized in that, Singular sample removal is performed on the calibration set, denoted as... For the set of sample indices of the calibration set, To correct the sample size, ;Calculate the mean vector and covariance matrix based on the spectral components of the comprehensive characteristic spectra of each sample in the calibration set at each discrete wavelength, and determine the first... The Mahalanobis distance of the composite characteristic spectrum of each calibration set sample relative to the center of the composite characteristic spectrum distribution of the calibration set. When the covariance matrix is not invertible, its Moore-Penrose generalized inverse is used for calculation. ; Calculate the first Spectrochemical distance inconsistency of a calibration set sample : ; In the formula, Indicates the correction set except for the first Index of other samples besides the existing samples; remember and Each of the generated correction sets The mean and standard deviation, and Each of the generated correction sets The mean and standard deviation are used to determine the threshold for Mahalanobis distance anomaly detection. Threshold for determining the inconsistency between spectral and chemical distance : ; ; When the The calibration set samples satisfy or When this happens, the sample in the calibration set is identified as an outlier and removed. After removing outlier samples, the calibration set is used to select a subset of characteristic wavelengths from the discrete characteristic wavelengths output by the moisture meter using stepwise regression. The spectral components in the comprehensive characteristic spectrum corresponding to the subset of characteristic wavelengths are used as independent variables, and the corresponding group-level unique batch moisture content true value label is used as dependent variable. The partial least squares method is used to train the moisture content prediction model.
9. The visually assisted non-destructive testing method for the moisture content of cigarettes according to claim 8, characterized in that, When the number of samples in the calibration set after outlier removal is not less than 3, leave-one-out cross-validation is used to determine the optimal number of latent variables for the moisture content prediction model. The model parameters are determined with the goal of minimizing the root mean square error of the cross-validation. Calculate the relative analysis error of internal cross-validation at the time. : ; In the formula, This represents the standard deviation of the true value label for moisture content of a single batch at the centralized group level. This represents the root mean square error of cross-validation; The moisture content prediction model, validated through cross-validation, is used to predict the moisture content of the independent validation set. Let be the model name. The number of samples in the independent validation set. For the first Each independently verified sample of collected tobacco bundles has a unique, true-value label for the moisture content of each batch at the group level. For the moisture content prediction model, the first The predicted moisture content of an independently validated tobacco bundle sample. Calculate the coefficient of determination for each independent validation set, using the average true moisture content of the independent validation set. and the root mean square error of prediction : ; ; remember To independently verify the standard deviation of the true moisture content label for a single batch at the centralized group level, in Calculate the relative analysis error of the independent validation set at time. : ; Only when , and When all parameters have been generated, a performance benchmark is performed; if both conditions are met simultaneously... , and When the moisture content prediction model and the corresponding characteristic wavelength are used for on-site detection, if any indicator fails to reach the corresponding threshold, the characteristic wavelength screening or anomalous sample inspection is re-executed until the threshold is met.
10. A vision-assisted non-destructive testing device for the moisture content of cigarettes, characterized in that, Used to perform a visually assisted non-destructive testing method for the moisture content of cigarettes as described in any one of claims 1 to 9; The vision-assisted non-destructive testing equipment for cigarette moisture content includes a moisture meter, a rotating clamp assembly for placing cigarettes, an image acquisition assembly for capturing images of cigarettes, and a processing and control unit. The rotating clamp assembly includes a honeycomb clamp for holding cigarettes and a rotating table for driving the honeycomb clamp to rotate.
