Glass defect detection method based on BP neural network

The BP neural network is used to identify platinum defects in glass substrates, which solves the problem of difficulty in accurately identifying platinum defects with existing technology, achieves high-accuracy classification of glass substrate defects, and improves the quality control capabilities of glass substrates.

CN113706468BActive Publication Date: 2024-09-13HEBEI GUANGXING SEMICON TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202110852729.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-27
Publication Date
2024-09-13
Estimated Expiration
2041-07-27

AI Technical Summary

Technical Problem

It is difficult to accurately identify platinum defects in glass substrates, especially needle-shaped platinum defects, with the existing technology.

Method used

The glass defect detection method based on BP neural network is used to obtain the image of the glass to be detected, extract the target image and characteristic parameters of the glass defect, and use the trained glass defect detection model to identify the defect type of the glass to be detected, including image acquisition and image processing and feature extraction module, using BP neural network for classification.

Benefits of technology

It has greatly improved the identification accuracy of common defects in glass substrates, and is especially suitable for classifying different types of platinum defects, improving the quality control capabilities of glass substrates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113706468B
    Figure CN113706468B
Patent Text Reader

Abstract

The embodiment of the present invention provides a glass defect detection method based on BP neural network, which relates to the technical field of glass defect detection. The method includes: obtaining a glass image to be detected; extracting a target image including glass defects from the glass image to be detected; extracting characteristic parameters of the glass defects from the target image; using the characteristic parameters of the glass defects as input, and identifying the defect type of the glass to be detected through a glass defect detection model; the glass defect detection model is obtained by training the BP neural network with multiple glass image samples including glass defects. The above technical solution of the present invention collects images of glass substrates and extracts characteristic parameters of glass defects, and uses the BP neural network trained with image samples including different glass defects to identify the type of glass defects. It has strong applicability to the classification of different types of platinum defects and greatly improves the recognition accuracy of common defects in glass substrates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of glass defect detection, and in particular to a glass defect detection method based on BP neural network. Background Art

[0002] Accurate classification of glass substrate defects is of great significance for timely improvement and adjustment of production process parameters, countermeasures for defects, and improvement of yield rate. There are two main production methods for display glass substrates: overflow method and float method. The two processes are different, and the production equipment, materials, and process flows used are not exactly the same, so the types of defects mixed in the glass substrate are different.

[0003] During the production process of substrate glass, the high-temperature glass liquid melted in the kiln is often clarified and homogenized through a platinum channel to reduce bubbles, lighten streaks, adjust the temperature and viscosity to meet the requirements of the molding process, and control the flow of glass liquid entering the molding area. Platinum defects are one of the important and key defects in quality control during this process. According to the morphology and generation mechanism of platinum defects, they are generally divided into regular platinum (triangles, regular hexagons), irregular platinum (also called granular platinum) and needle-shaped platinum. In particular, needle-shaped platinum defects are extremely small in size, with a length ranging from tens of μm to more than a hundred μm and a diameter of less than 1 μm. It is currently difficult for existing technologies to accurately identify the above platinum defects. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a glass defect detection method based on a BP neural network to solve the problem that it is difficult to accurately identify platinum defects on a glass substrate in the prior art.

[0005] In order to achieve the above object, in a first aspect of the present invention, a glass defect detection method based on BP neural network is provided, comprising:

[0006] Acquire the glass image to be inspected;

[0007] Extracting a target image including glass defects from the glass image to be detected;

[0008] Extracting characteristic parameters of glass defects from the target image;

[0009] The characteristic parameters of the glass defects are used as input, and the defect type of the glass to be detected is identified by a glass defect detection model; the glass defect detection model is obtained by training a BP neural network through a plurality of glass image samples including glass defects.

[0010] Optionally, extracting a target image including glass defects from the glass image to be detected includes:

[0011] Detecting first glass defect edges of all glass defects in the glass image to be detected;

[0012] For each glass defect:

[0013] Obtaining grayscale values ​​of all pixels belonging to the first glass defect edge and calculating a mean and a standard deviation of the grayscale values ​​of the first glass defect edge;

[0014] The difference between the gray value mean and the standard deviation is used as the segmentation threshold;

[0015] Performing threshold segmentation on the first glass defect edge according to the segmentation threshold to extract a second glass defect edge of the glass defect, and taking an area enclosed by the second glass defect edge as a target area;

[0016] The image including the target area is used as a target image including glass defects.

