Stem-containing cigarette detection method and device, electronic device and storage medium
By collecting density data from multiple points in cigarettes, calculating quartiles and ranges, and identifying and statistically analyzing cigarettes containing stems, the problem of inaccurate stem control in existing technologies is solved, improving cigarette quality and real-time detection.
Patent Information
- Application Number
- CN202511284885.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2025-11-25
AI Technical Summary
Existing technologies struggle to effectively control the stems in cigarettes, leading to unstable cigarette quality and smoking defects. Furthermore, online detection methods are susceptible to fluctuations in density distribution, making it difficult to optimize stem control parameters.
By collecting single-point density data from multiple sampling points of cigarettes, calculating quartiles and quartile ranges, determining outlier limits, identifying and statistically analyzing cigarettes containing stems, and optimizing stem control parameters.
It enables precise detection and control of cigarette stem marks, improves the stability of cigarette quality, reduces smoking defects, and enhances the real-time performance and accuracy of detection.
Smart Images

Figure CN121007804A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cigarette manufacturing process quality control, and in particular to methods, apparatus, electronic devices, and storage media for detecting cigarettes containing stems. Background Technology
[0002] During the cigarette rolling process, the cigarette rolling machine performs air separation on the raw tobacco, removing stems by utilizing the fact that the density of stems is greater than that of tobacco shreds. However, due to the limited air separation capacity of the equipment and factors such as stems being connected to or entangled with tobacco shreds, it is impossible to ensure that all stems are completely removed during the air separation process, nor is it possible to completely avoid accidentally removing tobacco shreds while removing stems. The presence of stems in cigarettes can cause cigarette punctures, abnormal fluctuations in cigarette weight and draw resistance, and may also cause defects such as cigarette popping or flameout during smoking. Therefore, during the manufacturing process, it is necessary to remove stems as much as possible to reduce the proportion of cigarettes containing stems.
[0003] Currently, methods such as image recognition, offline scanning, and online microwave detection data can be used to screen cigarettes containing stems. While image recognition and offline scanning offer high detection accuracy, they are limited by sampling efficiency and latency, making it difficult to achieve real-time feedback and closed-loop control during the production process. Online microwave detection data methods are susceptible to design differences in density distribution and fluctuations in the center position of the density distribution during production, making it difficult to optimize stem control parameters.
[0004] There is currently no effective solution to the problem of optimizing the control parameters of the tag in related technologies. Summary of the Invention
[0005] This embodiment provides a method, apparatus, electronic device, and storage medium for detecting cigarettes containing stem tags, in order to solve the problem of difficulty in optimizing stem tag control parameters in related technologies.
[0006] Firstly, this embodiment provides a method for detecting cigarette sticks containing stems, the method comprising:
[0007] Collect single-point density data from multiple collection points for each cigarette;
[0008] For each of the collection points, the density data of the single point is statistically analyzed across cigarettes, and a density dataset is generated for each collection point.
[0009] Based on each density dataset, calculate the quartiles and quartile ranges respectively, and determine the outlier limits according to the quartiles and quartile ranges. Identify the collection points whose single-point density data exceeds the outlier limits as outliers.
[0010] Cigarettes exhibiting the aforementioned anomalies are identified as cigarettes containing stems.
[0011] After removing duplicates from multiple abnormal points in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags.
[0012] In some embodiments, the collection of single-point density data from multiple collection points for each cigarette includes:
[0013] The single-point density data of each cigarette is collected from multiple collection points of the microwave detector output by the cigarette machine.
[0014] In some of these embodiments, the collection points are evenly distributed sequentially from the lit end of the cigarette to the filter end, and each collection point is assigned a collection point number.
[0015] In some embodiments, for each of the collection points, the single-point density data is statistically analyzed across cigarette branches to generate a density dataset corresponding to each collection point, including:
[0016] The single-point density data is constructed into a data matrix, wherein: the rows of the data matrix represent the collection point number; the columns represent different cigarette numbers; the matrix element values are the single-point density data corresponding to the collection point; and all the single-point density data in each row of the data matrix constitute a density dataset corresponding to the collection point.
[0017] In some embodiments, the step of calculating quartiles and quartile ranges based on each of the density datasets, determining outlier limits based on the quartiles and quartile ranges, and identifying collection points whose single-point density data exceeds the outlier limits as outliers includes:
[0018] The first quartile and the third quartile are calculated based on the density dataset, and the difference between the third quartile and the first quartile is taken as the quartile range.
[0019] Outlier limits are determined based on the first quartile, the third quartile, and the quartile range.
[0020] In some embodiments, determining outlier limits based on the first quartile, the third quartile, and the quartile range includes:
[0021] The product of the third quartile and the quartile range with an empirical coefficient is used as the upper limit of the outlier limit.
[0022] The lower limit of the outlier boundary is obtained by subtracting the product of the quartile range and the empirical coefficient from the first quartile.
[0023] In some embodiments, after removing duplicates from multiple abnormal points in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags, including:
[0024] Iterate through each cigarette and determine if there are any abnormalities.
[0025] If the cigarette has any one or more of the abnormal points, then the cigarette is determined to be a cigarette with a stem tag, and a count of cigarettes with stem tags is performed.
[0026] The total number of cigarettes containing stems is obtained by counting all cigarettes with stems.
[0027] Secondly, this embodiment provides a device for detecting cigarette sticks containing stems, the device comprising: an acquisition module, a processing module, and a result module; wherein:
[0028] The acquisition module is used to collect single-point density data from multiple collection points for each cigarette; for each collection point, the single-point density data is statistically analyzed across cigarettes, and a density dataset is generated for each collection point.
[0029] The processing module is used to calculate the quartiles and quartile ranges based on each of the density datasets, and to determine the outlier limit based on the quartiles and the quartile ranges, and to identify the collection points whose single-point density data exceed the outlier limit as outliers.
[0030] The result module is used to identify cigarettes with the abnormal points as cigarettes containing stem tags; after deduplicating multiple abnormal points in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags.
[0031] Thirdly, this embodiment provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the method for detecting cigarettes containing stems as described in the first aspect.
[0032] Fourthly, this embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for detecting cigarette sticks containing stems as described in the first aspect.
[0033] Compared with related technologies, this embodiment provides a method, apparatus, electronic device, and storage medium for detecting cigarettes with stem tags. In this method, firstly, single-point density data from multiple collection points are collected for each cigarette; secondly, for each collection point, single-point density data is statistically analyzed across cigarettes, generating a density dataset for each collection point; subsequently, quartiles and quartile ranges are calculated based on each density dataset, and outlier limits are determined according to the quartiles and quartile ranges, identifying collection points whose single-point density data exceeds the outlier limits as outliers; further, cigarettes with outliers are identified as cigarettes containing stem tags; finally, after deduplication of multiple outliers in the same cigarette, the total number of cigarettes containing stem tags is calculated and divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags. It converts differentiated detection data into outlier data through logical operations to determine the number of cigarettes containing stem tags, and performs adaptive outlier detection based on the statistical characteristics of the collection points themselves, thereby optimizing the stem tag control parameters.
[0034] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0035] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0036] Figure 1 This is a hardware structure block diagram of an industrial computer terminal for the cigarette stick detection method containing stems according to an embodiment of this application;
[0037] Figure 2 This is a flowchart of a method for detecting cigarette sticks containing stems according to one embodiment of this application;
[0038] Figure 3 This is a statistical diagram of cigarettes grouped in different tracks according to one embodiment of this application;
[0039] Figure 4 This is a flowchart of a method for detecting cigarette sticks containing stems according to one embodiment of this application;
[0040] Figure 5 This is a structural block diagram of a cigarette detection device containing a stem tag, according to one embodiment of this application. Detailed Implementation
[0041] To better understand the purpose, technical solution, and advantages of this application, the application is described and explained below in conjunction with the accompanying drawings and embodiments.
[0042] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by a person skilled in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, or B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific order of objects.
[0043] The method embodiments provided in this example can be executed in an industrial computer terminal, a computer, or a similar electronic device with a certain computing power. For example, it can run on an industrial computer terminal. Figure 1 This is a hardware structure block diagram of the industrial computer terminal for the cigarette detection method containing stem tags in this embodiment. (See diagram for details.) Figure 1 As shown, an industrial computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The aforementioned industrial computer terminal may also include a transmission device 106 for communicating with the microwave detector of the cigarette machine and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the industrial computer terminal described above. For example, the industrial computer terminal may also include components that are more advanced than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.
[0044] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the cigarette stick detection method with stems in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to an industrial computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0045] The transmission device 106 is used to receive or send data via a network. This network includes wireless networks provided by the communication vendor of the industrial computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module for wireless communication with the Internet.
[0046] This embodiment provides a method for detecting cigarette sticks containing stems. Figure 2 This is a flowchart of the method for detecting cigarette sticks containing stems in this embodiment, as shown below. Figure 2 As shown, the process includes the following steps:
[0047] Step S210: Collect single-point density data from multiple collection points for each cigarette.
[0048] To eliminate systematic differences between cigarettes from different sources, cigarettes can be grouped according to their rolling and assembly processes before collection. Specifically, for single-channel cigarette rolling machines, the rolling process uses a single track, while the assembly process is divided into front and rear rows, separating the cigarettes into front and rear rows. For dual-channel cigarette rolling machines, the rolling process uses two tracks, and the assembly process on each track is also divided into front and rear rows. Based on this, the cigarettes are divided into four groups: front track front row cigarettes, front track rear row cigarettes, rear track front row cigarettes, and rear track rear row cigarettes. This grouping strategy allows for independent statistical analysis of the density data for each group.
[0049] Using a microwave detector from a cigarette rolling machine, each cigarette within each group is tested to obtain single-point density data at multiple fixed collection points evenly distributed along the cigarette's axis. This single-point density data reflects the packing density of the cigarette at that specific location, providing a data foundation for subsequent anomaly identification based on statistical analysis.
[0050] Step S220: For each collection point, statistically analyze the single-point density data across cigarettes, and generate a density dataset corresponding to each collection point.
[0051] A separate data matrix is constructed for each fixed collection point. This data matrix consists of single-point density data of continuously produced cigarettes at that fixed collection point. The row dimension of the data matrix corresponds to the collection point, and each row index corresponds to a specific physical detection location. The column dimension of the data matrix represents the cigarette production sequence, and each column index corresponds to the detection data of one cigarette. The matrix elements (i.e., each cell) store the single-point density data measured on the corresponding cigarette at a specific collection point. The density dataset corresponding to each collection point consists of the single-point density observation values of all columns in that row, forming a complete density data sequence for that detection location. For example, if there are m cigarettes in the statistical period, and each cigarette is detected at M collection points, a joint data matrix of size M×m will be generated.
[0052] Step S230: Calculate the quartiles and quartile ranges for each density dataset, and determine the outlier limits based on the quartiles and quartile ranges. Identify the collection points whose single-point density data exceeds the outlier limits as outliers.
[0053] This method employs the N+1 method (where N is the sample size of the dataset) to calculate the quartiles of the density distribution at each sampling point. Specifically, based on the density dataset of that sampling point, its first quartile (Q1) and third quartile (Q3) are calculated. The position of the quartile in the sorted dataset is then calculated using the N+1 method formula. This method can more effectively handle quartile calculations for small to medium-sized sample datasets.
[0054] Subsequently, subtracting Q1 from Q3 yields the interquartile range (IQR). The interquartile range reflects the dispersion of the middle 50% of the data, is insensitive to outliers, and has stable performance. After obtaining Q1, Q3, and IQR, outlier thresholds are determined. Outlier thresholds are obtained by multiplying an empirical coefficient by IQR, and then adding or subtracting it from either Q1 or Q3.
[0055] Step S240: Identify cigarettes with abnormal points as cigarettes containing stems.
[0056] The significant density difference between stems and tobacco leaves is a key factor. The dense, lignified structure of tobacco stems (main veins or lateral veins) results in a much higher density than the looser tobacco leaves. While abnormally high and low density values are theoretically consistent, stems can cause localized, significant high-density anomalies. When a cigarette machine's microwave detector scans a cigarette, the microwave signal attenuation characteristics at the stem location differ significantly from the surrounding tobacco area, resulting in a sudden high-density anomaly in the density data. Therefore, a density anomaly statistically determined to be outside the normal fluctuation range has a very high probability of physically corresponding to a stem impurity, thus identifying cigarettes with anomalies as containing stems.
[0057] Step S250: After removing duplicates from multiple abnormal points in the same cigarette, calculate the total number of cigarettes containing stems and divide it by the total number of cigarettes to obtain the proportion of cigarettes containing stems.
[0058] This system achieves the statistical analysis of cigarettes containing stem tags by executing an efficient "traversal-judgment-counting" process. First, each cigarette is traversed, and it is determined whether there is at least one point density data exceeding the outlier limit across all its sampling points. Once any one or more outliers are found in a cigarette, it is determined to contain a stem tag. Regardless of whether a single cigarette contains one or more outliers, only one count is performed, effectively avoiding duplicate counting. Finally, all counts are accumulated to obtain the total number of cigarettes containing stem tags. Dividing the total number of cigarettes containing stem tags by the total number of cigarettes detected yields the percentage of cigarettes containing stem tags.
[0059] In related technologies, microwave detection for cigarette density analysis is affected by design differences in the density distribution of the product itself and dynamic fluctuations in the density distribution center position during production. Different brands and specifications of cigarette products have their own preset density curve designs, which means that a uniform and fixed detection threshold is difficult to universally and accurately identify stem abnormalities in all products. More importantly, during the production process, due to factors such as fluctuations in the physical properties of the tobacco raw materials, mechanical vibration of equipment, and fine-tuning of process parameters, the average density (i.e., the density distribution center) of the entire batch of cigarettes will slowly drift or suddenly change. This overall density fluctuation will drown out the weak local abnormal signals caused by stems, leading to a large number of false alarms or missed detections in the system. If only a simple threshold comparison method is used, the system cannot effectively distinguish this global background fluctuation from the real local stem defects. Therefore, most existing technologies can only achieve rough screening and rejection of abnormal cigarettes and cannot optimize the stem control parameters.
[0060] Steps S210 to S250 above involve: first, collecting single-point density data from multiple collection points for each cigarette; second, for each collection point, statistically analyzing single-point density data across cigarettes to generate a density dataset for each collection point; subsequently, calculating the quartiles and quartile ranges for each density dataset, and determining outlier limits based on the quartiles and quartile ranges, identifying collection points whose single-point density data exceeds the outlier limits as outliers; further, identifying cigarettes with outliers as containing stem tags; finally, after deduplicating multiple outliers within the same cigarette, calculating the total number of cigarettes containing stem tags divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags. This method uses logical operations to convert differential detection data into outlier data to determine the number of cigarettes containing stem tags, and adaptive outlier detection based on the statistical characteristics of the collection points themselves, thereby optimizing the stem tag control parameters.
[0061] In one specific embodiment, the acquisition of single-point density data from multiple collection points for each cigarette includes: acquiring single-point density data from multiple collection points for each cigarette output by the microwave detector of the cigarette rolling machine.
[0062] The microwave detector in the cigarette rolling machine outputs single-point density data from the cigarette sampling points. For example, setting the number of sampling points to 32 allows for precise location of most stem and density defects in a standard cigarette, effectively identifying which part of the cigarette has a problem and helping to determine the direction for adjusting the cigarette rolling process. It's also worth noting that matching the number of sampling points with the position of the grooves in the tobacco trimming disc ensures that each sampling point corresponds to a specific process location, allowing the test results to be directly fed back to equipment adjustments.
[0063] In one specific embodiment, the collection points are evenly distributed sequentially from the lit end of the cigarette to the filter end, and each collection point is assigned a collection point number. Specifically, the collection points are evenly distributed sequentially along the axial direction of the cigarette, from the head (lit end) to the tail (filter end). This means that all collection points are located within the tobacco section of the cigarette, and the physical distance between adjacent collection points is equal. Each collection point is assigned a unique collection point number, for example, sequentially numbered d1, d2, d3, ..., d32. The number d1 corresponds to the starting position of the lit end of the cigarette, while the point with the highest number (such as d32) is closest to the filter end. This one-to-one numbering rule ensures that collection points with the same number across different cigarettes necessarily correspond to the same physical location on the cigarette, laying a foundation for comparability in subsequent cross-cigarette statistical analysis.
[0064] In one specific embodiment, for each collection point, single-point density data is statistically analyzed across cigarette branches, generating a density dataset corresponding to each collection point, including:
[0065] The single-point density data are constructed into a data matrix, where: the rows of the data matrix represent the collection point number; the columns represent the different cigarette numbers; the matrix element values are the single-point density data of the corresponding collection point; and all the single-point density data in each row of the data matrix form a density dataset corresponding to a collection point.
[0066] For example, if the number of cigarettes produced within a statistical period is n, and the number of collection points is set to 32, then 32 density datasets will be generated. The density dataset corresponding to the k-th collection point (k=1, 2, ..., 32) can be represented as: D k ={D {k,1} D {k,2} D {k,n}}, where D k Let D represent the density dataset of the k-th point. {k,i} This represents the point density data of the i-th cigarette at the k-th sampling point.
[0067] In one specific embodiment, quartiles and quartile ranges are calculated for each density dataset, and outlier limits are determined based on the quartiles and quartile ranges. Data collection points whose density exceeds the outlier limits are identified as outliers, including:
[0068] The first and third quartiles are calculated based on the density dataset. The difference between the third and first quartiles is taken as the quartile range. Outlier limits are determined based on the first, third, and quartile ranges.
[0069] The N+1 method is used to calculate the quartiles and interquartile range of the density distribution at each sampling point. Specifically, the formula for the N+1 method is: position = (n+1) × p / 4, where n represents the total number of samples in the current dataset (i.e., the number of cigarettes), and p is a parameter. Substituting p=1 into the formula to calculate Q1 yields Q1 position = (n+1) × 1 / 4, and substituting p=3 into the formula to calculate Q3 yields Q3 position = (n+1) × 3 / 4. After obtaining the specific values of Q1 and Q3, the interquartile range is calculated using the formula: IQR = Q3 - Q1.
[0070] In one specific embodiment, determining outlier limits based on the first quartile, the third quartile, and the quartile range includes:
[0071] The upper limit of the outlier limit is obtained by adding the product of the quartile range and an empirical coefficient to the third quartile; the lower limit of the outlier limit is obtained by subtracting the product of the quartile range and the empirical coefficient from the first quartile.
[0072] After obtaining Q1, Q3, and IQR, outlier thresholds are set accordingly. These thresholds are derived by multiplying an empirical coefficient (k) by IQR and then adding or subtracting from Q1 or Q3. Specifically, the upper limit of the outlier threshold is set to Q3 + k × IQR, and the lower limit is set to Q1 - k × IQR. k is a preset multiplier used to control the leniency of the outlier thresholds; its value directly affects the sensitivity and specificity of outlier detection. For example, k is set to 1.5. This value is a standard statistical convention, based on the normal distribution assumption, and can effectively identify mild outliers far from the main data set, helping to avoid missed detections and reduce false positives. Data points with a density higher than the upper limit are considered high outliers, while those with a density lower than the lower limit are considered low outliers. In particular, by counting the number of data points exceeding the outlier thresholds at each collection point, the number of high and low outliers can be obtained. By calculating the difference between the number of high and low outliers, a difference array can be generated to characterize the degree of influence of the outlier on each collection point.
[0073] In one specific embodiment, after deduplicating multiple outliers in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags, including:
[0074] Iterate through each cigarette and determine if there are any anomalies. If a cigarette has one or more anomalies, it is determined to be a cigarette with a stem tag, and a count of cigarettes with stem tags is performed. The total number of cigarettes with stem tags is obtained by summarizing the counts of all cigarettes with stem tags.
[0075] For each cigarette, the system checks the point density data of all its collection points (e.g., 32) to determine if at least one collection point is marked as abnormal. The core judgment rule is designed as follows: if a cigarette has an abnormal point on any one or more collection points, the entire cigarette is immediately judged as containing a stem tag. The number of cigarettes containing stem tags is counted, and the total number divided by the total number of cigarettes gives the percentage of cigarettes containing stem tags. For example, based on the ZJ116B cigarette-making unit, producing cigarettes with a specification of (30mm filter + 54mm cigarette) × 17mm circumference, with a statistical period of approximately 10 minutes, the number of cigarettes containing stem tags within the statistical period is 6131, and the total number of cigarettes is 107123. Through calculation, we can obtain the percentage of cigarettes containing stem tags (…). The percentage is approximately 5.72%. The total number of cigarettes in each group, the number of cigarettes containing stems, and the percentage of cigarettes containing stems in each group are as follows: Figure 3 As shown.
[0076] In one specific embodiment, to verify the accuracy of the proportion of cigarettes containing stems calculated by the method of the present invention, we conducted sampling verification and statistical analysis. First, based on the obtained proportion of cigarettes containing stems, the sample size was selected according to the sample size calculation formula, where the sample size calculation formula is:
[0077] ;
[0078] in In statistics, a standard score is a score corresponding to a confidence level and is used to measure the significance of a result (e.g., For a 90% confidence level It is 1.645. For a 95% confidence level (1.96) This represents the percentage of cigarettes containing stem tags, and E is the maximum allowable error range. A random sample of cigarettes is drawn, and professional inspectors dissect and examine each cigarette in this sample to determine the actual number of cigarettes containing stem tags. Dividing the actual number of cigarettes containing stem tags by the sample size gives the manually measured percentage of cigarettes containing stem tags. For example, when the percentage of cigarettes containing stem tags is 5.72%,... Using 1.96 as the 95% confidence level and setting E to ±1%, the sample size is approximately 2100. Professional inspectors dissected and examined each of the 2100 samples, recording that 114 cigarettes actually contained stems. Based on this, the proportion of manually measured cigarettes containing stems was calculated. It is approximately 5.43%.
[0079] To quantify the proportion of cigarettes containing stems The ratio of cigarettes containing stems as measured manually To ensure consistency, we conducted a single-sample proportion Z-test. First, we established the statistical hypothesis: the null hypothesis (H0) indicates that the algorithm is accurate, i.e., the actual percentage of cigarettes containing the smudges is true. This is equal to the percentage of cigarettes with tags calculated by this method. Alternative hypothesis (H1): indicates that the prediction is inaccurate, i.e., the actual percentage of cigarettes with tags is not accurate. This is not equal to the percentage of cigarettes with tags calculated by this method. Subsequently, the formula for calculating the test statistic, the Z-test for the single-sample proportion, is as follows:
[0080] ;
[0081] in, It is a manually measured proportion of cigarettes containing stems. This represents the percentage of cigarettes containing stems, where N is the sample size. The Z-statistic calculated from this is compared to the critical value of the standard normal distribution. Compare the results. If the absolute value of the calculated Z-statistic is greater than the critical value... If the value of H0 is less than or equal to the critical value, then H0 is rejected, meaning the test result is considered unreliable; conversely, if the absolute value of the calculated Z-statistic is less than or equal to the critical value... If H0 is positive, then the test result is considered reliable. For example, when the proportion of cigarettes containing stems... The percentage was 5.72%, determined manually based on the proportion of cigarettes containing stems. The percentage is 5.43%, and the sample size of cigarettes is 2100. Substituting these values into the formula, the calculated Z-statistic is -0.5723. The absolute value of the Z-statistic is then compared with the set critical value. By comparing it to 1.96, we can see that the absolute value of the calculated Z-statistic is less than the critical value. Therefore, the statistical conclusion is not to reject H0, indicating that the difference between the proportion of cigarettes with stems in the algorithm and the proportion of cigarettes with stems in the manual measurement is not statistically significant, and the detection results are reliable.
[0082] To further verify the proportion of cigarettes containing stems calculated by this method Besides hypothesis testing, the accuracy of a hypothesis can also be assessed using the more intuitive confidence interval (CI) method. The formula for the confidence interval is:
[0083] ;
[0084] in, It is a manually measured proportion of cigarettes containing stems. In order to be in The corresponding value at the confidence level, where N is the sample size of cigarettes. The core of this method lies in: based on manually measured proportions of cigarettes containing stems. Given the sample size N of cigarettes, calculate the 95% confidence interval for the measured proportion of cigarettes containing stems. This interval represents the possible range of the actual proportion of cigarettes containing stems at a 95% confidence level. The judgment rule is as follows:
[0085] If the proportion of stem-containing cigarettes in the method of the present invention is... If it falls within this confidence interval, it indicates and The difference is within the allowable range of statistical error, proving the method is reliable. If the proportion of cigarettes containing stems... If it does not fall within this confidence interval, it indicates that... and There are statistically significant differences, making the method unreliable. In this embodiment, the proportion of cigarettes containing stems was determined manually. Calculated with a percentage of 5.43% and a sample size N of 2100, the 95% confidence interval is (4.46%, 6.40%). This invention's algorithm calculates the proportion of cigarettes containing stems. =5.72% falls exactly within this range.
[0086] This conclusion corroborates the conclusions of the aforementioned hypothesis testing, jointly demonstrating that the online detection method proposed in this invention has high accuracy, and its output results are not significantly different from those of the benchmark method of manual dissection examination.
[0087] Figure 4 This is a flowchart of a method for detecting cigarettes containing stems, according to one embodiment of this application. Figure 4 As shown, the method for detecting cigarettes containing stems includes the following steps:
[0088] Step S401: Group the cigarettes according to the rolling process;
[0089] Step S402: Collection of single-point density data at the millimeter level for a single cigarette; that is, by using a microwave detector of a cigarette rolling machine to detect each cigarette in each group after grouping, the single-point density data of the collection point is obtained.
[0090] Step S403: Distribution statistics of density at each collection point; By statistically analyzing the single-point density data across cigarettes for each collection point, a density dataset is generated for each collection point.
[0091] Step S404: Determine the density outlier limits for each collection point; Calculate the quartiles and quartile ranges for each density dataset, determine the outlier limits based on the quartiles and quartile ranges, and identify collection points whose density data exceeds the outlier limits as outliers.
[0092] Step S405: The number of collection points containing stems is characterized by the high or low density anomaly value of each collection point; cigarettes with anomalies are identified as cigarettes containing stems.
[0093] Step S406: Perform union deduplication statistics on cigarettes containing multiple outliers; traverse each cigarette and determine whether there is at least one point density data exceeding the outlier limit among all its collection points; if there is any outlier, determine that the cigarette is a cigarette containing a stem.
[0094] Step S407, Statistics on the proportion of cigarettes with stem tags; Calculate the total number of cigarettes with stem tags divided by the number of cigarettes to obtain the proportion of cigarettes with stem tags in each different group and the total proportion of cigarettes with stem tags.
[0095] Step S408: Based on the proportion of cigarettes containing stems, the reliability of the test results is judged by comparing the statistics and critical values through sampling verification and statistical analysis.
[0096] Figure 5 This is a structural block diagram of the cigarette detection device 50 containing stems in this embodiment, as shown below. Figure 5As shown, the cigarette detection device 50 containing stem tags includes: an acquisition module 52, a processing module 54, and a result module 56; wherein: the acquisition module 52 is used to collect single-point density data from multiple collection points for each cigarette; for each collection point, the single-point density data is statistically analyzed across cigarettes, and a density dataset is generated for each collection point; the processing module 54 is used to calculate the quartiles and quartile ranges based on each density dataset, and determine the outlier limit based on the quartiles and quartile ranges, identifying collection points whose single-point density data exceeds the outlier limit as outliers; the result module 56 is used to identify cigarettes with outliers as cigarettes containing stem tags; after deduplication processing of multiple outliers in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags.
[0097] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0098] This embodiment also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments. In some embodiments, the electronic device may be an industrial computer, an edge computing server, or other similar device. The electronic device is connected to a microwave detector in a cigarette machine, enabling it to acquire cigarette density data and, based on its pre-programmed computer program, execute the above-described method for detecting cigarettes containing stems.
[0099] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0100] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0101] S1, collect single-point density data from multiple collection points for each cigarette;
[0102] S2, For each collection point, statistically analyze the single-point density data across cigarettes, and generate a density dataset for each collection point;
[0103] S3. Calculate the quartiles and quartile ranges for each density dataset, and determine the outlier limits based on the quartiles and quartile ranges. Identify the collection points whose single-point density data exceeds the outlier limits as outliers.
[0104] S4, identify cigarettes with abnormal points as cigarettes containing stems;
[0105] S5. After removing duplicates from multiple outliers in the same cigarette, calculate the total number of cigarettes containing stems and divide it by the total number of cigarettes to obtain the proportion of cigarettes containing stems.
[0106] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.
[0107] Furthermore, in conjunction with the method for detecting cigarette sticks containing stems provided in the above embodiments, this embodiment can also provide a computer-readable storage medium. This computer-readable storage medium stores a computer program thereon.
[0108] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0109] 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.
[0110] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0111] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0112] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. 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 scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. A method for detecting cigarettes containing stems, characterized in that, The method includes: Collect single-point density data from multiple collection points for each cigarette; For each of the collection points, the density data of the single point is statistically analyzed across cigarettes, and a density dataset is generated for each collection point. Based on each density dataset, calculate the quartiles and quartile ranges respectively, and determine the outlier limits according to the quartiles and quartile ranges. Identify the collection points whose single-point density data exceeds the outlier limits as outliers. Cigarettes exhibiting the aforementioned anomalies are identified as cigarettes containing stems. After removing duplicates from multiple abnormal points in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags.
2. The method for detecting cigarettes containing stems according to claim 1, characterized in that, The collection of single-point density data from multiple collection points for each cigarette includes: The single-point density data of each cigarette is collected from multiple collection points of the microwave detector output by the cigarette machine.
3. The method for detecting cigarettes containing stems according to claim 2, characterized in that, The collection points are evenly distributed in sequence from the lit end of the cigarette to the filter end, and each collection point is assigned a collection point number.
4. The method for detecting cigarettes containing stems according to claim 3, characterized in that, For each of the aforementioned collection points, the single-point density data is statistically analyzed across cigarette branches, generating a density dataset corresponding to each collection point, including: The single-point density data is constructed into a data matrix, wherein: the rows of the data matrix represent the collection point number; the columns represent different cigarette numbers; the matrix element values are the single-point density data corresponding to the collection point; and all the single-point density data in each row of the data matrix constitute a density dataset corresponding to the collection point.
5. The method for detecting cigarettes containing stems according to claim 1, characterized in that, The step of calculating quartiles and quartile ranges for each of the density datasets, determining outlier limits based on the quartiles and quartile ranges, and identifying collection points whose single-point density data exceeds the outlier limits as outliers includes: The first quartile and the third quartile are calculated based on the density dataset, and the difference between the third quartile and the first quartile is taken as the quartile range. Outlier limits are determined based on the first quartile, the third quartile, and the quartile range.
6. The method for detecting cigarettes containing stems according to claim 5, characterized in that, The step of determining outlier limits based on the first quartile, the third quartile, and the quartile range includes: The product of the third quartile and the quartile range with an empirical coefficient is used as the upper limit of the outlier limit. The lower limit of the outlier boundary is obtained by subtracting the product of the quartile range and the empirical coefficient from the first quartile.
7. The method for detecting cigarettes containing stems according to claim 1, characterized in that, After removing duplicates from multiple abnormal points in the same cigarette, the total number of cigarettes containing stems is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stems, including: Iterate through each cigarette and determine if there are any abnormalities. If the cigarette has any one or more of the abnormal points, then the cigarette is determined to be a cigarette with a stem tag, and a count of cigarettes with stem tags is performed. The total number of cigarettes containing stems is obtained by counting all cigarettes with stems.
8. A device for detecting cigarettes containing stems, characterized in that, The device includes: an acquisition module, a processing module, and a result module; wherein: The acquisition module is used to collect single-point density data from multiple collection points for each cigarette; for each collection point, the single-point density data is statistically analyzed across cigarettes, and a density dataset is generated for each collection point. The processing module is used to calculate the quartiles and quartile ranges based on each of the density datasets, and to determine the outlier limit based on the quartiles and the quartile ranges, and to identify the collection points whose single-point density data exceed the outlier limit as outliers. The result module is used to identify cigarettes with the abnormal points as cigarettes containing stem tags; after deduplicating multiple abnormal points in the same cigarette, the total number of cigarettes containing stem tags is divided by the total number of cigarettes to obtain the proportion of cigarettes containing stem tags.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method for detecting cigarettes containing stems as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for detecting cigarettes with stems as described in any one of claims 1 to 7.