Cigarette filter tip end face anomaly detection method, system, device and medium

By preprocessing and optimizing the image set of cigarette filter tip end face, pseudo-anomaly images are generated. Feature extraction and reconstruction are then performed using a filter rod detection network, which solves the problems of detection accuracy and stability under low-contrast end face texture conditions and improves the effect of filter tip end face defect detection.

CN122156070APending Publication Date: 2026-06-05BENGBU CIGARETTE MATERIAL FACTORY +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BENGBU CIGARETTE MATERIAL FACTORY
Filing Date
2026-01-30
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively enhance feature representation under low-contrast end-face texture conditions, resulting in insufficient accuracy and stability in filter tip end-face defect detection, which can easily lead to false detections or missed detections, especially in complex production environments.

Method used

By preprocessing the image set of cigarette filter tip end face, a standard image set is generated, and elastic deformation and local pixel perturbation are applied to expand the abnormal sample space. Feature extraction and image reconstruction are performed using a pre-constructed filter rod detection network, and reconstruction loss value and discrimination loss value are calculated to optimize network parameters to improve detection accuracy.

Benefits of technology

It improves the model's ability to identify subtle texture anomalies, enhances the stability of detection and its ability to generalize to unknown anomaly types, reduces the probability of false detection and false negative detection, and adapts to complex production environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156070A_ABST
    Figure CN122156070A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of machine vision anomaly recognition, and discloses a cigarette filter end face anomaly detection method, a system, equipment and a medium, the method comprising the following steps: performing image preprocessing on a cigarette filter end face image set to obtain a standard image set; generating a pseudo-anomaly image by using elastic deformation and local pixel disturbance, and generating a cigarette filter end face image sample according to the pseudo-anomaly image; performing feature extraction and image reconstruction processing on the cigarette filter end face image sample to obtain a reconstructed residual signal graph; calculating an overall loss value according to the reconstructed residual signal graph; performing gradient descent optimization on a filter rod detection network according to the overall loss value to obtain a cigarette filter end face anomaly detection network; and performing anomaly recognition on a to-be-detected cigarette filter end face image by using the cigarette filter end face anomaly detection network. The application can improve the prediction capability of the cigarette filter end face anomaly detection network and more accurately perform anomaly recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision anomaly recognition technology, specifically to a method, system, device, and medium for detecting anomalies on the end face of a cigarette filter. Background Technology

[0002] In the quality control process of cigarette production, the appearance quality of the cigarette filter tip end face directly affects product consistency and consumer experience. Therefore, achieving stable and efficient online detection of end face defects is of great significance. Common defects on the filter tip end face include localized damage, gaps, contamination adhesion, structural deformation, and minor textural abnormalities. These defects are usually small in size, have indistinct boundaries, and exhibit different forms in different batches and under different production conditions, increasing the difficulty of automated detection.

[0003] Currently, filter tip end-face inspection mainly employs two methods: manual sampling and machine vision inspection. Manual sampling relies on continuous observation and judgment by operators, which is easily affected by fatigue, experience level, and subjective factors, making it difficult to maintain consistent inspection results under high-speed production conditions. While machine vision inspection can improve inspection efficiency, traditional methods are mostly based on manually set rules for analysis, such as threshold segmentation, contour extraction, texture statistics, or template matching. These methods have high requirements for imaging environment and product consistency; when lighting conditions change, background noise increases, or texture fluctuates, false positives or false negatives are easily generated, and their adaptability to complex defects is limited.

[0004] With the continuous application of deep learning technology in industrial vision, neural network-based defect detection methods are gradually being introduced into filter tip end-face detection scenarios. Especially when it's difficult to obtain a large number of defect samples, anomaly detection methods based on normal sample modeling have attracted attention. While these methods reduce manual annotation costs to some extent, they still have shortcomings in practical applications: on the one hand, the overall texture contrast of the filter tip end-face is low, and detailed features are easily affected by noise, limiting the model's ability to identify minor anomalies; on the other hand, defect types are random during production, and when trained solely on normal samples, the model's generalization ability to unseen defects remains insufficient.

[0005] To address these issues, existing research (202511411493.2) discloses a method for detecting anomalies on the end face of cigarette filters based on texture information enhancement. This method mainly relies on spatial domain texture statistics for enhancement and modeling, but lacks the ability to perceive low contrast and subtle structural anomalies. Research (202410103196.0) discloses a step of processing feature maps separately using discrete cosine transforms of different frequency components, but it does not perform frequency band division of frequency domain features, nor does it establish the correlation between different frequency components, resulting in poor frequency domain enhancement effects.

[0006] Therefore, how to improve feature representation under low-contrast end-face texture conditions, enhance the model's ability to recognize subtle structural changes, and improve the stability of detection results has become an urgent problem to be solved in current filter tip end-face defect detection technology. Summary of the Invention

[0007] The technical problem to be solved by this invention is how to improve the feature expression capability under low contrast end face texture conditions and improve the stability and accuracy of filter tip end face defect detection results.

[0008] The present invention solves the above-mentioned technical problems through the following technical means:

[0009] A set of images of the cigarette filter tip end face is obtained, and the set of images of the cigarette filter tip end face is preprocessed to obtain a standard image set; The standard image set is subjected to elastic deformation and local pixel perturbation to obtain pseudo-anomaly images, and cigarette filter end face image samples are generated based on the pseudo-anomaly images. The pre-constructed filter rod detection network is used to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample to obtain the reconstruction residual signal map corresponding to the cigarette filter cross-section image sample. The reconstruction loss value and the discrimination loss value of the filter rod detection network are calculated based on the reconstructed residual signal map, and the overall loss value is determined based on the reconstruction loss value and the discrimination loss value. The filter rod detection network is optimized by gradient descent based on the overall loss value to obtain a cigarette filter end face anomaly detection network. The cigarette filter end face anomaly detection network is then used to identify anomalies in the cigarette filter end face image to be detected.

