Product Surface Inspection Methods
By combining deep learning models with traditional algorithms for product surface inspection, the problem of poor robustness in complex scenarios has been solved, achieving efficient and accurate defect detection and improving detection efficiency and data utilization.
Patent Information
- Application Number
- CN202211117507.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-09-14
AI Technical Summary
In existing technologies, machine vision-based product surface defect detection methods have poor robustness and high false detection rates in complex scenarios, while deep learning methods are difficult to control and repair in real-world scenarios, resulting in insufficient detection efficiency and accuracy.
By combining deep learning models with traditional algorithms, product surface images are obtained through preprocessing. Defect areas are extracted using deep learning models, and local feature analysis is performed using traditional algorithms. The local features are then further determined to be OK or NG areas, and the feedback information is fed back to the deep learning model for online training.
It improves the adaptability and accuracy of defect detection, reduces the false positive rate, enhances detection efficiency and robustness, and improves data utilization and training timeliness.
Smart Images

Figure CN115393594B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual image processing, and in particular to a method and application for product surface inspection. Background Technology
[0002] In industrial settings, efficient and stable quality inspection is a crucial part of the product manufacturing process. The speed and accuracy of quality inspection directly impact production line capacity and the final product quality. The presence or absence of defects on a product's surface is a key indicator of whether it meets industrial quality requirements. In industrial manufacturing, defect detection on product surfaces is mostly performed manually. However, manual inspection methods are costly in terms of manpower and suffer from high false positive and false negative rates, failing to meet the demands of real-time inspection.
[0003] To adapt to the current trend of informatization and intelligentization in manufacturing, it is necessary to break free from the constraints of traditional manual labor on production capacity and efficiency. Currently, machine vision-based defect detection methods can be divided into two categories: one is the traditional machine vision-based method for detecting product surface defects, which selects and extracts defect features through image processing; the other, which has emerged in recent years, utilizes deep learning methods to detect product surface defects. Traditional methods have advantages such as high detection efficiency and controllable processes in simple scenarios, but for complex scenarios, feature extraction is complex and the algorithm has poor robustness. Deep learning-based defect detection methods have good performance in complex scenarios, but they are overly dependent on datasets, and the detection results are difficult to control. When problems occur in actual production, they cannot be repaired in a timely manner, making it difficult to implement in real-world scenarios.
[0004] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a product surface inspection method that can effectively alleviate the shortcomings of traditional methods and deep learning models when used alone.
[0006] To achieve the above objectives, embodiments of the present invention provide a product surface inspection method, comprising the following steps: acquiring a product surface image and preprocessing it; using a deep learning model to detect and extract defect areas from the preprocessed image; using a conventional algorithm to extract local features of the defect areas, and performing secondary analysis on the local features; if the local features are determined to be OK areas, then transmitting the defect area information to the deep learning model.
[0007] In one or more embodiments of the present invention, if the local feature is determined to be an NG region, the defect region information is directly output, and the product is determined to be a non-conforming product.
[0008] In one or more embodiments of the present invention, the method for acquiring a product surface image includes:
[0009] Use industrial cameras to capture a single set of product images or use different light sources to capture multiple sets of product images.
[0010] In one or more embodiments of the present invention, the product image preprocessing method includes: identifying the background and product parts of the product surface image, extracting the product parts from the product surface image, performing binarization processing on the product part image, extracting white pixels to obtain the pixel points of the product part, and obtaining the pixel coordinates of the product part.
[0011] In one or more embodiments of the present invention, the deep learning model includes: R-CNN algorithm, SPP-Net algorithm, Fast R-CNN algorithm, R-FCN algorithm or YOLO algorithm.
[0012] In one or more embodiments of the present invention, the method for extracting local features of a defect region includes: segmenting the defect region into multiple local features, and using a conventional algorithm to detect each local feature.
[0013] In one or more embodiments of the present invention, the conventional algorithm includes: detecting edge features in local features using the Sobel operator, Canyon algorithm, Laplace algorithm or Freichen algorithm; and detecting morphological features in local features using BLOB image processing technology.
[0014] In one or more embodiments of the present invention, the conventional algorithm further includes using gray-level histograms to statistically calculate gray-level distribution features in local features.
[0015] Another aspect of the present invention provides an electronic device comprising at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the product surface inspection method.
[0016] Another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the product surface inspection method.
[0017] Compared with existing technologies, the product surface inspection method according to embodiments of the present invention combines the advantages of deep learning models and traditional algorithms, and has the following advantages:
[0018] 1. Using deep learning to pre-extract defect regions is more adaptable to complex scenarios and has a higher defect detection accuracy compared to traditional methods. At the same time, the robustness of the model will gradually improve as the dataset increases.
[0019] 2. Compared to deep learning methods, this invention utilizes traditional algorithms to perform secondary analysis of local information in defect areas. For local defect areas, the complexity of background texture information is significantly reduced. In simple scenarios, using traditional methods for secondary analysis of defect areas can effectively reduce the false positive rate of defects and improve the robustness of the algorithm.
[0020] 3. By utilizing traditional algorithms to perform secondary judgments on local information and feeding this information back into the deep learning algorithm, the algorithm model can be trained and updated online. Compared to the past practice of manually labeling datasets, this greatly improves data utilization and training efficiency. Furthermore, online automatic training significantly enhances the timeliness of solving production problems. Attached Figure Description
[0021] Figure 1 This is a schematic flowchart of a product surface inspection method according to an embodiment of the present invention. Detailed Implementation
[0022] The specific embodiments of the present invention will be described in detail below, but it should be understood that the scope of protection of the present invention is not limited to the specific embodiments.
[0023] Unless otherwise expressly stated, throughout the specification and claims, the term "comprising" or its variations such as "including" or "comprises" shall be understood to include the stated elements or components without excluding other elements or other components.
[0024] A product surface inspection method according to a preferred embodiment of the present invention includes the following steps:
[0025] S1. Acquire and preprocess the product surface image;
[0026] The method for acquiring product surface images includes using an industrial camera to acquire a single set of product images or using different light sources to acquire multiple sets of product images.
[0027] The product image preprocessing method includes identifying the background and product parts of the product surface image, extracting the product part from the product surface image, performing binarization processing on the product part image, extracting white pixels to obtain the pixel points of the product part, and obtaining the pixel coordinates of the product part.
[0028] S2. Use a deep learning model to detect and extract defect areas from the preprocessed image;
[0029] Deep learning models include the R-CNN algorithm, SPP-Net algorithm, Fast R-CNN algorithm, R-FCN algorithm, or YOLO algorithm.
[0030] S3. Use traditional algorithms to extract local features of the defect area, and perform secondary analysis on the local features. If the local features are determined to be OK areas, then transmit the defect area information to the deep learning model.
[0031] S4. If the local feature is determined to be an NG region, the defect region information will be output directly.
[0032] In one embodiment, the method for extracting local features of a defect region includes segmenting the defect region into multiple local features and detecting each local feature using conventional algorithms. Conventional algorithms include using the Sobel operator, Canyon algorithm, Laplace algorithm, or Freichen algorithm to detect edge features within the local features. Specifically, this includes detecting the first or second-order gradient direction and the magnitude of the first or second-order derivative of the edge features; using BLOB image processing technology to detect morphological features within the local features, specifically detecting local features such as length, width, area, or roundness; or using gray-level histogram statistical calculations to determine gray-level distribution features within the local features. Specifically, this involves detecting gray-level distribution variance, energy, and entropy within the defect region. When the detected values are determined to be within a set value, the value is transmitted to the deep learning model database for supplementation and correction; when the detected values are determined to exceed the set value, the local feature information is output and recorded as a missing feature.
[0033] An embodiment of the present invention also provides an electronic device including at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the product surface inspection method as described above.
[0034] An embodiment of the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the product surface inspection method.
[0035] According to one embodiment, a program product, such as a machine-readable medium, is provided. The machine-readable medium may have instructions (i.e., the elements implemented in software as described above), which, when executed by a machine, cause the machine to perform the above-described combinations of the various embodiments of this specification. Figure 1 The various operations and functions described. Specifically, a system or apparatus equipped with a readable storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer or processor of the system or apparatus to read and execute the instructions stored in the readable storage medium.
[0036] In summary, the product surface inspection method of the present invention effectively combines the advantages of deep learning models and traditional algorithms, avoiding the shortcomings of using deep learning models and traditional algorithms alone. For most industrial scenarios, it can achieve high detection efficiency, high stability, high detection rate and low false detection rate.
[0037] The foregoing description of specific exemplary embodiments of the invention is for illustrative and explanatory purposes. These descriptions are not intended to limit the invention to the precise forms disclosed, and it will be apparent that many changes and variations can be made in accordance with the foregoing teachings. The exemplary embodiments were chosen and described in order to explain the specific principles of the invention and its practical application, thereby enabling those skilled in the art to implement and utilize various different exemplary embodiments of the invention, as well as various different choices and variations. The scope of the invention is intended to be defined by the claims and their equivalents.
Claims
1. A method for inspecting the surface of a product, characterized in that, Includes the following steps: The process of acquiring and preprocessing a product surface image includes: identifying the background and product parts of the product surface image, extracting the product part from the product surface image, binarizing the product part image, extracting white pixels to obtain the pixels of the product part, and obtaining the pixel coordinates of the product part. A deep learning model is used to detect and extract defect regions from the preprocessed image; The local features of the defective region are extracted using traditional algorithms, and the local features are analyzed in a secondary manner. If the local features are determined to be OK regions, the defective region information is transmitted to a deep learning model. If the local feature is determined to be an NG area, the defect area information is directly output, and the product is determined to be a non-conforming product. The method for extracting local features of the defect region includes: dividing the defect region into multiple local features and using traditional algorithms to detect each local feature.
2. The product surface inspection method as described in claim 1, characterized in that, The method for acquiring product surface images includes: Use industrial cameras to capture a single set of product images or use different light sources to capture multiple sets of product images.
3. The product surface inspection method as described in claim 1, characterized in that, The deep learning model includes: The algorithms include R-CNN, SPP-Net, Fast R-CNN, R-FCN, and YOLO.
4. The product surface inspection method as described in claim 1, characterized in that, The traditional algorithm includes: Detect edge features in local features using the Sobel operator, Canyon algorithm, Laplace algorithm, or Freichen algorithm; or BLOB image processing technology is used to detect morphological features in local features.
5. The product surface inspection method as described in claim 4, characterized in that, The traditional algorithm also includes using gray-level histograms to statistically calculate the gray-level distribution features in local features.
6. An electronic device, characterized in that, include: At least one processor; as well as A memory that stores instructions, which, when executed by the at least one processor, cause the at least one processor to perform the product surface inspection method as described in any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the product surface inspection method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Visual inspection method for intelligently-manufactured micro-structure surface defects
CN114820471A