Cigarette end face defect detection method based on visual target detection

Through the visual object detection method based on deep learning, the shortcomings of the cigarette end surface defect detection in the prior art under the light changes and complex background are solved, and the detection effect with high precision and real-time performance is achieved, meeting the needs of high-speed production lines.

CN119992207APending Publication Date: 2025-05-13CHINA TOBACCO HENAN IND CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510118472.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing smoke support end surface defect detection method is poor in light changes and complex background interference, making it difficult to accurately detect small defects, and is not robust and real-time, making it difficult to meet the needs of high-speed production lines.

Method used

The visual object detection method based on deep learning is adopted, and the end face images of the cigarette support are collected and preprocessed, and data enhancement is performed in combination with scene characteristics. The object detection model is trained to detect end face defects in real time, and quantitative characterization and evaluation are performed.

Benefits of technology

It realizes high-precision, strong real-time and robust smoke support end-face defect detection, which can identify small defects, reduce missed and missed inspections, and meet the inspection needs of high-speed production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119992207A_ABST
    Figure CN119992207A_ABST
Patent Text Reader

Abstract

The invention discloses a cigarette end surface defect detection method based on visual target detection, and the main design concept of the invention is that the method mainly comprises the steps: collecting original data of a cigarette end surface, carrying out the preprocessing of an original image, and segmenting the original image to obtain a cigarette end surface image; in combination with the scene characteristics of actually shooting the cigarette end face, expanding and reinforcing the cigarette end face image to obtain diversified cigarette end face visual samples; marking the cigarette end face visual sample and then training a target detection model based on deep learning; the trained target detection model is used for detecting a cigarette end face real-shot picture collected in the production process in real time, and the detected end face defects are subjected to quantitative characterization and then are subjected to score estimation. Compared with a traditional image processing method and a machine vision system, a new solution is provided for cigarette end face defect detection, and the dual requirements of a high-speed production line for detection precision and real-time performance can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of cigarette manufacturing, and in particular to a cigarette end face defect detection method based on visual target detection. Background Art

[0002] In tobacco production, cigarette end surface defects can affect the burning consistency and smoking experience of cigarettes, and may also cause problems such as air leakage and damage during the packaging process. Therefore, the detection of cigarette end surface defects is an important part of ensuring product quality.

[0003] Traditionally, end face defect detection mainly relies on manual inspection and simple image processing methods. Manual inspection relies on the operator's experience and subjective judgment, and can detect some minor defects, but it is inefficient and easily affected by fatigue, and it is difficult to meet the needs of modern high-speed production lines. In order to improve the efficiency and consistency of inspection, the industry has introduced computer vision and automatic inspection technology. Common traditional inspection schemes include automated methods based on image processing and machine vision systems. Image processing-based methods usually use edge detection (such as Canny, Sobel) and morphological operations (such as corrosion and expansion) to identify end face defects, and analyze end face integrity through feature extraction.

[0004] However, the above-mentioned existing methods do not perform well under lighting changes and complex background interference, and have limited detection accuracy for small defects with complex shapes (such as tiny cracks and burrs), especially in actual production environments where they lack robustness. In addition, machine vision systems optimize image acquisition quality by combining industrial cameras and light source design, but their detection accuracy depends on light source design and feature extraction algorithms, and their ability to detect defects in complex shapes and changing environments is limited. Summary of the invention

[0005] In view of the above, the present invention aims to provide a cigarette end face defect detection method based on visual target detection to solve the above-mentioned technical problems.

[0006] The technical solution adopted by the present invention is as follows:

[0007] The present invention provides a method for detecting cigarette end surface defects based on visual target detection, which includes:

[0008] Collect the original data of the cigarette end surface;

[0009] After preprocessing the original image, the cigarette end face image is segmented therefrom;

[0010] Combined with the characteristics of the scene of actually photographing the end face of a cigarette, the cigarette end face image is expanded and enhanced to obtain a variety of cigarette end face visual samples;

[0011] After labeling the visual samples of the cigarette end faces, training a deep learning-based target detection model;

[0012] The trained target detection model is used to detect real-time photos of cigarette end faces collected during the production process, and the detected end face defects are quantitatively characterized and scored.

[0013] In at least one possible implementation manner, the preprocessing includes denoising processing and contrast enhancement processing.

[0014] In at least one possible implementation, the extension and enhancement includes: adding Gaussian noise and / or salt and pepper noise to simulate the real noise that occurs when photographing the end faces of cigarettes on a production line.