[0017] Optionally, extracting characteristic parameters of glass defects from the target image includes:

[0018] Establishing a pixel coordinate system based on the target image;

[0019] Obtaining the coordinates of pixels of all target areas in the target image;

[0020] Determine a first centroid of each target area according to the coordinates of the pixels of each target area, and determine a second centroid of all target areas according to the coordinates of the pixels of all target areas, wherein the second centroid is a common centroid of all target areas;

[0021] Obtain the area of ​​each target region, the total area of ​​all target regions, the perimeter of each target region, the total perimeter of all target regions, and the grayscale value of each pixel in the target region;

[0022] The characteristic parameter of the glass defect is determined according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area.

[0023] Optionally, determining the second centroids of all target areas according to the coordinates of the pixels of all target areas includes:

[0024] Determine, according to the coordinates of the pixels of all the target areas, a first pixel at the top in the pixel coordinate system, a second pixel at the bottom in the pixel coordinate system, a third pixel at the leftmost end in the pixel coordinate system, and a fourth pixel at the rightmost end in the pixel coordinate system among the pixels of all the target areas;

[0025] The centroid of an area enclosed by the first pixel, the second pixel, the third pixel and the fourth pixel is used as the second centroid.

[0026] Optionally, determining the characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area comprises:

[0027] The characteristic parameters of glass defects are determined by the following formula:

[0028]

[0029] Among them, Xn is the horizontal coordinate of the first centroid of the nth target area, Yn is the vertical coordinate of the first centroid of the nth target area, Xc is the horizontal coordinate of the second centroid; Yc is the vertical coordinate of the second centroid, Sn is the area of ​​the nth target area, Sc is the total area of ​​all target areas, and N is the number of target areas.

[0030] Optionally, determining the characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area comprises:

[0031] The characteristic parameters of glass defects are determined by the following formula:

[0032]

[0033] Wherein, Pn is the perimeter of the nth target area.

[0034] Optionally, determining the characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area comprises:

[0035] Calculate the standard deviation of the areas of all target regions;

[0036] The standard deviation of the areas of all target regions is taken as the characteristic parameter of glass defects.

[0037] Optionally, determining the characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area comprises:

[0038] Compare the grayscale values ​​of all pixels in all target areas to determine the maximum grayscale value of all pixels and the minimum grayscale value of all pixels;

[0039] The difference between the maximum grayscale value of all pixels and the minimum grayscale value of all pixels is taken as the characteristic parameter of the glass defect.

[0040] Optionally, determining the characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area comprises:

[0041] The characteristic parameters of glass defects are determined by the following formula:

[0042]

[0043] Wherein, Gn is the gray value of the nth pixel in the target area, and Gc is the gray value of the pixel at the first centroid of the target area.

[0044] Optionally, determining the characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area comprises:

[0045] The characteristic parameters of glass defects are determined by the following formula:

[0046] E′=P (x) ×log2P (x) ;

[0047]

[0048] Among them, P(x) is the probability of occurrence of a pixel with a gray value of x, Mx is the number of pixels with a gray value of x, and M is the total number of pixels in the target area.

[0049] In a second aspect of the present invention, a glass defect detection device based on a BP neural network is provided, comprising:

[0050] An image acquisition module is configured to acquire an image of the glass to be inspected;

[0051] An image processing module, configured to extract a target image including glass defects from the glass image to be detected;

[0052] A feature extraction module is configured to extract feature parameters of glass defects from the target image;

[0053] The defect detection module is configured to use the characteristic parameters of the glass defects as input and identify the defect type of the glass to be detected through a glass defect detection model; the glass defect detection model is obtained by training a BP neural network through multiple glass image samples including glass defects.

[0054] The above technical solution of the present invention collects images of glass substrates and extracts characteristic parameters of glass defects, and uses a BP neural network trained with image samples including different glass defects to identify the types of glass defects. It has strong applicability to the classification of different types of platinum defects and greatly improves the recognition accuracy of common defects in glass substrates.

[0055] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0057] Figure 1 It is a method flow chart of a glass defect detection method based on BP neural network provided in a preferred embodiment of the present invention;

[0058] Figure 2 is a bubble image obtained by initial image segmentation provided in a preferred embodiment of the present invention;

[0059] Figure 3 The bubble image obtained by the second image segmentation provided in the preferred embodiment of the present invention;

