Calculation method and system for cigarette ash packing gap segmentation based on CSegNet
Through the calculation method and system based on CSegNet, a combined convolutional neural network and Transformer self-attention mechanism are used to build a gray crack segmentation model, which solves the problem of difficulty in accurately detecting cigarette dust cracks in the existing technology, and achieves efficient and accurate crack detection effect.
Patent Information
- Application Number
- CN202411893929.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to accurately detect the ash cracks in cigarette packaging, especially when the colors and textures of cigarette papers are diverse and the colors of the ash columns are largely different due to insufficient combustion.
Using CSegNet-based computing methods and systems, a gray-packing crack segmentation model is constructed through a combined convolutional neural network and a Transformer self-attention mechanism, a ResNeXTR module is used as the backbone network, and a ECBAM module is trained to achieve accurate segmentation of cigarette dust cracks.
It significantly improves the speed and accuracy of cigarette ash crack detection, can effectively identify crack areas with complex backgrounds and diverse shapes, and is suitable for detection of ash cracks during cigarette combustion.
Smart Images

Figure CN119723087A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cigarette detection, and in particular to a calculation method and system for cigarette package ash crack segmentation based on CSegNet. Background Art
[0002] The degree of ash column shrinkage and the proportion of ash cracks are important indicators for the quality of cigarette ash. Among them, the degree of ash column shrinkage mainly reflects the filling rate of tobacco. The internal pores of cigarettes with high filling rates are small, and the ash column shrinks less after burning. The formation of ash cracks is caused by multiple factors such as the wrapping performance of cigarette paper, tobacco formula, filling performance, and combustion thermal performance. The proportion of cracks on the ash column after burning is positively correlated with the ash flakes scattered during smoking. The ash flakes scattered will cause environmental pollution on the one hand, and affect consumers' smoking experience on the other hand.
[0003] The main trend in the field of cigarette inspection is to use visual image detection methods to detect the shrinkage of ash columns and the proportion of ash cracks. For visual image detection methods, the detection of the shrinkage of ash columns is relatively easy to achieve. However, the accurate detection of the proportion of crack area has always been a challenging problem. On the one hand, there are many types of colors and textures of cigarette paper, and the surface morphology after burning is relatively complex. On the other hand, the inadequate burning of cigarettes will lead to large differences in the color of ash columns (yellow, black, gray, and white), and the contrast between cracks and background at different positions is different. Conventional image segmentation algorithms are difficult to accurately extract the crack area. Therefore, this chapter focuses on the accurate and efficient detection of ash crack areas.
[0004] In the field of computer vision research, ash crack detection belongs to the problem of detecting cracks and abnormal areas such as cracks in defect detection. Early classic image algorithms mainly rely on the pixel value characteristics or texture characteristics of cracks for analysis and detection. For example, methods based on HoG gradient histograms, methods based on the combination of filters and machine learning, and local threshold segmentation methods. However, the versatility of such algorithms is limited by environmental changes and fixed parameters of manual feature extraction. It is difficult to achieve good results in the task of ash crack detection with significant global color changes. Especially during the burning process of cigarettes, the ash cracks are often irregular in shape and may appear in a variety of shapes such as lines, meshes, or blocks. The cracks may run continuously throughout the entire ash column or appear only in local areas. As the burning proceeds, the cracks may gradually expand, resulting in the loss of the integrity of the ash column. The color of the cracks is usually different from the color of the surrounding ash, and may appear darker black or dark gray due to incomplete combustion or different degrees of oxidation. In summary, the ash cracks present characteristics such as strip distribution, unequal areas, and darker colors during the smoking process, which poses a challenge to existing detection methods.
[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 calculation method and system for cigarette ash crack segmentation based on CSegNet after repeated experiments, in order to solve the problems existing in the prior art. Summary of the invention
[0006] The purpose of the present invention is to provide a calculation method and system for cigarette ash crack segmentation based on CSegNet, which can effectively improve the detection speed and accuracy of cigarette ash cracks.
[0007] In order to achieve the above-mentioned object of the invention, the present invention proposes a calculation method and system for cigarette ash crack segmentation based on CSegNet, wherein the calculation method includes:
[0008] Obtaining a panoramic image of a cigarette pack ash crack during cigarette burning and constructing a data set of panoramic images of a cigarette pack ash crack;
[0009] Construct a gray crack segmentation model based on joint convolutional neural network and Transformer self-attention mechanism;
[0010] In the bag-gray crack segmentation model, the encoder uses a ResNeXTR module as a backbone network, and the ResNeXTR module includes a ResNeXt50 convolutional network and a Swin-Transformer network; the decoder is combined with an ECBAM module;
[0011] The ash crack segmentation model is trained based on the data set of the panoramic image of the cigarette ash crack;
[0012] The cigarette ash cracks are detected by using the trained ash crack segmentation model.
[0013] The present invention also proposes a computing system for cigarette ash crack segmentation based on CSegNet, wherein the image acquisition module is used to collect crack image data in the cigarette burning process in real time;
[0014] A data preprocessing module is used to remove noise, calibrate grayscale and enhance contrast of image data;
[0015] The segmentation module includes a joint ResNeXt-Transformer encoder and ECBAM decoder structure to achieve semantic segmentation of the cleft area;
[0016] The output module is used to generate visual segmentation results and analysis reports of the crack area.
[0017] 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.
[0018] 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 wherein the processor implements the steps of the above-mentioned calculation method when executing the computer program.
[0019] Compared with the prior art, the present invention has the following characteristics and advantages:
[0020] The present invention proposes a calculation method and system for cigarette ash crack segmentation based on CSegNet, which can accurately identify color change areas and has the advantages of fast crack detection speed, high accuracy and strong adaptability. It can effectively identify crack areas with strip distribution, unequal areas and darker colors, and is very suitable for detecting ash cracks in the cigarette burning process, thereby improving the accuracy and efficiency of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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.
[0022] Figure 1 A schematic diagram of a cigarette ash crack image of the present invention;
[0023] Figure 2 It is a schematic diagram of the CSegNet network structure of the present invention;
[0024] Figure 3 It is a schematic diagram of the ResNeXTR network structure of the present invention;
[0025] Figure 4 Schematic diagram of the R residual block of the present invention;
[0026] Figure 5 Schematic diagram of the encoder structure of the Swin-Transformer of the present invention;
[0027] Figure 6 It is the ECBAM module structure diagram of the present invention;
[0028] Figure 7 It is a schematic diagram of the calculation method of cigarette ash crack segmentation based on CSegNet of the present invention. DETAILED DESCRIPTION
[0029] 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.
[0030] The present invention proposes a calculation method and system for cigarette ash crack segmentation based on CSegNet, wherein Figure 7 As shown, the calculation method includes:
[0031] Obtaining a panoramic image of a cigarette pack ash crack during cigarette burning and constructing a data set of panoramic images of a cigarette pack ash crack;
[0032] Construct a gray crack segmentation model based on joint convolutional neural network and Transformer self-attention mechanism;
[0033] In the gray crack segmentation model, the encoder uses the ResNeXTR module as the backbone network, which includes the ResNeXt50 convolutional network and the Swin-Transformer network; the decoder is combined with the ECBAM module;
[0034] The ash crack segmentation model is trained based on the dataset of panoramic images of cigarette ash cracks.
[0035] The cigarette pack ash cracks are detected using the trained ash pack crack segmentation model.
[0036] The CSegNet-based cigarette ash crack segmentation calculation method and system proposed in the present invention realizes accurate segmentation of cigarette ash crack areas by combining the local perception ability of CNN and the global modeling ability of Transformer. This method not only improves the speed and accuracy of crack detection, but also enhances the adaptability of the model to crack areas under different background colors and complex textures. It can effectively identify crack areas with strip distribution, unequal areas and darker colors, and is very suitable for the detection of ash cracks during cigarette burning.
[0037] The present invention proposes a method for calculating cigarette ash crack segmentation based on CSegNet, such as Figure 1As shown in a, the shape, size, texture and contrast of the cracks in the gray package show significant diversity and complexity. In order to achieve accurate segmentation of the cracks in the gray package, the present invention proposes a crack segmentation algorithm (Crack Segmentation Network, CSegNet) that combines convolutional neural network CNN and Transformer self-attention mechanism. The CSegNet network adopts an Encoder-Decoder encoding and decoding framework similar to DeepLab V3+, and includes the following steps:
[0038] 1) Obtain crack images during cigarette burning and preprocess the images, including noise removal, grayscale calibration, and contrast enhancement;
[0039] 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;
[0040] 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;
[0041] 4) Use average pooling and point-wise convolution operations to reduce the dimensionality of the encoder output to reduce the cost of self-attention calculation;
[0042] 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.
[0043] In an optional embodiment of the present invention, the ResNeXt50 convolutional network uses group convolution and combines the residual block structure to perform multi-scale feature extraction on the panoramic image of cigarette ash cracks. The solution using the ResNeXt50 convolutional network, combined with group convolution and residual block structure, significantly improves the ability of feature extraction, especially when processing panoramic images of cigarette ash cracks. This multi-scale feature extraction method enables the network to capture image features at different levels and scales, thereby improving the accuracy and robustness of crack detection.
[0044] Specifically, the use of ResNeXt network is mainly based on the following factors.
[0045] (1) ResNeXt50 introduces “cardinality” as a new dimension, alongside depth and width, which improves the representation capability of the model without increasing its complexity.
[0046] (2) The modular design of ResNeXt50 makes the model more flexible, easier to expand, and more efficient to train.
[0047] (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 (Residual Blocks) Figure 4 ), and distributed in 4 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.
[0048] In an optional embodiment of the present invention, the Swin-Transformer network adopts a windowed self-attention mechanism combined with local information exchange. Through the local window self-attention mechanism, Swin-Transformer can perform self-attention calculations within each window, reducing the high complexity of global self-attention calculations while retaining the Transformer's advantages in feature extraction. This mechanism enables Swin-Transformer to maintain computational efficiency and accuracy when processing high-resolution crack images, and can better capture spatial dependencies in images.
[0049] Specifically, 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 capture more local and global details, thereby providing a more refined feature representation for the semantic label generation of the gap. Since the original attention calculation is relatively large and has high requirements on the device, in order to reduce the model calculation, CSegNet has made improvements on the basic attention calculation and downsampled after calculating the K and V vectors. The specific structure is as follows: Figure 5 shown.
[0050] In an optional embodiment of the present invention, the encoder cascades local features from the ResNeXt50 convolutional network and global features from the Swin-Transformer network. By cascading the features of the ResNeXt50 convolutional network and the Swin-Transformer network in the encoder, the calculation method of the present invention significantly improves the accuracy and robustness of cigarette ash crack segmentation. This feature fusion strategy enables the model to simultaneously utilize the accuracy of local features and the contextual information of global features, thereby effectively identifying the crack area in a complex image background, and maintaining high accuracy even when the crack area has a low contrast with the background or an irregular shape.
[0051] Specifically, the structure of the ResNeXTR feature extraction module used for feature extraction in the encoder is as follows: Figure 3 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.
[0052] In an optional embodiment of the present invention, the encoder uses an average pooling layer P S Downsampling the encoded dimensions and using point-by-point convolution to reduce the feature dimensions. By using the average pooling layer in the encoder to downsample and point-by-point convolution to reduce the feature dimensions, the present invention achieves significant optimization of the cigarette ash crack segmentation calculation method, effectively reducing the number of model parameters and computational complexity, so that the model can process image data faster while maintaining high accuracy, thereby improving the model's operating efficiency.
[0053] The present invention proposes a CSegNet-based method for segmenting cigarette ash cracks. In the 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 with the ability of CNN to capture local contextual information through local receptive fields, weight sharing, and spatial subsampling to enhance the feature extraction capability of the crack area in the ash 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.
[0054] In an optional example of this implementation, the specific calculation process of the self-attention SA is as follows:
[0055] SA(X)=Attention(X·w Q ,P S (X.W K ),P S (X.W V )) (1)
[0056] 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:
[0057] Attention(Q,K,V)=softmax(SIM(Q,K))V (2)
[0058] SIM(Q,K) is the similarity calculation of Q and K, using cosine similarity, and its calculation formula is as follows:
[0059]
[0060] Where B ij is 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:
[0061]
[0062] In the formula, Represents a small network; the Transformer block consists of self-attention (SA) and MLP modules, and the calculation process is as follows:
[0063]
[0064] in, It represents the result of layer normalization of the output of self-attention SA. represents the result of MLP output after layer normalization, z l Represents the final output of the Transformer block. Through the self-attention mechanism, the local and global features in the cigarette ash crack image are deeply mined. The relative position bias and small network update strategy introduced enable the model to capture the spatial relationship in the image more accurately and improve the ability to locate the crack area. The layer normalization and feature splicing operations help reduce the gradient vanishing problem during training and accelerate the convergence of the model.
[0065] Specifically, in order to reduce the amount of computation in self-attention calculation, an 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.
[0066] In an optional embodiment of the present invention, the efficient convolutional block attention module includes an efficient channel attention module and a spatial attention module. By combining the efficient channel attention module and the spatial attention module, the performance of cigarette ash crack segmentation can be significantly improved. The ECAM module improves the representation ability of the feature map by optimizing the relationship between channels, so that the model can respond more sensitively to the feature changes in the crack area.
[0067] In an optional example of this implementation, the efficient channel attention module realizes the interaction of local channel information through 1D convolution operation; the spatial attention module simultaneously performs maximum pooling and average pooling on the feature map, and splices the pooling results for overall weighted operation. The combination of the efficient channel attention module and the spatial attention module significantly improves the accuracy and robustness of cigarette ash crack segmentation. ECAM enhances the feature interaction between channels through 1D convolution, so that the model can more accurately identify the features of the crack area, and maintain high accuracy even in the case of noise interference or unclear features. SAM combines maximum pooling and average pooling, so that the model can capture global contextual information while paying attention to local features, which is particularly important for crack detection in complex backgrounds. This fusion of local and global information not only improves the accuracy of crack detection, but also enhances the adaptability of the model to different crack shapes and backgrounds, and can have significant technical advantages and application value in the field of automated cigarette ash crack detection.
[0068] In an optional embodiment of the present invention, the bag ash crack segmentation model uses a combined loss function, which is a combination of a Binary Cross-Entropy with Logits loss function and a Dice loss function with a weight of 0.5 each. The calculation formula of the combined loss function is:
[0069] L=0.5L BCEwtihlogits +0.5L Dice (12)
[0070] In the formula, L is the combined loss function, L BCEwithLogits is the Binary Cross-Entropy with Logits loss function, L Dice is the Dice loss function. By using the combined loss function of the Binary Cross-Entropy with Logits loss function and the Dice loss function, the calculation method of the present invention has achieved significant technical results in the cigarette ash crack segmentation task. This combined loss function not only improves the model's recognition accuracy for the crack area, but also optimizes the model's ability to depict the crack edge. The BCEWithLogits loss function ensures the accuracy of the model in classification decisions, while the Dice loss function strengthens the model's optimization of the overlap between the predicted area and the real area.
[0071] Specifically, during the training and validation phases of the model, a joint loss function combining the Binary Cross-Entropy with Logits (BCE With Logits Loss) loss function and the Dice loss function is designed. 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.
[0072] In an optional example of this implementation, the calculation formula of the Binary Cross-Entropy with Logits loss function is:
[0073]
[0074] In the formula, 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. The loss function directly evaluates the original prediction output of the model, avoiding the information loss that may occur when converting between the activation function and the loss function, and improving the model's classification accuracy for the crack area. Through this loss function, the model can learn the boundary between the crack and non-crack areas more accurately, reducing the possibility of misclassification.
[0075] Specifically, the 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 explicit feedback to the model.
[0076] 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.
[0077] In an optional example of this implementation, the calculation formula of the Dice loss function is:
[0078] L Dice =1-Dice Coefficient (10)
[0079]
[0080] 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. By introducing the Dice loss function, the calculation method of the present invention achieves significant technical effects in the cigarette ash crack segmentation task. The Dice loss function focuses on optimizing the overlap between the predicted area and the true area, which is particularly important for segmentation tasks. This loss function is particularly suitable for dealing with category imbalance problems, which is common in situations where the area difference between the crack area and the background area is large. 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. Assume that X represents the true label of the real crack segmentation image, and Y represents the pixel category of the segmented image predicted by the model.
[0081] The present invention also proposes a computing system for cigarette ash crack segmentation based on CSegNet to implement the above-mentioned computing method, characterized in that the computing system comprises:
[0082] An image acquisition module, used for real-time acquisition of crack image data during cigarette burning;
[0083] A data preprocessing module is used to remove noise, calibrate grayscale and enhance contrast of image data;
[0084] The segmentation module includes a joint ResNeXt-Transformer encoder and ECBAM decoder structure to achieve semantic segmentation of the cleft area;
[0085] The output module is used to generate visual segmentation results and analysis reports of the crack area.
[0086] 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.
[0087] 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.
[0088] The specific implementation process of the present invention is now described in detail with reference to the embodiments:
[0089] On the constructed cigarette package ash crack panoramic image dataset, CSegNet randomly selected 90 images with ground truth and divided them into training set and validation set according to 10-fold Cross Validation for training, and tested on the remaining 10 images with ground truth. The images input to the network were uniformly resized to 448×448 pixels. The SGD optimizer was used during training, and the learning rate was set to 0.001. If the validation loss still increased after 10 consecutive epochs of training, the learning rate would be reduced to 0.1. The batch size was set to 1, and the training epochs were 100 rounds.
[0090] CSegNet optimization experiment
[0091] In order to investigate the effect of adding different modules to the benchmark model on the crack segmentation results, the CSegNet benchmark model uses the pre-trained ResNeXt50 network as the encoder and the decoder part of DeepLab V3+ as the decoder. An ablation experiment is performed on a comprehensive large dataset, and the experimental parameters are set according to 1.1.5. The experimental results are shown in Table 1. It can be seen that when the ResNeXt50 network as the encoder is replaced with the ResNeXt101 network with a deeper network layer, the model's crack segmentation results are worse; the shallow features of the ResNeXt50 network are combined with the output of SwinTransformer V2, combined with the deep features of ResNext50, and the ECA attention mechanism is added. The model has the best detection effect, with IOU and AUROC reaching 66.01% and 89.16% respectively.
[0092] Table 1 Ablation experiment results of CSegNet model
[0093]
[0094] 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 calculation method for cigarette ash crack segmentation based on CSegNet, characterized in that: The calculation methods include: Obtaining a panoramic image of a cigarette pack ash crack during cigarette burning and constructing a data set of panoramic images of a cigarette pack ash crack; Construct a gray crack segmentation model based on joint convolutional neural network and Transformer self-attention mechanism; In the bag-gray crack segmentation model, the encoder uses a ResNeXTR module as a backbone network, and the ResNeXTR module includes a ResNeXt50 convolutional network and a Swin-Transformer network; the decoder is combined with an ECBAM module; The ash crack segmentation model is trained based on the data set of the panoramic image of the cigarette ash crack; The cigarette ash cracks are detected by using the trained ash crack segmentation model.
2. The calculation method for cigarette ash crack segmentation based on CSegNet according to claim 1, characterized in that: The ResNeXt50 convolutional network uses group convolution combined with a residual block structure to perform multi-scale feature extraction on the panoramic image of the cigarette pack ash crack.
3. The calculation method for cigarette ash crack segmentation based on CSegNet as claimed in claim 1, characterized in that: The Swin-Transformer network adopts a windowed self-attention mechanism combined with local information exchange.
4. The calculation method for cigarette ash crack segmentation based on CSegNet according to claim 1, characterized in that: The encoder concatenates local features from the ResNeXt50 convolutional network and global features from the Swin-Transformer network.
5. The calculation method for cigarette ash crack segmentation based on CSegNet as claimed in claim 1, characterized in that: The encoder uses an average pooling layer P S Downsample the encoded dimension and use point-wise convolution to reduce the feature dimension.
6. The calculation method for cigarette ash crack segmentation based on CSegNet as claimed in claim 5, characterized in that: The specific calculation process of self-attention SA is as follows: SA(X)=Attention(X·W Q ,P S (X·W K ),P S (X·W V )) 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: Attnention(Q,K,V)=softmax(SIM(Q,K))V SIM(Q,K) is the similarity calculation of Q and K, using cosine similarity, and its calculation formula is as follows: Where B ij is 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: In the formula, represents a small network; The Transformer block consists of self-attention (SA) and MLP modules, and the calculation flow is as follows: in, It represents the result of layer normalization of the output of self-attention SA. represents the result of MLP output after layer normalization, z l Represents the final output result of the Transformer block.
7. The calculation method for cigarette ash crack segmentation based on CSegNet according to claim 1, characterized in that: The efficient convolutional block attention module includes an efficient channel attention module and a spatial attention module.
8. The CSegNet-based method for calculating cigarette ash crack segmentation according to claim 7, characterized in that: The efficient channel attention module realizes the interaction of local channel information through 1D convolution operation; the spatial attention module simultaneously performs maximum pooling and average pooling on the feature map, and concatenates the pooling results for overall weighted operation.
9. The calculation method for cigarette ash crack segmentation based on CSegNet according to claim 1, characterized in that: The ash crack segmentation model uses a combined loss function, which is a combination of a Binary Cross-Entropy with Logits loss function and a Dice loss function with a weight of 0.5 each. The calculation formula of the combined loss function is: L=0.5L BCEwtihlogits +0.5L Dice In the formula, L is the combined loss function, L BCEwithLogits is the Binary Cross-Entropy with Logits loss function, L Dice is the Dice loss function.
10. The calculation method for cigarette ash crack segmentation based on CSegNet according to claim 9, characterized in that: The calculation formula of the Binary Cross-Entropy with Logits loss function is: In the formula, 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.
11. The CSegNet-based method for segmenting cigarette ash cracks according to claim 9, characterized in that: The calculation formula of the Dice loss function is: 50 Dice =1-Dice Coefficient Where |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.
12. A computing system for cigarette ash crack segmentation based on CSegNet, implementing the computing method according to any one of claims 1 to 11, characterized in that: The computing system comprises: An image acquisition module, used for real-time acquisition of crack image data during cigarette burning; A data preprocessing module is used to remove noise, calibrate grayscale and enhance contrast of image data; The segmentation module includes a joint ResNeXt-Transformer encoder and ECBAM decoder structure to achieve semantic segmentation of the cleft area; The output module is used to generate visual segmentation results and analysis reports of the crack area.
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.