[0015] In at least one possible implementation, the expansion and enhancement also includes: simulating different shooting angles, viewing angles and size changes when shooting the end faces of cigarettes on the production line through random rotation, horizontal flipping, scaling, cropping and translation.

[0016] In at least one possible implementation, the extension and enhancement also includes: simulating the image acquisition effects under different lighting and camera settings when photographing the end faces of cigarettes on a production line by adjusting the brightness, contrast, saturation and hue.

[0017] In at least one possible implementation, the training process of the target detection model includes: optimizing the visual target detection model using a cosine annealing learning rate strategy.

[0018] In at least one possible implementation manner, the labeling includes: marking each defect category label and defect boundary box coordinates of the cigarette end surface.

[0019] In at least one possible implementation, the step of quantifying and characterizing the detected end face defects and then scoring them includes:

[0020] Obtain the detected defect categories and bounding box coordinates;

[0021] estimating the area of ​​each defect using the bounding box coordinates;

[0022] According to the preset weight value and area of ​​the corresponding defect category, the cigarette end face defects are evaluated by deducting points.

[0023] In at least one possible implementation, the deduction assessment is calculated according to the following formula:

[0024] Deduction points = ;

[0025] Where n is the number of defects detected, For the The weight coefficient of the class defect, For the The area of ​​the defect.

[0026] In at least one possible implementation, the defect categories of the cigarette end surface include at least one or more combinations of the following: empty tip, contact tip, thin tip, glue hole, stain, crack, burr, depression, air hole, and residual impurities.

[0027] Compared with the prior art, the main design concept of the present invention is that it mainly includes collecting the original data of the cigarette end face, segmenting the cigarette end face image from the original image after preprocessing; expanding and strengthening the cigarette end face image in combination with the scene characteristics of the actual cigarette end face shooting to obtain a variety of cigarette end face visual samples; annotating the cigarette end face visual samples and training a target detection model based on deep learning; using the trained target detection model to detect the actual cigarette end face images collected during the production process in real time, and quantitatively characterize the detected end face defects and then estimate them. Traditional image processing methods judge the presence or absence of defects based on information such as the pixels and contours of the defects, but cannot accurately judge the type of defects and quantify the degree of defects. Compared with traditional image processing methods and machine vision systems, the present invention provides a new solution for cigarette end face defect detection, which can meet the dual requirements of high-speed production lines for detection accuracy and real-time performance, and has at least the following advantages:

[0028] (1) High-precision detection: The end surface of a cigarette may have extremely small defects, such as cracks, burrs, dents, pores, residual impurities, etc. These defects directly affect the appearance, quality and smoking experience of the cigarette. Traditional algorithms based on edge detection or morphological processing can often only identify relatively obvious defects and are easily affected by image noise, lighting changes, etc., resulting in false detection and missed detection.

[0029] The solution of the present invention can not only detect obvious defects, but also identify tiny cracks, fine burrs and slight depressions on the surface of cigarettes, which is particularly important for the quality control of high-end tobacco products, avoiding missed detection and false detection, and ensuring that the quality of each cigarette meets the standards.

[0030] (2) Strong real-time performance: Given the extremely high speed of tobacco production lines, efficient automated inspection is essential. Traditional imaging methods are not only time-consuming, but also inefficient and prone to omissions or negligence.

[0031] As mentioned in an embodiment below, the present invention utilizes the cosine annealing learning rate strategy to optimize the network structure and enhance its highly parallel computing capability, thereby enabling real-time detection in a high-speed production line environment and ensuring that each cigarette can be detected and processed in a timely manner during the production process.

[0032] (3) High robustness: The environment in tobacco production is often complex and changeable. Factors such as lighting conditions, cigarette placement angles, and background changes may affect the accuracy of traditional detection methods. For example, the end face of a cigarette may show different gloss, shadows, or reflections due to differences in equipment in different production batches, which increases the difficulty of detection.

[0033] As mentioned in an embodiment below, the YOLOv8-based deep learning model can learn features under different conditions by training a large number of diverse cigarette end-face images with different backgrounds and lighting conditions, thereby ensuring the robustness of the model in complex environments. In other words, it has strong environmental adaptability, and the model can still maintain a high detection accuracy even when the lighting changes, the cigarettes are placed at different angles, or the background is complex.

[0034] (4) High degree of automation: Traditional cigarette end face defect detection methods usually rely on manual setting of thresholds, parameter adjustments, and rule definitions, which not only increases the complexity of the operation but also easily introduces human errors.