[0010] Optionally, the image preprocessing of the cigarette filter end face image set to obtain a standard image set includes: The image size of each cigarette filter end face image in the cigarette filter end face image set is unified to obtain a unified image; The unified image is subjected to image grayscale processing to obtain a grayscale image; The grayscale image is subjected to image normalization processing to obtain a standard image set.

[0011] Optionally, the step of performing elastic deformation and local pixel perturbation on the standard image set to obtain a pseudo-anomaly image includes: A two-dimensional displacement vector field is randomly sampled, and a smooth random displacement field is constructed based on the two-dimensional displacement vector field. Construct a smooth random displacement field using the following formula:

[0012] in, Represents a smooth random displacement field. The preset standard deviation is . Two-dimensional Gaussian kernel, This represents the convolution operation. Represents a two-dimensional displacement vector field; The smooth random displacement field is used to perform image control deformation mapping on each standard image in the standard image set to obtain an elastic deformation image; The elastic deformation image is obtained by performing image control deformation mapping on the displacement mapping image using the following formula:

[0013] in, Indicates the first A standard image The corresponding elastic deformation image, Represents a smooth random displacement field. This represents the preset image control deformation mapping function; A two-dimensional Fourier transform is performed on the standard image to obtain the amplitude spectrum and the phase spectrum. A local pixel perturbation image is then generated based on the amplitude spectrum and the phase spectrum. The following formula is used to generate a locally pixel-perturbed image:

[0014]

[0015] in, This represents a preset random frequency band mask matrix. Indicates amplitude spectrum, This represents the amplitude spectrum corresponding to a preset normal image. Represents the phase spectrum. This represents the two-dimensional inverse Fourier transform. Indicates the first A standard image The corresponding pixel perturbation image; By combining the elastic deformation image and the local pixel perturbation image, a pseudo-anomaly image is obtained.

[0016] Optionally, the step of using a pre-constructed filter rod detection network to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample includes: The feature encoding module in the filter rod detection network is used to perform multi-layer convolution processing on each cross-sectional image sample of the cigarette filter tip to obtain multi-layer convolution features. The multi-layer convolutional features are enhanced in the frequency domain to obtain a frequency domain enhanced feature map; The frequency domain enhanced feature map is decoded and reconstructed to obtain the reconstructed residual signal map corresponding to the cross-sectional image sample of the cigarette filter.

[0017] Optionally, the step of performing frequency domain enhancement on the multi-layer convolutional features to obtain a frequency domain enhanced feature map includes: A two-dimensional discrete cosine transform is performed on the scale convolution features at each scale in the multi-layer convolution features to obtain the frequency domain feature representation; The frequency domain features are divided into three sub-frequency bands, the frequency band energy features of each sub-frequency band are calculated, and the cross-frequency band attention matrix of the scale convolution features is calculated based on the frequency band energy features. The cross-band attention matrix is ​​calculated using the following formula:

[0018]

[0019]

[0020] in, Indicates the frequency band energy characteristics of the low-frequency band The corresponding query vector, Indicates the frequency band energy characteristics of the high-frequency band The corresponding key vector, This represents the cross-band attention matrix. Represents the key vector transpose, Indicates the scaling factor; Based on the cross-band attention matrix, the scale convolutional features are subjected to cross-band attention weighted fusion to obtain the frequency domain enhanced descriptor corresponding to the scale convolutional features; The frequency domain enhanced descriptor is subjected to depthwise separable convolution to obtain a frequency domain semantic vector, and the frequency domain semantic vector is subjected to bicubic interpolation upsampling to obtain sampled features; The sampled features are then subjected to channel-dimensional attention-weighted fusion to obtain a frequency domain enhanced feature map.

[0021] Optionally, calculating the reconstruction loss value and discrimination loss value of the filter rod detection network based on the reconstructed residual signal map includes: The reconstruction loss value is calculated based on the pixel difference between the reconstructed residual signal map and the corresponding cigarette filter cross-section image sample. The classification head in the filter detection network is used to perform anomaly detection on the reconstructed residual signal map to obtain the detection result; The discrimination loss value is calculated using the cross-entropy loss function based on the discrimination result.

[0022] Optionally, the step of performing gradient descent optimization on the filter rod detection network based on the overall loss value to obtain a cigarette filter tip end-face anomaly detection network includes: Calculate the parameter gradients of the network parameters of the filter rod detection network relative to the overall loss value; The network parameters are updated based on the parameter gradient to obtain updated parameters, and the overall update loss value of the updated parameters is calculated. The network parameters are iteratively updated based on the overall updated loss value until the overall updated loss value is less than a preset loss value threshold, thereby obtaining the target network parameters. By replacing the network parameters with the target network parameters, an anomaly detection network for the cigarette filter tip end face is obtained.