[0060] Figure 4 It is a schematic diagram of a stain sample image after image segmentation provided by a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0061] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0062] like Figure 1 As shown, in a first aspect of this embodiment, a glass defect detection method based on a BP neural network is provided, comprising:

[0063] S100, obtaining an image of the glass to be inspected;

[0064] S200, extracting a target image including glass defects from a glass image to be detected;

[0065] S300, extracting characteristic parameters of glass defects from the target image;

[0066] S400, using characteristic parameters of glass defects as input, identifying the defect type of the glass to be detected through a glass defect detection model; the glass defect detection model is obtained by training a BP neural network through a plurality of glass image samples including glass defects.

[0067] In this way, this embodiment collects images of glass substrates and extracts characteristic parameters of glass defects, and uses a BP neural network trained with image samples including different glass defects to identify the types of glass defects. It has strong applicability for the classification of different types of platinum defects and greatly improves the recognition accuracy of common defects in glass substrates.

[0068] Specifically, the main production methods of glass substrates currently include overflow method and float method. Due to the differences in the two process, the types of defects contained in the glass substrates are different. In addition, in laser glass, platinum will still dissolve during the glass melting process, causing the glass to contain Pt ions and even Pt particles. Although small enough Pt particles do not affect the use, experiments have shown that the presence of Pt particles in laser glass is very dangerous. Therefore, accurately identifying the defect types of glass substrates is of great significance for quality control. In this embodiment, a certain number of different types of glass defect images are pre-acquired as training samples of the BP neural network, for example, 33 adhesion defects (ADG), 33 bubbles, 24 regular platinum images, 35 granular platinum images, 34 stains, and 19 needle-shaped platinum images, totaling 178 defect images, are used as training samples, and all training samples are divided into three groups, wherein 143 images are randomly selected from the first group for training the BP neural network, and the remaining 35 images are used as the second group to test the generalization ability of the BP neural network, and then 35 images are randomly selected from the 143 training samples as the third group, and the second and third groups of training samples are used to verify the classification accuracy of the BP neural network. After training, a glass defect detection model is obtained, wherein the training process is a prior art and will not be repeated here. Since the size of the glass substrate is very large, for example, the size of the G5 glass substrate is 1100mm×1300mm, and the size of the G6 is 1500mm×1850mm, and the defect size is from a dozen μm to tens of μm, and the defect occupies an area of ​​the image of one hundred millionth of an order of magnitude. If the target image is not extracted, the glass image to be detected collected by the camera is almost entirely background that does not need to be processed, resulting in a large amount of invalid calculations, and thus the real-time and reliability of online detection cannot be guaranteed. Therefore, it is necessary to perform image segmentation on the acquired glass image to be detected, extract the target image of the glass defect, and then extract the feature parameters of the glass defect based on the extracted target image as the input of the glass defect detection model. To improve the classification accuracy of the glass defect detection model, the key lies in the selection of features. Appropriate features can strike a balance between the amount of calculation and the classification effect, and have good generalization ability. According to the common defects of the glass substrate, this embodiment selects the following two types of features as the input of the glass defect detection model, one of which is a feature related to the shape of the glass defect, that is, a feature that is not related to the grayscale; the other is a feature related to the grayscale of the glass defect. In order to achieve good applicability, each selected feature in this embodiment is required to be independent of the size, direction and illumination of the glass defect. In this way, by extracting feature parameters related to the shape of the glass defect and feature parameters related to the grayscale of the glass defect, the classification accuracy of the defect type of the glass image to be detected by the glass defect detection model can be effectively improved.

[0069] Although filtering and other preprocessing can remove most of the interference from noise after obtaining the glass image to be detected, the glass defects still exist in the background and have not been separated. Therefore, it is necessary to accurately segment the glass image to be detected to extract the target image of the glass defects. In step S200, the target image including the glass defects is extracted from the glass image to be detected, including:

[0070] Detecting the first glass defect edge of all glass defects in the glass image to be detected;

[0071] For each glass defect: obtain the grayscale values ​​of all pixels belonging to the first glass defect edge and calculate the grayscale value mean and standard deviation of the first glass defect edge; use the difference between the grayscale value mean and the standard deviation as the segmentation threshold; perform threshold segmentation on the first glass defect edge according to the segmentation threshold to extract the second glass defect edge of the glass defect, and use the area enclosed by the second glass defect edge as the target area;

[0072] An image including the target area is used as a target image including glass defects.