[0035] The solution provided by the present invention can be, but is not limited to, end-to-end training, and can automatically learn the characteristics of end face defects from a large amount of image data without human intervention. This eliminates the step of manual parameter setting, reduces errors caused by human operation, and improves the stability and consistency of detection.

[0036] (5) Defect quantification: The present invention can quantitatively evaluate the severity of defects on the end surface of cigarettes through quantitative analysis. For example, the area of ​​the concave or missing end surface of the cigarette, as well as the size of the glue holes and stains on the end surface, will affect the quality of the cigarette. By quantitatively characterizing the defects, the production line can decide whether to rework or directly remove defective products based on the severity of the defects, thereby preventing defective products from entering the market. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described below with reference to the accompanying drawings, in which:

[0038] Figure 1 A schematic diagram of a cigarette end face defect detection method based on visual target detection provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0040] As mentioned above, the industry's traditional visual inspection method for cigarette end face defects faces several core problems: First, it lacks robustness, and is prone to false detection or missed detection when the lighting changes and the background is cluttered; second, the detection accuracy is limited, and it is difficult to identify small and irregular defects, especially when faced with complex defects, it is difficult to extract accurate features; third, the real-time and adaptability are poor, and it is impossible to meet the dual requirements of detection efficiency and accuracy on high-speed production lines, and it is difficult to adapt to the detection needs of cigarettes of different specifications and shapes. These problems are mainly due to the poor adaptability of traditional methods to environmental changes, the reliance on fixed rules for feature extraction, and the difficulty in balancing detection speed and accuracy. Therefore, in practical applications, traditional methods are difficult to meet the needs of high-precision and high-robustness detection, especially on modern high-speed production lines, and more intelligent and efficient detection solutions are urgently needed.

[0041] In view of this, the present invention proposes an embodiment of a cigarette end surface defect detection method based on visual target detection. Specifically, Figure 1 shown, including:

[0042] Step S1, collecting raw data of the cigarette end surface;

[0043] In actual operation, the collection of raw data of the cigarette end face can be done by using a single camera to take two-dimensional images. The camera receives the light reflected from the cigarette end face through the lens to form its projected image on the plane. In order to ensure the image quality, it is preferred to use a high-resolution industrial camera or a common RGB camera, and adjust the appropriate lens focal length and aperture to ensure clear imaging of the end face. At the same time, a uniform light source (such as a ring light) is used to avoid shadows or highlight areas to ensure the uniformity of the image. During the shooting process, the camera maintains an appropriate angle and distance with the cigarette end face to obtain the best imaging effect.

[0044] Step S2, after pre-processing the original image, segmenting it to obtain a cigarette end face image;

[0045] Furthermore, after pre-processing such as denoising and contrast enhancement, the original image obtained by shooting can more conveniently and accurately extract edge and shape features, perform regional segmentation, and finally obtain the surface information of the cigarette end face. Since the above image data is the basis for subsequent analysis and processing, the processing of the original image can be specifically referred to as follows:

[0046] In the process of preprocessing the original image of the cigarette end face, denoising can be performed first to remove the noise in the image. Common methods include Gaussian filtering, median filtering and mean filtering. Gaussian filtering removes random noise by smoothing the image; median filtering removes salt and pepper noise by replacing the target pixel with the median of the surrounding pixels; mean filtering uses the mean of the neighborhood pixels for processing to reduce small noise. Next, contrast enhancement can be performed, such as through histogram equalization or adaptive contrast enhancement, to make the image contrast more uniform and highlight the details of the cigarette end face. Then, edge detection technology, such as Canny edge detection, is used to extract the contour of the object in the image and clarify the boundary of the cigarette end face. Finally, image segmentation is performed to separate the cigarette end face from the background based on the grayscale or edge information of the image. Common segmentation methods include global threshold segmentation, region growing method or watershed algorithm combined with edge detection. Through these steps, the quality of the image can be effectively improved, providing a clear image basis for subsequent analysis and feature extraction.

[0047] Step S3, combining the scene characteristics of the actual cigarette end face shooting, expanding and strengthening the cigarette end face image to obtain diversified cigarette end face visual samples;