[0023] To address the aforementioned problems, this invention also proposes a cigarette filter tip end face anomaly detection system, the system comprising: The image preprocessing module is used to acquire a set of images of the cigarette filter tip end face, and to perform image preprocessing on the set of images of the cigarette filter tip end face to obtain a standard image set. The pseudo-anomaly image generation module is used to perform elastic deformation and local pixel perturbation on the standard image set to obtain pseudo-anomaly images, and generate cigarette filter end face image samples based on the pseudo-anomaly images. The reconstructed residual signal map generation module is used to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample using a pre-constructed filter rod detection network to obtain the reconstructed residual signal map corresponding to the cigarette filter cross-section image sample. The loss value calculation module is used to calculate the reconstruction loss value and the discrimination loss value of the filter rod detection network based on the reconstructed residual signal map, and to determine the overall loss value based on the reconstruction loss value and the discrimination loss value. The network parameter optimization module is used to perform gradient descent optimization on the filter rod detection network based on the overall loss value to obtain a cigarette filter end face anomaly detection network, and to use the cigarette filter end face anomaly detection network to identify anomalies in the cigarette filter end face image to be detected.

[0024] The present invention also provides a processing device, characterized in that it includes at least one processor and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor can execute the above-described method for detecting abnormalities at the end face of a cigarette filter by calling the program instructions.

[0025] The present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, the computer instructions causing the computer to execute the above-described method for detecting anomalies at the end face of a cigarette filter.

[0026] The advantages of this invention are: This invention preprocesses a set of cigarette filter tip end-face images to eliminate differences in the external shooting environment and improve the generalization ability of the filter rod detection network. Then, it applies elastic deformation and local pixel perturbation to the standard image set to obtain pseudo-anomaly images. Cigarette filter tip end-face image samples are generated based on these pseudo-anomaly images, effectively expanding the anomaly sample space and improving the accuracy of anomaly detection and its generalization ability to unknown anomaly types. Using a pre-constructed filter rod detection network to perform feature extraction and image reconstruction on each cigarette filter tip cross-section image sample, it can extract the frequency domain information of the image, thereby enhancing the discriminability of low-contrast textures and microstructures and improving the model's stability in detecting microtexture anomalies. The reconstruction loss and discrimination loss values ​​of the filter rod detection network are calculated based on the reconstructed residual signal map. The overall loss value is determined based on the reconstruction loss value and discrimination loss value. The network parameters of the filter rod detection network can be optimized by gradient descent using the overall loss value to obtain a cigarette filter end face anomaly detection network that can be used for automatic identification and judgment of abnormal areas on the cigarette filter end face in actual industrial scenarios, and to perform anomaly identification more accurately. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating a method for detecting abnormalities at the end face of a cigarette filter tip according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the end face of a cigarette filter tip in one embodiment of the present invention; Figure 3 This is a visualization of the result of anomaly identification of an image of the end face of a cigarette filter in one embodiment of the present invention; Figure 4 This is a functional module diagram of a cigarette filter tip end face anomaly detection system provided in one embodiment of the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] Reference Figure 1 The diagram shown is a flowchart illustrating a method for detecting anomalies on the end face of a cigarette filter according to an embodiment of the present invention. In this embodiment, the method for detecting anomalies on the end face of a cigarette filter includes: S1. Obtain a set of images of the cigarette filter tip end face, and perform image preprocessing on the set of images of the cigarette filter tip end face to obtain a standard image set.

[0030] In this embodiment of the invention, the cigarette filter end face image set consists of multiple cigarette filter end face images captured by an industrial camera, specifically as follows: Figure 2 As shown. To ensure the consistency and robustness of subsequent filter rod detection network processing, image preprocessing is required on the cigarette filter tip end face image set to improve the generalization ability of the filter rod detection network.

[0031] Specifically, the image preprocessing of the cigarette filter end face image set to obtain a standard image set includes: The image size of each cigarette filter end face image in the cigarette filter end face image set is unified to obtain a unified image; The unified image is subjected to image grayscale processing to obtain a grayscale image; The grayscale image is subjected to image normalization processing to obtain a standard image set.

[0032] In this embodiment of the invention, image size unification means unifying the size of each cigarette filter end face image in the cigarette filter end face image set to the same resolution (e.g., 224×224). Image size unification can be achieved through image cropping, stretching, and other methods to obtain a unified image.

[0033] Furthermore, image grayscale processing involves equalizing the R (RED), G (GREEN), and B (BLUE) components of each pixel in a unified image. Their values ​​range from 0 to 255, where 0 represents pure black, 255 represents pure white, and intermediate values ​​represent different shades of gray. This can be achieved by summing the values ​​of the R, G, and B channels and taking the average, selecting the maximum value from the R, G, and B channels, or performing a weighted average of the pixel values ​​from the R, G, and B channels. The resulting grayscale image is then derived from the grayscale value of each pixel.

[0034] In detail, normalizing a grayscale image involves mapping the pixel values ​​of the grayscale image to a unified numerical space. For example, mapping can be performed using the maximum-minimum method, or the Z-score algorithm can be used to normalize the grayscale image to obtain a standard image set.

[0035] For example, a standard image set can be represented as: ,in, Indicates the first A standard image of the filter tip of a cigarette after image preprocessing. This represents the total number of images of the cigarette filter tip end face; let The binary category labels are ,when When =1, it means For a normal image of the filter tip, when =0 indicates This is an image of an abnormal filter tip.

[0036] In this embodiment of the invention, by performing image preprocessing on the image set of cigarette filter tip end face, differences in the external shooting environment can be eliminated, thereby improving the generalization ability of the filter rod detection network.

[0037] S2. Perform elastic deformation and local pixel perturbation on the standard image set to obtain pseudo-anomaly images, and generate cigarette filter tip end face image samples based on the pseudo-anomaly images.

[0038] In this embodiment of the invention, it is relatively easy to obtain normal images of the cigarette filter tip end face in real-world scenarios, and there is very little data on abnormal samples. Therefore, it is necessary to perform elastic deformation and local pixel perturbation on the standard image set to generate pseudo-abnormal images of different forms.