[0073] Since the size of glass defects is very small, in order to accurately segment the glass image to be inspected to improve the accuracy of extracting the target image of glass defects, this embodiment adopts a secondary segmentation method to segment the glass image to be inspected to extract the glass defect edges of all glass defects. Figure 2As shown, an edge detection operator is used to perform initial image segmentation on the glass image to be detected. For example, the Canny operator is used to perform initial edge detection of glass defects on the glass image to be detected. The initial edge detection needs to ensure that as many edges as possible in the image are captured as accurately as possible. Therefore, the edge detection during the initial edge detection requires a low missed detection rate and can appropriately retain some noise points. Among them, the Canny operator edge detection is a prior art and its detection process is not described here. After the edge of the glass defect is detected, the boundary of the edge in the height and width directions is found, and the glass defect image is segmented from the glass image to be detected to form an initial target image. Due to the existence of factors such as lighting conditions and interference, the initial target image also needs to be filtered. After image segmentation, the number of pixels of the initial target image is usually very low, often in dozens of pixels. Therefore, a high-computation filtering method can be used to achieve good results. This embodiment uses frequency domain filtering. Through fast Fourier transform, the low-frequency part in the frequency domain image is removed, and then Fourier inverse transform is performed to obtain the filtered initial target image. Due to the large number of glass defect types and different reflective conditions, the grayscale value range of glass defects is very large. Traditional fixed threshold, adaptive threshold and other methods cannot achieve good segmentation results. In order to solve this problem, this implementation adopts the method of using the grayscale mean of pixels at the edge as an automatic threshold to perform a second image segmentation on the initial target image, so as to further accurately extract the second glass defect edge of the glass defect based on the first glass defect edge. Specifically, Figure 3 As shown, for each glass defect extracted by the initial edge detection, the grayscale values ​​of all pixels belonging to the first glass defect edge of the glass defect are obtained, the grayscale values ​​of each pixel are compared, the maximum and minimum values ​​of all grayscale values ​​are eliminated, the grayscale values ​​of the remaining pixels are averaged to obtain the grayscale value mean, and the standard deviation of the grayscale values ​​of the remaining pixels is calculated, and the grayscale value mean minus the standard deviation is used as the segmentation threshold, so as to achieve good adaptability, and accurately extract the edge based on the first glass defect edge to achieve the purpose of accurately extracting the second glass defect edge of the glass defect. In order to facilitate the extraction of feature parameters, for each extracted glass defect, that is, the area enclosed by each second glass defect edge, it is taken as a separate target area, and the image including all detected target areas is determined to be the target image including the glass defect.

[0074] The selection of feature parameters has an important influence on improving the accuracy of glass defect classification based on BP neural network with feature extraction. How to select feature parameters directly affects the accuracy of classification results of glass defect detection model. Therefore, feature parameters of glass defects are extracted from target images, including:

[0075] A pixel coordinate system is established based on a target image; coordinates of pixels of all target areas in the target image are obtained; a first centroid of each target area is determined based on the coordinates of the pixels of each target area, and a second centroid of all target areas is determined based on the coordinates of the pixels of all target areas, wherein the second centroid is a common centroid of all target areas; the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area are obtained; characteristic parameters of glass defects are determined based on at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area.

[0076] It can be understood that in this embodiment, the pixels of the target area include the edge of the target area and all pixels in the target area, the first centroid of the target area is the geometric center of the target area, and the second centroid of all target areas is the common centroid of all target areas. For example, the second centroid can be, but is not limited to, the centroid of the area enclosed by the first centroids of all target areas. The area of ​​each target area can be calculated by the pixels in the target area, thereby calculating the area of ​​all target areas; the perimeter of the target area can be calculated by the pixels at the edge of the target area, thereby calculating the perimeter of all target areas. In this way, the characteristic parameters of the glass defect determined by determining at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area are independent of the size, direction and illumination of the glass defect, and can achieve good applicability.

[0077] Determine the second centroid of all target areas based on the coordinates of the pixels of all target areas, including: determine the first pixel at the top in the pixel coordinate system, the second pixel at the bottom in the pixel coordinate system, the third pixel at the leftmost in the pixel coordinate system, and the fourth pixel at the rightmost in the pixel coordinate system among the pixels of all target areas based on the coordinates of the pixels of all target areas; use the centroid of the area enclosed by the first pixel, the second pixel, the third pixel, and the fourth pixel as the second centroid. In this embodiment, the area enclosed by the first pixel, the second pixel, the third pixel, and the fourth pixel is an area formed by connecting the first pixel to the third pixel, the third pixel to the second pixel, the second pixel to the fourth pixel, and the fourth pixel to the first pixel, and the geometric center of the area is the second centroid. Figure 4 The stain sample image after image segmentation is shown. Figure 4 In FIG. 8 , the stain sample image includes four target areas, the triangle is the second centroid of each target area, and the circle is the first centroid of each target area.

