Deep learning-based canning defect detection method, system and device

By combining multi-directional light source illumination and tank rotation with deep learning algorithms, two-stage defect screening of the tank is achieved, solving the problems of accuracy and efficiency in pre-coating defect detection and reducing production costs.

CN120471892BActive Publication Date: 2026-02-10ZHENGZHOU JINTAI CANNER
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510617390.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2026-02-10
Estimated Expiration
2045-05-14

AI Technical Summary

Technical Problem

Existing technologies cannot effectively screen out tanks with appearance defects in the tank substrate defect detection stage before spraying, causing them to enter the subsequent spraying process and resulting in cost losses.

Method used

Preliminary defect analysis was conducted by using multi-directional light source illumination combined with tank rotation to capture reflected light images. After spraying, texture images were captured and then converted and stitched together. Deep learning algorithms were used for region segmentation and differential comparison to achieve two-stage defect screening.

Benefits of technology

Defective tanks can be efficiently and accurately screened before spraying to avoid ineffective spraying, reduce production costs, and ensure the accuracy and efficiency of analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471892B_ABST
    Figure CN120471892B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of production detection, and discloses a canning defect detection method, system and equipment based on deep learning. The method comprises the following steps: irradiating a to-be-detected can body with a light source and performing multiple self-rotations, and then shooting a reflection light image of the surface of the to-be-detected can body after the self-rotations; performing first defect analysis on the to-be-detected can body based on the reflection light image, so that the to-be-detected can body is classified into a first qualified can body or a defective can body; after the first qualified can body is completed with color spraying, a texture image of the surface of the first qualified can body is shot again; the texture image is subjected to plane conversion to obtain a plane image, the plane image is spliced to obtain a complete image; the complete image is subjected to region segmentation based on a deep learning algorithm to obtain multiple sub-images, and second defect analysis is performed on the first qualified can body based on the sub-images, so that the first qualified can body is classified into a second qualified can body or a defective can body. According to the application, a can body with an appearance defect can be removed in advance before a spraying process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of production inspection technology, and in particular to a method, system and equipment for detecting defects in can manufacturing based on deep learning. Background Technology

[0002] In the metal packaging manufacturing industry, defect detection of cans (such as food cans and beverage cans) is a core step in ensuring product quality and safety. Common defects include surface scratches, dents, deformation, uneven coating, and printing misalignment. These defects may be caused by raw material flaws, fluctuations in the stamping process, or wear and tear on production line equipment.

[0003] To automate the inspection of metal cans, existing technologies have proposed methods such as the following: Chinese patent document CN115330702A discloses a depth vision-based method for identifying defects in beverage bottle filling. This method, after acquiring an image of the can, uses a convolutional neural network to perform comprehensive detection of appearance defects, thereby identifying various appearance defects during the product packaging process. Another example is Chinese patent document CN119228800A, which discloses a method for detecting shape defects in packaging cans. This method analyzes the grayscale distribution characteristics of the target area, gradient effects, and the similarity between target areas in adjacent frames to calculate the comprehensive reflective features of the target area, thereby reducing false positives caused by reflection. Then, based on the evaluation results, the gamma coefficient is determined, and gamma transformation can adjust the image contrast to make defect features more obvious, thus improving the accuracy of defect detection.

[0004] None of the above solutions involve the defect detection of the tank substrate before spraying, and it is impossible to remove tanks with appearance defects in advance before the spraying process. As a result, defective tanks will still enter the subsequent spraying process, causing cost losses. Summary of the Invention

[0005] To address the problems mentioned in the background section, this application provides a method, system, and equipment for detecting defects in can manufacturing based on deep learning.

[0006] To achieve the aforementioned objectives, this invention proposes a deep learning-based method for detecting defects in can manufacturing, comprising:

[0007] The test tank is illuminated by a light source from multiple directions. During the illumination process, the test tank rotates multiple times. After each rotation, an image of the reflected light on the surface of the test tank is captured.

[0008] Based on the reflected light image, a first defect analysis is performed on the tank to be inspected to classify the tank to be inspected into a first qualified tank or a defective tank.

[0009] After the first qualified tank is coated with color, a texture image of the surface of the first qualified tank is taken again.

[0010] The texture image is transformed into a planar image, and the planar images are then stitched together to obtain a complete image.