[0039] Specifically, the step of performing elastic deformation and local pixel perturbation on the standard image set to obtain pseudo-anomaly images includes: A two-dimensional displacement vector field is randomly sampled, and a smooth random displacement field is constructed based on the two-dimensional displacement vector field. The smooth random displacement field is used to perform image control deformation mapping on each standard image in the standard image set to obtain an elastic deformation image; A two-dimensional Fourier transform is performed on the standard image to obtain the amplitude spectrum and the phase spectrum. A local pixel perturbation image is then generated based on the amplitude spectrum and the phase spectrum. By combining the elastic deformation image and the local pixel perturbation image, a pseudo-anomaly image is obtained.

[0040] In this embodiment of the invention, the two-dimensional displacement vector field represents a two-dimensional vector that should be moved to the right / down by how much for each pixel (or grid node) on the image. By concatenating all the vectors together, a "vector map" with the same resolution as the image is formed, thus obtaining the two-dimensional displacement vector field. This invention obtains the field by random sampling.

[0041] Furthermore, a smooth random displacement field is constructed using the following formula:

[0042] in, Represents a smooth random displacement field. The preset standard deviation is . Two-dimensional Gaussian kernel, This represents the convolution operation. This represents a two-dimensional displacement vector field.

[0043] In detail, the elastic deformation image is obtained by performing image control deformation mapping on the displacement mapping image using the following formula:

[0044] in, Indicates the first A standard image The corresponding elastic deformation image, Represents a smooth random displacement field. This represents the preset image control deformation mapping function.

[0045] In this embodiment of the invention, by means of By performing a two-dimensional Fourier transform, its amplitude spectrum can be obtained. and phase spectrum According to the amplitude spectrum and phase spectrum The image with local pixel perturbation is generated using the following formula:

[0046]

[0047] in, This represents a preset random frequency band mask matrix. Indicates amplitude spectrum, This represents the amplitude spectrum corresponding to a preset normal image. Represents the phase spectrum. This represents the two-dimensional inverse Fourier transform. Indicates the first A standard image The corresponding pixel perturbation image.

[0048] In this embodiment of the invention, by aggregating the elastic deformation image and the local pixel perturbation image, pseudo-anomaly images with elastic deformation and local frequency domain amplitude spectrum replacement can be generated based on the elastic deformation method and the fractal noise-based local pixel perturbation method. This effectively expands the anomaly sample space, enabling the model to learn richer anomaly distribution features. By introducing pseudo-anomaly samples of different forms into the training process, the model's ability to perceive various anomaly modes such as structural distortion, local damage, and texture anomalies is enhanced, thereby improving the accuracy of anomaly detection and the generalization ability to unknown anomaly types. This allows the subsequent filter rod detection network to identify different types of anomalies.

[0049] S3. Using a pre-constructed filter rod detection network, feature extraction and image reconstruction processing are performed on each cigarette filter cross-section image sample to obtain the reconstructed residual signal map corresponding to the cigarette filter cross-section image sample.

[0050] In this embodiment of the invention, the pre-constructed filter rod detection network includes: a feature encoding module, a frequency domain enhancement module, a decoding and reconstruction module, and a classification head. The feature encoding module and the frequency domain enhancement module perform feature extraction and frequency domain enhancement, the decoding and reconstruction module reconstructs the image from the cross-sectional image sample of the cigarette filter to obtain a reconstructed residual signal map, and the classification head is used for subsequent anomaly identification.

[0051] Specifically, the step of using a pre-constructed filter rod detection network to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample includes: The feature encoding module in the filter rod detection network is used to perform multi-layer convolution processing on each cross-sectional image sample of the cigarette filter tip to obtain multi-layer convolution features. The multi-layer convolutional features are enhanced in the frequency domain to obtain a frequency domain enhanced feature map; The frequency domain enhanced feature map is decoded and reconstructed to obtain the reconstructed residual signal map corresponding to the cross-sectional image sample of the cigarette filter.

[0052] In this embodiment of the invention, the feature encoding module is based on the EfficientNet network and includes, in sequence, a first convolutional block group, a second convolutional block group, a third convolutional block group, and a fourth convolutional block group. Each convolutional block group is cascaded sequentially along the network depth direction. The output of the previous convolutional block group serves as the input to the next convolutional block group, and the module processes the cigarette filter cross-section image samples sequentially to extract the primary features at the first scale. Second-scale intermediate features 3rd scale advanced texture features and fourth-scale abstract features ;Collect primary features at the first scale Second-scale intermediate features 3rd scale advanced texture features and fourth-scale abstract features This yields multi-layer convolutional features.

[0053] Furthermore, the frequency domain enhancement module in the filter rod detection network is used to enhance the multi-layer convolutional features, resulting in a frequency domain enhanced feature map. The frequency domain enhancement module includes a discrete cosine transform unit, a frequency band separation unit, and a cross-band attention unit.

[0054] Specifically, the step of performing frequency domain enhancement on the multi-layer convolutional features to obtain a frequency domain enhanced feature map includes: A two-dimensional discrete cosine transform is performed on the scale convolution features at each scale in the multi-layer convolution features to obtain the frequency domain feature representation; The frequency domain features are divided into three sub-frequency bands, the frequency band energy features of each sub-frequency band are calculated, and the cross-frequency band attention matrix of the scale convolution features is calculated based on the frequency band energy features. Based on the cross-band attention matrix, the scale convolutional features are subjected to cross-band attention weighted fusion to obtain the frequency domain enhanced descriptor corresponding to the scale convolutional features; The frequency domain enhanced descriptor is subjected to depthwise separable convolution to obtain a frequency domain semantic vector, and the frequency domain semantic vector is subjected to bicubic interpolation upsampling to obtain sampled features; The sampled features are then subjected to channel-dimensional attention-weighted fusion to obtain a frequency domain enhanced feature map.