[0078] In this embodiment, the characteristic parameters related to the shape of the glass defect include a discreteness S, and the characteristic parameters of the glass defect are determined according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area, including determining the characteristic parameters of the glass defect by the following formula:

[0079]

[0080] Among them, Xn is the horizontal coordinate of the first centroid of the nth target area, Yn is the vertical coordinate of the first centroid of the nth target area, Xc is the horizontal coordinate of the second centroid; Yc is the vertical coordinate of the second centroid, Sn is the area of ​​the nth target area, Sc is the total area of ​​all target areas, and N is the number of target areas.

[0081] In this embodiment, the characteristic parameter related to the shape of the glass defect also includes the square of the total perimeter divided by the total area E, and the characteristic parameter of the glass defect is determined according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area, including determining the characteristic parameter of the glass defect by the following formula:

[0082]

[0083] Wherein, Pn is the perimeter of the nth target area.

[0084] In this embodiment, the characteristic parameters related to the shape of the glass defect also include the standard deviation of the area. The characteristic parameters of the glass defect are determined based on the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and at least one of the grayscale values ​​of each pixel in the target area, including: calculating the standard deviation of the areas of all target areas; and using the standard deviation of the areas of all target areas as the characteristic parameters of the glass defect.

[0085] In this embodiment, the characteristic parameters related to the grayscale value of the glass defect include the difference between the maximum grayscale value and the minimum grayscale value. The characteristic parameters of the glass defect are determined based on at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area, including: comparing the grayscale values ​​of all pixels in all target areas to determine the maximum grayscale value of all pixels and the minimum grayscale value of all pixels; taking the difference between the maximum grayscale value of all pixels and the minimum grayscale value of all pixels as the characteristic parameter of the glass defect.

[0086] In this embodiment, the characteristic parameter related to the grayscale value of the glass defect also includes a standard deviation Std with the grayscale value at the centroid as the median, and the characteristic parameter of the glass defect is determined according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area, including determining the characteristic parameter of the glass defect by the following formula:

[0087]

[0088] Wherein, Gn is the gray value of the nth pixel in the target area, and Gc is the gray value of the pixel at the first centroid of the target area.

[0089] In this embodiment, the characteristic parameter related to the grayscale value of the glass defect also includes a grayscale entropy E′, and the characteristic parameter of the glass defect is determined according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area, including determining the characteristic parameter of the glass defect by the following formula:

[0090] E′=P (x) ×log2P (x) ;

[0091]

[0092] Among them, P(x) is the probability of occurrence of a pixel with a gray value of x, Mx is the number of pixels with a gray value of x, and M is the total number of pixels in the target area.

[0093] In this embodiment, the BP neural network structure includes an input layer, a first hidden layer, a second hidden layer and an output layer. The selection of hidden layers is as follows: if one hidden layer is selected, it cannot adapt to the nonlinearity of glass defect characteristics; if more hidden layers are selected, the model is difficult to train, and overfitting will cause a decrease in generalization ability. Therefore, in this embodiment, two hidden layers are selected for classification.

[0094] The present embodiment selects 11 characteristic parameters, including 6 characteristics related to the shape of glass defects and 5 characteristics related to grayscale. Among them, the characteristics related to the shape of glass defects are: discreteness, the square of the total perimeter divided by the total area, the standard deviation of the area, the square of the distance between the average centroid position and the center of the figure divided by the total area, the invariant moment and the standard deviation of the eccentricity; the characteristics related to grayscale are: the difference between the maximum grayscale value and the minimum grayscale value, the standard deviation with the grayscale value at the centroid as the median, the grayscale entropy, the mean grayscale value, and the standard deviation with the mean grayscale value as the median. Among them, the square of the distance between the average centroid position and the center of the figure divided by the total area, the invariant moment, the standard deviation of the eccentricity, the mean grayscale value, and the standard deviation with the mean grayscale value as the median are the five commonly used characteristics, which will not be repeated here. Since there are 11 inputs, the number of neurons in the input layer is 11; since there are 6 defect categories, namely adhesion defects, bubbles, regular-shaped platinum, granular platinum, stains and needle-shaped platinum, the number of neurons in the output layer is 6, and the output range is 0-1, corresponding to the probability of belonging to this category; each layer uses the tansig activation function.