[0011] The complete image is segmented using a deep learning algorithm to obtain multiple sub-images. Based on the sub-images, a second defect analysis is performed on the first qualified tank to classify the first qualified tank as a second qualified tank or the defective tank.

[0012] Furthermore, the first defect analysis of the tank to be tested includes the following steps:

[0013] Each surface of the tank to be tested is divided into grids to obtain multiple sub-grids. The average brightness value of each sub-grid is obtained by combining the reflected light images from multiple directions. The sub-grids located in the same horizontal direction are taken as a horizontal sequence, and the sub-grids located in the same vertical direction are taken as a vertical sequence. A first numerical sequence corresponding to the horizontal sequence and a second numerical sequence corresponding to the vertical sequence are constructed based on the average brightness value.

[0014] The changes in the first and second numerical sequences are analyzed to determine the defect grids in the sub-grid. The adjacent defect grids are merged to obtain the defect area of ​​the tank to be inspected. If the area of ​​the defect area is greater than a first threshold, the tank to be inspected is classified as the defective tank; otherwise, it is classified as the first qualified tank.

[0015] Further, obtaining the average brightness value for each of the sub-grids includes the following steps:

[0016] The container to be tested is illuminated by light sources in four directions. The container to be tested rotates three times, each time by 25 degrees. After each rotation, the reflected light image of the container to be tested is taken in each direction. The brightness values ​​of the sub-grid in each reflected light image are summed and averaged to obtain the average brightness value of the sub-grid.

[0017] Further, determining the defective mesh within the sub-mesh includes the following steps:

[0018] The first and second numerical sequences are processed using the sliding window method to obtain a first average sequence and a second average sequence. A second threshold is set, and the first and second average sequences are binarized based on the second threshold to obtain a first processed sequence and a second processed sequence. If multiple sequence points with a value of 1 appear consecutively in the first and second processed sequences, the sub-grids in which the average brightness value is abnormal are located as the defect grids.

[0019] Furthermore, the second defect analysis of the first qualified tank includes the following steps:

[0020] Obtain a template image for the sub-image, align the sub-image with the template image, and after alignment, calculate the absolute value of the difference between corresponding pixels in the sub-image and the template image, sum the absolute values ​​to obtain a comprehensive value. If the comprehensive value is greater than a third threshold, it is determined that the sub-image has a defect, and the corresponding first qualified tank is classified as the defective tank.

[0021] Furthermore, aligning the sub-image with the template image includes the following steps:

[0022] Multiple reference regions are set for the template image, and one of the reference regions is selected as the calibration region. The standard region coordinates and standard pixel distribution of the calibration region are recorded. After the sub-image is acquired, the reference region within the standard region coordinates in the sub-image is extracted, and the actual pixel distribution of the reference region is acquired. The similarity between the calibration region and the reference region is calculated based on the standard pixel distribution and the actual pixel distribution. If the similarity is greater than a fourth threshold, the sub-image and the template image are aligned based on the calibration region and the reference region.

[0023] If the similarity is less than or equal to the fourth threshold, then another reference region is selected as the calibration region. If the similarity between the newly selected calibration region and the corresponding control region is less than or equal to the fourth threshold, then the first qualified tank is directly classified as the defective tank.

[0024] Furthermore, after obtaining the similarity between the calibration region and the control region for the first time, if the similarity is less than or equal to the fourth threshold, the calibration region is split into a first grid image, the control region is split into a second grid image, the similarity distribution trend between the calibration region and the control region is determined based on the first grid image and the second grid image, and the extended region is cropped in the template image according to the similarity distribution trend.

[0025] The extended region and the calibration region are merged into an extended image. If a matching region is located in the extended image, and the similarity between the matching region and the reference region is greater than the fourth threshold, the sub-image is aligned with the template image based on the reference region and the matching region. If the matching region is not located, another reference region is selected as the calibration region.

[0026] Furthermore, the deep learning algorithm is the U-Net semantic segmentation model, which performs planar transformation on the texture image based on affine transformation.

[0027] A deep learning-based can-making defect detection system is provided to implement the aforementioned deep learning-based can-making defect detection method. The system includes:

[0028] The acquisition module illuminates the can under test with light sources from multiple directions. During the illumination process, the can under test rotates multiple times. After each rotation, an image of the reflected light on the surface of the can under test is captured. After the first qualified can is coated with color, an image of the texture on the surface of the first qualified can is captured again.