[0055] In this embodiment of the invention, the discrete cosine transform unit processes the first-scale primary features in the multi-layer convolutional features respectively. Second-scale intermediate features 3rd scale advanced texture features and fourth-scale abstract features Performing a two-dimensional discrete cosine transform yields the corresponding frequency domain feature representation. , , and For any frequency domain feature representation, extract its frequency components. And calculate the corresponding amplitude response and phase response, which are expressed as follows: and .

[0056] Furthermore, the frequency band separation unit uses a preset frequency range to divide each frequency domain feature representation into a low-frequency band. Mid-frequency band and high frequency band Three sub-bands are used, and the frequency band energy characteristics of each sub-band are calculated based on the amplitude response.

[0057] Specifically, the frequency band energy characteristics of each sub-band are calculated using the following formula:

[0058] in, Indicates frequency band energy characteristics, Indicates the first Frequency aggregation regions corresponding to each sub-band Indicates the first Convolutional features at each scale in frequency coordinates The amplitude response at that point.

[0059] In this embodiment of the invention, frequency band energy features are weighted and fused by calculating a cross-band attention matrix to obtain a frequency domain enhancement descriptor.

[0060] In detail, the cross-band attention matrix is ​​calculated using the following formula:

[0061]

[0062]

[0063] in, Indicates the frequency band energy characteristics of the low-frequency band The corresponding query vector, Indicates the frequency band energy characteristics of the high-frequency band The corresponding key vector, This represents the cross-band attention matrix. Represents the key vector transpose, This represents the scaling factor.

[0064] The scaling factor can be obtained through Therefore, the dimensional representation of the frequency domain allows for the weighted fusion of scale convolutional features at each scale using a cross-band attention matrix, generating a frequency domain enhancement descriptor for the corresponding scale.

[0065] Furthermore, a pre-built depthwise separable convolutional network is used to perform depthwise separable convolution on the frequency domain enhanced descriptors, mapping the frequency domain enhanced descriptors to frequency domain semantic vectors of the corresponding scale. The depthwise separable convolutional network includes channel-wise convolutional layers and pointwise convolutional layers.

[0066] In detail, bicubic interpolation upsampling is performed on the frequency domain semantic vectors at each scale to align them to a uniform spatial size. Finally, an adaptive weighted fusion of the multi-scale sampled features is performed through a channel attention mechanism at the channel dimension to obtain the frequency domain enhanced feature map corresponding to each cigarette filter cross-section image sample. This significantly enhances the system's generalization performance and environmental adaptability in the detection of multiple batches and specifications of products, especially in complex production environments, effectively reducing the probability of false detections and false negatives.

[0067] In this embodiment of the invention, the decoding and reconstruction module decodes and reconstructs the frequency domain enhanced feature map. The decoding and reconstruction module consists of a U-Net sub-network, which is an encoder-decoder structure including a downsampling encoding path, an upsampling decoding path, and skip connections set between the encoding and decoding paths, used to reconstruct the input frequency domain enhanced feature map; Inputting the U-Net network yields cross-sectional image samples for each cigarette filter. Corresponding reconstructed feature map ,Will and Element-by-element difference calculations are performed to obtain the reconstructed residual signal map. .

[0068] In this embodiment of the invention, by performing discrete cosine transform and frequency band separation modeling on multi-scale image features of cigarette filter cross-section image samples, frequency domain information of the image can be extracted, thereby enhancing the discriminability of low-contrast textures and microstructures. Cross-band attention weighted fusion further strengthens the correlation between different frequency components, improves the model's detection stability for microtexture anomalies, and effectively enhances the filter rod detection network's ability to identify abnormal features.

[0069] S4. Calculate the reconstruction loss value and discrimination loss value of the filter rod detection network based on the reconstructed residual signal diagram, and determine the overall loss value based on the reconstruction loss value and the discrimination loss value.

[0070] In this embodiment of the invention, the reconstruction loss value is the loss between the reconstructed residual signal map and the corresponding cigarette filter cross-section image sample, and the discrimination loss is the loss between the discrimination result and the actual abnormal result when the filter rod detection network is used to perform anomaly discrimination on the reconstructed residual signal map.

[0071] Specifically, the step of calculating the reconstruction loss value and discrimination loss value of the filter rod detection network based on the reconstructed residual signal map includes: The reconstruction loss value is calculated based on the pixel difference between the reconstructed residual signal map and the corresponding cigarette filter cross-section image sample. The classification head in the filter detection network is used to perform anomaly detection on the reconstructed residual signal map to obtain the detection result; The discrimination loss value is calculated using the cross-entropy loss function based on the discrimination result.

[0072] In this embodiment of the invention, the reconstruction loss value is calculated using the following formula:

[0073] in, This represents the reconstruction loss value. Indicates the first A reconstructed residual signal diagram, Indicates the first A sample of cigarette filter cross-section image corresponding to a reconstructed residual signal map. This represents the total number of cross-sectional image samples of cigarette filters. This represents the L1 paradigm.

[0074] Furthermore, the discriminant loss value can be calculated using the following formula:

[0075] in, Indicates the discriminant loss value. Represents the cross-entropy loss function. Indicates the first Reconstructed residual signal diagram The corresponding true discrimination label, This represents the classification head in the filter rod detection network.