[0048] In addition to the above-mentioned preprocessing and object segmentation, in order to improve the generalization ability of the model and reduce overfitting, data enhancement processing is further adopted in the processing of cigarette end face images. First, through geometric transformations such as random rotation, horizontal flipping, scaling, cropping and translation, different shooting angles, viewing angles and size changes are simulated to enhance the model's recognition ability for cigarettes in different postures. Next, color transformation is performed, including brightness, contrast, saturation and hue adjustment, to simulate the effects under different lighting and camera settings, and improve the model's adaptability to light and color changes. In addition, Gaussian noise and salt and pepper noise are added to enhance the model's robustness to image noise that may occur in actual environments. Through these diverse image data enhancement methods, the diversity of training cigarette end face samples can be effectively expanded, and the recognition performance of the model in different scenarios can be significantly improved. That is to say, the enhancement processing involved in the present invention is centered around the characteristics of the cigarette end face and the actual shooting scene environment when collecting cigarette end face images. The specific enhancement processing concept proposed, for example, the data enhancement strategy for cigarette end face images includes: random rotation, brightness adjustment, contrast enhancement, and especially adding noise. Through these specific enhancement means, the model can learn more diverse defect features and improve generalization ability and detection effect.

[0049] Step S4, annotating the visual samples of the cigarette end faces and training a deep learning-based target detection model;

[0050] For reference, in the cigarette end face image detection task involved in some embodiments of the present invention, the YOLOv8 model is preferably used for training, and the training process may include: data annotation, data set preparation, model training and optimization and other steps. First, use the labeling tool (LabelImg) to annotate the extended cigarette end face image, mark the defect category label and defect boundary box coordinates of each cigarette end face, and save the annotated data in YOLO format. The cigarette defect types mentioned here include more obvious defects, such as empty heads, contacts, thin heads, glue holes and stains, as well as minor defects, such as cracks, burrs, depressions, pores, residual impurities, etc. Then, the annotated data set is divided into a training set, a validation set, and a test set in a ratio of 8:1:1. During the model training process, the pre-trained weights of YOLOv8 (yolov8n.pt) are loaded, and the PyTorch library is used for transfer learning. In order to improve the convergence speed and stability during model training, especially for the actual situation of cigarette production site, the present invention proposes to optimize the visual target detection model by using the cosine annealing learning rate strategy in some preferred embodiments. This strategy enables the model to converge quickly in the early stage of training by dynamically adjusting the learning rate, and to be able to be stably and finely optimized in the later stage, thereby obtaining higher detection accuracy: in this way, when the model is deployed, even when the speed of the tobacco production line is very fast, it can also achieve real-time and accurate detection, ensuring that each cigarette can be detected and processed in time during the production process. Continuing from the previous text, during the training process, set the appropriate batch size and number of training rounds, and use the default loss function of YOLOv8, including classification loss, bounding box regression loss and confidence loss, to comprehensively evaluate the model performance. Finally, the performance evaluation is performed on the validation set and the test set, and the model effect is evaluated using indicators such as mean average precision (mAP), precision and recall, and the focus area of ​​the model is analyzed in combination with the Grad-CAM visualization tool to verify the robustness and practical application ability of the model in the cigarette end face detection task. Through these steps, the YOLOv8 model can be used to achieve efficient detection and recognition of cigarette end face images, providing a reliable basis for subsequent analysis.

[0051] Step S5: Utilize the trained target detection model to detect the end face images of cigarettes collected during the production process in real time, and quantify and characterize the detected end face defects and give them an estimated score.

[0052] The YOLOv8 model is used to detect various defect areas in the cigarette end face image. For each detected defect, its category (as mentioned above, the defects of the cigarette end face include cracks, edge loss, dents, stains and other defects of different types and degrees of obviousness) and the defect bounding box information are obtained, and the area of ​​the detected defect is calculated using image processing methods. It can be explained here that the calculation of the defect area is based on the size of the bounding box, that is, the pixel area of ​​the defect area is estimated by geometric parameters such as the width and height of the bounding box. Finally, the defect is evaluated by deducting points based on the pre-defined defect category and the corresponding weight scoring rules.

[0053] Regarding the deduction assessment, different types of defects have different scoring weights. For example, more obvious and serious defects such as empty heads and contacts can be assigned higher weight coefficients, while minor and less obvious defects such as dents or surface impurities can be assigned lower weight coefficients. The specific deduction calculation formula is as follows:

[0054] Deduction points =

[0055] Where n is the number of defects detected, For the The weight coefficient of the class defect, For the The deduction mechanism takes into account the area, type and quantity of defects and calculates the total deduction score, that is, the deduction scores of all defects are accumulated to obtain the overall defect score of the current cigarette. The above method can effectively evaluate the quality of each cigarette end face, help screen out products that meet quality standards, and classify products with obvious defects.