[0029] The first analysis module performs a first defect analysis on the tank to be inspected based on the reflected light image, so as to classify the tank to be inspected into a first qualified tank or a defective tank.

[0030] The conversion module performs planar conversion on the texture image to obtain a planar image, and then stitches the planar images together to obtain a complete image;

[0031] The second analysis module performs region segmentation on the complete image based on a deep learning algorithm to obtain multiple sub-images. Based on the sub-images, it performs a second defect analysis on the first qualified tank to classify the first qualified tank as a second qualified tank or the defective tank.

[0032] A deep learning-based can manufacturing defect detection device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method described above.

[0033] This embodiment first uses a deep learning algorithm to perform region segmentation on the complete image, dividing it into multiple sub-regions. A corresponding sub-image is generated based on the image content contained in each sub-region. Then, the sub-images are compared with a pre-set template image using a difference method to determine if any defects exist in the sub-regions. By analyzing the complete image in two stages, the deep learning algorithm only performs contour segmentation, and then the difference method is used to quickly compare each region, greatly improving analysis efficiency while ensuring accuracy. Attached Figure Description

[0034] Figure 1 This is a flowchart illustrating the steps of the deep learning-based can-making defect detection method proposed in this application.

[0035] Figure 2 This is a schematic diagram of the tank's rotation process in this application;

[0036] Figure 3 This is a comparative diagram of the extended region and the calibration region of this application;

[0037] Figure 4 This is a schematic diagram of the structure of the deep learning-based can-making defect detection system of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0039] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are used only to distinguish one element from another. For example, without departing from the scope of this application, a first script may be referred to as a second script, and similarly, a second script may be referred to as a first script.

[0040] like Figure 1 As shown, a deep learning-based method for detecting defects in can manufacturing includes:

[0041] S1: Illuminate the tank under test with light sources from multiple directions. During the illumination process, the tank under test rotates multiple times. After each rotation, take an image of the reflected light on the surface of the tank under test.

[0042] This embodiment detects the side of the can by illuminating it with light sources in four directions: front, back, left, and right. After the can enters the detection area, it rotates three times, each time by 25 degrees. A camera is positioned on one side of each light source. After the can enters the detection area, the camera illuminates it once; afterwards, it captures an image of the reflected light after each rotation. In other embodiments, a single light source may be used, with two or more rotations.

[0043] S2: Based on the reflected light image, perform the first defect analysis on the tank to be inspected to classify the tank to be inspected into a first qualified tank or a defective tank.

[0044] When the surface of the can to be inspected has scratches, dents, or other defects, the brightness value of the pixels will change. Therefore, the defect analysis of the can to be inspected can be performed by observing the change in the brightness value of the pixels in the reflected light image. When a defect is detected on the surface of the can, the can is judged as a defective can and will not be painted further. Cans without defects are set as the first qualified cans and will continue to be painted.

[0045] S3: After the first qualified tank has been painted, take another image of the texture on the surface of the first qualified tank.

[0046] S4: Perform planar transformation on the texture image to obtain a planar image, and stitch the planar images together to obtain a complete image.

[0047] After the pattern is applied to the first qualified can, it re-enters the inspection area. Specifically, in this embodiment, cameras are installed in four directions, thus eliminating the need for rotation. If only one camera is used, at least one rotation is required to obtain images of the front and rear sides. Since the can is non-planar, its image needs to be converted to a planar shape after acquisition. Finally, with only one camera, the texture images are stitched together according to the can's rotation direction; with four cameras, the four images are stitched together based on the camera's shooting position.

[0048] S5: Perform region segmentation on the complete image based on deep learning algorithm to obtain multiple sub-images. Perform second defect analysis on the first qualified tank based on the sub-images to classify the first qualified tank as a second qualified tank or a defective tank.

[0049] This embodiment first uses a deep learning algorithm to perform region segmentation on the complete image, dividing it into multiple sub-regions. A corresponding sub-image is generated based on the image content contained in each sub-region. Then, the sub-images are compared with a pre-set template image using a difference method to determine if any defects exist in the sub-regions. By analyzing the complete image in two stages, the deep learning algorithm only performs contour segmentation, and then the difference method is used to quickly compare each region, greatly improving analysis efficiency while ensuring accuracy.