[0076] In this embodiment of the invention, Represents the reconstructed residual signal diagram The corresponding true discrimination label, When the reconstructed residual signal image is a normal image of the filter tip, it indicates that the image is normal. When the reconstructed residual signal image is an abnormal filter image, the cross-entropy loss between the classification head's discrimination result and the true discrimination label is calculated to obtain the discrimination loss value.

[0077] Furthermore, the total loss value is constructed using the following formula:

[0078] in, This represents the total loss value. This represents the reconstruction loss value. This represents the preset hyperparameters. This indicates the discrimination loss value.

[0079] S5. Based on the overall loss value, perform gradient descent optimization on the filter rod detection network to obtain the cigarette filter tip end face anomaly detection network, and use the cigarette filter tip end face anomaly detection network to identify anomalies in the cigarette filter tip end face image to be detected.

[0080] In this embodiment of the invention, gradient descent optimization is achieved by using the backpropagation algorithm to calculate the gradient of the loss function value with respect to the filter rod detection network parameters, and by iteratively updating the model weights through gradient descent, to obtain a cigarette filter end-face anomaly detection network that can be used for automatic identification and judgment of abnormal areas on the cigarette filter end face in actual industrial scenarios.

[0081] Specifically, the step of performing gradient descent optimization on the filter rod detection network based on the overall loss value to obtain the cigarette filter tip end-face anomaly detection network includes: Calculate the parameter gradients of the network parameters of the filter rod detection network relative to the overall loss value; The network parameters are updated based on the parameter gradient to obtain updated parameters, and the overall update loss value of the updated parameters is calculated. The network parameters are iteratively updated based on the overall updated loss value until the overall updated loss value is less than a preset loss value threshold, thereby obtaining the target network parameters. By replacing the network parameters with the target network parameters, an anomaly detection network for the cigarette filter tip end face is obtained.

[0082] In this embodiment of the invention, the partial derivative of the overall loss value with respect to the network parameters is calculated to obtain the parameter gradient. The network parameters are updated along the direction of parameter gradient descent to obtain the updated parameters. The reconstruction loss value and the discrimination loss value are calculated based on the filter detection network corresponding to the updated parameters, and then the updated overall loss value corresponding to the updated parameters is obtained.

[0083] Furthermore, by returning the above steps of updating the network parameters according to the parameter gradient based on the updated overall loss value, the network parameters are iteratively updated until the updated overall loss value is less than the preset loss value threshold to obtain the target network parameters. This can improve the predictive ability of the cigarette filter end face anomaly detection network and make anomaly identification more accurate.

[0084] In this embodiment of the invention, the image of the cigarette filter tip end face to be detected is an image that requires end face anomaly identification, such as an end face image of a cigarette filter tip in a real industrial setting. The cigarette filter tip end face anomaly detection network can automatically identify and judge abnormal areas on the end face. See details in [link to relevant documentation]. Figure 3 The image shown is a visualization of the results of anomaly identification performed on an image of the cigarette filter tip.

[0085] like Figure 4 The diagram shown is a functional block diagram of a cigarette filter end face anomaly detection system provided in an embodiment of the present invention.

[0086] The cigarette filter tip end-face anomaly detection system 100 of the present invention can be installed in a processing device. Depending on the functions implemented, the cigarette filter tip end-face anomaly detection system 100 may include an image preprocessing module 101, a pseudo-anomaly image generation module 102, a reconstructed residual signal image generation module 103, a loss value calculation module 104, and a network parameter optimization module 105. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.

[0087] In this embodiment, the functions of each module / unit are as follows: The image preprocessing module 101 is used to acquire a set of images of the cigarette filter end face, and to perform image preprocessing on the set of images of the cigarette filter end face to obtain a standard image set. The pseudo-anomaly image generation module 102 is used to perform elastic deformation and local pixel perturbation on the standard image set to obtain a pseudo-anomaly image, and generate a cigarette filter end face image sample based on the pseudo-anomaly image. The reconstructed residual signal image generation module 103 is used to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample using a pre-constructed filter rod detection network to obtain the reconstructed residual signal image corresponding to the cigarette filter cross-section image sample. The loss value calculation module 104 is used to calculate the reconstruction loss value and the discrimination loss value of the filter rod detection network based on the reconstructed residual signal map, and to determine the overall loss value based on the reconstruction loss value and the discrimination loss value. The network parameter optimization module 105 is used to perform gradient descent optimization on the filter rod detection network according to the overall loss value to obtain a cigarette filter end face anomaly detection network, and to use the cigarette filter end face anomaly detection network to identify anomalies in the cigarette filter end face image to be detected.

[0088] As a further preferred technical solution, the image preprocessing module 101 is specifically used for: The image size of each cigarette filter end face image in the cigarette filter end face image set is unified to obtain a unified image; The unified image is subjected to image grayscale processing to obtain a grayscale image; The grayscale image is subjected to image normalization processing to obtain a standard image set.

[0089] As a further preferred technical solution, the pseudo-anomaly image generation module 102 is specifically used for: A two-dimensional displacement vector field is randomly sampled, and a smooth random displacement field is constructed based on the two-dimensional displacement vector field. Construct a smooth random displacement field using the following formula:

[0090] in, Represents a smooth random displacement field. The preset standard deviation is . Two-dimensional Gaussian kernel, This represents the convolution operation. Represents a two-dimensional displacement vector field; The smooth random displacement field is used to perform image control deformation mapping on each standard image in the standard image set to obtain an elastic deformation image; The elastic deformation image is obtained by performing image control deformation mapping on the displacement mapping image using the following formula:

[0091] in, Indicates the first A standard image The corresponding elastic deformation image, Represents a smooth random displacement field. This represents the preset image control deformation mapping function; A two-dimensional Fourier transform is performed on the standard image to obtain the amplitude spectrum and the phase spectrum. A local pixel perturbation image is then generated based on the amplitude spectrum and the phase spectrum. The following formula is used to generate a locally pixel-perturbed image:

[0092]

[0093] in, This represents a preset random frequency band mask matrix. Indicates amplitude spectrum, This represents the amplitude spectrum corresponding to a preset normal image. Represents the phase spectrum. This represents the two-dimensional inverse Fourier transform. Indicates the first A standard image The corresponding pixel perturbation image; By combining the elastic deformation image and the local pixel perturbation image, a pseudo-anomaly image is obtained.

[0094] As a further preferred technical solution, the reconstructed residual signal graph generation module 103 is specifically used for: The feature encoding module in the filter rod detection network is used to perform multi-layer convolution processing on each cross-sectional image sample of the cigarette filter tip to obtain multi-layer convolution features. The multi-layer convolutional features are enhanced in the frequency domain to obtain a frequency domain enhanced feature map; The frequency domain enhanced feature map is decoded and reconstructed to obtain the reconstructed residual signal map corresponding to the cross-sectional image sample of the cigarette filter.

[0095] As a further preferred technical solution, the reconstructed residual signal graph generation module 103 is specifically used for: A two-dimensional discrete cosine transform is performed on the scale convolution features at each scale in the multi-layer convolution features to obtain the frequency domain feature representation; The frequency domain features are divided into three sub-frequency bands, the frequency band energy features of each sub-frequency band are calculated, and the cross-frequency band attention matrix of the scale convolution features is calculated based on the frequency band energy features. The cross-band attention matrix is ​​calculated using the following formula:

[0096]

[0097]

[0098] in, Indicates the frequency band energy characteristics of the low-frequency band The corresponding query vector, Indicates the frequency band energy characteristics of the high-frequency band The corresponding key vector, This represents the cross-band attention matrix. Represents the key vector transpose, Indicates the scaling factor; Based on the cross-band attention matrix, the scale convolutional features are subjected to cross-band attention weighted fusion to obtain the frequency domain enhanced descriptor corresponding to the scale convolutional features; The frequency domain enhanced descriptor is subjected to depthwise separable convolution to obtain a frequency domain semantic vector, and the frequency domain semantic vector is subjected to bicubic interpolation upsampling to obtain sampled features; The sampled features are then subjected to channel-dimensional attention-weighted fusion to obtain a frequency domain enhanced feature map.

[0099] As a further preferred technical solution, the loss value calculation module 104 is specifically used for: The reconstruction loss value is calculated based on the pixel difference between the reconstructed residual signal map and the corresponding cigarette filter cross-section image sample. The classification head in the filter detection network is used to perform anomaly detection on the reconstructed residual signal map to obtain the detection result; The discrimination loss value is calculated using the cross-entropy loss function based on the discrimination result.

[0100] As a further preferred technical solution, the network parameter optimization module 105 is specifically used for: Calculate the parameter gradients of the network parameters of the filter rod detection network relative to the overall loss value; The network parameters are updated based on the parameter gradient to obtain updated parameters, and the overall update loss value of the updated parameters is calculated. The network parameters are iteratively updated based on the overall updated loss value until the overall updated loss value is less than a preset loss value threshold, thereby obtaining the target network parameters. By replacing the network parameters with the target network parameters, an anomaly detection network for the cigarette filter tip end face is obtained.

[0101] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0102] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0103] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting abnormalities on the end face of a cigarette filter, characterized in that, include: A set of images of the cigarette filter tip end face is obtained, and the set of images of the cigarette filter tip end face is preprocessed to obtain a standard image set; The standard image set is subjected to elastic deformation and local pixel perturbation to obtain pseudo-anomaly images, and cigarette filter end face image samples are generated based on the pseudo-anomaly images. The pre-constructed filter rod detection network is used to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample to obtain the reconstruction residual signal map corresponding to the cigarette filter cross-section image sample. The reconstruction loss value and the discrimination loss value of the filter rod detection network are calculated based on the reconstructed residual signal map, and the overall loss value is determined based on the reconstruction loss value and the discrimination loss value. The filter rod detection network is optimized by gradient descent based on the overall loss value to obtain a cigarette filter end face anomaly detection network. The cigarette filter end face anomaly detection network is then used to identify anomalies in the cigarette filter end face image to be detected.

2. The method for detecting abnormalities at the end face of a cigarette filter as described in claim 1, characterized in that, The image preprocessing of the cigarette filter tip end face image set to obtain a standard image set includes: The image size of each cigarette filter end face image in the cigarette filter end face image set is unified to obtain a unified image; The unified image is subjected to image grayscale processing to obtain a grayscale image; The grayscale image is subjected to image normalization processing to obtain a standard image set.