[0095] A total of 178 defective images from actual production were collected on the production line as training samples, including 33 adhesion defects, 33 bubbles, 24 regular platinum, 35 granular platinum, 34 stains and 19 needle-shaped platinum. All training samples were divided into three groups. 143 images were randomly selected from the first group for BP neural network training, and the remaining 35 images were used as the second group to test the generalization ability of the BP neural network. 35 images were randomly selected from the 143 training samples as the third group. The second and third groups of training samples were used to verify the classification accuracy of the BP neural network. After 42 iterations of training, the network achieved good results with an error of 0.065. In order to select the appropriate number of hidden layer neurons, considering that the initial value of the neural network weight is a random value, the accuracy rate of 76% is set as the threshold and repeated training is performed until the accuracy of the second and third groups of samples exceeds the threshold. The results of the combination of different numbers of neurons are shown in Table 1.

[0096]

[0097]

[0098] Table 1

[0099] According to experimental results, considering the amount of computation, the optimal number of neurons in the first hidden layer and the second hidden layer is 16 to 24, achieving a balance between accuracy and generalization ability.

[0100] Taking the number of neurons in the first hidden layer and the second hidden layer as

[2416] as an example, 178 samples were classified, and the statistical results of the accuracy of defects of various types are shown in Table 2.

[0101]

[0102] Table 2

[0103] The excessive pursuit of accuracy by the BP neural network will cause overfitting, which restricts the generalization ability of the network. In order to improve the classification accuracy while having good generalization ability, this implementation method also adopts a method of merging the results of multiple networks. From a probabilistic point of view, if there are three completely independent classifiers, the classification accuracy rates are P1, P2, and P3 respectively, then the accuracy rate of the combined results is shown in Table 3.

[0104]

[0105] Table 3

[0106] As shown in Table 3, when P1, P2, and P3 are all greater than 50%, if at least two of the networks Net1, Net2, and Net3 recognize a defect as "√", the merged result is "√". For example, if Net1 and Net2 recognize a defect image as a bubble, and Net3 recognizes the same defect image as a stain, the merged result is a bubble. After experiments, when P1, P2, and P3 are all greater than 50%, the merged result P will be greater than P1, P2, and P3. However, the actual BP neural network is not completely independent. In order to achieve higher mutual independence, the three BP neural networks adopt different numbers of hidden layers, namely

[2416] ,

[2020] , and

[2016] . The accuracy of their individual classifications and the accuracy after merging are shown in Table 4.

[0107]

[0108] Table 4

[0109] After the three networks were merged, 178 samples were classified with an overall accuracy of 90.5%, which is higher than the highest overall accuracy of 86.5% of a single network. There was a significant improvement in ADG and granular platinum defects, proving that the merger of the three networks is helpful in improving the accuracy.

[0110] In summary, this embodiment selects 6 characteristic parameters related to the shape of glass defects and 5 characteristic parameters related to grayscale based on the differences in different defect shapes and grayscale features. After classification by the trained BP neural network, an overall accuracy rate of 86.5% can be achieved, and the network has good generalization ability. At the same time, the characteristic parameters selected by this embodiment have good adaptability to different platinum defects, and effectively solve the classification problems of regular-shaped platinum, granular platinum and needle-shaped platinum. The classification accuracy of the three types of defects can reach 91.7%, 88.6% and 89.5%; at the same time, it also solves the problem of accurate classification of stain defects on the glass surface, which is suitable for the manufacture of optoelectronic display glass and optical glass.

[0111] The optional embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the technical concept of the embodiments of the present invention, a variety of simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all belong to the protection scope of the embodiments of the present invention.

[0112] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not further describe various possible combinations.

[0113] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the embodiments of the present invention, they should also be regarded as the contents disclosed in the embodiments of the present invention.

Claims