[0050] This invention utilizes multi-directional light source illumination combined with the capture of reflected light images from the rotating can body for preliminary defect analysis, thereby efficiently and accurately identifying defective cans, avoiding ineffective coating, and saving costs. After coating qualified cans, texture images are captured, and complete images are obtained through planar transformation and stitching, ensuring the accuracy of subsequent analysis. Finally, a deep learning algorithm is used to region the complete image, obtaining multiple sub-images, and then each sub-image is analyzed in detail. This method balances accuracy and efficiency, comprehensively improving the effectiveness and quality of can manufacturing defect detection.

[0051] Of particular note is that this invention allows for the early removal of cans with appearance defects before the painting process, thereby reducing cost losses during production.

[0052] In this embodiment, the first defect analysis of the tank to be tested includes the following steps:

[0053] Each surface of the tank to be inspected is divided into grids to obtain multiple sub-grids. The average brightness value of each sub-grid is obtained by combining the reflected light images from multiple directions. Sub-grids located in the same horizontal direction are taken as the horizontal sequence, and sub-grids located in the same vertical direction are taken as the vertical sequence. Based on the average brightness value, a first numerical sequence corresponding to the horizontal sequence and a second numerical sequence corresponding to the vertical sequence are constructed.

[0054] Specifically, obtaining the average brightness value for each sub-grid includes the following steps:

[0055] The tank under test is illuminated by light sources in four directions. The tank under test rotates three times, each time by 25 degrees. After each rotation, a reflected light image of the tank under test is taken in each direction. The brightness values ​​of the sub-grid in each reflected light image are summed and averaged to obtain the average brightness value of the sub-grid.

[0056] Reference Figure 2 The tank H to be tested is illuminated by four light sources. First, the surface of the tank is divided into a grid, for example, into 50*50 sub-grids. At the same time, the correspondence between each sub-grid and different reflected light images is established according to the rotation angle. For example, in reflected light image 1 taken by camera R, sub-grid W is in row 10 and column 10. After the tank rotates 25 degrees, in reflected light image 2 taken by camera R, sub-grid W is in row 10 and column 15.

[0057] For the position of subgrid W, since it is directly facing the light source of camera R, there will be a large brightness in the reflected light image 1 of camera C, which is defined as brightness level A1. After the tank is rotated 25 degrees counterclockwise for the first time, the brightness level of subgrid W is reduced to A2. After the tank is rotated 25 degrees counterclockwise for the second time, the brightness level of subgrid W is reduced to A3. After the tank is rotated 25 degrees counterclockwise for the third time, the brightness level of grid W is increased to A2 (entering the illumination range of the light source above).

[0058] The first brightness value (corresponding to brightness level A1) of subgrid W is obtained from the reflected light image captured by camera R, the second brightness value (corresponding to brightness level A2) of subgrid W after the first rotation, the third brightness value (corresponding to brightness level A3) of subgrid W after the second rotation, and the fourth brightness value (corresponding to the last appearing brightness level A2) of subgrid W is obtained from the reflected light image captured by camera P. The first brightness value to the fourth brightness value are summed and averaged to obtain the average brightness value of the subgrid.

[0059] For each area on the surface of the tank, rotating in this way will yield one brightness level A1, two brightness levels A2, and one brightness level A3. Therefore, by summing and averaging, the brightness value changes caused by the change of light source during the rotation can be eliminated, thereby improving the accuracy of subsequent analysis.

[0060] The changes in the first and second numerical sequences are analyzed to determine the defect grid in the sub-grid. Adjacent defect grids are merged to obtain the defect area of ​​the tank to be inspected. If the area of ​​the defect area is greater than the first threshold, the tank to be inspected is classified as a defective tank; otherwise, it is classified as a first qualified tank.

[0061] After obtaining the average brightness value, a first numerical sequence and a second numerical sequence are constructed for the sub-mesh. The first numerical sequence represents the brightness variation of the tank under test in the horizontal direction, and the second numerical sequence represents the brightness variation of the tank under test in the vertical direction. Therefore, if a sudden change in brightness value occurs in either the first or second numerical sequence, it may indicate the presence of a pit or scratch, and the sub-mesh with the sudden change is identified as a defect mesh. Next, adjacent defect meshes are merged to obtain the defect area on the tank surface. If the defect area is greater than a first threshold, for example, 1 / 30 of the surface area of ​​the tank under test, then the tank under test is identified as a defective tank.