3. The method for detecting abnormalities at the end face of a cigarette filter as described in claim 1, characterized in that, The process of applying elastic deformation and local pixel perturbation to the standard image set to obtain pseudo-anomaly images includes: A two-dimensional displacement vector field is randomly sampled, and a smooth random displacement field is constructed based on the two-dimensional displacement vector field. Construct a smooth random displacement field using the following formula: in, Represents a smooth random displacement field. The preset standard deviation is . Two-dimensional Gaussian kernel, This represents the convolution operation. Represents a two-dimensional displacement vector field; The smooth random displacement field is used to perform image control deformation mapping on each standard image in the standard image set to obtain an elastic deformation image; The elastic deformation image is obtained by performing image control deformation mapping on the displacement mapping image using the following formula: in, Indicates the first A standard image The corresponding elastic deformation image, Represents a smooth random displacement field. This represents the preset image control deformation mapping function; A two-dimensional Fourier transform is performed on the standard image to obtain the amplitude spectrum and the phase spectrum. A local pixel perturbation image is then generated based on the amplitude spectrum and the phase spectrum. The following formula is used to generate a locally pixel-perturbed image: in, This represents a preset random frequency band mask matrix. Indicates amplitude spectrum, This represents the amplitude spectrum corresponding to a preset normal image. Represents the phase spectrum. This represents the two-dimensional inverse Fourier transform. Indicates the first A standard image The corresponding pixel perturbation image; By combining the elastic deformation image and the local pixel perturbation image, a pseudo-anomaly image is obtained.

4. The method for detecting abnormalities at the end face of a cigarette filter as described in claim 1, characterized in that, The process of extracting features and reconstructing images from each cigarette filter cross-section image sample using a pre-constructed filter rod detection network includes: The feature encoding module in the filter rod detection network is used to perform multi-layer convolution processing on each cross-sectional image sample of the cigarette filter tip to obtain multi-layer convolution features. The multi-layer convolutional features are enhanced in the frequency domain to obtain a frequency domain enhanced feature map; The frequency domain enhanced feature map is decoded and reconstructed to obtain the reconstructed residual signal map corresponding to the cross-sectional image sample of the cigarette filter.

5. The method for detecting abnormalities at the end face of a cigarette filter as described in claim 4, characterized in that, The step of enhancing the multi-layer convolutional features in the frequency domain to obtain a frequency-domain enhanced feature map includes: A two-dimensional discrete cosine transform is performed on the scale convolution features at each scale in the multi-layer convolution features to obtain the frequency domain feature representation; The frequency domain features are divided into three sub-frequency bands, the frequency band energy features of each sub-frequency band are calculated, and the cross-frequency band attention matrix of the scale convolution features is calculated based on the frequency band energy features. The cross-band attention matrix is ​​calculated using the following formula: in, Indicates the frequency band energy characteristics of the low-frequency band The corresponding query vector, Indicates the frequency band energy characteristics of the high-frequency band The corresponding key vector, This represents the cross-band attention matrix. Represents the key vector transpose, Indicates the scaling factor; Based on the cross-band attention matrix, the scale convolutional features are subjected to cross-band attention weighted fusion to obtain the frequency domain enhanced descriptor corresponding to the scale convolutional features; The frequency domain enhanced descriptor is subjected to depthwise separable convolution to obtain a frequency domain semantic vector, and the frequency domain semantic vector is subjected to bicubic interpolation upsampling to obtain sampled features; The sampled features are then subjected to channel-dimensional attention-weighted fusion to obtain a frequency domain enhanced feature map.

6. The method for detecting abnormalities at the end face of a cigarette filter as described in claim 1, characterized in that, The step of calculating the reconstruction loss value and discrimination loss value of the filter rod detection network based on the reconstructed residual signal map includes: The reconstruction loss value is calculated based on the pixel difference between the reconstructed residual signal map and the corresponding cigarette filter cross-section image sample. The classification head in the filter detection network is used to perform anomaly detection on the reconstructed residual signal map to obtain the detection result; The discrimination loss value is calculated using the cross-entropy loss function based on the discrimination result.

7. The method for detecting abnormalities at the end face of a cigarette filter as described in claim 1, characterized in that, The step of performing gradient descent optimization on the filter rod detection network based on the overall loss value to obtain the cigarette filter tip end face anomaly detection network includes: Calculate the parameter gradients of the network parameters of the filter rod detection network relative to the overall loss value; The network parameters are updated based on the parameter gradient to obtain updated parameters, and the overall update loss value of the updated parameters is calculated. The network parameters are iteratively updated based on the overall updated loss value until the overall updated loss value is less than a preset loss value threshold, thereby obtaining the target network parameters. By replacing the network parameters with the target network parameters, an anomaly detection network for the cigarette filter tip end face is obtained.

8. A cigarette filter tip end face anomaly detection system, characterized in that, include: The image preprocessing module is used to acquire a set of images of the cigarette filter tip end face, and to perform image preprocessing on the set of images of the cigarette filter tip end face to obtain a standard image set. The pseudo-anomaly image generation module is used to perform elastic deformation and local pixel perturbation on the standard image set to obtain pseudo-anomaly images, and generate cigarette filter end face image samples based on the pseudo-anomaly images. The reconstructed residual signal map generation module is used to perform feature extraction and image reconstruction processing on each cigarette filter cross-section image sample using a pre-constructed filter rod detection network to obtain the reconstructed residual signal map corresponding to the cigarette filter cross-section image sample. The loss value calculation module is used to calculate the reconstruction loss value and the discrimination loss value of the filter rod detection network based on the reconstructed residual signal map, and to determine the overall loss value based on the reconstruction loss value and the discrimination loss value. The network parameter optimization module is used to perform gradient descent optimization on the filter rod detection network based on the overall loss value to obtain a cigarette filter end face anomaly detection network, and to use the cigarette filter end face anomaly detection network to identify anomalies in the cigarette filter end face image to be detected.

9. A processing device, characterized in that, It includes at least one processor and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor can execute the method as described in any one of claims 1-7 by invoking the program instructions.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause the computer to perform the method as described in any one of claims 1-7.