1. A glass defect detection method based on BP neural network, characterized in that: include: Acquire the glass image to be inspected; Extracting a target image including glass defects from the glass image to be detected; Extracting characteristic parameters of glass defects from the target image; Taking the characteristic parameters of the glass defects as input, the defect type of the glass to be detected is identified by a glass defect detection model; the glass defect detection model is obtained by training a BP neural network through a plurality of glass image samples including glass defects; Extracting a target image including glass defects from the glass image to be detected includes: Detecting first glass defect edges of all glass defects in the glass image to be detected; For each glass defect: Obtaining grayscale values ​​of all pixels belonging to the first glass defect edge and calculating a mean and a standard deviation of the grayscale values ​​of the first glass defect edge; The difference between the gray value mean and the standard deviation is used as the segmentation threshold; Performing threshold segmentation on the first glass defect edge according to the segmentation threshold to extract a second glass defect edge of the glass defect, and taking an area enclosed by the second glass defect edge as a target area; using the image including the target area as a target image including glass defects; Extracting characteristic parameters of glass defects from the target image includes: Establishing a pixel coordinate system based on the target image; Obtaining the coordinates of pixels of all target areas in the target image; Determine a first centroid of each target area according to the coordinates of the pixels of each target area, and determine a second centroid of all target areas according to the coordinates of the pixels of all target areas, wherein the second centroid is a common centroid of all target areas; Obtain the area of ​​each target region, the total area of ​​all target regions, the perimeter of each target region, the total perimeter of all target regions, and the grayscale value of each pixel in the target region; The characteristic parameter of the glass defect is determined according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area.

2. The glass defect detection method based on BP neural network according to claim 1 is characterized in that: Determine the second centroids of all target areas according to the coordinates of the pixels of all target areas, including: Determine, according to the coordinates of the pixels of all the target areas, a first pixel at the top in the pixel coordinate system, a second pixel at the bottom in the pixel coordinate system, a third pixel at the leftmost end in the pixel coordinate system, and a fourth pixel at the rightmost end in the pixel coordinate system among the pixels of all the target areas; The centroid of an area enclosed by the first pixel, the second pixel, the third pixel and the fourth pixel is used as the second centroid.

3. The glass defect detection method based on BP neural network according to claim 2 is characterized in that: Determining a characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area includes: The characteristic parameters of glass defects are determined by the following formula: Among them, Xn is the horizontal coordinate of the first centroid of the nth target area, Yn is the vertical coordinate of the first centroid of the nth target area, Xc is the horizontal coordinate of the second centroid; Yc is the vertical coordinate of the second centroid, Sn is the area of ​​the nth target area, Sc is the total area of ​​all target areas, and N is the number of target areas.

4. The glass defect detection method based on BP neural network according to claim 1, characterized in that: Determining a characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area includes: The characteristic parameters of glass defects are determined by the following formula: Wherein, Pn is the perimeter of the nth target area, Sc is the total area of ​​all target areas, and N is the number of target areas.

5. The glass defect detection method based on BP neural network according to claim 1, characterized in that: Determining a characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area includes: Calculate the standard deviation of the areas of all target regions; The standard deviation of the areas of all target regions is taken as the characteristic parameter of glass defects.

6. The glass defect detection method based on BP neural network according to claim 1, characterized in that: Determining a characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area includes: Compare the grayscale values ​​of all pixels in all target areas to determine the maximum grayscale value of all pixels and the minimum grayscale value of all pixels; The difference between the maximum grayscale value of all pixels and the minimum grayscale value of all pixels is taken as the characteristic parameter of the glass defect.

7. The glass defect detection method based on BP neural network according to claim 1, characterized in that: Determining a characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area includes: The characteristic parameters of glass defects are determined by the following formula: Wherein, Gn is the gray value of the nth pixel in the target area, Gc is the gray value of the pixel at the first centroid of the target area, and N is the number of target areas.

8. The glass defect detection method based on BP neural network according to claim 1, characterized in that: Determining a characteristic parameter of the glass defect according to at least one of the first centroid, the second centroid, the area of ​​each target area, the total area of ​​all target areas, the perimeter of each target area, the total perimeter of all target areas, and the grayscale value of each pixel in the target area includes: The characteristic parameters of glass defects are determined by the following formula: And′=P (x) ×log2P (x) ; Among them, P(x) is the probability of occurrence of a pixel with a gray value of x, Mx is the number of pixels with a gray value of x, and M is the total number of pixels in the target area.

Citation Information

Cited By

  • Metal mesh defect detection method based on structure comparison information lamination

    CN115170520A

  • A metal mesh defect detection method based on structural contrast information stacking

    CN115170520B