A method, system and device for calculating a cigarette ash leakage rate
By combining multi-angle imaging and a parallel hybrid attention mechanism with a convolutional neural network of ResNeXt50 and Swin-Transformer, the problem of low accuracy in cigarette pack ash tear rate detection is solved, realizing automated and intelligent detection of cigarette pack ash tear rate, and improving the accuracy and efficiency of detection.
Patent Information
- Application Number
- CN202411893998.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing methods for detecting the crack rate of cigarette pack ash have problems such as low detection accuracy, susceptibility to light effects, and blurred crack characteristics, making it difficult to achieve automated and accurate detection and segmentation in complex backgrounds.
Images of the cigarette combustion process are acquired using a multi-angle imaging system. Gray column regions are segmented using a parallel hybrid attention mechanism combined with a convolutional neural network with ResNeXt50 and Swin-Transformer structures. Cracked regions are removed through an adaptive gating mechanism and connected component analysis. Finally, the crack rate is calculated.
It significantly improves the accuracy and robustness of cigarette crack rate detection, realizes cigarette quality control and production optimization, and provides reliable data support for the automated and intelligent detection of cigarette combustion quality.
Smart Images

Figure CN119722649B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cigarette detection, in particular to a cigarette ash wrapping crack rate calculation method, a detection system and a device. BACKGROUND
[0002] In the quality control process of cigarette production, the burning performance of cigarettes is one of the important indicators for evaluating cigarette products. The burning process of cigarettes directly affects the experience of consumers, and the ash wrapping crack rate is one of the key parameters for measuring the quality of cigarette burning. The ash wrapping crack rate is usually determined by calculating the ratio of the crack area in the ash column area after the cigarette is burned to the total ash wrapping area. The lower the crack rate, the higher the integrity of the ash column, and the stronger the ability of the cigarette to maintain the structure during the burning process. Therefore, the detection and analysis of the crack rate can not only be used for quality control, but also provide data support for the optimization of cigarette materials and formulations.
[0003] Traditional crack rate detection methods rely on manual detection or simple image analysis techniques, usually based on visual judgment or basic image processing algorithms such as threshold segmentation and edge detection. These methods have problems such as low detection accuracy, detection results easily affected by light, and crack features blurred. In addition, due to the complex surface morphology of the ash column, manual detection is inefficient and the objectivity of the results is difficult to guarantee, especially in large-scale production detection. With the development of deep learning and image processing technology, detection methods based on deep learning have begun to show significant advantages in industrial detection. These methods can automatically extract features and have high-precision image recognition capabilities through deep learning models, allowing for automated and accurate detection and segmentation of complex ash column cracks.
[0004] However, in actual cigarette detection, the crack area of the ash column often has diversity, including irregular shape, uneven area, and blurred edges. In addition, the light contrast between the crack and non-crack areas is different, and the degree of burning also affects the clarity of the image. These factors pose a great challenge to the detection of cigarette crack rate. Existing image segmentation methods based on convolutional neural networks (CNN) and attention mechanisms, such as YOLO, ResNeXT, Swin-Transformer, etc., have been used in similar industrial detection scenarios. However, how to further improve the detection accuracy and robustness to achieve automatic detection and accurate segmentation of cigarette cracks in complex backgrounds is still a research focus in this field.
[0005] In view of this, the present inventors, based on years of production and design experience in this field and related fields, have designed a cigarette ash wrapping crack rate calculation method, a detection system and a device through repeated trials, in order to solve the problems existing in the prior art. SUMMARY
[0006] The application aims to provide a cigarette ash package crack rate calculation method, a detection system and a device, which can effectively improve the detection accuracy of the cigarette ash package crack rate.
[0007] To achieve the above-mentioned application purposes, the application provides a cigarette ash package crack rate calculation method, a detection system and a device, wherein the cigarette ash package crack rate calculation method comprises:
[0008] Obtaining multi-angle ash package images in the cigarette combustion process and pre-processing the multi-angle ash package images;
[0009] Segmenting the ash column region in the pre-processed ash package image based on a convolutional neural network;
[0010] Removing the crack region in the ash column region and performing edge detection and region filling based on an adaptive gating mechanism and connected component analysis;
[0011] Calculating the crack rate of the segmented ash column region after removing the crack region and outputting the calculation result.
[0012] The application also provides a cigarette apparent combustion quality detection system, which is characterized in that the system implements the above-mentioned method and comprises the following modules:
[0013] A multi-angle image acquisition module for obtaining ash package images at different angles in the cigarette combustion process;
[0014] An ash column segmentation module for segmenting the ash column region based on a parallel hybrid attention mechanism;
[0015] A crack removal module for removing the crack region in the ash column image through an adaptive gating mechanism;
[0016] A crack rate calculation module for automatically calculating the crack rate based on a cigarette ash package crack rate formula;
[0017] A result output module for generating crack rate detection results and crack rate trend charts.
[0018] The application also provides a computer readable storage medium having a computer program stored thereon, which is characterized in that the computer program is executed by a processor to implement the steps of the above-mentioned calculation method.
[0019] The application also provides a computer device comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor is characterized in that it implements the steps of the above-mentioned calculation method when executing the computer program.
[0020] Compared with the prior art, the application has the following characteristics and advantages:
[0021] The application provides a cigarette ash cracking rate calculation method, a detection system and a device. BRIEF DESCRIPTION OF DRAWINGS
[0022] The drawings described herein are for illustrative purposes only and are not intended to limit the scope of the present disclosure in any way. In addition, the shapes and scale sizes of the components in the drawings are only illustrative and are used to help understand the present application, and are not specific limitations on the shapes and scale sizes of the components of the present application. Those skilled in the art can select various possible shapes and scale sizes according to specific circumstances to implement the present application under the teaching of the present application.
[0023] Figure 1 A schematic diagram of the detection process of the crack rate of the present application;
[0024] Figure 2 A schematic diagram of the PHAM-YOLO network model structure of the present application;
[0025] Figure 3a A schematic diagram of the overall structure of the parallel hybrid attention mechanism PHAM of the present application;
[0026] Figure 3b A schematic diagram of the channel attention module of the parallel hybrid attention mechanism PHAM of the present application;
[0027] Figure 3c A schematic diagram of the spatial attention module of the parallel hybrid attention mechanism PHAM of the present application;
[0028] Figure 3d A schematic diagram of the coordinate attention module of the parallel hybrid attention mechanism PHAM of the present application;
[0029] Figure 4 A schematic diagram of the SPPF structure of the present application;
[0030] Figure 5 A schematic diagram of the average precision mean of the present application;
[0031] Figure 6 FIG. 1 is a schematic diagram of a CSegNet network structure according to the present application;
[0032] Figure 7 FIG. 2 is a schematic diagram of a ResNeXTR network structure according to the present application;
[0033] Figure 8 FIG. 3 is a schematic diagram of a residual block according to the present application;
[0034] Figure 9 FIG. 4 is a schematic diagram of an encoder structure of a Swin-Transformer according to the present application;
[0035] Figure 10a FIG. 5 is a schematic diagram of an ECBAM module structure according to the present application;
[0036] Figure 10b FIG. 6 is a schematic diagram of an ECAM module structure according to the present application;
[0037] Figure 10c FIG. 7 is a schematic diagram of a SAM module structure according to the present application;
[0038] Figure 11 FIG. 8 is a schematic diagram of a JEUNet network structure according to the present application;
[0039] Figure 12 FIG. 9 is a schematic diagram of a joint excitation upsampling JEU module structure according to the present application;
[0040] Figure 13 FIG. 10 is a schematic diagram of a cigarette ash cracking rate calculation method according to the present application;
[0041] Figure 14 FIG. 11 is a schematic diagram of an edge detection and region filling step according to the present application. DETAILED DESCRIPTION
[0042] The details of the application can be more clearly understood in conjunction with the accompanying drawings and the description of specific embodiments of the application. However, the specific embodiments of the application described herein are for the purpose of explaining the application only, and should not be understood in any way as limiting the application. Based on the teachings of the present application, a skilled person can conceive any possible modification of the application, which should be considered as falling within the scope of the present application.
[0043] The present application provides a cigarette ash cracking rate calculation method, a detection system and a device, as shown in Figure 13 The cigarette ash cracking rate calculation method comprises:
[0044] obtaining multi-angle ash images during the combustion process of the cigarette, and pre-processing the multi-angle ash images;
[0045] Segment the ash column region in the preprocessed ash package image based on a convolutional neural network;
[0046] Remove the crack region in the ash column region, and perform edge detection and region filling based on an adaptive gating mechanism and connected component analysis;
[0047] Calculate the crack rate of the segmented and crack-removed ash column region and output the calculation result.
[0048] The cigarette ash crack rate calculation method, detection system and device provided by the present application comprehensively use multi-angle imaging, convolutional neural network and adaptive gating technology. The accuracy of detection is significantly improved, and the ash column and crack can be accurately identified. The stability is greatly enhanced, and it is suitable for different cigarettes and combustion stages. It effectively promotes the quality control and production optimization of cigarettes, and effectively improves the product quality and market competitiveness.
[0049] In an optional embodiment of the present application, the ash column region in the preprocessed ash package image is segmented based on a convolutional neural network, which includes using a parallel attention mechanism combined with a ResNeXt50 convolutional network and a Swin-Transformer network to extract the ash column features in each ash package image. The characteristics of the ResNeXt50 convolutional network enable it to efficiently learn rich and accurate local features from the ash package image, and the Swin-Transformer network makes up for its deficiency in capturing long-distance relevance. The two work together to enhance the overall understanding of the ash column features. The channel, spatial and coordinate attention mechanisms in the parallel attention mechanism can effectively focus on the ash column defect features and reduce the weight input of useless background information. Combined with the operation of the decoder part, the accuracy of the ash column region segmentation is improved, making the subsequent crack rate calculation based on the ash column region more accurate and reliable.
[0050] In an optional embodiment of the present application, the gray column region in the preprocessed package ash image is segmented based on a convolutional neural network, which includes: in the encoder part, the image is subjected to multi-scale feature extraction by a convolutional neural network module, the feature map is divided into multiple stages according to different scales, and the feature channel correlation is enhanced by a Squeeze-and-Excitation module; in the decoder part, the feature map is subjected to up-sampling by a joint excitation up-sampling module, and the spatial and channel attention mechanisms are combined to improve the segmentation accuracy. The multi-scale feature extraction in the encoder and the use of the Squeeze-and-Excitation module enable the network to fully mine the detailed features in the image and strengthen the key feature channels, thereby improving the feature expression capability. The joint excitation up-sampling in the decoder part is combined with the spatial and channel attention mechanisms, which effectively overcomes the inaccurate segmentation problem that is prone to occur in the traditional method when processing complex gray column images. Overall, the accuracy and reliability of the gray column region segmentation are greatly improved, and the occurrence of misjudgment and omission is reduced, thereby laying a solid foundation for the subsequent accurate calculation of the cigarette package ash crack rate.
[0051] In an optional embodiment of the present application, the crack region in the gray column region is removed, which includes using a fusion model of CSegNet and JEUNet to identify the crack region. CSegNet can effectively extract and strengthen the crack features through its unique network structure and module combination, but the calculation resource consumption is large. JEUNet improves the up-sampling speed while ensuring the accuracy of semantic segmentation, and has high calculation efficiency. After the fusion of the two, the detection accuracy and calculation efficiency are taken into account, which can accurately identify the crack region in a complex background, reduce the occupation of calculation resources, improve the running speed and stability of the entire detection system, thereby providing a reliable guarantee for the accurate calculation of the cigarette package ash crack rate, and helping to improve the efficiency and reliability of the cigarette quality detection.
[0052] In an optional embodiment of the present application, the crack region in the gray column region is removed, which further includes using a CSegNet network model to extract features in combination with an ECBAM module, and performing segmentation of the crack region and the gray column region by attention weighting. The CSegNet network model in combination with the ECBAM module can deeply mine image features, the joint use of ResNeXt50 and Swin-Transformer makes the feature extraction more comprehensive, and the recognition ability for different types of cracks is enhanced. The ECBAM module focuses on the crack region through a unique attention weighting mechanism, which significantly improves the segmentation accuracy and reduces misjudgment.
[0053] In an optional embodiment of the present application, as Figure 14As shown, in the step of removing the crack area in the ash column region, and based on the adaptive gating mechanism and connected domain analysis, the edge detection and region filling includes the following sub-steps: using Sobel operator or Canny edge detection algorithm to extract the crack edge; embedding an adaptive gating module in the deep convolutional network for enhancing crack features and suppressing non-crack features; extracting the connected domain of the crack region, and screening the feature region according to area and shape; filling the crack region and measuring the color of the ash column region. The Sobel operator or Canny edge detection algorithm can accurately locate the crack edge, providing a reliable basis for subsequent processing. The adaptive gating module effectively improves the accuracy of crack detection, reduces the possibility of misjudgment, and makes the identification of the crack region more accurate. The connected domain analysis combined with the screening standard further eliminates interference factors and ensures the accuracy of crack region extraction. Accurate crack filling ensures the integrity of the ash column region, making the color measurement result more accurate and reliable
[0054] In an optional embodiment of the present application, the formula for calculating the crack rate includes:
[0055] CR=S2 / S1x100
[0056] In the formula, CR is the crack rate; S2 is the area of the crack region of the cigarette; S1 is the total area of the ash column S1.
[0057] The crack rate CR in percentage form directly quantifies the crack degree of the cigarette ash region, making the evaluation of the cigarette burning quality more intuitive and accurate. By accurately calculating S2 and S1, and according to this formula, the crack rate provides a clear quality control indicator for cigarette manufacturers. Enterprises can quickly judge the stability and integrity of the product during the burning process, and timely find problems in the production process, such as the influence of raw material differences, production process fluctuations, etc. on the burning quality of cigarettes
[0058] In an optional embodiment of the present application, the output calculation result includes: expressing the crack rate in percentage form and generating a crack rate trend chart. The crack rate trend chart further enhances the readability and analysis value of the data, and can clearly reflect the quality fluctuation trend of the cigarette in different burning stages, different batches or different production conditions. Through observation and analysis of the trend chart, the stability of the cigarette burning quality can be understood in depth, and the apparent burning quality of the cigarette and the quality fluctuation trend of the cigarette in different burning stages, different batches or different production conditions can be analyzed more comprehensively, and potential quality problems can be found in time.
[0059] In an optional example of this embodiment, the output calculation result further includes generating a detection report containing the crack rate and the ash column integrity. Based on the data obtained through a series of operations such as acquisition, preprocessing, ash column region segmentation, crack region removal, and crack rate calculation of the multi-angle ash cover image during the cigarette combustion process, the generated report can not only understand the real-time quality status of the product during the combustion process according to the crack rate value, but also further analyze the performance of the product in terms of structure retention through the ash column integrity evaluation.
[0060] In an optional embodiment of the present application, a multi-angle imaging system is used to take and acquire multi-angle ash cover images of a continuously burning cigarette, which at least includes a front view, a side view, and a top view. The front view, the side view, and the top view complement each other, fully display various features of the ash column during the combustion process, and greatly increase the integrity of the image information. In terms of crack detection, it can effectively avoid missed detection or misjudgment due to limited viewing angle, more accurately determine the crack position, shape, and size, and especially has better recognition effect for complex crack shapes. Rich multi-angle image data provides a solid foundation for subsequent processing, improves the accuracy of ash column region segmentation, crack detection, and other operations, and further improves the accuracy and reliability of the entire cigarette ash cover crack rate calculation.
[0061] In an optional example of this embodiment, a bionic suction machine based on cigarette combustion is used to maintain the continuous combustion of the cigarette. Maintaining the continuous combustion of the cigarette through the bionic suction machine can ensure the stability and consistency of the cigarette combustion process, overcoming the problem of uneven combustion caused by environmental factors (such as airflow fluctuations, temperature changes, etc.) in the natural combustion process. The stable combustion process makes the acquired ash cover image have higher repeatability and comparability, whether it is comparative detection of different batches of cigarettes or repeated detection of the same cigarette at different times, it can be carried out under the same combustion conditions.
[0062] The present application also proposes a cigarette apparent combustion quality detection system, characterized in that the system implements the above-mentioned method, including the following modules:
[0063] A multi-angle image acquisition module acquires ash cover images at different viewing angles during the cigarette combustion process;
[0064] An ash column segmentation module segments the ash column region based on a parallel hybrid attention mechanism;
[0065] A crack removal module removes the crack region in the ash column image through an adaptive gating mechanism;
[0066] A crack rate calculation module automatically calculates the crack rate based on the cigarette ash cover crack rate formula;
[0067] A result output module generates crack rate detection results and a crack rate trend chart.
[0068] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is characterized in that the computer program is executed by a processor to realize the steps of the calculation method.
[0069] The application further provides a computer device, which comprises a memory and a processor, and the memory stores a computer program capable of running on the processor, and the processor is characterized in that the processor executes the computer program to realize the steps of the calculation method.
[0070] As shown in Figure 1 A cigarette ash cracking rate calculation method, the method comprising the following steps:
[0071] 1) Input the sample image of the cigarette combustion process to be detected, and acquire ash images at different angles through a multi-angle imaging system to ensure the comprehensiveness and diversity of the image data;
[0072] 2) Automatically segment the ash column region based on a convolutional neural network (CNN), extract the ash column features by combining a parallel hybrid attention mechanism (PHAM-YOLO) with a ResNeXT50 and a Swin-Transformer structure, and realize the precise separation of the ash column region and the background region;
[0073] 3) Remove the cracking region in the ash column image, remove the cracks based on an adaptive gating mechanism and connected component analysis, and perform edge detection and region filling to ensure that the cracking region does not affect the color measurement of the ash region;
[0074] 4) Calculate the cracking rate CR of the segmented and crack-removed ash region, including extracting the area S2 of the cigarette cracking region and the total area S1 of the ash column, and calculating the cracking rate according to the formula CR = S2 / S1 x 100, wherein S1 is the total area of the ash column region, and S2 is the cracking area;
[0075] 5) Output the ash cracking rate detection result, express the cracking rate in the form of percentage, and generate a cracking rate trend chart for the analysis of the apparent combustion quality.
[0076] 1.1 Image processing
[0077] 1.1.1 Image acquisition module
[0078] A high-resolution static imaging camera is used to acquire static images of the carbon line during the cigarette combustion process.
[0079] A dynamic imaging camera is used to capture real-time carbon line change images generated during the cigarette combustion.
[0080] Through the cooperative imaging of the dual cameras, the carbon line features of the burning cigarette can be captured at different time nodes and perspectives, ensuring clear images even under complex background conditions.
[0081] 1.1.2 Image preprocessing
[0082] The collected raw image data is processed by the preprocessing module, including:
[0083] Color calibration: standard color cards are used to calibrate the color of the image to eliminate color deviations under different lighting conditions.
[0084] Light uniformity adjustment: according to the changes of the environmental light, the light uniformity of the image is adjusted to ensure the clarity and consistency of the cigarette carbon line image during the burning process.
[0085] Image denoising: through noise filtering algorithm, the smoke, ash and other interference factors generated during the burning process of the cigarette are removed to enhance the quality and effectiveness of the image.
[0086] 1.2 Parallel hybrid attention mechanism (PHAM-YOLO)
[0087] 1.2.1 PHAM-YOLO network structure
[0088] YOLO (You Only Look Once) is one of the most representative deep learning target detection algorithms, with fast running speed and high detection accuracy, it has achieved a lot of successful applications, the algorithm has developed to the eighth generation, but the commonly used is still the relatively stable YOLO v5 network structure. In view of the image features of the cigarette burning carbon line in different detection equipment scenes such as straight line type and rotating disc type, the parallel hybrid attention mechanism PHAM (Parallel Hybrid Attention Mechanism) is embedded on the YOLO v5 network structure, and the PHAM-YOLO network model is constructed.
[0089] Figure 2is a schematic diagram of the network structure of PHAM-YOLO, and the PHAM-YOLO network is divided into a backbone network Backbone, a feature processing network Neck, and a target prediction network Head. Among them, CBS, Focus, and CSP are three main convolution modules in each network: ① The CBS convolution module is composed of a convolution layer Conv, a normalization layer BactchNorm2d, and an activation function SiLU; ② The Focus module performs column-by-column downsampling and splicing on the initial data. The original HxWx3 image is changed into a feature map of H / 2xW / 2x12 through a slice operation, and after splicing, it is changed into H / 2xW / 2x32 through a CBS convolution operation again. This operation can ensure that no information is lost during downsampling; ③ CSP is a residual module, CSP1 (divided into CSP1_1 and CSP1_3) is applied in Backbone, and CSP2 is applied in Neck. In addition, the role of the Concat module is to splice the feature maps. PHAM-YOLO embeds the PHAM module in the backbone network of YOLO v5, and the PHAM module contains three attention mechanisms of channel, space, and coordinates, which can effectively focus on defect features and reduce the weight input of useless background information. In addition, PHAM-YOLO also uses the pyramid fast pooling (SPPF) module to use a continuous fixed convolution kernel to perform fast pooling on the input feature map to fuse feature maps of different receptive fields to improve the expression ability of the feature map; uses the boundary box regression (BBR) to improve the accuracy of the combustion carbon line positioning, and introduces EIOU (Efficient Intersection over Union) as the boundary loss function to solve the ambiguity of the CIOU (complete Intersection on Union) loss function, making the BBR regression more accurate.
[0090] 1.2.2 Parallel hybrid attention mechanism PHAM
[0091] The PHAM module contains three attention mechanisms of channel, space, and coordinates, which can effectively focus on defect features and reduce the weight input of useless background information. As shown in Figure 3a is a schematic diagram of the network structure of PHAM, the upper branch is composed of a channel attention mechanism module and a spatial attention mechanism module, and the lower branch is a coordinate attention mechanism module. As shown in Figure 3b is a structure diagram of the channel attention mechanism module, which performs two-dimensional global maximum / average pooling operations on the initial feature F to obtain two groups of feature vectors, and then transmits the two groups of feature vectors to a multilayer perceptron (MLP) network to obtain a channel attention feature map Wc(F). As shown in Figure 3cWs(F) is obtained by using a convolution kernel to reduce the channel dimension to 1, and the spatial attention feature map Ws(F) is generated. Then, Ws(F) is convolved with Wc(F) to obtain the attention mechanism map W1(F) of the upper branch. The channel attention and spatial attention of the upper branch are obtained by global pooling, which is used to capture the local correlation of the feature map.
[0092] As shown in FIG. 1, the PHAM mechanism is composed of two branches, the upper branch and the lower branch. The upper branch is composed of a channel attention mechanism module and a spatial attention mechanism module. The channel attention mechanism module is shown in FIG. 2, which is a structural diagram of the channel attention mechanism module. The input feature map F is first processed by a convolution kernel with a size of (H, W) to reduce the channel dimension to 1, and the channel attention feature map Wc(F) is generated. Then, Wc(F) is convolved with F to obtain the attention mechanism map W1(F) of the upper branch. Figure 3d As shown in FIG. 3, the lower branch is a coordinate attention mechanism module. First, the input feature map is averaged pooled along the horizontal direction and the vertical direction using convolution kernels with sizes of (H, 1) and (1, W), respectively. The output of the c-th channel with a height of h and the c-th channel with a width of w is:
[0093]
[0094] By transforming formula (1.1) and formula (1.2), the global receptive field and accurate position information can be well obtained. In order to better utilize the generated features, first, z h and z w are concatenated
[117] , and the concatenated features are processed by a transformation function and a nonlinear activation function, and output f:
[0095] f = δ (F1([z h , z w ])) (1.3)
[0096] In the formula, F1 is a transformation function with a convolution kernel of 1x1, δ is a nonlinear activation function, and f is an intermediate feature mapping that encodes spatial information in the horizontal direction and the vertical direction.
[0097] Secondly, f is divided into two independent tensors, and the coordinate attention mechanism map W2(F) of the lower branch is obtained by convolution and nonlinear transformation, which is mainly used to capture the non-local correlation of the feature map. Finally, the attention mechanism maps W1(F) and W2(F) of the upper and lower branches are fused and converted into W(F) through a nonlinear activation function δ, forming a PHAM mechanism, as shown in formula (1.4).
[0098] W(F) = δ[W1(F) + W2(F)] (1.4).
[0099] 1.2.3 Feature Pyramid Fast Pooling
[0100] The SPP (Spatial Pyramid Pooling) structure is used in the YOLO network to change the size of the feature map. The SPP first performs a CBS operation on the input feature map, then performs a maximum pooling operation on the CBS output feature map using convolution kernels with sizes of 3x3, 5x5 and 9x9 respectively, and then concatenates the CBS output feature map and the maximum pooling output feature map, and then sends them into the CBS module. Although the SPP module realizes the conversion of the feature map into a specific size, this parallel connection method ignores the influence of different receptive field feature maps on the model performance, and increases the additional calculation overhead of the model.
[0101] The SPPF (Spatial Pyramid Fast Pooling) structure replaces the parallel maximum pooling operation of the three different size convolution kernels in the original SPP with a serial operation of three same size convolution kernels. As shown in FIG. 1C, the SPPF first performs a 5x5 maximum pooling operation on the data transmitted from the CBS structure in series (canceling ① and ②), and then transmits the data into the CBS structure by concatenation splicing (adding ③ and ④). The SPPF uses a continuous fixed convolution kernel to pool the input feature map, fuses feature maps of different receptive fields, and enriches the expression ability of the feature map without increasing the calculation overhead. Figure 4
[0102] 1.2.4 EIOU loss function
[0103] In target detection, the function of the boundary loss function is to determine the positive and negative samples and evaluate the distance between the predicted box and the real box. The IOU is the ratio of the intersection and union of the predicted box and the real box, as shown in formula (1.5), which satisfies non-negativity, identity, symmetry and triangle inequality, and the value is between 0 and 1 regardless of the size of the predicted box. In actual use, the IOU loss is as shown in formula (1.6). However, the IOU loss cannot optimize the case where the real box and the predicted box are not intersected, and cannot reflect how the real box and the predicted box intersect. In order to solve these problems, the minimum circumscribed rectangle of the real box and the predicted box is introduced on the basis of the IOU, as shown in formula (1.7):
[0104]
[0105] L IOU =1-IOU (1.6)
[0106]
[0107] Wherein: C is the area of the minimum bounding rectangle of the prediction box and the real box, but the GIOU loss still has some problems. When the prediction box and the real box appear to contain, the GIOU loss degenerates into the IOU loss; when the prediction box and the real box intersect, it converges slowly in the horizontal and vertical directions. DIOU loss and CIOU loss, these two kinds of loss are by directly minimizing the normalized distance between the prediction box and the real box to improve the convergence speed, and make the regression result more accurate when overlapping or even containing the target box, as shown in formulas (1.8)-(1.11).
[0108]
[0109] Wherein: alpha is a weight function, nu is used to measure the consistency of the aspect ratio, rho represents the Euclidean distance between the two center points, and c represents the diagonal length of the minimum bounding rectangle of the prediction box and the real box. But DIOU loss does not consider the aspect ratio of the pre-boundary box in the regression process, and the precision still has room for further improvement; CIOU loss describes the relative value, but there is a certain ambiguity. In this paper, EIOU loss function is used instead of CIOU loss function as the boundary loss function, which is defined as formula (1.12), which considers the overlapping area, the distance between the center points and the actual width and height difference. Solve the problems existing in CIOU loss function, make the model converge faster and the regression process more stable.
[0110]
[0111] 1.3CSegNet network
[0112] In order to realize the accurate segmentation of the ash crack, the application proposes a crack segmentation algorithm (Crack Segmentation Network, CSegNet) combining convolutional neural network (CNN) and Transformer self-attention mechanism. The CSegNet network adopts an Encoder-Decoder coding and decoding framework similar to DeepLab V3+, and includes the following steps:
[0113] 1) Obtain the crack image in the cigarette combustion process, and pre-process the image, including noise removal, gray calibration and contrast enhancement;
[0114] 2) ResNeXt-Transformer (ResNeXTR) module is used in the encoder, which includes ResNeXt50 convolutional network and Swin-Transformer network, which is used to extract local and global features in the image;
[0115] 3) Incorporate Efficient Convolutional Block Attention Module (ECBAM) in decoder, which contains Efficient Channel Attention Module (ECAM) and Spatial Attention Module (SAM), to emphasize the salient features of crack region;
[0116] 4) Reduce the dimension of encoder output by using average pooling and point-wise convolution operation to reduce the cost of self-attention calculation;
[0117] 5) Use a combined loss function of Binary Cross-Entropy with Logits and Dice loss, Binary Cross-Entropy with Logits loss and Dice loss function are combined together with a weight of 0.5 to optimize the segmentation accuracy and edge detection effect.
[0118] The main innovations of CSegNet are as follows:
[0119] (1) In the encoder Encoder part, a ResNeXt-Transformer (ResNeXTR) feature extraction module is designed as the backbone network, ResNeXTR combines the flexibility of Transformers in modeling long-term dependencies and the ability of CNNs to capture local context information through local receptive fields, weight sharing, and spatial subsampling, enhancing the feature extraction capability of the crack region in the gray image. In addition, in order to reduce the computational cost of Transformers, an average pooling layer is introduced to downsample the dimension of the encoded features.
[0120] (2) In the decoder Decoder part, an Efficient Convolutional Block Attention Module (ECBAM) is designed by combining an Efficient Channel Attention Module (ECAM) and a Spatial Attention Module (SAM), further optimizing feature expression to focus on key information of cracks under different background colors.
[0121] (3) Use ReLU activation function, SGD gradient descent and Binary Cross Entropy with Logits mixed loss function to speed up the convergence speed and improve the segmentation accuracy.
[0122] 1.3.1 Overview of CSegNet algorithm
[0123] The CSegNet network model adopts the basic encoder-decoder architecture of DeepLab V3+, as shown inFigure 6 In view of the flexibility of the Transformer in modeling long-term dependencies, and the CNN can use local receptive fields, shared weights, and spatial subsampling to obtain local context information, a ResNeXt-Transformer (ResNeXTR) feature extraction module is designed as the backbone network in the encoder part to enhance the feature extraction capability of the input image. The part of CNN in the ResNeXTR feature extraction module adopts a ResNeXt50 network as a convolution feature extractor, and the Transformer part adopts a Swin-Transformer network based on a self-attention mechanism. In order to reduce the computational cost of self-attention calculation, an average pool is introduced to downsample the dimension after encoding. After the image passes through the encoder, in order to further enrich the feature information and enhance the feature extraction capability of the model, the shallow features from ResNeXt50 are concatenated with the output of Swin-Transformer as shallow output, and then input into the decoder to be fused with the deep feature map output by ResNet50 as the comprehensive output of the encoder.
[0124] The decoder decoder maintains the structure of DeepLab V3+, but designs an ECBAM attention module before outputting the classification label, which enhances the long-range interaction between low-level feature maps without significantly increasing the parameter size, thereby further optimizing the feature representation. After the decoder obtains the multi-scale semantic feature map, it performs 4 times upsampling, and then fuses the shallow semantic information output by the ResNeXTR module. After 3x3 convolution and 4 times upsampling, the features pass through the ECBAM attention module to obtain the semantic segmentation result.
[0125] 1.3.2ResNeXTR network structure
[0126] The structure of the ResNeXTR feature extraction module for feature extraction in the encoder is shown in Figure 7 ResNeXTR uses a ResNeXt50 network as a CNN feature extractor on the one hand, which can learn more extensive and rich local features from the package gray crack image; on the other hand, it uses a Swin-Transformer network based on a self-attention mechanism as the Transformer component in the module, enabling the network to capture the long-distance correlation between different regions in the crack image. By combining the features output by the two networks, ResNeXTR constructs a feature engineering with rich shallow features and strong local feature correlation, to a certain extent, balancing the segmentation efficiency and accuracy.
[0127] 1.3.2.1ResNeXt
[0128] The use of ResNeXt network is mainly based on the following factors.
[0129] (1) ResNeXt50 introduces "cardinality" as a new dimension, which is parallel to depth and width, and improves the representation ability of the model without increasing the complexity of the model.
[0130] (2) The modular design of ResNeXt50 makes the model more flexible, easy to extend, and can be trained more efficiently.
[0131] (3) ResNeXt50 performs better than Xception, the initial encoder network of DeepLab V3+, on ImageNet dataset, and shows excellent generalization ability on multi-task learning and different datasets. Therefore, using ResNeXt50 as part of the feature extraction network can improve the model performance, enhance the stability and robustness of the model. ResNeXt50 ResNet network is composed of multiple residual blocks (Residual Blocks) as shown in Figure 8 , and is distributed in 4 stages according to the configuration of [3, 4, 6, 3]. Through these residual blocks, ResNeXt50 network performs in-depth feature analysis on the input image, generates multi-scale feature maps, and ensures accurate and rich semantic representation of the input image. In actual training, we first use the pre-trained ResNeXt50 network on the public dataset ImageNet to perform preliminary feature extraction on the input image.
[0132] 1.3.2.2 Average Pooling Layer Embedding Transformer
[0133] In addition to the ResNeXt module described above, Swin Transformer V2, which is also pre-trained on ImageNet, is introduced to resolve the shallow features of the input image and construct detailed feature maps. Swin-Transformer V2 is an efficient visual Transformer network structure, unlike traditional Transformer networks, Swin-Transformer V2 processes images by using a windowed self-attention mechanism and introduces local information exchange to reduce computational complexity. In our model, the self-attention mechanism of Swin-Transformer helps to capture more local and global details, thereby providing a finer feature representation for the semantic label generation of the crack. Since the original attention has relatively large amount of calculation and high requirements for equipment, in order to reduce the amount of model calculation, the CSegNet improves the basic attention calculation, and after calculating the K, V vectors, it is down-sampled, and the specific structure is as shown in Figure 9
[0134] In order to reduce the amount of operation in the self-attention calculation, an average value pooling layer P S is introduced.The dimension of the encoded is down-sampled. In order to further reduce the amount of calculation, point-wise convolution is also used to further reduce the feature dimension. The specific calculation process of self-attention SA is as follows:
[0135] SA(X)=Attention(X·W Q ,P S (X·W K ),P S (X·W V )) (2.1)
[0136] where W Q , W K , W V represent the linear layers used for encoding, and Attention is the attention calculation method, and its calculation formula can be expressed as:
[0137] Attention(Q,K,V)=softmax(SIM(Q,K))V (2.2)
[0138] SIM(Q,K) is the similarity calculation of Q and K, using cosine similarity attention, and its calculation formula is as follows:
[0139]
[0140] where B ijis the relative position bias between pixel i and pixel j; τ is a learnable scaling parameter; B is obtained by the continuous relative position bias method, which is not directly optimizing the parameterized bias, but using a small network to update on the relative coordinates:
[0141]
[0142] where, denotes a small network, for example, a 2-layer MLP with ReLU activation by default. The Transformer block is composed of self-attention (SA) and MLP modules, and the calculation process is as follows:
[0143]
[0144] where, denotes the output of the self-attention SA after layer normalization (LN), denotes the output of the MLP after layer normalization (LN), z l denotes the final output of the Transformer block.
[0145] 1.3.4 Efficient Convolutional Block Attention Module ECBAM
[0146] In order to enable the network to effectively focus on the key information of the crack in the complex background while suppressing irrelevant information from different channels, the CSegNet designs an efficient convolutional attention module (Efficient Convolutional Block Attention Module, ECBAM) in the output part of the decoder. The structure of ECBAM is shown in Figure 10a In order to reduce the problem of increasing the model parameter count caused by adding the hybrid attention mechanism module, ECBAM first inputs the feature map into the ECAM (Efficient Channel Attention Module) module, as shown in Figure 10b ECAM uses 1D convolution to effectively realize the cross-channel interaction of local information; then, the feature map is input into the SAM (Spatial Attention Module) module, as shown in Figure 10c SAM simultaneously performs maximum pooling and average pooling on the feature map, and performs overall weighting operation on the feature map after splicing the results. This design can enable ECBAM to focus on the global semantic information of the defect area while introducing the channel correlation of the feature map.
[0147] In the training and validation stage of the model, a joint combination loss function combining Binary Cross-Entropy with Logits (BCE With Logits Loss) loss function and Dice loss function is designed.
[0148] (1) Binary Cross-Entropy with Logits loss function is a loss function commonly used in binary classification problems, which combines Sigmoid activation function and binary cross-entropy loss. In the crack segmentation task, the BCEWithLogits function provides explicit feedback for the model, and its definition is shown in equation 2.9:
[0149]
[0150] In the formula, N represents the total number of samples; y i represents the true label of the i-th sample, 1 indicates that the pixel is a crack, and 0 indicates that the pixel does not belong to the crack; p i is the original output predicted by the model for the i-th pixel. σ(p i ) represents the result obtained by processing the original output predicted by the model for the i-th pixel through the sigmoid function.
[0151] (2) Dice loss function is different from Binary Cross-Entropy. Dice loss function measures the overlap between labels and predictions. Assuming X represents the true label of the real crack segmentation image, and Y represents the pixel class of the model predicted segmentation image, the definition of Dice loss function is shown in equation 2.10 and equation 2.11:
[0152] L Dice = 1-Dice Coefficient (2.10)
[0153]
[0154] In the formula, |X∩Y| represents the number of intersection elements between X and Y, and |X| and |Y| represent the number of elements in X and Y, respectively. The final loss function used by the model is shown in equation 2.12:
[0155] L = 0.5L BCEwtihlogits + 0.5L Dice (2.12)
[0156] This formula combines the BCE With Logits loss and the Dice loss function with a weight of 0.5 each. The combination of these two loss functions helps to balance the accuracy of crack detection and boundary description in the segmentation task.
[0157] 1.4 Research on JEUNet-based crack semantic segmentation algorithm
[0158] The research motivation of CSegNet is to realize the accurate segmentation of the package ash crack area. However, due to the embedding of ResNeXt50, Swin-Transformer V2, ECBAM and other modules, the parallel operation of these modules consumes a large amount of computing resources, which is not conducive to the engineering of the algorithm. Therefore, it is necessary to carry out research on efficient semantic segmentation algorithms in order to provide a fast and accurate algorithm for the engineering implementation of package ash crack detection.
[0159] In view of the problem that the existing semantic segmentation algorithm needs to consume a large amount of computing resources while realizing accurate segmentation, this section designs a joint excitation up-sampling network (JEUNet) for crack segmentation. JEUNet is a network containing an encoder-decoder symmetric structure. In the decoder stage, spatial attention is integrated with joint up-sampling to replace the general layer-by-layer up-sampling method, while considering the correlation of multi-scale feature information and channel direction, improving the up-sampling speed and enhancing the accuracy of semantic segmentation.
[0160] 1.4.1 Overview of JEUNet algorithm
[0161] Package ash crack detection can be described as a pixel-level anomaly prediction task. The proposed joint excitation up-sampling network JEUNet has a classic encoder-decoder symmetric structure, and its network framework is as shown in Figure 11 The yellow arrow represents direct input; the black arrow represents 3x3 convolution operation with a step size of 1, which uses Zero-padding strategy to keep the feature map at the same level at the same size; the gray arrow represents the cut and connection operation, which cuts the left feature map to the corresponding size on the right side and then connects it; the blue arrow represents the 1x1 operation for final classification, and the last two layers output are the result and background; the red arrow represents the down-sampling of the feature map through 2x2 max pooling; the green arrow represents the 2x up-sampling of the feature map using 2x2 deconvolution operation. k represents the number of basic channels of the convolution feature map (in this paper, k = 32).
[0162] The encoder part of JEUNet is consistent with the trunk network of UNet. The original input image is encoded by successive convolutional layers in 4 stages, and transmitted by 2x max pooling down-sampling between every 2 stages. Therefore, there are 5 scales in total, including the original image, and each scale of feature map contains information with different receptive fields. The shallow feature map mainly contains local pixel detail texture information, while the deep feature map contains local semantic information in the image. In the decoding process of JEUNet, the outputs of the 2nd, 3rd and 4th stages are input into the designed JEU (Joint Excitation Up-sampling block) module, which replaces the three scales of convolutional successive up-sampling in the original UNet. The output of the JEU module is up-sampled once and concatenated with the output of the 1st stage of the encoder, then two 3x3 convolution operations are performed in the same layer, and finally up-sampled to the original image size and connected with the initial convolution result of the original image. After two convolution operations, the prediction result is obtained. In the decoder part, the up-sampled feature map and the shallow feature of the encoder part are concatenated to improve the prediction accuracy of the local pixels.
[0163] 1.4.2 JEUNet module
[0164] The joint excitation up-sampling JEU module is a kind of calculation unit that integrates spatial attention into the joint up-sampling network. On the one hand, three feature maps with different receptive fields are adjusted to the same size and connected as a joint feature map T; on the other hand, a transformation vector W is constructed to excite each channel in the tensor T. In the up-sampling process, the JEU module considers the correlation between multi-scale feature information and channel direction, improves the accuracy of semantic segmentation, and reduces the complexity of up-sampling calculation. Figure 12 The structure diagram of the JEU block is shown, the purple arrow represents the joint up-sampling path, and the red arrow represents the feature map excitation path.
[0165] The present application JEUNet uses joint upsampling to replace the initial two layer-by-layer upsampling of the decoder link in UNet. Through embedding vector extraction, the multi-level feature maps output by the 2nd, 3rd and 4th stages are input into the designed JEU module, and the feature maps of stage 4 (w x w) and stage 3 (2w x 2w) are upsampled to the same size as stage 2, 4w x 4w. The concatenated operation is performed on the feature maps after joint upsampling, and a multi-level feature map T with a size of 4w x 4w x X (X = 4k + 8k + 16k = 28k = 896) is obtained. After joint upsampling, the new 3 feature maps are combined into a multi-level feature map T, which has a size of 4w x 4w x X, where X = 4k + 8k + 16k = 28k = 896. The multi-level feature map T contains 4w x 4w embedding vectors with a size of 1 x X, each embedding vector contains semantic information of 3 different receptive fields, and each embedding vector is one-to-one corresponding to each position (x, y) in the original image.
[0166] 1.4.3 Multi-level feature map spatial channel excitation
[0167] After joint upsampling, the JPU block then uses four different expansion rates of dilated convolution to extract features and perform splicing, with the purpose of capturing feature information at different scales in the multi-level feature map to ensure the accuracy of the semantic segmentation upsampling decoder. However, each scale of feature map in the multi-level feature map itself contains semantic information of different receptive fields, and the use of multiple dilated convolutions may repeat the multi-level embedding vector itself, resulting in no obvious effect on the improvement of semantic segmentation accuracy. In addition, the multi-level feature map T contains X channels, each channel is obtained by convolution kernel operation with different parameters, and the relevance between these channels has not been paid attention to, so its accuracy improvement for semantic segmentation prediction results is limited.
[0168] In order to adaptively recalibrate the feature response of the channel direction and model the mutual dependence between different channels. We introduce the SE (Squeeze-and-Excitation) module into the JEU block, which integrates spatial attention into the structure of the upsampling network, which is also the significant difference between JEU and JPU modules. As shown in formula 2.13, for the Tensor T of 4w x 4w x X, a global average pooling function is used to compress it into a 1 x X feature vector F, and the xth element F x of F is calculated as follows:
[0169]
[0170] In the formula, F(x) corresponds to the xth channel of Tensor T, and I and J are the xth channel feature map T xwhere I and J are the height and width of the feature map (I = J = 4w), and i and j represent the coordinates of each point on the feature map. To establish the relevance between different channel features, F is connected with two fully connected layers to calculate the contribution weight of different channels during the learning process, and to activate the corresponding channel in the feature map during prediction, as shown in equation (2.14).
[0171]
[0172] where δ() represents the ReLU activation function and σ() represents the Sigmoid activation function.
[0173] During the learning process, the feature vector F is mapped through two fully connected layers to form the final weight vector W, and the weight of each channel in W is x The importance of the corresponding channel x in the multi-level feature map T is predicted, thereby modeling the correlation between feature channels. In the operation of the two fully connected layers, the vector F is scaled (1 / 2) and restored once to reduce the amount of calculation, w1 is the mapping weight vector of the first fully connected layer, and w2 is the mapping weight vector of the second fully connected layer. represents the feature map T corresponding to the xth channel x and the weight vector W x The weighted multiplication of the excitation feature map, the JEU block gives each channel c in the multi-level feature map T obtained by joint upsampling a new response weight through the weight vector W, and finally obtains the multi-level feature map after spatial channel excitation
[0174] 1.5 Crack region removal
[0175] 1) Crack edge detection: Apply Sobel operator or Canny edge detection algorithm in the gray column segmentation map to extract the edge information in the image. By analyzing the connectivity of the edge image, the edge features of the crack region are preliminarily identified.
[0176] 2) Adaptive gating mechanism application: Introduce an adaptive gating module (Adaptive Gating Mechanism) in the feature extraction layer of the convolutional neural network. This module adjusts the feature points through a dynamic gating function (such as the Sigmoid function), gives higher weights to the edge features of the crack region, and attenuates the noise interference of the gray column, to improve the accuracy of crack detection.
[0177] 3) Connected component analysis: Perform connected component analysis on the image after adaptive gating processing. First, extract all connected components that may belong to cracks, and filter these connected components by area size, shape contour, etc. to remove small or irregular connected components, and ensure that only the true crack region is retained.
[0178] 4) Crack filling: After determining the crack area, fill the crack area by region filling algorithm such as morphological closing operation. If the crack area is large, use multi-scale filling strategy, i.e. fill from the center to the edge layer by layer, to ensure that the filled ash column image is complete and intact, so as to facilitate subsequent color detection.
[0179] 1.6 Color feature extraction
[0180] 1) Color space conversion: Convert the ash column area image after removing the crack from the RGB color space to the CIELAB color space. This conversion process can better simulate the perception of human eyes to color and adapt to the changes of different lighting environments.
[0181] 2) Color channel separation: In the CIELAB space, extract the L (brightness), a (red-green component) and b (yellow-blue component) values. On this basis, calculate the average value of L value of all pixels in the ash column area to represent the color gray scale information of the ash column. The average value of L value can accurately reflect the depth of the ash column color.
[0182] 1.7 Color calibration and gray scale equalization
[0183] 1) D65 light source calibration: Based on the D65 light source of CIELAB color space standard, calibrate the image color to ensure that the detection result is not affected by the change of external light, especially to maintain consistent color measurement under different environmental lighting.
[0184] 2) Gray scale equalization: Use the gray scale histogram equalization method to process the ash column image after removing the crack, dynamically adjust the image brightness and contrast, and make the gray scale distribution more uniform, so as to ensure the stability of the ash column color detection in different combustion stages.
[0185] 1.8 Detection of crack rate
[0186] The ash column crack rate is calculated according to formula (2.15):
[0187]
[0188] In the formula, CR is the crack rate, unit: percentage (%); S1 is the ash column area, unit: square millimeter (mm2); S2 is the crack area, unit: square millimeter (mm2). 2
[0189] The detection process of crack rate in ash column detection system is shown in Figure 1 First, extract the contour of the cigarette in the ash column image, segment the ash column area, and then segment the ash column area and crack area according to the carbon line position and crack area determined by the algorithms in chapters 4 and 5, calculate the ash column area and crack area, and then calculate the crack rate.
[0190] The above detailed description of the embodiments is only intended to explain the present application, so that the present application can be better understood, but these descriptions cannot be interpreted as limiting the present application in any way, and in particular, the features described in different embodiments can be arbitrarily combined with each other to form other embodiments, and these features should be understood as being applicable to any one embodiment, and not limited to the described embodiments, unless explicitly described otherwise.
Claims
1. A method for calculating a cigarette ash leakage rate, characterized by, The cigarette ash package crack rate calculation method comprises: Obtaining multi-angle ash package images during cigarette combustion, and preprocessing the multi-angle ash package images; Segmenting the ash column region in the preprocessed ash package image based on a convolutional neural network; Removing the crack region in the ash column region, and performing edge detection and region filling based on an adaptive gating mechanism and connected component analysis; Calculating the crack rate of the segmented and crack region-removed ash column region and outputting the calculation result; The step of removing the crack region in the ash column region comprises the following steps: Using a CSegNet and JEUNet fusion model to identify the crack region; Using JEUNet to detect cracks; during the decoding process of JEUNet, the outputs of the second, third, and fourth stages are input into the designed JEU module, which replaces the three-scale convolutional continuous up-sampling in the original UNet; the output of the JEU module is up-sampled once and concatenated with the output of the first decoding stage, and then two 3x3 convolution operations are performed in the same layer, and finally the up-sampled to the original image size is connected with the initial convolution result of the original image, and the prediction result is obtained after two convolution operations; in the decoder decoding part, the up-sampled feature map is concatenated with the shallow layer features of the encoder part, which can improve the prediction accuracy of local pixels; Through embedded vector extraction, the multi-level feature maps output by the second, third, and fourth stages are input into the designed JEU module, and the feature maps of stage 4 and stage 3 are up-sampled to the same size as stage 2, and the concatenated feature maps are obtained. The size of the multi-level feature map T is 4w×4w×X; The feature vector F is mapped through two fully connected layers to form the final weight vector W, and the weight value W of each channel in W x The importance of the corresponding channel x in the multi-level feature map T is predicted, thereby modeling the correlation between the feature channels. The JEU module gives each channel c in the multi-level feature map T obtained by joint up-sampling a new response weight through the weight vector W, and finally obtains a multi-level feature map after spatial channel excitation .
2. The method of claim 1, wherein, For the multi-level feature map T of 4w×4w×X, a global average pooling function is used to compress it into a 1×X feature vector F; Segmenting the ash column region in the preprocessed ash package image based on a convolutional neural network, 3. The method of claim 1, wherein the method comprises: Including using a parallel attention mechanism to combine a ResNeXt50 convolutional network and a Swin-Transformer network to extract ash column features in each of the ash package images. Segmenting the ash column region in the preprocessed ash package image based on a convolutional neural network, comprising: In the encoder part, a convolutional neural network module is used to extract multi-scale features from the image, and the feature maps are divided into multiple stages according to different scales, and the Squeeze-and-Excitation module is used to enhance the feature channel correlation; 4. The method of claim 1, wherein, In the decoder part, the feature map is up-sampled by the joint excitation up-sampling module, and the spatial and channel attention mechanisms are combined to improve the segmentation accuracy.
5. The method of claim 1, wherein the method comprises: Removing the crack region in the ash column region also includes using a CSegNet network model to extract features and perform attention weighting to segment the crack region and the ash column region. In the step of removing the crack region in the ash column region, and based on the adaptive gating mechanism and the connected component analysis, the edge detection and region filling are performed, comprising the following sub-steps: Using a Sobel operator or a Canny edge detection algorithm to extract the crack edge; An adaptive gating module is embedded in a deep convolutional network to enhance the crack features and suppress the non-crack features. Connected domains of the crack region are extracted, and the feature regions are screened according to the area and shape. The crack region is filled, and the color measurement of the ash column region is performed.
6. The method of claim 1, wherein, The formula for calculating the crack rate includes: CR=S2 / S1×100 In the formula, CR is the crack rate; S2 is the area of the crack region of the cigarette; S1 is the total area of the ash column S1.
7. The method of claim 1, wherein, The output calculation result includes: expressing the crack rate in percentage and generating a crack rate trend chart.
8. The method for calculating the ash crack rate of cigarette packs as described in claim 7, characterized in that, The output calculation result also includes: generating a detection report containing the crack rate and the ash column integrity.
9. The method of claim 1, wherein, A multi-angle imaging system is used to take pictures of a continuously burning cigarette and obtain multi-angle ashed images, which at least include front view, side view and top view.
10. The method for calculating the ash crack rate of cigarette packs as described in claim 9, characterized in that, A bionic puffing machine based on cigarette combustion is used to maintain the continuous combustion of the cigarette.
11. A cigarette apparent combustion quality detection system, characterized in that, The system implements the method of any one of claims 1-10, including the following modules: A multi-angle image acquisition module acquires ashed images of different angles during the cigarette combustion process. An ash column segmentation module segments the ash column region based on a parallel hybrid attention mechanism. A crack removal module removes the crack region in the ash column image through an adaptive gating mechanism. A crack rate calculation module automatically calculates the crack rate based on the cigarette ash crack rate formula. A result output module generates the crack rate detection result and the crack rate trend chart.
12. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the calculation method according to any one of claims 1 to 10.
13. A computer device comprising a memory and a processor, having stored on the memory a computer program capable of running on the processor, characterized in that, The processor, when executing the computer program, implements the steps of the calculation method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Road scene semantic segmentation method based on convolutional neural network
CN112508956A
Dam crack detection method based on unmanned aerial vehicle image and deep learning
CN118072193A