[0056] In summary, the main design concept of the present invention is that it mainly includes collecting the original data of the cigarette end face, segmenting the cigarette end face image after preprocessing the original image; expanding and strengthening the cigarette end face image in combination with the scene characteristics of the actual cigarette end face shooting to obtain a variety of cigarette end face visual samples; training the target detection model based on deep learning after annotating the cigarette end face visual samples; using the trained target detection model to detect the real-life cigarette end face images collected during the production process in real time, and quantitatively characterize the detected end face defects and then estimate them. Traditional image processing methods judge the presence or absence of defects based on information such as the pixels and contours of the defects, but cannot accurately judge the type of defects and quantify the degree of defects. Compared with traditional image processing methods and machine vision systems, the present invention provides a new solution for cigarette end face defect detection, which can meet the dual requirements of high-speed production lines for detection accuracy and real-time performance.

[0057] If the expressions expressing orientation are mentioned in the embodiments of the present invention, they are relative concepts based on the embodiments. In addition, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, wherein a, b, c can be single or multiple.

[0058] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings, but the above is only a preferred embodiment of the present invention. It should be noted that the technical features involved in the above embodiments and their preferred methods can be reasonably combined and matched into a variety of equivalent schemes by those skilled in the art without departing from or changing the design ideas and technical effects of the present invention; therefore, the present invention is not limited to the scope of implementation shown in the drawings, and all changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the specification and drawings, should be within the protection scope of the present invention.

Claims

1. A method for detecting cigarette end surface defects based on visual target detection, characterized in that: include: Collect the original data of the cigarette end surface; After preprocessing the original image, the cigarette end face image is segmented therefrom; Combined with the characteristics of the scene of actually photographing the end face of a cigarette, the cigarette end face image is expanded and enhanced to obtain a variety of cigarette end face visual samples; After labeling the visual samples of the cigarette end faces, training a deep learning-based target detection model; The trained target detection model is used to detect real-time photos of cigarette end faces collected during the production process, and the detected end face defects are quantitatively characterized and scored.

2. The cigarette end surface defect detection method based on visual target detection according to claim 1 is characterized in that: The preprocessing includes denoising and contrast enhancement.

3. The cigarette end surface defect detection method based on visual target detection according to claim 2 is characterized in that: The extended enhancement includes: adding Gaussian noise and / or salt and pepper noise to simulate the real noise that occurs when photographing the end face of a cigarette on a production line.

4. The cigarette end surface defect detection method based on visual target detection according to claim 3 is characterized in that: The expansion and enhancement also includes: simulating different shooting angles, viewing angles and size changes when shooting the end faces of cigarettes on the production line through random rotation, horizontal flipping, scaling, cropping and translation.

5. The cigarette end surface defect detection method based on visual target detection according to claim 3 is characterized in that: The expansion and enhancement also includes: simulating the image acquisition effects under different lighting and camera settings when photographing the end faces of cigarettes on the production line by adjusting the brightness, contrast, saturation and hue.

6. The cigarette end surface defect detection method based on visual target detection according to claim 1, characterized in that: The training process of the target detection model includes: optimizing the visual target detection model by using a cosine annealing learning rate strategy.

7. The method for detecting cigarette end surface defects based on visual target detection according to claim 1, characterized in that: The labeling includes: marking each defect category label and defect boundary box coordinates of the cigarette end surface.

8. The method for detecting cigarette end surface defects based on visual target detection according to claim 7, characterized in that: The step of quantitatively characterizing the detected end face defects and then evaluating the scores includes: Obtain the detected defect categories and bounding box coordinates; estimating the area of ​​each defect using the bounding box coordinates; According to the preset weight value and area of ​​the corresponding defect category, the cigarette end face defects are evaluated by deducting points.

9. The method for detecting cigarette end surface defects based on visual target detection according to claim 8, characterized in that: The deduction assessment is calculated according to the following formula: Deduction points = ; Where n is the number of defects detected, For the The weight coefficient of the class defect, For the The area of ​​the defect.

10. The cigarette end surface defect detection method based on visual target detection according to any one of claims 1 to 9, characterized in that: The defect categories of the cigarette end surface include at least one or more combinations of the following: empty tip, contact tip, thin tip, glue hole, stain, crack, burr, dent, air hole, and residual impurities.

Citation Information

Cited By

  • Real-time online detection method for appearance quality of cigarette stacking anti-collision strip

    CN120971439A

  • Bamboo-plastic packaging box tracking and positioning identification method based on AI vision

    CN121600360A