[0062] This embodiment identifies defective meshes within sub-meshes using the following steps:

[0063] The first and second numerical sequences are processed using the sliding window method to obtain the first and second average value sequences. A second threshold is set, and the first and second average value sequences are binarized based on the second threshold to obtain the first and second processed sequences. If multiple sequence points with a value of 1 appear consecutively in the first and second processed sequences, the sub-grids in which the average brightness value is abnormal are located as defect grids.

[0064] If the sliding window size is set to 3, and the first numerical sequence is [3, 3, 8, 3, 3, 3], then the corresponding first average value sequence is [4.67, 4.67, 4.67, 3]. If the second threshold is set to 4, then sequence points greater than the second threshold are converted to 1, and sequence points less than or equal to the second threshold are converted to 0. Then the generated first processing sequence is [1, 1, 1, 0]. If the sequence point 1 appears consecutively, the average brightness value of the subgrid with this sequence point is [3, 3, 8, 3, 3]. If the average brightness value of the third subgrid is abnormal, then this subgrid is defined as a defective grid.

[0065] This embodiment performs a second defect analysis on the first qualified tank, including the following steps:

[0066] Obtain the template image of the sub-image, align the sub-image with the template image, and after alignment, calculate the absolute value of the difference between corresponding pixels in the sub-image and the template image, sum the absolute values ​​to obtain a comprehensive value. If the comprehensive value is greater than the third threshold, the sub-image is judged to have a defect, and the corresponding first qualified tank is classified as a defective tank.

[0067] The template image is a pre-prepared complete image corresponding to the sub-image. Since the similarity between the sub-image and the template image is calculated using the difference method, the two images must be aligned before calculation to ensure accuracy. After alignment, the pixel values ​​of corresponding positions in the sub-image and the template image are subtracted, and the absolute values ​​of the differences are summed as a comprehensive value. The larger the comprehensive value, the greater the difference between the two images. A third threshold is used to quantify the similarity between the two images. When the comprehensive value is greater than the third threshold, it is determined that there is a significant difference between the sub-image and the template image, and the corresponding first qualified tank is classified as a defective tank.

[0068] In this embodiment, aligning the sub-image with the template image includes the following steps:

[0069] Multiple reference regions are set for the template image. One reference region is selected as the calibration region. The standard region coordinates and standard pixel distribution of the calibration region are recorded. After obtaining the sub-image, the reference region within the standard region coordinates in the sub-image is extracted, and the actual pixel distribution of the reference region is obtained. The similarity between the calibration region and the reference region is calculated based on the standard pixel distribution and the actual pixel distribution. If the similarity is greater than the fourth threshold, the sub-image and the template image are aligned based on the calibration region and the reference region.

[0070] For example, three reference regions are set in the template image, with each region being 1 / 10 or 1 / 8 the size of the template image. A coordinate system is established with one vertex of the template image as the origin, and the coordinates of each vertex of the reference region are obtained as the region coordinates. Before alignment, a reference region is randomly selected as the calibration region, and its corresponding coordinates are used as the standard region coordinates. A coordinate system is established in the sub-image using the same method, and a portion of the standard region coordinates is extracted as the control region. Then, the actual pixel distribution of the control region and the standard pixel distribution of the calibration region are obtained, and their similarity is determined using a pixel distribution histogram. If the similarity is greater than a fourth threshold, it indicates that the calibration region and the control region are similar. The sub-image is then aligned with the template image based on these two as anchor points. The fourth threshold is, for example, 0.95. Since both the control region and the calibration region are relatively small, the similarity between the two images can be quickly determined using a color histogram.

[0071] If the similarity is less than or equal to the fourth threshold, another reference area is selected as the calibration area. If the similarity between the newly selected calibration area and the corresponding control area is less than or equal to the fourth threshold, the first qualified tank is directly classified as a defective tank.

[0072] If the control area and the calibration area are determined to be dissimilar, it may be due to a coating problem at that location. To continue the alignment process, this invention selects other reference areas for comparison. If the comparison is successful, alignment is performed based on the successfully compared reference area and the control area. If the comparison fails, the first qualified tank is classified as a defective tank.

