Calculation method, detection system and device for cigarette ash packing crack rate
Through multi-angle imaging and deep learning technology, combined with parallel hybrid attention mechanism and convolutional neural network, automatic segmentation of cigarette ash column area and removal of crack areas are achieved, solving the accuracy and robustness problems in existing detection technologies, and significantly improving the accuracy of cigarette crack rate detection.
Patent Information
- Application Number
- CN202411893998.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The existing cigarette detection technology has problems such as low detection accuracy, susceptibility to light and blurred crack characteristics, making it difficult to achieve accurate cigarette crack detection and segmentation in complex backgrounds.
The multi-angle imaging system is used to obtain the image of the cigarette combustion process, and the convolutional neural network combining ResNeXt50 and Swin-Transformer structure is used to automatically segment the gray column area, and the crack area in the gray column image is removed through adaptive gating mechanism and connectivity domain analysis, and the crack rate is finally calculated.
It significantly improves the accuracy and robustness of cigarette ripsy rate detection, solves the problems of low accuracy, light impact and blurred characteristics in traditional detection methods, and provides reliable data support and analysis tools for cigarette quality control and production optimization.
Smart Images

Figure CN119722649A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cigarette detection, and in particular to a method for calculating the ash crack rate of cigarette packages, a detection system and a device. Background Art
[0002] In the process of cigarette production quality control, cigarette combustion performance is one of the important indicators for evaluating cigarette products. The burning process of cigarettes directly affects the consumer experience, and the ash crack rate is one of the key parameters for measuring the burning quality of cigarettes. The ash 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 area. The lower the crack rate, the higher the integrity of the ash column and the stronger the ability of the cigarette to maintain its structure during the combustion 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 formulas.
[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 are easily affected by lighting, and crack feature ambiguity. In addition, due to the complex surface morphology of the gray column, manual detection efficiency is low 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, deep learning-based detection methods have begun to show significant advantages in the field of industrial detection. These methods can automatically and accurately detect and segment complex gray column cracks through automatic feature extraction and high-precision image recognition capabilities of deep learning models.
[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 lighting 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 great challenges 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 under complex backgrounds remains a research focus in this field.
[0005] In view of this, the inventor, based on many years of experience in production design in this field and related fields, has designed a cigarette pack ash crack rate calculation method, detection system and device through repeated experiments, in order to solve the problems existing in the prior art. Summary of the invention
[0006] The object of the present invention is to provide a method for calculating the cigarette ash tear rate, a detection system and a device, which can effectively improve the detection accuracy of the cigarette ash tear rate.
[0007] In order to achieve the above-mentioned purpose, the present invention provides a method for calculating the crack rate of cigarette ash packs, a detection system and a device, wherein the method for calculating the crack rate of cigarette ash packs includes:
[0008] Acquire ash images of cigarettes at multiple angles during the burning process, and pre-process the ash images at multiple angles;
[0009] The gray column area in the preprocessed gray-enclosed image is segmented based on a convolutional neural network;
[0010] Remove the gaps in the gray column area, and perform edge detection and area filling based on the adaptive gating mechanism and connected domain analysis;
[0011] The crack rate of the gray column area after segmentation and removal of the crack area is calculated and the calculation result is output.
[0012] The present invention also provides a cigarette apparent combustion quality detection system, characterized in that the system implements the above method and comprises the following modules:
[0013] Multi-angle image acquisition module, which can obtain ash images from different angles during cigarette burning;
[0014] Gray column segmentation module, which segments the gray column area based on a parallel hybrid attention mechanism;
[0015] The crack removal module removes the crack area in the gray column image through an adaptive gating mechanism;
[0016] The crack rate calculation module automatically calculates the crack rate based on the cigarette ash crack rate formula;
[0017] The result output module generates the crack rate detection results and the crack rate change trend chart.
[0018] The present invention also provides a computer-readable storage medium on which a computer program is stored, characterized in that the computer program implements the steps of the above-mentioned calculation method when executed by a processor.
[0019] The present invention also proposes a computer device, comprising a memory and a processor, wherein a computer program that can be run on the processor is stored in the memory, and the device is characterized in that the steps of the above-mentioned calculation method are implemented when the processor executes the computer program.
[0020] Compared with the prior art, the present invention has the following characteristics and advantages:
[0021] The present invention proposes a method for calculating the crack rate of cigarette package ash, a detection system and a device. The method obtains images of the cigarette burning process through a multi-angle imaging system, automatically segments the gray column area by using a parallel hybrid attention mechanism (PHAM-YOLO) combined with a convolutional neural network (CNN) of ResNeXT50 and Swin-Transformer structures, and removes the crack area in the gray column image by using an adaptive gating mechanism and connected domain analysis. Finally, the crack rate is determined by calculating the ratio of the crack area area to the total area of the gray column. The method significantly improves the accuracy and robustness of cigarette crack rate detection, solves the problems of low detection accuracy, susceptibility to light influence and fuzzy crack features existing in traditional detection methods, provides reliable data support and analysis tools for cigarette quality control and production optimization, realizes the automatic and intelligent detection of cigarette combustion quality, and improves detection efficiency and objectivity. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings described herein are only for explanation purposes and are not intended to limit the scope of the present invention in any way. In addition, the shapes and proportional dimensions of the various components in the figures are only schematic, used to help understand the present invention, and are not specifically limited to the shapes and proportional dimensions of the various components of the present invention. Those skilled in the art can select various possible shapes and proportional dimensions to implement the present invention according to the teachings of the present invention.
[0023] Figure 1 It is a schematic diagram of the detection process of the crack rate of the present invention;
[0024] Figure 2 Schematic diagram of the PHAM-YOLO network model structure of the present invention;
[0025] Figure 3a It is a schematic diagram of the overall structure of the parallel hybrid attention mechanism PHAM of the present invention;
[0026] Figure 3b It is a schematic diagram of the parallel hybrid attention mechanism PHAM channel attention module of the present invention;
[0027] Figure 3c It is a schematic diagram of the parallel hybrid attention mechanism PHAM spatial attention module of the present invention;
[0028] Figure 3d It is a schematic diagram of the coordinate attention module of the parallel hybrid attention mechanism PHAM of the present invention;
[0029] Figure 4 It is a schematic diagram of the SPPF structure of the present invention;
[0030] Figure 5 It is a schematic diagram of the average precision mean value of the present invention;
[0031] Figure 6 It is a schematic diagram of the CSegNet network structure of the present invention;
[0032] Figure 7 It is a schematic diagram of the ResNeXTR network structure of the present invention;
[0033] Figure 8 Schematic diagram of the residual block of the present invention;
[0034] Fig. 9 Schematic diagram of the encoder structure of the Swin-Transformer of the present invention;
[0035] Fig.10a It is a schematic diagram of the ECBAM module structure of the present invention;
[0036] Fig.10b It is a schematic diagram of the ECAM module structure of the present invention;
[0037] Fig.10c It is a schematic diagram of the SAM module structure of the present invention;
[0038] Fig.11 A schematic diagram of the JEUNet network structure of the present invention;
[0039] Fig.12 This is a schematic diagram of the structure of the joint excitation upsampling (JEU) module of the present invention;
[0040] Fig.13 It is a schematic diagram of the method for calculating the cigarette pack ash crack rate of the present invention;
[0041] Fig.14 It is a schematic diagram of the edge detection and area filling steps of the present invention. DETAILED DESCRIPTION
[0042] The details of the present invention can be more clearly understood with reference to the accompanying drawings and the description of the specific embodiments of the present invention. However, the specific embodiments of the present invention described herein are only used for the purpose of explaining the present invention and cannot be understood as limiting the present invention in any way. Under the guidance of the present invention, technicians can conceive of any possible variations based on the present invention, which should all be considered to belong to the scope of the present invention.
[0043] The present invention proposes a method for calculating the cigarette pack ash crack rate, a detection system and a device, such as Fig.13 As shown, the method for calculating the cigarette pack ash crack rate includes:
[0044] Acquire ash images of cigarettes at multiple angles during the burning process, and pre-process the ash images at multiple angles;
[0045] The gray column area in the preprocessed gray-enclosed image is segmented based on a convolutional neural network;
[0046] Remove the gaps in the gray column area, and perform edge detection and area filling based on the adaptive gating mechanism and connected domain analysis;
[0047] The crack rate of the gray column area after segmentation and removal of the crack area is calculated and the calculation result is output.
[0048] The present invention proposes a method, detection system and device for calculating the crack rate of cigarette pack ash, and the method for calculating the crack rate of cigarette pack ash comprehensively uses multi-angle imaging, convolutional neural network and adaptive gating technologies. The detection accuracy is significantly improved, and ash columns and cracks can be accurately identified; the stability is greatly enhanced, and it is adaptable to different cigarettes and combustion stages; it strongly promotes cigarette quality control and production optimization, and effectively improves product quality and market competitiveness.
[0049] In an optional embodiment of the present invention, the gray column area in the preprocessed gray-encased image is segmented based on a convolutional neural network, including extracting gray column features in each gray-encased image using a parallel attention mechanism combined with a ResNeXt50 convolutional network and a Swin-Transformer network. The characteristics of the ResNeXt50 convolutional network enable it to efficiently learn rich and accurate local features from the gray-encased image, while the Swin-Transformer network makes up for its shortcomings in capturing long-distance correlations. The two work together to enhance the overall grasp of gray column features. The channel, space, and coordinate attention mechanisms in the parallel attention mechanism can effectively focus on gray column defect features, reduce the weight input of useless background information, and combined with the operation of the decoder part, improve the accuracy of gray column area segmentation, making the subsequent calculation of the crack rate based on the gray column area more accurate and reliable.
[0050] In an optional embodiment of the present invention, the gray column area in the preprocessed gray package image is segmented based on a convolutional neural network, including: in the encoder part, a convolutional neural network module is used to extract multi-scale features of the image, the feature map is divided into multiple stages according to different scales, and the feature channel correlation is enhanced by the Squeeze-and-Excitation module; in the decoder part, the feature map is upsampled by a joint excitation upsampling module, and the segmentation accuracy is improved by combining the space and channel attention mechanism. The use of multi-scale feature extraction and the Squeeze-and-Excitation module in the encoder enables the network to fully explore the detailed features in the image, strengthen the key feature channels, and improve the feature expression ability. The joint excitation upsampling of the decoder part is combined with the space and channel attention mechanism to effectively overcome the problem of inaccurate segmentation that is easy to occur in traditional methods when processing complex gray column images. On the whole, the accuracy and reliability of gray column area segmentation are greatly improved, the occurrence of misjudgment and missed judgment is reduced, and a solid foundation is laid for the subsequent accurate calculation of the cigarette package ash crack rate.
[0051] In an optional embodiment of the present invention, the crack area in the ash column area is removed, including using a fusion model of CSegNet and JEUNet to identify the crack area. CSegNet can effectively extract and enhance the crack features through its unique network structure and module combination, but it consumes a lot of computing resources. JEUNet ensures the accuracy of semantic segmentation while improving the upsampling speed, and has high computational efficiency. After the fusion of the two, both detection accuracy and computational efficiency are taken into account. It can not only accurately identify the crack area under complex background, but also reduce the occupation of computing resources, improve the operation speed and stability of the entire detection system, thereby providing a reliable guarantee for the accurate calculation of the crack rate of cigarette pack ash, and helping to improve the efficiency and reliability of cigarette quality detection.
[0052] In an optional embodiment of the present invention, removing the crack area in the gray column area also includes using the CSegNet network model in combination with the ECBAM module to perform feature extraction and attention weighting to segment the crack area and the gray column area. The CSegNet network model combined with the ECBAM module can deeply mine image features. The combined use of ResNeXt50 and Swin-Transformer makes feature extraction more comprehensive and enhances the ability to recognize different types of cracks. The ECBAM module uses a unique attention weighting mechanism to allow the network to focus on the crack area, significantly improving segmentation accuracy and reducing misjudgments.
[0053] In an optional embodiment of the present invention, Fig.14As shown in the figure, in the steps of removing the crack area in the gray column area and performing edge detection and area filling based on the adaptive gating mechanism and connected domain analysis, the following sub-steps are included: using the Sobel operator or the Canny edge detection algorithm to extract the crack edge; embedding the adaptive gating module in the deep convolutional network to enhance the crack features and suppress the non-crack features; extracting the connected domain of the crack area, and filtering the feature area according to the area and shape; filling the crack area and measuring the color of the gray column area. The Sobel operator or the 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 area more accurate. The connected domain analysis combined with the screening criteria further eliminates interference factors and ensures the accuracy of the crack area extraction. Accurate crack filling ensures the integrity of the gray column area, making the color measurement results more accurate and reliable.
[0054] In an optional embodiment of the present invention, the calculation formula of the crack rate includes:
[0055] CR=S2 / S1×100
[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, presented as a percentage, intuitively quantifies the degree of cracking in the ash area of the cigarette pack, making the evaluation of cigarette combustion quality more intuitive and accurate. By accurately calculating S2 and S1 and deriving the crack rate based on this formula, a clear quality control indicator is provided for cigarette manufacturers. Based on this indicator, companies can quickly determine the stability and integrity of the product during the combustion process and promptly discover problems in the production process, such as differences in raw materials, fluctuations in production processes, etc., which affect the combustion quality of cigarettes.
[0058] In an optional embodiment of the present invention, the calculation results are output, including: expressing the crack rate in percentage form and generating a crack rate change trend graph. The crack rate change trend graph further enhances the readability and analytical value of the data, and can clearly reflect the quality fluctuation trend of cigarettes at different combustion stages, different batches or different production conditions. By observing and analyzing the trend graph, one can gain an in-depth understanding of the stability of the cigarette combustion quality, more comprehensively analyze the apparent combustion quality of cigarettes, and the quality fluctuation trend of cigarettes at different combustion stages, different batches or different production conditions, and promptly discover potential quality problems.
[0059] In an optional example of this implementation, outputting the calculation results also includes: generating a test report including the crack rate and ash column integrity. Based on the data obtained from a series of operations such as the acquisition, preprocessing, ash column area segmentation, crack area removal, and crack rate calculation of multi-angle package ash images during cigarette combustion, the system generates a report that can not only understand the immediate quality status of the product during the combustion process based on the crack rate value, but also further analyze the product's performance in terms of structural retention through ash column integrity evaluation.
[0060] In an optional embodiment of the present invention, a continuously burning cigarette is photographed by a multi-angle imaging system to obtain multi-angle ash package images, and the multi-angle ash package images include at least a front view, a side view, and a top view. The front view, the side view, and the top view complement each other, and fully display the various characteristics of the ash column during the burning process, which greatly increases the integrity of the image information. In terms of crack detection, it can effectively avoid missed detection or misjudgment due to viewing angle limitations, and more accurately determine the position, shape, and size of the crack, especially for complex cracks. The rich multi-angle image data provides a solid foundation for subsequent processing, improves the accuracy of operations such as ash column area segmentation and crack detection, and thus improves the accuracy and reliability of the calculation of the entire cigarette ash crack rate.
[0061] In an optional example of this embodiment, a bionic suction machine based on cigarette burning is used to keep the cigarette burning continuously. The bionic suction machine can ensure the stability and consistency of the cigarette burning process, and overcome the problem of uneven combustion caused by environmental factors (such as air flow fluctuations, temperature changes, etc.) during natural combustion. The stable combustion process makes the acquired ash bag image more repeatable and comparable, whether it is a comparative test of different batches of cigarettes or repeated tests of the same cigarette at different times, it can be carried out under the same combustion conditions.
[0062] The present invention also provides a cigarette apparent combustion quality detection system, characterized in that the system implements the above method and comprises the following modules:
[0063] Multi-angle image acquisition module, which can obtain ash images from different angles during cigarette burning;
[0064] Gray column segmentation module, which segments the gray column area based on a parallel hybrid attention mechanism;
[0065] The crack removal module removes the crack area in the gray column image through an adaptive gating mechanism;
[0066] The crack rate calculation module automatically calculates the crack rate based on the cigarette ash crack rate formula;
[0067] The result output module generates the crack rate detection results and the crack rate change trend chart.
[0068] The present invention also provides a computer-readable storage medium on which a computer program is stored, characterized in that the computer program implements the steps of the above-mentioned calculation method when executed by a processor.
[0069] The present invention also proposes a computer device, comprising a memory and a processor, wherein a computer program that can be run on the processor is stored in the memory, and the device is characterized in that the steps of the above-mentioned calculation method are implemented when the processor executes the computer program.
[0070] like Figure 1 As shown, a method for calculating the ash crack rate of cigarette packages comprises the following steps:
[0071] 1) Input the sample image of the cigarette burning process to be tested, and obtain the ash package images at different angles through the multi-angle imaging system to ensure the comprehensiveness and diversity of the image data;
[0072] 2) Automatic segmentation of gray column areas is achieved based on convolutional neural networks (CNNs). The parallel hybrid attention mechanism (PHAM-YOLO) combined with the ResNeXT50 and Swin-Transformer structures is used to extract gray column features to achieve accurate separation of gray column areas and background areas.
[0073] 3) Remove the crack area in the gray column image. Based on the adaptive gating mechanism and connected domain analysis, the crack is removed by edge detection and area filling to ensure that the crack area does not affect the color measurement of the gray area.
[0074] 4) Calculating the crack rate CR of the ash area of the split and crack-removed cigarette, including extracting the crack area S2 and the total area of the ash column S1, and calculating the crack rate according to the formula CR=S2 / S1×100, where S1 is the total area of the ash column area and S2 is the crack area;
[0075] 5) Output the ash bag crack rate detection results, express the crack rate in percentage form and generate a crack rate change trend chart for analysis of apparent combustion quality.
[0076] 1.1 Image processing
[0077] 1.1.1 Image acquisition module
[0078] A high-resolution still imaging camera used to obtain static images of the char lines during cigarette burning.
[0079] A dynamic imaging camera is used to capture real-time images of the changing char lines as a cigarette burns.
[0080] Through dual-camera collaborative imaging, the charcoal line characteristics of cigarette burning can be captured at different time points and viewing angles, 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: Use a standard color chart to calibrate the image to eliminate color deviations under different lighting conditions.
[0084] Light uniformity adjustment: According to the changes in ambient light, adjust the light uniformity of the image to ensure the clarity and consistency of the cigarette charcoal line image during the burning process.
[0085] Image denoising: Use noise filtering algorithms to remove interference factors such as smoke and ash generated during cigarette burning, thereby enhancing 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 its advantages of fast running speed and high detection accuracy, it has been successfully applied in a large number of applications. The algorithm has now developed to the eighth generation, but the more stable YOLO v5 network structure is still commonly used. Aiming at the image features of cigarette burning charcoal lines in different detection equipment scenarios such as straight lines and turntables, the parallel hybrid attention mechanism PHAM (Parallel Hybrid Attention Mechanism) is embedded in the YOLO v5 network structure to build a PHAM-YOLO network model.
[0089] Figure 2This is a schematic diagram of the network structure of PHAM-YOLO. The PHAM-YOLO network is divided into the backbone network Backbone, the feature processing network Neck, and the target prediction network Head. Among them, CBS, Focus, and CSP are the three main convolution modules in each network: ① The CBS convolution module consists of the convolution layer Conv, the normalization layer BactchNorm2d, and the activation function SiLU; ② The Focus module downsamples and splices the initial data in alternate columns, and the original H×W×3 image is sliced into a feature map of H / 2×W / 2×12. After splicing, it undergoes a CBS convolution operation again, becoming a size of H / 2×W / 2×32. This operation can ensure that information is not lost during downsampling; ③ CSP is a residual module, CSP1 (divided into CSP1_1 and CSP1_3) is used in Backbone, and CSP2 is used in Neck. In addition, the function of the Concat module is to splice the feature map. PHAM-YOLO embeds the PHAM module in the backbone network of YOLO v5. The PHAM module contains three attention mechanisms: channel, space, and coordinates. It 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 continuous fixed convolution kernels to quickly pool the input feature map to fuse feature maps of different receptive fields to improve the expressiveness of the feature map; the bounding box regression (BBR) is used to improve the accuracy of the burning charcoal line positioning, and the EIOU (Efficient Intersection over Union) is introduced 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: channel, space, and coordinate, which can effectively focus on defect features and reduce the weight input of useless background information. Figure 3a As shown in Figure 1, it is a schematic diagram of the network structure of PHAM, where 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. Figure 3b As shown in Figure 1, it is a structural diagram of the channel attention mechanism module, which performs two-dimensional global maximum / average pooling operations on the initial features F to obtain two sets of feature vectors, and then transmits these two sets of feature vectors to the multi-layer perceptron (MLP) network to obtain the channel attention feature map Wc(F). Figure 3cThe figure shows the structure of the spatial attention mechanism module, which performs a 2D global pooling operation and uses a convolution kernel to reduce the channel dimension to 1 to generate a spatial attention feature map Ws(F). 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 through global pooling to capture the local correlation of the feature map.
[0092] like Figure 3d As shown in Figure 1, it is the structural diagram of the coordinate attention mechanism module of the lower branch. First, the input feature map is average pooled in the horizontal and vertical directions using convolution kernels of size (H, 1) and (1, W), respectively. The output of the c-th channel with a height of h and a width of w is:
[0093]
[0094] By transforming formula (1.1) and formula (1.2), we can obtain the global receptive field and accurate location information. In order to make better use of the generated features, first, z h and z w Concatenate
[117] Operation, the connected features are processed by transformation function and nonlinear activation function respectively, and output f:
[0095] f=δ(F1([Z h ,Z w ]))(1.3)
[0096] Where F1 is the conversion function with a convolution kernel of 1×1, δ is the nonlinear activation function, and f is the intermediate feature map that encodes spatial information in the horizontal and vertical directions.
[0097] Secondly, f is divided into two independent tensors, and the coordinate attention mechanism map W2(F) of the lower branch is obtained through 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 transformed into W(F) through the nonlinear activation function δ to form the 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 to change the size of the feature map in the YOLO network. SPP first performs a CBS operation on the input feature map, and then performs a maximum pooling operation on the feature map output by CBS using convolution kernels of sizes 3×3, 5×5, and 9×9, and then cascades it with the feature map output by CBS and sends it to the CBS module. Although the SPP module realizes the function of converting feature maps to a specific size, this parallel connection method ignores the impact of feature maps with different receptive fields on model performance and increases the additional computational overhead of the model.
[0101] The SPPF (Spatial Pyramid Fast Pooling) structure replaces the parallel maximum pooling operation of three convolution kernels of different sizes in the original SPP with the serial operation of three convolution kernels of the same size. Figure 4 As shown in the figure, SPPF first performs a 5×5 maximum pooling operation on the data transmitted serially from the CBS structure (cancelling ① and ②), and then passes the data into the CBS structure through cascade concatenation (adding ③ and ④). SPPF uses continuous fixed convolution kernels to pool the input feature maps, fusing feature maps of different receptive fields, enriching the expressive power of feature maps without increasing computational overhead.
[0102] 1.2.4EIOU 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 true box. IOU is the ratio of the intersection and union between the predicted box and the true box, as shown in formula (1.5). It satisfies non-negativity, identity, symmetry and triangle inequality. Regardless of the size of the predicted box, its value is between 0 and 1. In actual use, IOU loss is shown in formula (1.6). However, IOU loss cannot optimize the situation where the real box and the predicted box do not intersect, nor can it reflect how the real box and the predicted box intersect. In order to solve these problems, the minimum enclosing rectangle of the real box and the predicted box is introduced on the basis of IOU, as shown in formula (1.7):
[0104]
[0105] L IOU =1-IOU (1.6)
[0106]
[0107] Where: C is the area of the minimum circumscribed rectangle of the predicted box and the true box, but GIOU loss still has some problems. When the predicted box and the true box are included, GIOU loss degenerates into IOU loss; when the predicted box and the true box intersect, the convergence is slow in the horizontal and vertical directions. DIOU loss and CIOU loss, these two types of losses directly minimize the normalized distance between the predicted box and the true box to increase the convergence speed, and make the regression results more accurate when the target box overlaps or even contains the target box, as shown in formulas (1.8) to (1.11).
[0108]
[0109] Among them: α is the weight function, ν is used to measure the consistency of the aspect ratio, ρ represents the Euclidean distance between the two center points, and c represents the diagonal length of the minimum circumscribed rectangle of the predicted box and the true box. However, DIOU loss does not consider the vertical and horizontal dimensions of the predicted bounding box during the regression process, and there is still room for further improvement in accuracy; CIOU loss describes a relative value, but there is a certain ambiguity. This paper uses the EIOU loss function instead of the CIOU loss function as the boundary loss function, and its definition is shown in formula (1.12). It comprehensively considers the overlapping area, the distance between the center points, and the actual width and height difference. It solves the problems existing in the CIOU loss function, making the model converge faster and the regression process more stable.
[0110]
[0111] 1.3CSegNet Network
[0112] In order to achieve accurate segmentation of the cracks in the packet, this paper proposes a crack segmentation algorithm (Crack Segmentation Network, CSegNet) that combines convolutional neural network CNN and Transformer self-attention mechanism. The CSegNet network uses an Encoder-Decoder encoding and decoding framework similar to DeepLab V3+, and includes the following steps:
[0113] 1) Obtain crack images during cigarette burning and preprocess the images, including noise removal, grayscale calibration, and contrast enhancement;
[0114] 2) The ResNeXt-Transformer (ResNeXTR) module is used in the encoder, which includes the ResNeXt50 convolutional network and the Swin-Transformer network to extract local and global features in the image;
[0115] 3) In the decoder, an efficient convolutional block attention module (ECBAM) is combined, including an efficient channel attention module (ECAM) and a spatial attention module (SAM) to enhance the salient features of the gap area;
[0116] 4) Use average pooling and point-wise convolution operations to reduce the dimension of the encoder output to reduce the cost of self-attention calculation;
[0117] 5) Using the combined loss function of Binary Cross-Entropy with Logits and Dice loss, the Binary Cross-Entropy with Logits loss and Dice loss functions are combined with a weight of 0.5 each to optimize the segmentation accuracy and edge detection effect.
[0118] The main innovations of CSegNet are as follows:
[0119] (1) In the encoder part, a ResNeXt-Transformer (ResNeXTR) feature extraction module is designed as the backbone network. ResNeXTR enhances the feature extraction capability of the crack area in the gray-encapsulated image by combining the flexibility of Transformers in modeling long-term dependencies with the ability of CNN to capture local contextual information through local receptive fields, weight sharing, and spatial subsampling. 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 part, the Efficient Channel Attention Module (ECAM) and the Spatial Attention Module (SAM) are combined to design an Efficient Convolutional Block Attention Module (ECBAM) to further optimize the feature expression and focus on the key information of the cracks under different background colors.
[0121] (3) ReLU activation function, SGD gradient descent and Binary Cross Entropy with Logits hybrid loss function are used to speed up convergence and improve segmentation accuracy.
[0122] 1.3.1 CSegNet Algorithm Overview
[0123] The CSegNet network model adopts the basic codec architecture of DeepLab V3+, such as Figure 6 As shown in the figure. Given that Transformer is flexible in modeling long-term dependencies, while CNN can use local receptive fields, shared weights, and spatial subsampling to obtain local context information, a ResNeXt-Transfomer (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 CNN part of the ResNeXTR feature extraction module uses the ResNeXt50 network as a convolutional feature extractor, and the Transformer part uses the Swin-Transformer network based on the self-attention mechanism. In order to reduce the computational cost of self-attention calculation, average pooling is introduced to downsample the encoded dimensions. 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 cascaded with the output of SwinTransformer as shallow outputs, which are then input into the decoder and fused with the deep feature maps output by ResNet50 to become the comprehensive output of the encoder.
[0124] The decoder retains the structure of DeepLab V3+, but an ECBAM attention module is designed before outputting the classification label to strengthen the long-range interaction between low-level feature maps without significantly increasing the parameter size, thereby further optimizing the feature representation. After obtaining the multi-scale semantic feature map, the decoder performs 4x upsampling, and then fuses it with the shallow semantic information output by the ResNeXTR module. After 3×3 convolution and 4x upsampling, the feature obtains the semantic segmentation result through the ECBAM attention module.
[0125] 1.3.2 ResNeXTR network structure
[0126] The structure of the ResNeXTR feature extraction module used for feature extraction in the encoder is as follows Figure 7 As shown in the figure, ResNeXTR uses the ResNeXt50 network as a CNN feature extractor, which can learn more extensive and rich local features from the gray crack image; on the other hand, the Swin-Transformer network based on the self-attention mechanism is used as the Transformer component in the module, which enables the network to capture the long-distance correlation between different regions in the crack image. By combining the features output by these two networks, ResNeXTR constructs a feature engineering with rich shallow features and strong local feature correlation, which balances segmentation efficiency and accuracy to a certain extent.
[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, alongside depth and width, which improves the representation capability of the model without increasing its complexity.
[0130] (2) The modular design of ResNeXt50 makes the model more flexible, easier to expand, and more efficient to train.
[0131] (3) ResNeXt50 performs better on the ImageNet dataset than Xception, the initial encoder network of DeepLab V3+, and demonstrates excellent generalization capabilities in multi-task learning and different datasets. Therefore, using ResNeXt50 as part of the feature extraction network can improve model performance and enhance the stability and robustness of the model. The ResNet network of ResNeXt50 consists of multiple unique residual blocks, such as Figure 8 As shown in Figure 1, the residual blocks are distributed in four stages according to the configuration of [3, 4, 6, 3]. Through these residual blocks, the ResNeXt50 network performs in-depth feature analysis on the input image and generates multi-scale feature maps, ensuring accurate and rich semantic representation of the cracks in the input image. In actual training, we first use the ResNeXt50 network pre-trained on the public dataset ImageNet to perform preliminary feature extraction on the input image.
[0132] 1.3.2.2 Transformer with Average Pooling Layer Embedded
[0133] In addition to the above-mentioned ResNeXt module, Swin TransformerV2, which is also pre-trained on ImageNet, is introduced to parse the shallow features of the input image and construct a detailed feature map. Swin-Transformer V2 is an efficient visual Transformer network structure. Unlike traditional Transformer networks, SwinTransformer 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 capture more local and global details, thereby providing a more refined feature representation for the generation of semantic labels for cracks. Since the computational complexity of the original attention is relatively large and the requirements for the equipment are high, in order to reduce the computational complexity of the model, CSegNet has made improvements to the basic attention calculation and downsampled after calculating the K and V vectors. The specific structure is as follows: Fig. 9 shown.
[0134] In order to reduce the amount of computation in self-attention calculation, the average pooling layer P is introduced S The encoded dimension is downsampled. In order to further reduce the amount of calculation, point-by-point convolution is 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 It represents the linear layer used for encoding, and Attention is the attention calculation method, which 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, 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 does not directly optimize the parameterized bias, but uses a small meta-network update on the relative coordinates:
[0141]
[0142] In the formula, Represents a small network, such as a 2-layer MLP with ReLU activation by default. The Transformer block consists of a self-attention (SA) and MLP module, and the calculation flow is as follows:
[0143]
[0144] in, It represents the result of layer normalization (LN) of the output of self-attention SA. represents the output of MLP after layer normalization (LN), z l Represents the final output result 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 a complex background while suppressing irrelevant information from different channels, CSegNet designs an Efficient Convolutional Block Attention Module (ECBAM) at the output of the decoder. The ECBAM structure is as follows: Fig.10a In order to reduce the problem of increasing 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 Fig.10b As shown in the figure, 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 Fig.10c As shown in Figure 1, SAM performs maximum pooling and average pooling on the feature map at the same time, concatenates the results and performs an overall weighted operation on the feature map. This design enables ECBAM to focus on the global semantic information of the defect area while introducing the channel correlation of the feature map. 1.3.5 Loss Function
[0147] During the training and validation phases of the model, a joint combined loss function consisting of the Binary Cross-Entropy with Logits (BCE With Logits Loss) loss function and the Dice loss function was designed.
[0148] (1) Binary Cross-Entropy with Logits loss function is a loss function commonly used for binary classification problems, which combines the Sigmoid activation function and the binary cross entropy loss. In the crack segmentation task, the BCEWithLogits function provides clear feedback to the model, and its definition is shown in Equation 2.9:
[0149]
[0150] Where N represents the total number of samples; y i represents the true label of the i-th sample, 1 means that the pixel is a crack, and 0 means that the pixel does not belong to a crack; p i is the original output predicted by the model for the i-th pixel. i ) represents the result obtained by processing the original output of the model's prediction for the i-th pixel through the sigmoid function.
[0151] (2) The Dice loss function is different from the Binary Cross-Entropy function. The Dice loss function measures the overlap between the label and the prediction. Assuming that X represents the true label of the true crack segmentation image, and Y represents the pixel category of the model predicted segmentation image, the definition of the 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 elements in the intersection of 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 formula 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 delineation in the segmentation task.
[0157] 1.4 Research on gap semantic segmentation algorithm based on JEUNet
[0158] The research motivation of CSegNet is to achieve accurate segmentation of the bag crack area. However, since it is embedded with modules such as ResNeXt50, Swin-Transformer V2, and ECBAM, the parallel operation of these modules consumes a lot of computing resources, which is not conducive to the engineering of the algorithm. Therefore, it is necessary to study efficient semantic segmentation algorithms in order to provide a fast and accurate algorithm for the engineering implementation of bag crack detection.
[0159] In order to solve the problem that existing semantic segmentation algorithms need to consume large computing resources while achieving accurate segmentation, this section designs a Joint Excitation Up-sampling Network (JEUNet) for cleft segmentation. JEUNet is a network with an encoder-decoder symmetric structure. In the decoder stage, spatial attention and joint upsampling are integrated to replace the general layer-by-layer upsampling method. At the same time, feature information at multiple scales and the correlation of channel directions are considered, which improves the upsampling speed and enhances the accuracy of semantic segmentation.
[0160] 1.4.1 Overview of JEUNet Algorithm
[0161] Packet crack detection can be described as a pixel-level anomaly prediction task. The proposed joint excitation upsampling network JEUNet has a classic encoder-decoder symmetric structure. Its network framework is as follows: Fig.11 As shown. The yellow arrow indicates direct input; the black arrow indicates a 3×3 convolution operation with a stride of 1, which uses the zero-padding strategy to keep the feature maps of the same level at the same size; the gray arrow indicates a cut and connect operation, which cuts the left feature map to the size corresponding to the right and then connects it; the blue arrow indicates a 1×1 operation for final classification, and the last two layers of output are the result and the background; the red arrow indicates downsampling the feature map by 2×2 maximum pooling; the green arrow indicates upsampling the feature map by a factor of 2 using a 2×2 deconvolution operation. k indicates the number of base channels of the convolution feature map (in this article, k = 32).
[0162] The encoder part of JEUNet is consistent with the backbone network of UNet. The original input image is encoded in 4 stages through continuous convolutional layers, and is transmitted through 2× maximum pooling downsampling between every 2 stages. Therefore, there are 5 scales including the original image. The feature map of each scale contains information with different receptive fields. The shallow feature map is mainly the detailed texture information of local pixels, while the deep feature map contains the local semantic information in the image. In the decoding process of JEUNet, the outputs of the 2nd, 3rd and 4th stages are input to the designed JEU (Joint Excitation Up-sampling block) module, which replaces the continuous upsampling of convolutions at three scales in the original UNet. The output of the JEU module is upsampled once and cascaded with the output of the first stage of the encoder, and then two 3×3 convolution operations are performed in the same layer. Finally, it is upsampled 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 cascade operation of the upsampled feature map and the shallow features of the encoder part can improve the local prediction accuracy of the pixel.
[0163] 1.4.2JEUNet Module
[0164] The Jointly Excited Upsampling (JEU) module is a computational unit that integrates spatial attention into the joint upsampling network. On the one hand, three feature maps with different receptive fields are resized 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. During the upsampling process, the JEU module simultaneously considers the correlation of multi-scale feature information and channel direction, improving the accuracy of semantic segmentation while reducing the complexity of upsampling calculations. Fig.12 The structural diagram of the JEU block is shown, the purple arrow indicates the joint upsampling path, and the red arrow indicates the feature map excitation path for multi-level feature map joint upsampling.
[0165] The JEUNet of the present invention uses joint upsampling to replace the initial two layer-by-layer upsampling in the decoder link of UNet. Through embedding vector extraction, the multi-level feature maps output by the 2nd, 3rd and 4th stages are respectively input into the designed JEU module, and the feature maps of stage 4 (w×w) and stage 3 (2w×2w) are upsampled to 4w×4w of the same size as stage 2. The feature maps after joint upsampling are concat-operated to obtain a multi-level feature map T of size 4w×4w×X (X=4k+8k+16k=28k=896). After joint upsampling, the new three feature maps are concatenated and merged into a multi-level feature map T of size 4w×4w×X, where X=4k+8k+16k=28k=896. The multi-level feature map T contains 4w×4w embedding vectors of size 1×X, each of which contains semantic information of three different receptive fields and corresponds one-to-one 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 4 dilated convolutions with different expansion rates to extract features and concatenate them. The purpose is to capture 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 the feature map in the multi-level feature map itself contains semantic information of different receptive fields. The use of multiple dilated convolutions may be repeated with the multi-level embedding vector itself, resulting in no significant improvement in the accuracy of semantic segmentation. In addition, the multi-level feature map T contains X channels, each of which is obtained by convolution kernels with different parameters. The correlation between these channels has not been paid attention to, so the accuracy improvement of the semantic segmentation prediction results is limited.
[0168] In order to adaptively recalibrate the feature response in the channel direction and model the interdependence between different channels. We introduced the SE (Squeeze-and-Excitation) module in the JEU block to integrate spatial attention into the structure of the upsampling network, which is also a significant difference between the JEU and JPU modules. As shown in Formula 2.13, for a 4w×4w×X Tensor T, a global average pooling function is used to compress it into a 1×X feature vector F, and the xth element F in F x The calculation method is as follows:
[0169]
[0170] In the formula, F(x) corresponds to the x-th channel in Tensor T, and I and J are the x-th channel feature map T respectively. xThe length and width of (I = J = 4w), i and j represent the coordinates of each point on the feature map. In order to establish the correlation between the features of different channels, F is connected to two fully connected layers to calculate the contribution weights of different channels during the learning process and to activate the corresponding channels in the feature map during prediction, as shown in formula (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, where the weight of each channel in W is W x The importance of the corresponding channel x in the multi-level feature map T is predicted to model the correlation between feature channels. In the two fully connected layer operations, 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 With the weight vector W x Weighted multiplication of the excitation feature map, the JEU block assigns a new response weight to each channel c in the multi-level feature map T obtained by joint upsampling through the weight vector W, and finally obtains the multi-level feature map after spatial channel excitation
[0174] 1.5 Removal of the rift area
[0175] 1) Crack edge detection: Apply the Sobel operator or Canny edge detection algorithm to the gray column segmentation image to extract the edge information in the image. By analyzing the connectivity of the edge image, the edge features of the crack area can be preliminarily identified.
[0176] 2) Application of adaptive gating mechanism: Introduce an adaptive gating mechanism into 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 area, and attenuates the noise interference of the gray column to improve the accuracy of crack detection.
[0177] 3) Connected domain analysis: Connected domain analysis is performed on the image after adaptive gating processing. First, all connected domains that may belong to the cracks are extracted, and these connected domains are filtered according to criteria such as area size, shape outline, etc., and small or irregular connected domains are eliminated to ensure that only the real crack areas are retained.
[0178] 4) Rip filling: After determining the crack area, fill the crack area through morphological closing operation and other regional filling algorithms. If the crack area is large, a multi-scale filling strategy is adopted, that is, filling from the center to the edge layer by layer to ensure that the gray image after filling is intact for subsequent color detection.
[0179] 1.6 Color feature extraction
[0180] 1) Color space conversion: The gray area image after the cracks are removed is converted from the RGB color space to the CIELAB color space. This conversion process can better simulate the human eye's perception of color and adapt to changes in different lighting environments.
[0181] 2) Color channel separation: In CIELAB space, extract L (brightness), a (red and green components) and b (yellow and blue components). On this basis, calculate the average L value of all pixels in the gray area to represent the grayscale information of the gray column. The average L value can accurately reflect the depth of the gray color.
[0182] 1.7 Color Calibration and Grayscale Balance
[0183] 1) D65 light source calibration: The image color is calibrated based on the D65 light source of the CIELAB color space standard to ensure that the detection results are not affected by changes in external light, especially to maintain consistent color measurement under different ambient lighting.
[0184] 2) Grayscale balance: The grayscale histogram equalization method is used to process the ash bag image after the cracks are removed. By dynamically adjusting the image brightness and contrast, the grayscale distribution is made more uniform, thereby ensuring the stability of the ash bag color detection at different combustion stages.
[0185] 1.8 Detection of crack rate
[0186] The crack rate of the ash package is calculated according to formula (2.15):
[0187]
[0188] Where CR is the crack rate, in percentage (%); S1 is the area of the gray zone, in square millimeters (mm2); S2 is the area of the crack zone, in square millimeters (mm 2 ).
[0189] The detection process of crack rate in the ash bag detection system is as follows: Figure 1 As shown, first extract the outline of the cigarette in the ash pack image and segment the ash column area. Then extract the ash pack area and the crack area according to the char line position and crack area segmentation determined by the algorithms in Chapter 4 and Chapter 5. Calculate the area of the ash pack area and the area of the crack area, and then calculate the crack rate.
[0190] The detailed explanation of the above-mentioned embodiments is only intended to explain the present invention so as to facilitate a better understanding of the present invention. However, these descriptions cannot be interpreted as limitations on the present invention for any reason. In particular, the various features described in different embodiments may also be arbitrarily combined with each other to form other embodiments. Unless there is a clear description to the contrary, these features should be understood to be applicable to any embodiment and are not limited to the described embodiments.
Claims
1. A method for calculating the ash crack rate of cigarette packages, characterized in that: The method for calculating the cigarette pack ash crack rate comprises: Acquire ash images of cigarettes at multiple angles during the burning process, and pre-process the ash images at multiple angles; Segmenting the gray column area in the preprocessed gray-enclosed image based on a convolutional neural network; removing the crack area in the gray column area, and performing edge detection and area filling based on an adaptive gating mechanism and connected domain analysis; The crack rate of the gray column area after segmentation and removal of the crack area is calculated and the calculation result is output.
2. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: Based on the convolutional neural network, the gray column area in the preprocessed gray image is segmented. Including, using a parallel attention mechanism combined with a ResNeXt50 convolutional network and a Swin-Transformer network to extract the gray column features in each of the gray-enclosed images.
3. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: Segmenting the gray column area in the preprocessed gray-enclosed image based on a convolutional neural network includes: In the encoder part, the convolutional neural network module is used to extract multi-scale features of the image, the feature map is divided into multiple stages according to different scales, and the feature channel correlation is enhanced through the Squeeze-and-Excitation module; In the decoder part, the feature map is upsampled through the joint excitation upsampling module, and the spatial and channel attention mechanisms are combined to improve the segmentation accuracy.
4. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: removing the crack area in the ash column area, Including, using the fusion model of CSegNet and JEUNet to identify the crack area.
5. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: Removing the crack area in the gray column area also includes using a CSegNet network model in combination with an ECBAM module to perform feature extraction and attention weighting to segment the crack area and the gray column area.
6. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: The steps of removing the crack area in the gray column area and performing edge detection and area filling based on the adaptive gating mechanism and connected domain analysis include the following sub-steps: Use the Sobel operator or Canny edge detection algorithm to extract the crack edge; An adaptive gating module is embedded in the deep convolutional network to enhance the crack features and suppress the non-crack features; Extract the connected domain of the crack area and filter the characteristic area according to area and shape; Fill the gap area and take color measurements of the gray column area.
7. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: The calculation formula of 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.
8. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: Output calculation results, including: expressing the breach rate in percentage form and generating a breach rate change trend graph.
9. The method for calculating the cigarette ash crack rate according to claim 8, characterized in that: Output calculation results also include: generating a test report including crack rate and ash column integrity.
10. The method for calculating the cigarette ash crack rate according to claim 1, characterized in that: The continuously burning cigarette is photographed by a multi-angle imaging system to obtain multi-angle ash images of the package, and the multi-angle ash images of the package include at least a front view, a side view and a top view.
11. The method for calculating the cigarette ash crack rate according to claim 10, characterized in that: Use a bionic suction machine based on cigarette burning to keep the cigarette burning continuously.
12. A cigarette apparent combustion quality detection system, characterized in that: The system implements the method described in any one of claims 1 to 11, and includes the following modules: Multi-angle image acquisition module, which can obtain ash images from different angles during cigarette burning; Gray column segmentation module, which segments the gray column area based on a parallel hybrid attention mechanism; The crack removal module removes the crack area in the gray column image through an adaptive gating mechanism; The crack rate calculation module automatically calculates the crack rate based on the cigarette ash crack rate formula; The result output module generates the crack rate detection results and the crack rate change trend chart.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the computing method according to any one of claims 1 to 11 are implemented.
14. A computer device comprising a memory and a processor, wherein a computer program capable of running on the processor is stored in the memory, characterized in that: When the processor executes the computer program, the steps of the computing method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Road scene semantic segmentation method based on convolutional neural network
CN112508956A
Method for measuring cigarette combustion cone parameters and standard kit
CN114047285A
Dam crack detection method based on unmanned aerial vehicle image and deep learning
CN118072193A