Cigarette surface defect detection system based on machine vision and detection method thereof
By monitoring cigarette posture disturbances in real time and combining them with suspected defect signals, the detection and lighting strategies are dynamically adjusted, solving the problems of misjudgment and missed detection in cigarette surface defect detection systems on fast production lines, and achieving highly reliable defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HENAN UNIVERSITY OF TECHNOLOGY
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-01
AI Technical Summary
Existing cigarette surface defect detection systems are prone to misjudgment or missed detection on high-speed production lines due to the unstable posture of cigarettes. In particular, when the seam of the cigarette packaging paper is located at the edge of the detection station, the system cannot accurately match the feature points, resulting in broken or ghosted spliced images. Furthermore, the defect detection model is inaccurate in judging suspected defects.
By monitoring attitude disturbances during cigarette handover, disturbance signals of axial slip and circumferential roll angle are generated. Combined with suspected defect signals, the detection strategy and lighting strategy are dynamically adjusted. An optical displacement sensor is used to measure attitude changes, and image correction and local lighting enhancement are performed at the second detection station. The results of the two detections are then fused for the final judgment.
This improved the reliability of cigarette surface defect detection, reduced the false rejection rate and false negative rate, and ensured the high reliability and accuracy of the detection results.
Smart Images

Figure CN121955002A_ABST
Abstract
Description
A machine vision-based system and method for detecting surface defects in cigarettes. Technical Field
[0001] This invention relates to the field of defect detection technology, and in particular to a machine vision-based system and method for detecting surface defects in cigarettes. Background Technology
[0002] In existing technologies, the detection of surface defects in cigarettes generally employs two methods: 2D machine vision and 3D structured light. 3D structured light is mainly used to detect defects such as protrusions and contour deformation on the surface of cigarettes. Due to its high precision and high deployment cost, it is generally used for random inspections of cigarettes rather than routine inspections. 2D machine vision is mainly used to detect problems such as wrinkles, stains, pattern misalignment, and packaging defects on the surface of cigarettes. Due to its low cost, it is generally applicable to routine inspections of cigarettes.
[0003] Chinese patent application number CN202310264767.4 discloses a method, device, equipment, and storage medium for detecting defects in cigarette filter rods. This invention uses at least two industrial cameras to acquire circumferential images of cigarette filter rods, and stitches them together to form a complete 360° image of the cigarette's circumference through the cooperation of two drums. The acquired image dataset is preprocessed and classified according to defect type and location. The defect detection model is used to detect defective cigarette filter rods, replacing traditional manual quality inspection and other processes, reducing labor intensity and inspection costs for workers, and improving cigarette production efficiency and quality.
[0004] Because the production speed of cigarette production lines today is extremely fast, basically reaching hundreds of packs per minute, the defect detection of cigarettes must also be accelerated accordingly. However, when using the above-mentioned dual-drum combination method, when the cigarette to be tested is transferred from the first drum to the second drum, it is in a brief mechanically unstable state during the process of separating from the first drum and not yet being completely adsorbed and fixed by the second drum. Under the interference of the linear velocity of the two drums, the difference in cigarette type, or airflow disturbance, it is very easy to cause unexpected axial slippage and circumferential rolling.
[0005] Furthermore, the defect detection system mainly relies on stable natural features on the cigarette surface (such as printed patterns and seams) as anchor points to accurately align the images captured by the two cameras. However, if the seam of the cigarette packaging paper is located at the edge of the first drum inspection station, and the cigarette rolls circumferentially during the transfer to the second drum, the system's stitching algorithm will forcibly match incorrect features or make estimations based on incorrect motion models because it cannot find reliable feature points for matching. This results in breaks, ghosting, or distortion at the seams of the stitched 360° image, which will then be misjudged with high confidence by the subsequent defect detection model as serious packaging damage, curling, or misalignment defects, or will cause missed detections due to the concealment of real defects.
[0006] In addition, similar defect detection methods for cigarettes, although they differ from the method of penetrating illumination, use a combination of illumination and defect detection models. They identify the presence of flavor capsule defects by using the contrast between light and dark caused by the deformation of the cigarette surface. However, the defect detection model may give a judgment with low confidence for some suspected defects. For example, if the contrast between light and dark on the cigarette surface is not obvious due to slight damage to the flavor capsule or partial obstruction, the detection system may directly reject the current cigarette, leading to an increased false rejection rate, or it may directly let it pass, resulting in missed detection.
[0007] Therefore, in order to address the above problems, this invention proposes a machine vision-based cigarette surface defect detection system and method. Summary of the Invention
[0008] The purpose of this invention is to provide a machine vision-based cigarette surface defect detection system and method to solve the technical problems mentioned in the background.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting surface defects in cigarettes based on machine vision, comprising the following steps:
[0010] The first surface image of the cigarette is acquired at the first inspection station and defect analysis is performed to generate a first inspection result that includes defect judgment and internal defect confidence level.
[0011] If, based on the first test result, it is determined that the cigarette does not have the defect of being immediately rejected, then the first test result will be further analyzed.
[0012] Based on the confidence level in the first detection result, if there is a suspected internal defect with a confidence level lower than the first preset threshold, a defect doubt signal is generated.
[0013] When the cigarette is transferred from the first inspection station to the second inspection station, the posture change of the cigarette is monitored, and a disturbance signal characterizing the axial slip and circumferential roll angle of the cigarette is generated.
[0014] Based on the determination results of whether the disturbance signal exceeds the preset impact threshold and whether the defect doubt signal exists, an adjustment instruction is generated to adjust the detection strategy of the second detection station.
[0015] Based on the adjustment instructions, the second surface image of the cigarette is acquired at the second inspection station, and defect analysis is performed to generate the second inspection result;
[0016] The defect determination result is obtained by combining the first and second test results.
[0017] Preferably, the adjustment instruction includes:
[0018] If the defect suspicion signal exists and the disturbance signal is less than the first threshold, a first control command is generated to re-inspect the defect suspicion area.
[0019] If there is no defect suspicion signal, and the disturbance signal is greater than the first threshold but less than the second threshold, then a second control command is generated to correct the second surface image.
[0020] If the defect suspicion signal exists, and the disturbance signal is greater than the first threshold but less than the second threshold, then a third control command is generated to sequentially re-inspect the defect suspicion area and correct the second surface image.
[0021] If the disturbance signal exceeds the second threshold, a fourth control command is generated to re-detect or safely remove the current cigarette.
[0022] Preferably, when the adjustment instruction is a second control instruction or a third control instruction, the detection strategy of the second detection station includes:
[0023] The disturbance signal is used as a priori parameter to perform motion estimation and geometric correction on the second surface image to compensate for image stitching misalignment or image blurring caused by the disturbance signal.
[0024] Preferably, when the adjustment instruction is a first control instruction or a third control instruction, the detection strategy of the second detection station includes:
[0025] Based on the location information in the defect suspicion signal, the light source is controlled to perform local illumination enhancement on the corresponding area and / or to perform defect enhancement analysis on the defect suspicion area.
[0026] Preferably, the first surface image and the second surface image are used to detect defects using a defect detection model, and when the adjustment instruction is not executed, the first surface image and the second surface image are analyzed in the same way.
[0027] Preferably, the fusion step of the first detection result and the second detection result includes:
[0028] The initial confidence level in the defect doubt signal and the magnitude of the disturbance signal are used as fusion parameters to determine the credibility of the second detection result;
[0029] Based on the fusion parameters, a comprehensive decision is made on the first detection result and the second detection result to generate the final defect determination result.
[0030] Preferably, the posture change of the cigarette is monitored by a displacement detection system. The displacement detection system is based on an optical sensor using laser tracking technology, which calculates the axial slip and the circumferential roll angle by monitoring the differences between consecutive frames of images of feature points on the surface of the cigarette.
[0031] Preferably, the first threshold and the second threshold are adjusted according to the specifications of the cigarette and the rotation speed of the current first detection station and the second detection station.
[0032] Preferably, the adjustment of the first threshold and the second threshold includes:
[0033] A pre-stored basic threshold mapping table corresponding to different cigarette specifications is provided, wherein the cigarette specifications include at least the cigarette circumference, length and single cigarette weight.
[0034] Based on the cigarette specifications, the mapping table is queried to obtain the corresponding basic first threshold and basic second threshold.
[0035] Based on the ratio of the current operating speed of the production line to the reference speed, the basic first threshold and the basic second threshold are dynamically compensated to obtain the first threshold and the second threshold.
[0036] A machine vision-based cigarette surface defect detection system includes:
[0037] The first drum and the second drum are respectively provided with a plurality of circumferentially distributed first and second detection stations. Each station has a plurality of vacuum adsorption holes spaced apart along the axis of the cigarette.
[0038] The actuator has two parts, located downstream of the first drum and the second drum respectively, and is used to receive rejection instructions and perform cigarette rejection actions;
[0039] The displacement monitoring module is integrated between two adjacent vacuum adsorption holes and uses an optical displacement sensor to detect the axial sliding amount and circumferential roll angle of the cigarette.
[0040] The first image acquisition module and the second image acquisition module are respectively disposed on one side of the first drum and the second drum;
[0041] The first lighting unit and the second lighting unit are respectively disposed inside the first drum wheel and the second drum wheel, and are matched with the corresponding image acquisition module;
[0042] The processing unit is equipped with a defect detection model and a defect enhancement analysis model;
[0043] The control module is electrically connected to the first detection unit and the displacement monitoring module to determine the defect suspicion signal and the disturbance signal and generate the detection adjustment command for the second detection station.
[0044] The data fusion module is used to fuse the first and second detection results.
[0045] The beneficial effects of this invention are:
[0046] This invention monitors the attitude disturbances of the cigarettes being tested during handover in real time, and dynamically adjusts the detection and lighting strategies of the second detection station in conjunction with the suspected internal defect information from the first detection station. Specifically, during cigarette handover, an optical displacement sensor measures the axial slip and circumferential roll angle of the cigarettes to generate a disturbance signal. Simultaneously, the first detection station analyzes and generates a defect suspicion signal containing low-confidence suspected defect location information. Based on the combination of the two signals, the system generates different types of control commands to dynamically adjust the detection strategy of the second detection station. Finally, the system performs a weighted adaptive fusion decision on the two detection results based on the disturbance magnitude, command type, and execution effect to ensure that the final judgment output has high reliability. Attached Figure Description
[0047] Figure 1 is a schematic flowchart of the internal defect determination process in the cigarette surface defect detection method of the present invention.
[0048] Figure 2 is a schematic diagram of the process for generating different adjustment instructions in the cigarette surface defect detection method of the present invention.
[0049] Figure 3 is a schematic diagram of the cooperation between the first drum wheel and the second drum wheel in this invention.
[0050] Figure 4 is a schematic diagram of the vacuum adsorption hole and optical displacement sensor located at the detection station in this invention.
[0051] The attached figures are labeled as follows:
[0052] 1. First drum; 11. First inspection station; 2. Second drum; 21. Second inspection station; 3. Vacuum adsorption hole; 4. Optical displacement sensor; 5. First image acquisition module; 6. Second image acquisition module; 7. Second lighting unit; 71. LED beads. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and 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.
[0054] Example 1
[0055] In the process of detecting surface defects in cigarettes, some existing technologies use a dual-drum combination to obtain a 360° surface image of the cigarette. However, in a rapid testing production line, when the cigarette to be tested is transferred from the first drum to the second drum, it is in a brief state of mechanical instability while it is detaching from the first drum and not yet fully adsorbed and fixed by the second drum. Under the interference of the linear velocity of the two drums, the difference in cigarette type, or airflow disturbances, it is very easy for unexpected axial slippage and circumferential rolling to occur.
[0056] If the seam of the cigarette packaging is located at the edge of the first drum inspection station, and the cigarette rolls circumferentially during the transfer to the second drum, the system's splicing algorithm will forcibly match incorrect features or make estimations based on incorrect motion models because it cannot find reliable feature points for matching. This will result in breaks, ghosting, or distortion at the seam of the spliced 360° image, which will then be misjudged with high confidence by the subsequent defect detection model as serious packaging damage, curling, or misalignment defects, or will cause missed detection because it covers up the real defects.
[0057] To address the aforementioned problems, this embodiment provides a machine vision-based method for detecting surface defects in cigarettes, as shown in Figures 1 to 4, including the following steps:
[0058] S100. After acquiring the first surface image of the cigarette to be tested and performing defect analysis, the cigarette is removed or further analysis is performed based on the analysis results.
[0059] Specifically, in one of the first inspection stations of the first drum, an industrial camera is used to acquire a first surface image of the cigarette and perform defect analysis. The image includes surface features of approximately 180° around the circumference of the cigarette to be tested. After acquiring the first surface image, it is input into the defect detection model to generate a first detection result that includes defect determination and internal defect confidence.
[0060] The system first determines whether the current cigarette has serious defects that need to be removed immediately based on the first detection result, such as surface damage, dirt, glue residue, and curling edges. If so, a removal instruction is generated; otherwise, the collaborative detection process, such as detecting menthol capsule defects, continues.
[0061] In this embodiment, the defect detection model is a deep learning object detection model based on the YOLOv11 architecture. Its main improvements are: introducing a coordinate attention mechanism into the feature pyramid network structure, which enables the model to more accurately focus on minute defect features (such as minor scratches and the edges of burst beads) in complex product packaging backgrounds. At the same time, the WIoU loss function is used to replace the traditional IoU loss to improve the regression accuracy and stability of the model for defect bounding boxes in complex backgrounds.
[0062] Furthermore, to achieve high performance in scenarios with small sample sizes, the training process employs a strategy that combines deep data augmentation and transfer learning, as detailed below:
[0063] a) Training data augmentation based on the fusion of DCGAN and Poisson:
[0064] First, a small-scale, precisely labeled set of cigarette defect samples is collected. For rare or morphologically varied defect types (such as missing menthol capsules or specific types of wrinkles), a deep convolutional generative adversarial network is used for data augmentation. After training, the generator of this adversarial network can learn the feature distribution of real defect samples and generate diverse new defect images that are highly similar to real defects in texture and shape.
[0065] Subsequently, using Poisson fusion technology, the defect images generated by the adversarial network were seamlessly fused into a large number of normal cigarette background images collected from the production line. Poisson fusion ensured a natural transition of the fusion boundary by maintaining the consistency of the gradient field of the generated defect region, effectively avoiding unnatural edges caused by simple pasting. This generated a large number of realistic synthetic defect samples that can be used for training. This process greatly enriched the diversity and scale of the training data, and fundamentally alleviated the model overfitting problem caused by the scarcity of defect samples.
[0066] b) Model training and optimization:
[0067] The improved YOLOv11 model was trained using the augmented sample dataset described above. Training employed a transfer learning strategy, where the model's backbone network was loaded with weights pre-trained on a large public dataset (such as COCO) to accelerate convergence and improve feature extraction capabilities. The Adam optimizer was used during training, with an initial learning rate set to [value missing]. The cosine annealing strategy was used for adjustment, and a total of 300 epochs were trained.
[0068] In other embodiments, other defect detection models may be used to detect the surface of the cigarette, and no limitation is imposed here.
[0069] S200. Based on the confidence level in the first detection result, the defect of the burst bead is detected. If the confidence level of the defect is higher than the minimum threshold and lower than the first preset threshold, it is determined to be a suspected internal defect and a defect doubt signal is generated.
[0070] Specifically, during the detection of menthol capsule defects at the first detection station, if the contrast between light and dark on the surface of the cigarette is not obvious, that is, if the confidence level is lower than the first preset threshold but higher than the minimum threshold, the suspected menthol capsule defect is marked as a suspected internal defect, and a defect doubt signal containing its location information is generated. In this embodiment, the minimum confidence level threshold is 0.3 and the first preset threshold is 0.7.
[0071] S300. When the cigarette is transferred from the first inspection station to the second inspection station, monitor the change in the cigarette's posture, generate a disturbance signal that characterizes the axial slip and circumferential roll angle of the cigarette, and generate an adjustment command for adjusting the inspection strategy of the second inspection station based on whether the disturbance signal exceeds a preset threshold and whether there is a defect doubt signal.
[0072] Specifically, after the cigarette completes defect detection at the first inspection station, it rotates towards the second drum under the drive of the first drum. When it rotates to the junction of the first and second drums, the cigarette is released from adsorption at the first inspection station and is adsorbed at the corresponding second inspection station, thus completing the transfer. It should be noted that the adsorption and fixation of the cigarette uses a vacuum adsorption device and adsorption holes set at the first and second inspection stations. This is existing technology and will not be described in detail.
[0073] It is important to note that at the instant the cigarette is transferred from the first drum to the second drum, the optical displacement sensor integrated into the first and second detection stations begins to operate. Similar to the optical sensor on the bottom of a mouse, this sensor is based on high-speed image acquisition and analysis. It illuminates the surface of the cigarette using an infrared LED or laser source and captures images of the cigarette's surface at an extremely high frequency. By tracking the positional changes of specific feature points on the cigarette's surface (such as paper fiber texture, printing marks, or laser spots) across several consecutive frames, the sensor can calculate and output the axial slip of the cigarette in real time with micrometer-level and milliradian-level precision. and circumferential roll angle The aforementioned axial slip is the displacement of the cigarette along its own axis, and the circumferential roll angle is the rotation angle of the cigarette about its own axis. Together, they constitute the disturbance signal.
[0074] Then, the system will use this real-time monitored disturbance signal and the potential defect signals generated in the previous steps to make a comprehensive logical judgment. The core of this judgment is to determine whether the potential defect signal exists and the strength of the disturbance signal, so as to jointly decide the detection strategy of the subsequent second detection station. Specifically:
[0075] (1) If a defect suspicion signal exists, that is, whether the first station has found a low-confidence suspected defect, and the intensity value of the disturbance signal is less than the first threshold, it indicates that the cigarette is stable in the transmission process and will not affect the subsequent acquisition of the second surface image. Then, a first control command is generated. This command makes full use of the detection resources of the second detection station to perform fixed-point re-inspection on the suspicious points found by the first detection station. Based on the location coordinates of the suspicious points in the defect suspicion area, the second detection station is required to perform local lighting enhancement or high-definition imaging on the area. The specific local lighting enhancement methods include: mapping the location coordinates of the suspected area contained in the defect suspicion signal to the expected imaging area of the cigarette on the second detection station. The control module adjusts the lighting brightness of the light source (e.g., LED beads) corresponding to the expected area. For example, if the suspected defect area is located in the middle section of the filter, the row of LED beads corresponding to its height is controlled to increase the brightness. If it is necessary to highlight the shape features at a specific angle, different columns of lateral lighting beads can be activated to produce a more obvious contrast between light and dark.
[0076] (2) If there is no defect doubt signal and the intensity value of the disturbance signal is between the first threshold and the second threshold (the second threshold is greater than the first threshold), it indicates that the cigarette has a certain degree of posture change when the two drums are connected or when it is rotating with the drums, which may affect the splicing or clarity of subsequent images. Then, a second control command is generated to perform motion estimation and geometric correction on the second surface image based on the axial slip and circumferential roll angle in the disturbance signal.
[0077] In this embodiment, motion estimation is performed through a two-dimensional affine transformation model, specifically, the circumferential roll angle. This directly corresponds to the rotation component of the image about its center. During correction, the image needs to be adjusted by a factor of [size missing]. Similarly, the axial slip is compensated for by the reverse rotation of the angle. This mainly corresponds to the translation component of the image along its axis. During correction, the image needs to be translated horizontally. To counteract the slippage effect, the physical motion of the cigarette is quantized into a specific image transformation matrix using the above method.
[0078] After obtaining the two-dimensional affine transformation model, geometric correction is performed. The specific steps include: first, creating a blank target image in memory with the same size as the original image; then, for each pixel in the target image, using the inverse of the transformation matrix obtained in the previous step, calculating the coordinates of the corresponding source pixel in the original image. Using inverse mapping can avoid holes in the corrected image; since the calculated source pixel coordinates are usually non-integer with sub-pixel precision, an interpolation algorithm (such as nearest neighbor interpolation, bilinear interpolation, or higher-order bicubic interpolation) is needed to estimate the pixel value at that position based on the values of the surrounding pixels in the source image; finally, the calculated pixel value is assigned to the target image, thus obtaining a clear image with corrected geometric shape.
[0079] (3) If a defect suspicion signal exists and the intensity value of the disturbance signal is between the first threshold and the second threshold, it indicates that the cigarette not only has a low-confidence suspected internal defect at the first detection station, but also has a certain degree of posture change during the handover process. Then, a third control command is generated, requiring the second detection station to perform local illumination enhancement or high-definition imaging on the defect suspicion area and to perform motion estimation and geometric correction on the second surface image based on the axial slip and circumferential roll angle in the disturbance signal when acquiring the second surface image.
[0080] (4) If the disturbance signal exceeds the second threshold, regardless of whether there is a defect doubt signal, a fourth control command will be generated. The posture of the cigarette at the second detection station is significantly different from that at the first detection station. The detection result at this point is insufficient to collect a qualified and reliable second surface image, and the defect detection cannot be completed. This command will directly bypass the regular detection process of the second station and trigger the re-inspection or safe rejection of the cigarette. In this embodiment, the re-inspection method is to place such cigarettes in a box to be inspected and conduct the inspection by manual re-inspection or re-sending them to the production line to be tested.
[0081] In this embodiment, the first threshold is set as the axial slip amount. Circumferential roll angle The second threshold is set to , .
[0082] It is important to note that the aforementioned preset first and second thresholds are not fixed, but rather dynamically change through a pre-stored basic threshold mapping table within the control module, which is used for different cigarette specifications (such as diameter, length, and weight per cigarette). This basic threshold mapping table is a database or data matrix pre-stored within the control system. Its core logic is to establish a correspondence between the physical specifications of the cigarette and the attitude change thresholds that the system can tolerate. The basic idea is that different specifications of cigarettes have different masses, moments of inertia, contact areas with the drum, and friction. Therefore, at the same production line speed, the ease and critical point of instability (slipping, rolling) are also different, thus obtaining the first and second thresholds that are adapted to the current production rhythm and product model.
[0083] The construction of the aforementioned basic threshold mapping table can be obtained through multiple experiments, and will not be elaborated here.
[0084] S400. Based on the above adjustment instructions, the second surface image of the cigarette is acquired at the second inspection station, and defect analysis is performed to generate a second inspection result. The first and second inspection results are then fused to obtain a defect determination result.
[0085] Specifically, under different circumstances, after adjusting the detection strategy of the second detection station according to the above control instructions, an industrial camera is used to acquire a second surface image of the cigarette to be tested. This image includes surface features on the other side of about 180° that were not captured in the first surface image. The image is then input into the defect detection model for defect analysis, which mainly involves detecting surface appearance defects and internal burst bead defects.
[0086] Regardless of the instruction executed or the preprocessing performed, the final optimized second surface image is sent to the processing unit. This processing unit uses the same defect detection model as the first inspection station or a higher-precision defect enhancement analysis model to perform defect analysis on the second surface image. This defect analysis is targeted: if the adjustment instruction requires a re-inspection of the suspected defect area, the focus is on that suspected area; if it is for image correction and compensation, a panoramic scan is performed. After analysis, the second inspection result is generated as a structured output with the same data structure as the first inspection result, which also includes the two core contents of defect judgment and confidence level.
[0087] The aforementioned defect enhancement analysis model is a semantic segmentation model based on the U-Net architecture. It works in conjunction with the aforementioned defect detection model. The defect detection model is responsible for detecting appearance defects in the first surface image and for rapid initial screening and coarse localization of defects in the pop-beads. The defect enhancement analysis model, on the other hand, is responsible for fine segmentation of suspected defective regions in the pop-beads to determine the specific shape and severity of the defects. The training data for this defect enhancement analysis model also comes from the defect region image patches with pixel-level precise annotations generated by the aforementioned DCGAN and Poisson fusion technology, thus ensuring that it has a strong analytical capability for small and blurry defects.
[0088] Finally, the first and second test results are fused to determine whether the cigarette has defects and what kind of defects exist. Information fusion and final decision-making are then performed through a data fusion module, specifically as follows:
[0089] The initial information of the first detection result (the coordinates of the suspected defect area and its initial confidence level), the new information of the second detection result (the new judgment and its new confidence level in the same coordinate area), and the disturbance signal are used as input objects.
[0090] The system will assign a basic weight (e.g., 0.4) to the first detection result and a dynamic weight to the second detection result. This dynamic weight is negatively correlated with the magnitude of the disturbance signal. When the disturbance signal is less than the first threshold, it indicates that the acquisition conditions of the second surface image are ideal, and the new confidence of the second result will dominate the final judgment. When the disturbance signal is moderate but the relevant instructions have been executed, the weight of the second detection result needs to be multiplied by a discount factor based on the evaluation of the correction effect.
[0091] The fusion algorithm uses a weighted summation approach:
[0092]
[0093] in, For the final confidence level, and These are the confidence scores for a certain defect in the first and second test results, respectively.
[0094] The basic weight for the first detection result can be tentatively set at 0.4;
[0095] The dynamic weight for the second detection result has a base value of 0.6, but needs to be adjusted according to the type of adjustment instruction and the execution effect. In this embodiment, if the first control instruction is executed, then... It can remain at 0.6. If the third control command is executed and the image sharpness evaluation after correction is very high, then... It can remain at 0.6 or higher; if the second control instruction is being executed, then This can be multiplied by a discount factor (such as 0.8) because the image correction process itself may introduce small errors. Ultimately, .
[0096] Finally, the overall confidence level calculated above is compared with a preset judgment threshold (e.g., 0.7). If the overall confidence level is higher than the threshold, the cigarette is judged to be defective and the rejection mechanism is activated; if it is lower than the threshold, it is judged to be qualified.
[0097] In summary, this invention dynamically adjusts the detection strategy and lighting strategy of the second detection station by real-time monitoring of the attitude disturbance generated during the handover of the cigarettes under test and coordinating with the suspected internal defect information from the first detection station. Specifically, during the handover of cigarettes, the axial slip and circumferential roll angle of the cigarettes are measured by an optical displacement sensor to generate a disturbance signal. Simultaneously, the first detection station analyzes and generates a defect suspicion signal containing low-confidence suspected defect location information. Based on the combination of the above two signals, the system generates different types of control commands to dynamically adjust the detection strategy of the second detection station. Finally, the system performs a weighted adaptive fusion decision on the two detection results based on the disturbance magnitude, command type, and execution effect to ensure that the final judgment output has high reliability.
[0098] Example 2
[0099] This embodiment provides a machine vision-based cigarette surface defect detection system for performing the above-described detection method. Please refer to Figures 3 and 4 for details. Specifically, it includes:
[0100] Two synchronously rotating first drum 1 and second drum 2 are respectively provided with multiple circumferentially distributed first detection stations 11 and second detection stations 21. Each detection station has multiple vacuum adsorption holes 3 spaced apart along the axis of the cigarette on its inner wall. Vacuum adsorption holes 3 are connected to a vacuum pump. The first drum 1 and second drum 2 are symmetrically arranged and rotate in opposite directions. The cigarette to be tested is connected at the junction of the two drums to achieve comprehensive detection of the circumference of the cigarette.
[0101] In this embodiment, three vacuum adsorption holes 3 are provided, one of which is located in the filter part of the cigarette, and the other two are located in the combustion part of the cigarette.
[0102] The actuator has two parts, located downstream of the first drum 1 and the second drum 2 respectively. When it receives a rejection command, it removes the cigarette from the detection station. In this embodiment, the specific structure includes an air jet device located above the two drums. The air jet device includes an air pipe facing the circumference of the drum. When the drum rotates, the detection station passes under the air pipe. When performing the rejection action, the air jet device quickly sprays air and removes the cigarette in the corresponding detection station by airflow impact through the air pipe.
[0103] The displacement monitoring module is integrated between two adjacent vacuum adsorption holes 3. It continuously tracks the position changes of natural feature points (such as seams or fine textures of the packaging paper) on the surface of the cigarette in continuous frame images through an optical displacement sensor 4, so as to calculate and output the axial slip and circumferential roll angle of the cigarette in real time.
[0104] The first image acquisition module 5 and the second image acquisition module 6 are respectively disposed on one side of the first drum 1 and the second drum 2. In this embodiment, both image acquisition modules include a high-resolution area array CCD or CMOS industrial camera, equipped with a telecentric lens to eliminate perspective distortion. The camera is synchronized with the drum spindle through a photoelectric encoder to ensure that the shutter is triggered when the cigarette moves to the optimal imaging position.
[0105] The first lighting unit and the second lighting unit 7 are respectively disposed inside the first drum 1 and the second drum 2, and are matched with the corresponding image acquisition module. In this embodiment, the second lighting unit 7 is composed of multiple LED beads 71 that are equidistantly distributed and closely arranged. The LED beads 71 at different heights correspond to the annular height of the cigarette filter. When performing the above-mentioned local lighting enhancement action, the brightness of one or more rows of LED beads 71 at the height corresponding to the coordinates of the suspected defect area can be precisely controlled, thereby forming an annular enhanced lighting area on the cigarette surface and significantly enhancing the contrast between light and dark in the suspected burst bead defect area.
[0106] Meanwhile, the LED light group can be set in multiple rows, such as three rows, with one row located between two adjacent vacuum adsorption holes 3, and the other two rows symmetrically arranged on both sides of the cigarette to achieve sufficient illumination.
[0107] The processing unit is equipped with a defect detection model trained on a large amount of cigarette image data and a defect enhancement analysis model for fine analysis.
[0108] The control module is electrically connected to the first detection unit and the displacement monitoring module, and is used to receive the defect suspicion signal generated by the processing unit and the disturbance signal generated by the displacement monitoring module; and has built-in the same decision logic as described in claim S300: that is, based on whether the defect suspicion signal exists and whether the disturbance signal exceeds a preset threshold, it generates a corresponding first control command, second control command, third control command or fourth control command.
[0109] The aforementioned control module is further electrically connected to the second lighting unit 7, the second image acquisition module 6, and the image correction submodule within the processing unit, for distributing the generated adjustment instructions to the corresponding execution units: when the instruction is the first or third control instruction, the second lighting unit 7 is driven to adjust the lighting intensity of the specified coordinate area; when the instruction is the second or third control instruction, the image correction submodule is triggered to correct the image using a disturbance signal.
[0110] The data fusion module is used to perform a confidence-based weighted fusion of the first and second detection results. The weight of the second detection result will dynamically refer to the type of adjustment instruction to obtain a more reliable final defect judgment result.
[0111] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for detecting surface defects in cigarettes based on machine vision, characterized in that, Includes the following steps: A first surface image of the cigarette is acquired at the first inspection station and defect analysis is performed to generate a first inspection result that includes defect determination and internal defect confidence level. If the first inspection result determines that the cigarette does not have any defects that can be immediately rejected, the first inspection result is further analyzed. Based on the confidence level in the first inspection result, if there is a suspected internal defect with a confidence level lower than a first preset threshold, a defect suspicion signal is generated. When the cigarette is transferred from the first inspection station to the second inspection station, the posture change of the cigarette is monitored to generate a disturbance signal characterizing the axial slip and circumferential roll angle of the cigarette. Based on whether the disturbance signal exceeds a preset influence threshold and whether the defect suspicion signal exists, an adjustment instruction for adjusting the inspection strategy of the second inspection station is generated. According to the adjustment instruction, a second surface image of the cigarette is acquired at the second inspection station and defect analysis is performed to generate a second inspection result. The first and second inspection results are fused to obtain a defect determination result.
2. The method for detecting surface defects of cigarettes based on machine vision according to claim 1, characterized in that, The adjustment instructions include: if a defect suspicion signal exists and the disturbance signal is less than a first threshold, a first control instruction is generated to re-inspect the defect suspicion area; if no defect suspicion signal exists and the disturbance signal is greater than the first threshold but less than a second threshold, a second control instruction is generated to correct the second surface image; if a defect suspicion signal exists and the disturbance signal is greater than the first threshold but less than the second threshold, a third control instruction is generated to sequentially re-inspect the defect suspicion area and correct the second surface image; if the disturbance signal exceeds the second threshold, a fourth control instruction is generated to re-inspect or safely remove the current cigarette.
3. The method for detecting surface defects of cigarettes based on machine vision according to claim 2, characterized in that, When the adjustment command is a second control command or a third control command, the detection strategy of the second detection station includes: using the disturbance signal as a priori parameter to perform motion estimation and geometric correction on the second surface image to compensate for image splicing misalignment or image blurring caused by the disturbance signal.
4. The method for detecting surface defects of cigarettes based on machine vision according to claim 2, characterized in that, When the adjustment instruction is a first control instruction or a third control instruction, the detection strategy of the second detection station includes: according to the position information in the defect suspicion signal, controlling the light source to perform local illumination enhancement on the corresponding area and / or performing defect enhancement analysis on the defect suspicion area.
5. The method for detecting surface defects of cigarettes based on machine vision according to claim 1, characterized in that, The first surface image and the second surface image are used to detect defects using a defect detection model, and the defect analysis methods of the first surface image and the second surface image are the same when the adjustment instruction is not executed.
6. The method for detecting surface defects of cigarettes based on machine vision according to claim 1, characterized in that, The fusion step of the first detection result and the second detection result includes: using the initial confidence level in the defect doubt signal and the magnitude of the disturbance signal as fusion parameters to determine the credibility of the second detection result; and making a comprehensive decision on the first detection result and the second detection result based on the fusion parameters to generate a final defect judgment result.
7. The method for detecting surface defects of cigarettes based on machine vision according to claim 1, characterized in that, The posture change of the cigarette is monitored by a displacement detection system. The displacement detection system is based on an optical sensor using laser tracking technology. It calculates the axial slip and the circumferential roll angle by monitoring the differences between consecutive frames of images of feature points on the surface of the cigarette.
8. The method for detecting surface defects of cigarettes based on machine vision according to claim 2, characterized in that, The first threshold and the second threshold are adjusted according to the specifications of the cigarette and the rotation speed of the current first and second detection stations.
9. The method for detecting surface defects of cigarettes based on machine vision according to claim 8, characterized in that, The adjustment of the first threshold and the second threshold includes: pre-storing a basic threshold mapping table corresponding to different cigarette specifications, wherein the cigarette specifications include at least the cigarette circumference, length and single cigarette weight; querying the mapping table according to the cigarette specifications to obtain the corresponding basic first threshold and basic second threshold; and dynamically compensating the basic first threshold and basic second threshold based on the ratio of the current operating speed of the production line to the reference speed to obtain the first threshold and the second threshold.
10. A machine vision-based cigarette surface defect detection system, used to perform the detection method according to any one of claims 1-9, characterized in that, include: The first drum and the second drum each have multiple circumferentially distributed first and second detection stations. Each station has multiple vacuum adsorption holes spaced apart along the cigarette axis on its inner wall. Two actuators are provided, located downstream of the first and second drums respectively, for receiving rejection commands and executing cigarette rejection actions. A displacement monitoring module is integrated between two adjacent vacuum adsorption holes, using an optical displacement sensor to detect the axial sliding amount and circumferential rolling angle of the cigarette. A first image acquisition module and a second image acquisition module are respectively located on one side of the first and second drums. A first lighting unit and a second lighting unit are respectively located inside the first and second drums and matched with their respective image acquisition modules. A processing unit is configured with a defect detection model and a defect enhancement analysis model. A control module is electrically connected to the first detection unit and the displacement monitoring module to determine defect suspicion signals and disturbance signals and generate detection adjustment commands for the second detection station. The data fusion module is used to fuse the first and second detection results.
Citation Information
Patent Citations
Methods, apparatus, equipment and storage media for detecting defects in cigarette filter rods
CN115984593B