[0073] Furthermore, after obtaining the similarity between the calibration region and the control region for the first time, if the similarity is less than or equal to the fourth threshold, the calibration region is split into a first grid image and the control region is split into a second grid image. Based on the first grid image and the second grid image, the similarity distribution trend between the calibration region and the control region is determined, and the extended region is cropped in the template image according to the similarity distribution trend.

[0074] After initially selecting a reference region as the calibration region, if the similarity between the calibration region and the control region is less than a fourth threshold, the calibration region is further divided into multiple first grid images, and the control region is divided into second grid images. The similarity between each first grid image and each second grid image is then compared to determine the similarity distribution trend between the calibration region and the control region. Figure 3 As shown, it is currently necessary to compare the sub-image X and the template image Y. The calibration region I and the control region J were selected. By comparison, it was determined that the lower half Q of the calibration region I and the upper half V of the control region J have a high similarity, indicating that the calibration region has deviated upward. Therefore, the extended region is truncated downward from the calibration region.

[0075] The extended region and the calibration region are merged into an extended image. If a matching region is located in the extended image, and the similarity between the matching region and the control region is greater than the fourth threshold, the sub-image is aligned with the template image based on the control region and the matching region. If no matching region is located, another reference region is selected as the calibration region.

[0076] By comparing the expanded region with the control region, it was determined that a portion of the expanded region was highly similar to the control region, for example... Figure 3 If region F in the sub-image is highly similar to region G in the control region, then region F is merged with the lower half Q of the previously calibrated region to form region Z. Region Z includes regions G and F, while the control region includes V and F. If the similarity between region Z and the control region is greater than a fourth threshold, then region Z is used as the matching region. The sub-image is then aligned with the template image based on the matching and control regions. If no matching region is found, other reference regions are selected for further comparison based on the previous method.

[0077] In this embodiment, the deep learning algorithm is the U-Net semantic segmentation model, which performs planar transformation on the texture image based on affine transformation.

[0078] like Figure 4 As shown, a deep learning-based can-making defect detection system is used to implement the aforementioned deep learning-based can-making defect detection method. The system includes:

[0079] The acquisition module illuminates the tank under test with light sources from multiple directions. During the illumination process, the tank under test rotates multiple times. After each rotation, an image of the reflected light on the surface of the tank under test is captured. After the first qualified tank has completed the color spraying, an image of the texture on the surface of the first qualified tank is captured again.

[0080] The first analysis module performs a first defect analysis on the tank under test based on the reflected light image, so as to classify the tank under test into a first qualified tank or a defective tank.

[0081] The conversion module performs planar conversion on the texture image to obtain a planar image, and then stitches the planar images together to obtain a complete image.

[0082] The second analysis module performs region segmentation on the complete image based on deep learning algorithms to obtain multiple sub-images. Based on the sub-images, it performs a second defect analysis on the first qualified tank to classify the first qualified tank as a second qualified tank or a defective tank.

[0083] A deep learning-based can manufacturing defect detection device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method described above.

[0084] It should be understood that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0085] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting defects in can manufacturing based on deep learning, characterized in that, The test tank is illuminated by a light source from multiple directions. During the illumination process, the test tank rotates multiple times. After each rotation, an image of the reflected light on the surface of the test tank is captured. Based on the reflected light image, a first defect analysis is performed on the tank to be inspected to classify the tank to be inspected into a first qualified tank or a defective tank. After the first qualified tank is coated with color, a texture image of the surface of the first qualified tank is taken again. The texture image is transformed into a planar image, and the planar images are then stitched together to obtain a complete image. The complete image is segmented into multiple sub-images based on a deep learning algorithm. The first qualified tank is then subjected to a second defect analysis based on the sub-images to classify the first qualified tank as a second qualified tank or the defective tank. The second defect analysis of the first qualified tank includes the following steps: Obtain a template image for the sub-image, align the sub-image with the template image, and after alignment, calculate the absolute value of the difference between corresponding pixels of the sub-image and the template image, sum the absolute values ​​to obtain a comprehensive value. If the comprehensive value is greater than a third threshold, it is determined that the sub-image has a defect, and the corresponding first qualified tank is classified as the defective tank. Aligning the sub-image with the template image includes the following steps: Multiple reference regions are set for the template image, and one of the reference regions is selected as the calibration region. The standard region coordinates and standard pixel distribution of the calibration region are recorded. After the sub-image is acquired, the reference region within the standard region coordinates in the sub-image is extracted, and the actual pixel distribution of the reference region is acquired. The similarity between the calibration region and the reference region is calculated based on the standard pixel distribution and the actual pixel distribution. If the similarity is greater than a fourth threshold, the sub-image and the template image are aligned based on the calibration region and the reference region. If the similarity is less than or equal to the fourth threshold, then another reference region is selected as the calibration region. If the similarity between the newly selected calibration region and the corresponding control region is less than or equal to the fourth threshold, then the first qualified tank is directly classified as the defective tank.

