Cigarette filter stick quality detection method and device, computer equipment, storage medium and computer program product
By collecting and screening various features of cigarette filter rods, combining mutual information and SHAP values, and inputting them into the quality inspection model, the problems of low accuracy and poor real-time performance in cigarette filter rod quality inspection are solved, achieving more efficient quality inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for detecting the quality of cigarette filter rods suffer from low accuracy and poor real-time performance, making it difficult to capture the dynamic coupling effect between various parameters under complex process conditions.
Multiple features of cigarette filter rods are collected, such as process parameters, physical parameters, appearance images, and quality inspection text records. Target features are selected through mutual information, the contribution of features to the pre-trained model, and SHAP value, and then input into the trained quality inspection model for prediction.
By integrating multiple features to cover information throughout the entire production process, the limitations of single feature dimensions are avoided, detection accuracy and real-time performance are improved, rich data support is provided, highly relevant features are accurately screened, and detection efficiency is increased.
Smart Images

Figure CN121810591A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for detecting the quality of cigarette filter rods. Background Technology
[0002] Quality control is a crucial step in the production of cigarette filter rods, with pressure drop stability directly affecting the filtration efficiency and combustion performance. Traditional filter rod quality inspection relies on analysis of a single data source, such as process parameters collected by physical sensors, surface defect images identified by machine vision systems, or text reports generated from manual sampling. However, these data are usually processed independently, making it difficult to capture the dynamic coupling effects between parameters under complex process conditions, resulting in high errors in filter rod quality inspection.
[0003] Therefore, current methods for testing the quality of filter rods suffer from technical problems such as low accuracy and poor real-time performance. Summary of the Invention
[0004] Therefore, it is necessary to address the technical problems of low accuracy and poor real-time performance in the current methods for detecting the quality of cigarette filters by providing a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for detecting the quality of cigarette filters.
[0005] In a first aspect, this application provides a method for testing the quality of cigarette filter rods, including:
[0006] Collect multiple features of the cigarette filter rod to be tested; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records;
[0007] Based on multiple screening strategies, target features are selected from the various features. The screening criteria for these strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample.
[0008] The selected target features are input into the trained quality detection model, which outputs a prediction result of the pressure drop stability of the cigarette filter rod to be tested.
[0009] In one embodiment, the acquisition of multiple features of the cigarette filter rod to be tested includes: obtaining the initial process parameters of the cigarette filter rod to be tested in a historical time period; extracting time-series features from the initial process parameters through a sliding window of a preset size and a step size to obtain multiple time-series features; and forming the process parameters from the various time-series features.
[0010] In one embodiment, the acquisition of multiple features of the cigarette filter rod to be inspected further includes: extracting the defect area, defect length, and defect distribution density of the cigarette filter rod to be inspected based on the appearance image.
[0011] In one embodiment, the collection of multiple features of the cigarette filter to be tested also includes: extracting quality problem labels of the cigarette filter to be tested based on the quality inspection text record, and counting the frequency of defect reports within a preset time period.
[0012] In one embodiment, the step of inputting the selected target features into a trained quality detection model and outputting a prediction result of the pressure drop stability of the cigarette filter to be tested includes: inputting the target features corresponding to the cigarette filter to be tested into a trained quality detection model; weighting and fusing multiple target features to output a prediction result of the pressure drop stability of the cigarette filter to be tested.
[0013] In one embodiment, before inputting the target features corresponding to the cigarette filter to be detected into the trained quality detection model, the method further includes: inputting the target features into an ensemble model framework including XGBoost, LightGBM, and CatBoost; searching for the optimal hyperparameter combination in the target features in the hyperparameter space corresponding to the ensemble model framework based on a Bayesian optimization algorithm; and training the ensemble model framework including XGBoost, LightGBM, and CatBoost based on the optimal hyperparameter combination to obtain the trained quality detection model.
[0014] Secondly, this application also provides a cigarette filter rod quality testing device, comprising:
[0015] The feature acquisition module is used to acquire multiple features of the cigarette filter rod to be inspected; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records;
[0016] The feature selection module is used to select target features from a variety of features based on multiple selection strategies. The selection criteria for the multiple selection strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single prediction sample.
[0017] The result output module is used to input the selected target features into the trained quality detection model and output the prediction result of the pressure drop stability of the cigarette filter rod to be tested.
[0018] Thirdly, this application also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0019] Collect multiple features of the cigarette filter rod to be tested; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records;
[0020] Based on multiple screening strategies, target features are selected from the various features. The screening criteria for these strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample.
[0021] The selected target features are input into the trained quality detection model, which outputs a prediction result of the pressure drop stability of the cigarette filter rod to be tested.
[0022] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0023] Collect multiple features of the cigarette filter rod to be tested; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records;
[0024] Based on multiple screening strategies, target features are selected from the various features. The screening criteria for these strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample.
[0025] The selected target features are input into the trained quality detection model, which outputs a prediction result of the pressure drop stability of the cigarette filter rod to be tested.
[0026] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the following steps:
[0027] Collect multiple features of the cigarette filter rod to be tested; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records;
[0028] Based on multiple screening strategies, target features are selected from the various features. The screening criteria for these strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample.
[0029] The selected target features are input into the trained quality detection model, which outputs a prediction result of the pressure drop stability of the cigarette filter rod to be tested.
[0030] The aforementioned cigarette filter rod quality testing method, apparatus, computer equipment, storage medium, and computer program products, in the process of cigarette filter rod quality testing, first collect multiple features of the cigarette filter rod to be tested; these multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records; then, based on multiple screening strategies, target features are selected from these multiple features; the screening criteria for these multiple screening strategies include the mutual information between the feature and the cigarette filter rod to be tested, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature; the SHAP value is used to measure the contribution of the feature to a single prediction sample; finally, the selected target features are input into the trained quality testing model, and the predicted result of the pressure drop stability of the cigarette filter rod to be tested is output. Through the above process, multiple features of the cigarette filter rod to be tested are collected. Integrating at least two features such as process parameters, physical parameters, appearance images, and quality inspection text records can cover the entire production process information of the cigarette filter rod to be tested, avoiding prediction bias caused by the limitation of a single feature dimension, and providing rich data support for pressure drop stability testing. By combining the mutual information between features and filter rods, the degree of contribution to the prediction performance of the pre-trained model, and the SHAP value that measures the contribution of a single sample, highly correlated target features are accurately screened, improving detection efficiency while enhancing the accuracy and real-time performance of filter rod quality testing. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart illustrating a method for detecting the quality of cigarette filter rods in one embodiment;
[0033] Figure 2 This is a flowchart illustrating the quality inspection steps for cigarette filter rods in one embodiment;
[0034] Figure 3This is a flowchart illustrating a method for detecting the quality of cigarette filter rods in another embodiment;
[0035] Figure 4 This is a detailed flowchart of a cigarette filter rod quality testing method in one embodiment;
[0036] Figure 5 This is a structural block diagram of a cigarette filter rod quality detection device in one embodiment;
[0037] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0039] To address the technical problems of low accuracy and poor real-time performance in the quality detection of the aforementioned filter rods, in one embodiment, such as... Figure 1 As shown, a method for detecting the quality of cigarette filter rods is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0040] Step S102: Collect multiple features of the cigarette filter rod to be tested; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records.
[0041] The cigarette filter to be tested is a key component of cigarettes, generally used to filter harmful substances such as tar and nicotine from the smoke, while also affecting the smoking experience and the resistance to smoke flow. Collecting various characteristics of the cigarette filter can be achieved through sensors, visual inspection, and text recording, gathering multi-dimensional data related to the filter. Process parameters are key control variables in the production process, such as equipment parameters, image parameters, audio parameters, and filter length settings. Physical parameters are measured indicators of the cigarette filter, such as diameter, circumference, and weight. Appearance images are surface information of the cigarette filter acquired through machine vision, such as the presence of damage, impurities, and uneven color. Quality inspection text records are descriptions generated by manual or automated inspection.
[0042] Step S104: Select target features from multiple features based on multiple screening strategies. The screening criteria for multiple screening strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample.
[0043] Feature selection is based on predefined evaluation criteria, which removes redundant and low-relevance information from the collected multi-dimensional features and retains key features. SHAP (SHapley Additive exPlanations) is the evaluation basis for feature selection. Mutual information measures the degree of correlation between features and the pressure drop stability of the cigarette filter to be tested. The contribution of a feature to the prediction performance of the pre-trained model is determined by analyzing the changes in the prediction accuracy and error rate of the pre-trained model when the feature is present, thus judging the impact of the feature on the model performance. The SHAP value is used to quantify the contribution of each feature to the result of a single predicted sample.
[0044] Step S106: Input the selected target features into the trained quality detection model and output the predicted results of the pressure drop stability of the cigarette filter rod to be tested.
[0045] The target features are a set of key features that have been verified through a multi-dimensional screening strategy and have high relevance and contribution to the prediction of the pressure drop stability of the cigarette filter to be tested. The quality inspection model is a machine learning-trained model that learns the mapping relationship between the target features and the pressure drop stability to predict the pressure drop stability of the cigarette filter to be tested. Pressure drop stability is the degree of fluctuation of the pressure drop value of the cigarette filter to be tested within a set range when airflow passes through it under standard test conditions. The prediction result is the pressure drop stability result of the cigarette filter to be tested, output by the quality inspection model based on the target features.
[0046] In the above-mentioned cigarette filter rod quality inspection method, firstly, multiple features of the cigarette filter rod to be inspected are collected; these features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records; then, target features are selected from these features based on multiple screening strategies; the screening criteria for these strategies include the mutual information between the feature and the cigarette filter rod to be inspected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature; the SHAP value is used to measure the contribution of the feature to a single prediction sample; finally, the selected target features are input into the trained quality inspection model, and the predicted results of the pressure drop stability of the cigarette filter rod to be inspected are output. Through the above process, multiple features of the cigarette filter rod to be tested are collected. Integrating at least two features such as process parameters, physical parameters, appearance images, and quality inspection text records can cover the entire production process information of the cigarette filter rod to be tested, avoiding prediction bias caused by the limitation of a single feature dimension, and providing rich data support for pressure drop stability testing. By combining the mutual information between features and filter rods, the degree of contribution to the prediction performance of the pre-trained model, and the SHAP value that measures the contribution of a single sample, highly correlated target features are accurately screened, improving detection efficiency while enhancing the accuracy and real-time performance of filter rod quality testing.
[0047] In one exemplary embodiment, such as Figure 2 As shown, various characteristics of the cigarette filter rod to be tested are collected, including:
[0048] Step S202: Obtain the initial process parameters of the cigarette filter rod to be tested in the historical time period; Step S204: Extract time-series features from the initial process parameters through a sliding window of preset size and step size to obtain multiple time-series features; Step S206: Form process parameters from each time-series feature.
[0049] Among them, the initial process parameters are the core production parameters actually executed by the cigarette filter rod to be tested in the historical production stage; the historical time period is the specified past production cycle; the sliding window is a commonly used tool in time series data processing, referring to a fixed-length time interval; the step size is the interval at which the sliding window moves in the time series data; time series feature extraction is to extract features that reflect the data change pattern from the initial process parameters in the form of a time series; the process parameters are comprehensive parameters formed by integrating multiple time series features.
[0050] In this embodiment, the correlation and reference value of the data are ensured by acquiring the initial process parameters of historical time periods; based on the core parameters of actual production, the historical state of filter rod production can be truly reflected; the temporal feature extraction method with preset sliding window and step size accurately captures the temporal dimension pattern of the process parameters; by window truncation and step size control, data redundancy is avoided while the key features of the parameters are fully preserved; and by integrating multiple temporal features into the final process parameters, the detection accuracy of the cigarette filter rod to be tested is effectively improved.
[0051] In one embodiment, collecting multiple features of the cigarette filter rod to be tested further includes:
[0052] Based on the appearance image, the defect area, defect length, and defect distribution density of the cigarette filter rod to be inspected are extracted.
[0053] Among them, the appearance image can be an image of the cigarette filter rod surface taken by a vision acquisition device; the appearance image is used to fully present the morphology of the surface of the cigarette filter rod to be inspected and the possible defects; the defect area is the actual area of the appearance defect region of the cigarette filter rod to be inspected; the defect length is the extension distance of linear or elongated defects, such as cracks, scratches and other elongated defects; the defect distribution density is the number of defects per unit area or the proportion of defects covering the area; extraction can be the process of separating the defect region from the appearance image through image processing algorithms, and then calculating specific quantitative indicators such as defect area, length, and distribution density, thereby realizing the transformation from image to data.
[0054] In this embodiment, by extracting the defect area, defect length, and defect distribution density of the cigarette filter rod to be inspected from the appearance image, the quality judgment can be more accurate and reliable. Combined with the targeted feature extraction of defects of different shapes, various appearance problems on the surface of the cigarette filter rod to be inspected can be comprehensively captured, avoiding missed detections caused by a single detection dimension.
[0055] Furthermore, in one embodiment, collecting multiple features of the cigarette filter to be inspected also includes: extracting quality problem labels of the cigarette filter to be inspected based on quality inspection text records, and counting the frequency of defect reports within a preset time period.
[0056] Among them, the quality inspection text record is a textual document recorded manually or by the system during the production quality inspection process of the cigarette filter rod to be inspected; the quality problem label is a standardized label extracted from the quality inspection text record to identify the specific quality defect type of the filter rod; the preset time is a statistical time range set in advance according to the quality inspection needs, which can be flexibly adjusted; the defect report frequency is the number of quality inspection reports corresponding to a certain type of quality problem label within the preset time.
[0057] In this embodiment, a traceable quality data system is formed through tagging and frequency statistics. Combined with a preset time dimension, the time distribution pattern of defects can be clearly presented. Furthermore, tag extraction and frequency statistics can also improve the efficiency of quality data processing.
[0058] More specifically, in one embodiment, the selected target features are input into a trained quality detection model, which outputs a prediction of the pressure drop stability of the cigarette filter to be tested, including:
[0059] The target features corresponding to the cigarette filter to be tested are input into the trained quality detection model; multiple target features are weighted and fused to output the predicted results of the pressure drop stability of the cigarette filter to be tested.
[0060] Weighted fusion is a method of comprehensive calculation that assigns different weights to each target feature based on its influence on pressure drop stability. The prediction result is the evaluation conclusion on the pressure drop stability of the filter rod under test, which is output by the quality inspection model after weighted fusion of target features. The result can include qualified, unqualified, stable, unstable, etc.
[0061] In this embodiment, the limitations of a single feature can be avoided by combining weighted fusion, making the prediction results more reliable; after the quality inspection model inputs features, it can quickly output prediction results, reducing labor costs and inspection time, and improving production flow efficiency.
[0062] In one embodiment, such as Figure 3 As shown, before inputting the target features corresponding to the cigarette filter to be detected into the trained quality detection model, the following steps are also included:
[0063] Step S302: Input the target features into an ensemble model framework including XGBoost (eXtreme Gradient Boosting), LightGBM (Light Gradient Boosting Machine), and CatBoost (Categorical Boosting); Step S304: Based on the Bayesian optimization algorithm, search for the optimal hyperparameter combination in the target features in the hyperparameter space corresponding to the ensemble model framework; Step S306: Based on the optimal hyperparameter combination, train the ensemble model framework including XGBoost, LightGBM, and CatBoost to obtain the trained quality detection model.
[0064] Among them, the ensemble model framework is a modeling architecture that integrates multiple basic models; XGBoost is an ensemble learning algorithm based on gradient boosting decision trees, which builds a strong model by iteratively training weak classifiers and accumulating weights, and features high-dimensional data processing, strong anti-overfitting ability, and high training efficiency; LightGBM is an algorithm based on gradient boosting decision trees, which adopts histogram optimization and other designs, and features faster training speed, lower memory consumption, and efficient processing of large-scale data; CatBoost is a gradient boosting decision tree algorithm optimized for class features, which does not require manual encoding of class features and has the advantages of automatically handling missing values and good anti-overfitting effect; Bayesian optimization algorithm is a hyperparameter optimization method based on probabilistic models. By continuously learning the mapping relationship between hyperparameters and model performance, it intelligently searches for the optimal hyperparameter combination, finds a better solution with fewer iterations, and improves the efficiency of hyperparameter tuning.
[0065] More specifically, the hyperparameter space is the set of values for model hyperparameters, and different models have different types and values of hyperparameters; the optimal hyperparameter combination is the set of hyperparameter values that achieves the best performance of the ensemble model framework, obtained by searching in the hyperparameter space using the Bayesian optimization algorithm.
[0066] In this embodiment, by integrating three types of gradient boosting algorithms—XGBoost, LightGBM, and CatBoost—the prediction accuracy and stability can be improved, accurately capturing the correlation between the quality characteristics of the cigarette filter to be detected and the detection target. Furthermore, by employing a Bayesian optimization algorithm, the optimal hyperparameter combination can be found with fewer iterations, without traversing the entire hyperparameter space, thus avoiding resource waste.
[0067] More specifically, in one embodiment, the cigarette filter rod quality inspection method of this application can also be deployed in the quality monitoring system of the filter rod (cigarette filter rod to be inspected) production line, and its hardware architecture and data flow are as follows:
[0068] Physical sensors include a laser rangefinder (measuring filter rod length, model: KEYENCE IL-300), a photoelectric diameter sensor (measuring circumference, model: MICRO-EPSILON optoNCDT 1420), a high-precision electronic balance (measuring weight, model: Sartorius Quintix35), and a pressure sensor (measuring pressure drop, model: Siemens SITRANS P200).
[0069] Machine vision system: It uses a CCD industrial camera (model: Basler ace acA2440-75um) and a light source to detect surface defects, misalignment and other appearance abnormalities of the filter rod.
[0070] Equipment control system: Real-time acquisition of process parameters such as opening roller speed, forming machine speed, and fan speed from PLC (model: Siemens S7-1500) and MES system.
[0071] Database: The Oracle database stores historical production data and manual inspection records (entered in the form of text reports).
[0072] Execution vehicle: The algorithm runs on an industrial control computer (model: Advantech IPC-610H, configuration: Intel i7-9700K CPU, 32GB RAM) on the production line. The control computer interacts with sensors, PLCs and databases via industrial Ethernet.
[0073] Output and Application: The prediction results are transmitted in real time to the intelligent smoke machine terminal control platform for visual display, and an audible and visual alarm is triggered for abnormal situations exceeding the threshold (triggering the on-site alarm); at the same time, the prediction results and key feature contribution analysis are pushed to the data acquisition system to provide decision support for adjusting process parameters such as roller speed, and can also be connected to the control system to realize closed-loop feedback regulation.
[0074] The hardware configuration or model mentioned above is only an example. Other hardware that can achieve the same solution can also be used, which will not be elaborated here.
[0075] This application provides a method for testing the quality of cigarette filter rods. To better understand the process of the above-described method for testing the quality of cigarette filter rods, combined with... Figure 4 As shown below, the specific process of a quality testing method for cigarette filter rods according to this application is described in detail, including the following steps:
[0076] Step S402, Multi-source feature engineering.
[0077] Among them, the physical feature layer (mechanism-driven):
[0078] (1) Density characteristics: ; This is the weight of the filter rod (unit: g). It is the circumference of the filter rod (unit: mm). This is the length of the filter rod (unit: mm).
[0079] The above formula calculates the density of the filter rod using weight, circumference, and length, and is used to evaluate the uniformity and compaction of the filter rod material, which is a key physical indicator affecting pressure drop stability.
[0080] (2) Roller speed ratio interaction term: ;
[0081] in, These are the rotational speeds (unit: rpm) of different rollers (such as opening rollers and forming rollers). It is a very small constant (e.g., 1e-5) to prevent division by zero errors. It is the roller speed ratio, which reflects the speed coordination between the rollers. The speed difference is used to capture the dynamic differences between rollers; the interaction term is used to quantify the dynamic coupling effect between equipment operating parameters, which helps the model capture the nonlinear relationship between process parameters.
[0082] More importantly, the temporal feature layer (automatically extracted via TSFresh, dynamically evolving and modeled): sliding window statistics ( ):
[0083] ;
[0084] Where w is the window size (e.g., 5 time points). The step size is 1. It is the mean of the data within the window, reflecting short-term trends; The mean and standard deviation of the data within the window reflect volatility; by extracting the mean and standard deviation through a sliding window, the short-term dynamic changes of process parameters can be captured, enhancing the model's ability to identify time series patterns.
[0085] Furthermore, transform the feature layer (distribution correction): logarithmic transformation eliminates right skewness of voltage drop. .
[0086] in, This is the original pressure drop value of the filter rod (unit: Pa). This is the transformed pressure drop value (unit: Pa);
[0087] Pressure drop data are usually right-skewed. Logarithmic transformation can make them closer to a normal distribution, improving the stability of model training and prediction accuracy.
[0088] Therefore, step S402 constructs multi-dimensional features from three levels: physical mechanism, temporal dynamics, and distribution pattern, to comprehensively capture various factors affecting the quality of filter rods; and each feature has a clear physical or statistical meaning, further enhancing the interpretability of the model and making it easier for process personnel to understand and apply; at the same time, it also alleviates the problems of skewness, noise and non-stationarity in industrial data through numerical transformation and window statistics, thereby improving data quality.
[0089] Step S404, multimodal feature fitting.
[0090] The input to the Python algorithm pseudocode is the feature matrix. , Target vector Y, Feature number threshold k; Output: Optimal feature subset F*.
[0091] Mutual information filtering: calculation based on K-nearest neighbor estimation , retain > median Features Importance of XGBoost: Training the model Preserve the feature where gain weight > median. SHAP analysis: Calculate the average |, retaining the characteristics of the median Feature fusion: F_union= ∪ ∪ Dynamic adjustments include:
[0092] if|F_union|<10: Rank by mutual information and supplement to 10 dimensions;
[0093] if|F_union|>k: Based on overall score Filter the top-k features.
[0094] More pseudocode explanation: It is a feature and Mutual information between targets measures nonlinear correlation; ∪ ∪ It consists of feature subsets selected based on mutual information, XGBoost gain importance, and SHAP value, respectively; F_union is the union of the three to ensure multi-dimensional evaluation of feature importance; It involves weighted fusion of the three evaluation results to select the most representative feature.
[0095] Therefore, step S404 combines three methods—mutual information, tree model importance, and SHAP value—to evaluate features from different perspectives, avoiding omissions or misselections caused by a single method. The algorithm's adaptive dimensionality control can dynamically adjust the number of features, balancing computational efficiency and model performance. Multi-angle evaluation also enhances the robustness and representativeness of the feature set, thereby improving the model's generalization ability.
[0096] Step S406, Bayesian optimization of Stacking integration.
[0097] Gaussian process surrogate modeling is used to find the optimal combination of hyperparameters. To minimize model validation error (i.e., model performance, such as negative MAE): ,in, It is the hyperparameter space. Direct evaluation. The cost is extremely high (requiring the training and validation of complex models), therefore a proxy model needs to be built. To approximate And guide the search.
[0098] The prior of a Gaussian process is that a Gaussian process (GP) is a probability distribution defined on a function space. Its core idea is that the function... At any finite number of points { The set of function values on} } follows a multivariate Gaussian distribution, and a GP is determined by its mean function. Sum of covariance functions (kernel functions) Completely certain: , It is usually assumed to be a constant or zero. The similarity of function values is defined.
[0099] Furthermore, using the Matérn5 / 2 kernel to optimize hyperparameters can effectively handle slight variations in function values and is robust to noise.
[0100] ,
[0101] in, The Euclidean distance in parameter space. For length scale, Let be the signal variance. This kernel function assumes the objective function is twice differentiable. Compared to the commonly used radial basis function (RBF kernel), it is more robust to noise and can better handle slight abrupt changes in function values while remaining robust to noise. Based on the GP prior and observational data, and using Bayes' theorem, we can obtain the following for new points. function value The posterior predicted distribution: ,in: ; ; It is the covariance matrix The inverse matrix, ; This is a performance prediction value. To predict uncertainty.
[0102] This approach uses Expected Improvement (EI) to calculate a point. Compared to the current best observation =max( The expected increase that can be achieved: Under the posterior of GP, There is an analytical solution: Z= , and These are the CDF and PDF of the standard normal distribution. This is a small positive parameter used to control the exploration intensity. The next evaluation point is determined by maximizing the acquisition function. The objective function is the mean negative absolute error (MAE) of time series cross-validation (TS-CV) to ensure that the goal of hyperparameter optimization is to improve the model's generalization ability on time series data and strictly avoid future information leakage. ; , For model hyperparameters; For cross-validation folds, It is the training set. It is a validation set; This is the actual value. These are predicted values; the objective function integrates the model's... The introduction of TS-CV ensures the statistical validity and engineering practicality of the hyperparameter optimization process by demonstrating performance across different time windows, resulting in a more accurate and efficient final hyperparameter combination. It can adapt to the timing characteristics of data flow in a production environment.
[0103] Therefore, the algorithm flow and ensemble include initializing random observations; looping until convergence; updating the GP posterior distribution; and optimization. Select the next point Calculate the true performance using time series cross-validation. Add new data to the observation set and output the historical best solution. .
[0104] As an example, the parameter search strategy is shown in Table 1:
[0105] Table 1
[0106]
[0107] Time series cross-validation: Python algorithm code
[0108] from sklearn.model_selection import TimeSeriesSplit
[0109] tscv=TimeSeriesSplit(n_splits=3, test_size=1000)
[0110] for train_idx, test_idx in tscv.split(X):
[0111] #Training set: t0~t-1000
[0112] #Validation set: t-1000~t
[0113] Therefore, step S406 efficiently searches for the optimal hyperparameter combination through Bayesian optimization, avoiding the blindness of manual parameter tuning; the time series cross-validation method also respects the temporal nature of the data, prevents future information leakage, and improves the model's generalization ability; in addition, the integration of multiple models (XGBoost, LightGBM, CatBoost) forms a certain complementary effect, which helps to improve the overall prediction stability.
[0114] Step S408, Residual Enhancement Architecture.
[0115] The steps mentioned above include: stacking the ensemble model to predict the value y_base, calculating the residual y_rse = y_true - y_base, training the residual correction model to predict y_rse, and finally predicting y_final = y_base + y_rse.
[0116] Specifically, the dual-training mechanism is a two-stage training mechanism: the first stage (pre-training stage) includes: 1) using the base model (Stacking ensemble) to predict the training set and obtain y_base; 2) calculating the residual r_train on the training set = y_true - y_base; 3) using the original features as input and the residual r_train as the new target value, training a LightGBM model using Huber loss.
[0117] Loss function: The Huber loss function is a combination of mean squared error (MSE) and mean absolute error (MAE). The Huber loss is insensitive to outliers. In this stage, it ensures that the initial residual correction model will not deviate from normal values due to noise or extreme residuals in the training data, resulting in a robust base model. The model obtained at this point is denoted as M_res.
[0118] The second stage (fine-tuning stage) includes: 1) freezing the parameters of the base model and the M_res model obtained in the first stage; 2) adding y_base and the y_res predicted by M_res to obtain the final prediction y_final_stage1=y_base+y_res in the first stage; 3) calculating the error at this time; and using quantile loss (e.g., q=0.9) as the objective function to perform a second round of fine-tuning training on the M_res model.
[0119] Loss function: Quantile loss quantile loss ( It penalizes underestimation errors (i.e., the actual value is much higher than the predicted value), which makes the model particularly focused on correcting those points where the base model predicts too low (in this scenario, these may be the anomalies of the high pressure drop), which is equivalent to performing targeted optimization on the correction model to make it perform better in key areas.
[0120] More importantly, during the training of the LightGBM residual correction model, the model may "overfit" to the residuals on the training set. Once overfitted, the predicted y_res becomes unreliable, and adding it to y_base will actually reduce the final accuracy. Therefore, it is necessary to add elastic network regularization as a regularization term after the loss function. Elastic network regularization is a linear combination of L1 (Lasso) regularization and L2 (Ridge) regularization.
[0121] Elastic network regularization term ; ;
[0122] in, Hyperparameters that control the overall severity of punishment. Control the mixing ratio between L1 and L2.
[0123] L1 regularization adds a penalty term to the original loss function, which is the sum of the absolute values of the model weight coefficients. It tends to produce a sparse weight matrix, compressing the weights of some unimportant features to zero. Therefore, L1 has some feature selection capability. L2 regularization adds a penalty term to the original loss function, which is the sum of the squares of the model weight coefficients. Its effect is to uniformly reduce the weights, but generally not to reduce them to zero, ensuring the model considers all features while reducing dependency, thus making the model smoother and more robust to interference. Using the residual correction model after two-stage training, it participates in the calculation of y_final = y_base + y_res, thereby obtaining high-precision predictions with error compensation.
[0124] Therefore, step S408 further corrects the prediction error of the ensemble model through residual learning, forming a compensation mechanism and improving the model's prediction accuracy; Huber loss and quantile loss make the model more resilient to outliers and enhance its robustness.
[0125] In the above embodiments, a dynamic quantile threshold algorithm is used: an improved IQR method is employed, using 5% or 95% quantiles to construct adaptive boundaries, thereby enhancing the robustness of skewed data; a ternary coupled feature evaluation mechanism is used: mutual information (nonlinear dependence), XGBoost gain importance (feature contribution), and SHAP value (marginal effect) are fused to quantify the dynamic contribution of process parameters (e.g., the contribution rate of the coefficient of variation of the opening roll speed is 34.2%, 95% CI: 31.5%-37.1%); and a residual enhancement stacking architecture is used: a base model layer (XGBoost / LightGBM / CatBoost). After Bayesian optimization, the LightGBM residual correction module compensates for prediction errors, reducing MAE by 5% and solving the problem of excessive pressure drop fluctuations and unstable quality of filter rods caused by poor speed coordination among multiple devices such as the opening roller and forming machine. It also overcomes the problems of high misjudgment rate and failure of anomaly detection caused by abnormal sensor data, manual recording deviation, and inherent skewed data distribution. Furthermore, it establishes an evaluation system that can quantify the contribution of multi-dimensional features (including statistical confidence intervals), providing a reliable basis for process parameter optimization. Finally, it improves the real-time performance of the prediction model to meet the rapid response requirements of online quality control on the production line (target response time < 50 ms), replacing the lagging manual sampling inspection.
[0126] More specifically, in one exemplary embodiment, model training and parameter configuration; data sourcing and preprocessing: data preprocessing includes: filling missing values (<0.5%) using linear interpolation, and smoothing and denoising the raw sensor data using a median filter (window size 3). Optimal parameters of the base model (see Table 2):
[0127] Table 2
[0128]
[0129] Furthermore, in one embodiment, to verify the effectiveness of each module of this technical solution, ablation experiments and comparative experiments were set up. All comparative experiments were conducted under the same dataset and preprocessing procedures to ensure fairness. Comparative Analysis (LSTM): Using the same features as input, a two-layer LSTM network (64 hidden units) was constructed and trained for 50 epochs using the Adam optimizer (learning rate 0.001). Temporal Feature Removal: Only the original instantaneous value features were used; sliding window statistics and temporal feature extraction were not performed. Feature Selection Removal: The ternary coupled feature selection mechanism of this solution was not used; instead, all original features and derived features were used for training. Residual Learning Removal: Only the Bayesian-optimized Stacking ensemble model was used; no residual correction module was introduced. The performance comparison is shown in Table 3 below:
[0130] Table 3
[0131]
[0132] More specifically, in one embodiment, process optimization is applied to visualization analysis: control ranges of key process parameters are extracted based on SHAP value analysis; optimal weight window: 0.747-0.751g (low pressure drop and high feature contribution); roll speed ratio V2 / V1∈[0.82, 1.16].
[0133] Through the above embodiments, the following improvements were achieved: prediction accuracy was improved: R² reached 0.8902, an improvement of 11.8% compared to the LSTM benchmark; anomaly detection was enhanced: F1 value was 0.917, and the false detection rate was reduced to 4.7%; real-time performance was guaranteed: the average response time was 45 ms, meeting the online monitoring requirements of the production line; and process optimization was supported: the contribution of quantitative parameters (such as the contribution rate of the coefficient of variation of the opening roller speed was 34.2%).
[0134] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0135] Based on the same inventive concept, this application also provides a cigarette filter rod quality testing device for implementing the cigarette filter rod quality testing method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the cigarette filter rod quality testing device provided below can be found in the limitations of the cigarette filter rod quality testing method described above, and will not be repeated here.
[0136] In one exemplary embodiment, such as Figure 5 As shown, a cigarette filter rod quality testing device is provided, including: a feature acquisition module 501, a feature filtering module 502, and a result output module 503, wherein:
[0137] The feature acquisition module 501 is used to acquire multiple features of the cigarette filter rod to be inspected; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records.
[0138] The feature selection module 502 is used to select target features from multiple features based on multiple selection strategies. The selection criteria for multiple selection strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample.
[0139] The result output module 503 is used to input the selected target features into the trained quality detection model and output the prediction results of the pressure drop stability of the cigarette filter rod to be tested.
[0140] Furthermore, in one embodiment, the feature acquisition module 501 is also used to acquire the initial process parameters of the cigarette filter rod to be detected in a historical time period; extract time-series features from the initial process parameters through a sliding window of a preset size and a step size to obtain multiple time-series features; and form process parameters from each time-series feature.
[0141] Furthermore, in one embodiment, the feature acquisition module 501 is also used to extract the defect area, defect length and defect distribution density of the cigarette filter rod to be detected based on the appearance image.
[0142] Furthermore, in one embodiment, the feature acquisition module 501 is also used to extract quality problem labels of the cigarette filter rod to be inspected based on the quality inspection text record, and to count the frequency of defect reports within a preset time period.
[0143] Furthermore, in one embodiment, the result output module 503 is also used to input the target features corresponding to the cigarette filter rod to be tested into the trained quality detection model; to perform weighted fusion of multiple target features, and to output the prediction result of the pressure drop stability of the cigarette filter rod to be tested.
[0144] Furthermore, in one embodiment, the feature selection module 502 is also used to input the target features into an ensemble model framework including XGBoost, LightGBM, and CatBoost; search for the optimal hyperparameter combination in the target features in the hyperparameter space corresponding to the ensemble model framework based on the Bayesian optimization algorithm; and train the ensemble model framework including XGBoost, LightGBM, and CatBoost based on the optimal hyperparameter combination to obtain a trained quality detection model.
[0145] Each module in the aforementioned cigarette filter rod quality testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0146] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores cigarette filter rod quality testing data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network. When the computer program is executed by the processor, it implements a cigarette filter rod quality testing method.
[0147] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0148] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0149] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0150] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0151] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0152] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0153] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0154] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for quality testing of cigarette filter rods, characterized in that, The method includes: Collect multiple features of the cigarette filter rod to be tested; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records; Based on multiple screening strategies, target features are selected from the various features. The screening criteria for these strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single predicted sample. The selected target features are input into the trained quality detection model, which outputs a prediction result of the pressure drop stability of the cigarette filter rod to be tested.
2. The method according to claim 1, characterized in that, The collection of multiple characteristics of the cigarette filter rod to be tested includes: Obtain the initial process parameters of the cigarette filter rod to be tested during a historical time period; By using a sliding window of a preset size and a step size, the initial process parameters are subjected to time-series feature extraction to obtain multiple time-series features; The process parameters are formed by taking various timing characteristics.
3. The method according to claim 1, characterized in that, The collection of multiple features of the cigarette filter rod to be tested also includes: Based on the appearance image, the defect area, defect length, and defect distribution density of the cigarette filter rod to be inspected are extracted.
4. The method according to claim 1, characterized in that, The collection of multiple features of the cigarette filter rod to be tested also includes: Based on the quality inspection text record, extract the quality problem labels of the cigarette filter rod to be inspected, and count the frequency of defect reports within a preset time period.
5. The method according to claim 1, characterized in that, The step of inputting the selected target features into the trained quality detection model and outputting a prediction result of the pressure drop stability of the cigarette filter rod to be tested includes: Input the target features corresponding to the cigarette filter rod to be detected into the trained quality detection model; The multiple target features are weighted and fused to output a prediction result of the pressure drop stability of the cigarette filter rod to be tested.
6. The method according to claim 1, characterized in that, Before inputting the target features corresponding to the cigarette filter to be detected into the trained quality detection model, the method further includes: The target features are input into an integrated model framework including XGBoost, LightGBM, and CatBoost; Based on the Bayesian optimization algorithm, the optimal combination of hyperparameters in the target features is searched in the hyperparameter space corresponding to the integrated model framework. Based on the optimal hyperparameter combination, the integrated model framework including XGBoost, LightGBM and CatBoost is trained to obtain the trained quality detection model.
7. A cigarette filter rod quality testing device, characterized in that, The device includes: The feature acquisition module is used to acquire multiple features of the cigarette filter rod to be inspected; the multiple features include at least two of the following: process parameters, physical parameters, appearance images, and quality inspection text records; The feature selection module is used to select target features from a variety of features based on multiple selection strategies. The selection criteria for the multiple selection strategies include the mutual information between the feature and the cigarette filter to be detected, the contribution of the feature to the prediction performance of the pre-trained model, and the SHAP value of the feature. The SHAP value is used to measure the contribution of the feature to a single prediction sample. The result output module is used to input the selected target features into the trained quality detection model and output the prediction result of the pressure drop stability of the cigarette filter rod to be tested.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.