2. The method according to claim 1, characterized in that, The first defect analysis of the tank to be tested includes the following steps: Each surface of the tank to be tested is divided into grids to obtain multiple sub-grids. The average brightness value of each sub-grid is obtained by combining the reflected light images from multiple directions. The sub-grids located in the same horizontal direction are taken as a horizontal sequence, and the sub-grids located in the same vertical direction are taken as a vertical sequence. A first numerical sequence corresponding to the horizontal sequence and a second numerical sequence corresponding to the vertical sequence are constructed based on the average brightness value. The changes in the first and second numerical sequences are analyzed to determine the defect grids in the sub-grid. The adjacent defect grids are merged to obtain the defect area of ​​the tank to be inspected. If the area of ​​the defect area is greater than a first threshold, the tank to be inspected is classified as the defective tank; otherwise, it is classified as the first qualified tank.

3. The method according to claim 2, characterized in that, Obtaining the average brightness value for each of the subgrids includes the following steps: The container to be tested is illuminated by light sources in four directions. The container to be tested rotates three times, each time by 25 degrees. After each rotation, the reflected light image of the container to be tested is taken in each direction. The brightness values ​​of the sub-grid in each reflected light image are summed and averaged to obtain the average brightness value of the sub-grid.

4. The method according to claim 2, characterized in that, Determining the defective mesh in the sub-mesh includes the following steps: The first and second numerical sequences are processed using the sliding window method to obtain a first average sequence and a second average sequence. A second threshold is set, and the first and second average sequences are binarized based on the second threshold to obtain a first processed sequence and a second processed sequence. If multiple sequence points with a value of 1 appear consecutively in the first and second processed sequences, the sub-grids in which the average brightness value is abnormal are located as the defect grids.

5. The method according to claim 1, characterized in that, After obtaining the similarity between the calibration region and the control region for the first time, if the similarity is less than or equal to the fourth threshold, the calibration region is split into a first grid image and the control region is split into a second grid image. Based on the first grid image and the second grid image, the similarity distribution trend between the calibration region and the control region is determined, and the extended region is cropped in the template image according to the similarity distribution trend. The extended region and the calibration region are merged into an extended image. If a matching region is located in the extended image, and the similarity between the matching region and the reference region is greater than the fourth threshold, the sub-image is aligned with the template image based on the reference region and the matching region. If the matching region is not located, another reference region is selected as the calibration region.

6. The method according to claim 1, characterized in that, The deep learning algorithm is the U-Net semantic segmentation model, which performs planar transformation on the texture image based on affine transformation.

7. A deep learning-based can-making defect detection system, used to implement the deep learning-based can-making defect detection method as described in any one of claims 1-6, characterized in that, The system includes: The acquisition module illuminates the can under test with light sources from multiple directions. During the illumination process, the can under test rotates multiple times. After each rotation, an image of the reflected light on the surface of the can under test is captured. After the first qualified can is coated with color, an image of the texture on the surface of the first qualified can is captured again. The first analysis module performs a first defect analysis on the tank to be inspected based on the reflected light image, so as to classify the tank to be inspected into a first qualified tank or a defective tank. The conversion module performs planar conversion on the texture image to obtain a planar image, and then stitches the planar images together to obtain a complete image; The second analysis module performs region segmentation on the complete image based on a deep learning algorithm to obtain multiple sub-images. Based on the sub-images, it performs a second defect analysis on the first qualified tank to classify the first qualified tank as a second qualified tank or the defective tank.

8. A deep learning-based can manufacturing defect detection device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Depth vision-based beverage bottle filling defect identification method

    CN115330702A

  • Packaging tin appearance defect detection method

    CN119228800A

  • Fermentation tank processing procedure detection method and system based on artificial intelligence

    CN115131346A

  • Full-automatic polyurea assembled tank production system and method

    CN119259312A

  • Inspection equipment of defect

    JP1996145907A