Optical glass edge defect detection method and system

Through four digital optical imaging devices surrounding optical glass detection, combined with the FCN network and self-attention mechanism, the automation and accuracy problems of optical glass edge defect detection are solved, and objective discrimination standards and full-link automated production are achieved.

CN119941690BActive Publication Date: 2025-08-26XUZHOU LIANCHAO PHOTOELECTRIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510059386.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-08-26
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The existing optical glass defect detection mainly relies on manual detection, which is time-consuming and labor-intensive, and there is no objective judgment standard. Moreover, when based on computer vision, a single digital optical imaging device has a limited detection range, making it difficult to detect the surroundings of the edge of the optical glass.

Method used

Four digital optical imaging devices are used to uniformly distribute the optical glass around the optical glass, and four edge images are acquired. The target image is generated and then spliced. The self-attention mechanism and the fully connected neural network are used to calculate the defect confidence to achieve automated detection.

Benefits of technology

It realizes objective and quantitative defect identification standards, improves detection accuracy, solves the problem of limited detection range, has low time and space complexity, and supports full-link automated production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941690B_ABST
    Figure CN119941690B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting optical glass edge defects, comprising: using four digital optical camera devices to acquire four optical glass edge images; grayscale processing each of the four optical glass edge images to generate four grayscale images; segmenting each of the four grayscale images using an FCN network model, retaining only the optical glass edge portion to generate four target images; horizontally splicing the four target images to generate a spliced ​​image; extracting the pixel grayscale values ​​of each column in the vertical direction of the spliced ​​image, converting them into N feature vectors of dimension M, and then performing self-attention calculations to generate N hidden vectors that are input into a fully connected neural network model; generating N defect confidences; and determining whether the optical glass has edge defects based on the defect confidences. The present invention achieves automated defect detection for optical glass edges with high accuracy and low spatiotemporal complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of optical glass detection, and in particular to a method and system for detecting edge defects of optical glass. Background Art

[0002] With the development of society, optical glass has been widely used in many industries, and industrial demand has gradually increased. Since the traditional production model can no longer meet the growing industrial demand, the automated production model has gradually replaced the traditional production model.

[0003] However, the current detection of optical glass defects mainly relies on manual inspection, which judges optical glass defects based on the experience and eyesight of the inspector. This method is time-consuming and labor-intensive, relies on the experience of the inspector, and has no objective judgment criteria. In addition, when performing defect detection on the edge of optical glass based on computer vision, it is necessary to inspect all around the edge of the optical glass. However, the detection range of a single digital optical camera device is relatively limited, making it difficult to detect all around the edge of the optical glass. Summary of the Invention

[0004] In response to the above-mentioned technical deficiencies, the purpose of the present invention is to provide a method and system for detecting optical glass edge defects, aiming to solve the problem that the existing optical glass defect detection mainly relies on manual detection, which is time-consuming and labor-intensive, and has no objective judgment criteria. In addition, when performing defect detection on the edge of optical glass based on computer vision, the detection range of a single digital optical camera device is relatively limited, making it difficult to detect all around the edge of the optical glass.

[0005] In view of the above problems, the present application provides a method and system for detecting edge defects of optical glass.

[0006] In a first aspect disclosed in the present application, a method for detecting edge defects in optical glass is provided, the method comprising the following steps:

[0007] Step 1: Using an adsorption device to adsorb the optical glass, suspending the optical glass horizontally in the air, and using four digital optical camera devices to capture four images of the edge of the optical glass. The four digital optical camera devices are placed on the same horizontal plane as the optical glass and are evenly distributed around the optical glass.

[0008] Step 2: Grayscale the four optical glass edge images to generate four grayscale images. Segment the four grayscale images using the pre-trained FCN network model, retaining only the optical glass edge portion to generate four target images.

[0009] Step 3: stitch the four target images together horizontally to generate a stitched image;

[0010] Step 4: Extract the pixel grayscale value of each column in the vertical direction of the stitched image and convert it into N feature vectors with a dimension of M, where N is the width of the stitched image and M is the height of the stitched image;

[0011] Step 5: Perform self-attention calculations on the N feature vectors of dimension M to generate N hidden vectors. These N hidden vectors are sequentially input into the pre-trained fully connected neural network model to generate N defect confidence levels, where the defect confidence level has a value range of (0, 1).

[0012] Step 6: Perform numerical statistics on the N defect confidence levels. If the number of defect confidence levels less than 0.5 among the N defect confidence levels reaches 0.2N, the optical glass is determined to be an unqualified product with edge defects.

[0013] Preferably, the step 2 specifically includes the following steps:

[0014] Step 2.1: Use formula (1) to perform weighted summation of the values ​​of each pixel in the red, green, and blue channels of the four optical glass edge images. The result of the weighted summation of each pixel is used as the grayscale value of each pixel to generate four grayscale images, where R is the value of the red channel, G is the value of the green channel, B is the value of the blue channel, and H is the grayscale value:

[0015] H = 0.257R + 0.504G + 0.098B + 16 Formula (1);

[0016] Step 2.2: Segment the four grayscale images using the pre-trained FCN network model. The pre-trained FCN network model is used to segment the background and the edge of the optical glass in the grayscale image.

[0017] Step 2.3: Crop and remove the background portion of the four grayscale images, retaining only the edge of the optical glass to generate four target images.

[0018] Preferably, step 4 specifically includes the following steps:

[0019] Step 4.1: Extract the pixel grayscale value of the i-th column in the vertical direction of the stitched image Where i = 1, 2, ..., N, is used to indicate the column number;

[0020] Step 4.2: Convert the pixel grayscale value of each column in the vertical direction of the spliced ​​image into a feature vector of N dimensions M

[0021] Preferably, the step 5 specifically includes the following steps:

[0022] Step 5.1: Calculate the cosine similarity between each pair of N feature vectors using formula (2), where j = 1, 2, ..., N, used to indicate the column number, s i,j Used to represent vector X i and X j The cosine similarity between:

[0023]

[0024] Step 5.2: Use formula (3) to perform normalization and generate self-attention scores, where a i,j Used to represent vector X i and X j Self-attention score between:

[0025]

[0026] Step 5.3: Use formula (4) to perform weighted summation using self-attention scores, where Y i Used to represent the hidden vector:

[0027]

[0028] Step 5.4: Transform the N hidden vectors Y i The pre-trained fully connected neural network model is input in sequence, and the fully connected neural network model outputs N defect confidences respectively. The fully connected neural network model includes an input layer, two hidden layers and an output layer.

[0029] The second aspect disclosed in the present application provides an optical glass edge defect detection system, which is used in the above-mentioned optical glass edge defect detection method, and the system includes:

[0030] An optical camera module, wherein the optical glass is adsorbed by an adsorption device so that the optical glass is suspended horizontally, and four digital optical camera devices are used to capture four images of the edge of the optical glass. The four digital optical camera devices are placed on the same horizontal plane as the optical glass and are evenly distributed around the optical glass.

[0031] A preprocessing module is used to grayscale the four optical glass edge images to generate four grayscale images, and segment the four grayscale images using a pre-trained FCN network model to retain only the optical glass edge portion to generate four target images;

[0032] A stitching module, configured to stitch the four target images together horizontally to generate a stitched image;

[0033] A conversion module is used to extract the pixel grayscale value of each column in the vertical direction of the stitched image and convert it into N feature vectors with a dimension of M, where N is the width of the stitched image and M is the height of the stitched image;

[0034] A confidence module, which is used to perform a self-attention mechanism calculation on N feature vectors of dimension M to generate N hidden vectors, and sequentially input the N hidden vectors into a pre-trained fully connected neural network model to generate N defect confidences, where the value range of the defect confidence is (0, 1);

[0035] A determination module is used to perform numerical statistics on N defect confidence levels. If the number of defect confidence levels less than 0.5 among the N defect confidence levels reaches 0.2N, the optical glass is determined to be an unqualified product with edge defects.

[0036] The third aspect disclosed in the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned optical glass edge defect detection method when executing the computer program.

[0037] The fourth aspect disclosed in the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for detecting edge defects of optical glass when executed by a processor.

[0038] The fifth aspect disclosed in the present application provides a computer program product, including a computer program or instructions, which implement the steps of the above-mentioned optical glass edge defect detection method when executed by a processor.

[0039] The beneficial effects of the present invention are:

[0040] (1) It solves the problem of optical glass defect detection currently relying mainly on manual labor, and has objective and quantitative judgment standards, which is conducive to accelerating the realization of full-link automated production of optical glass.

[0041] (2) Four digital optical camera devices are evenly distributed around the optical glass and placed on the same horizontal plane as the optical glass to obtain four images of the edge of the optical glass, which solves the problem that the detection range of a single digital optical camera device is limited and it is difficult to detect the edges of the optical glass.

[0042] (3) The self-attention mechanism is used to detect defects based on the inherent differences of the optical glass edge, which has high accuracy and low time and space complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0044] Figure 1 The figure is an overall flow chart of an optical glass edge defect detection method.

[0045] Figure 2 This is an overall structural diagram of an optical glass edge defect detection system. DETAILED DESCRIPTION

[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0047] like Figure 1 As shown, an embodiment of the present application provides a method for detecting edge defects of optical glass, the method comprising the following steps:

[0048] Step 1: Using an adsorption device to adsorb the optical glass, suspending the optical glass horizontally in the air, and using four digital optical camera devices to capture four images of the edge of the optical glass. The four digital optical camera devices are placed on the same horizontal plane as the optical glass and are evenly distributed around the optical glass.

[0049] Step 2: Grayscale the four optical glass edge images to generate four grayscale images. Segment the four grayscale images using the pre-trained FCN network model, retaining only the optical glass edge portion to generate four target images.

[0050] Step 3: stitch the four target images together horizontally to generate a stitched image;

[0051] Step 4: Extract the pixel grayscale value of each column in the vertical direction of the stitched image and convert it into N feature vectors with a dimension of M, where N is the width of the stitched image and M is the height of the stitched image;

[0052] Step 5: Perform self-attention calculations on the N feature vectors of dimension M to generate N hidden vectors. These N hidden vectors are sequentially input into the pre-trained fully connected neural network model to generate N defect confidence levels, where the defect confidence level has a value range of (0, 1).

[0053] Step 6: Perform numerical statistics on the N defect confidence levels. If the number of defect confidence levels less than 0.5 among the N defect confidence levels reaches 0.2N, the optical glass is determined to be an unqualified product with edge defects.

[0054] Furthermore, the step 2 specifically includes the following steps:

[0055] Step 2.1: Use formula (1) to perform weighted summation of the values ​​of each pixel in the red, green, and blue channels of the four optical glass edge images. The result of the weighted summation of each pixel is used as the grayscale value of each pixel to generate four grayscale images, where R is the value of the red channel, G is the value of the green channel, B is the value of the blue channel, and H is the grayscale value:

[0056] H = 0.257R + 0.504G + 0.098B + 16 Formula (1);

[0057] Step 2.2: Segment the four grayscale images using the pre-trained FCN network model. The pre-trained FCN network model is used to segment the background and the edge of the optical glass in the grayscale image.

[0058] Step 2.3: Crop and remove the background portion of the four grayscale images, retaining only the edge of the optical glass to generate four target images.

[0059] Furthermore, the step 4 specifically includes the following steps:

[0060] Step 4.1: Extract the pixel grayscale value of the i-th column in the vertical direction of the stitched image Where i = 1, 2, ..., N, is used to indicate the column number;

[0061] Step 4.2: Convert the pixel grayscale value of each column in the vertical direction of the spliced ​​image into a feature vector of N dimensions M

[0062] Furthermore, the step 5 specifically includes the following steps:

[0063] Step 5.1: Calculate the cosine similarity between each pair of N feature vectors using formula (2), where j = 1, 2, ..., N, used to indicate the column number, s i,j Used to represent vector X i and X j The cosine similarity between:

[0064]

[0065] Step 5.2: Use formula (3) to perform normalization and generate self-attention scores, where a i,j Used to represent vector X i and X j Self-attention score between:

[0066]

[0067] Step 5.3: Use formula (4) to perform weighted summation using self-attention scores, where Y i Used to represent the hidden vector:

[0068]

[0069] Step 5.4: Transform the N hidden vectors Y i The pre-trained fully connected neural network model is input in sequence, and the fully connected neural network model outputs N defect confidences respectively. The fully connected neural network model includes an input layer, two hidden layers and an output layer.

[0070] Specifically, the training data set of the fully connected neural network model is constructed as follows: four optical glass edge images corresponding to two thousand optical glasses are collected, and the corresponding N hidden vectors are calculated in sequence according to steps 2 to 5. The hidden vectors corresponding to the positions of the defective parts are manually labeled respectively. The labeling method is one-hot vector labeling, 1 indicates that there is no defect, and 0 indicates that there is no defect. The training objective function is the binary cross entropy loss function.

[0071] In summary, the optical glass edge defect detection method provided by the embodiments of the present application has the following technical effects:

[0072] (1) It solves the problem of optical glass defect detection currently relying mainly on manual labor, and has objective and quantitative judgment standards, which is conducive to accelerating the realization of full-link automated production of optical glass.

[0073] (2) Four digital optical camera devices are evenly distributed around the optical glass and placed on the same horizontal plane as the optical glass to obtain four images of the edge of the optical glass, which solves the problem that the detection range of a single digital optical camera device is limited and it is difficult to detect the edges of the optical glass.

[0074] (3) The self-attention mechanism is used to detect defects based on the inherent differences of the optical glass edge, which has high accuracy and low time and space complexity.

[0075] Based on the same inventive concept as the method for detecting edge defects of optical glass in the aforementioned embodiment, Figure 2As shown, the present application provides an optical glass edge defect detection system, the system comprising:

[0076] An optical camera module, wherein the optical glass is adsorbed by an adsorption device so that the optical glass is suspended horizontally, and four digital optical camera devices are used to capture four images of the edge of the optical glass. The four digital optical camera devices are placed on the same horizontal plane as the optical glass and are evenly distributed around the optical glass.

[0077] A preprocessing module is used to grayscale the four optical glass edge images to generate four grayscale images, and segment the four grayscale images using a pre-trained FCN network model to retain only the optical glass edge portion to generate four target images;

[0078] A stitching module, configured to stitch the four target images together horizontally to generate a stitched image;

[0079] A conversion module is used to extract the pixel grayscale value of each column in the vertical direction of the stitched image and convert it into N feature vectors with a dimension of M, where N is the width of the stitched image and M is the height of the stitched image;

[0080] A confidence module, which is used to perform a self-attention mechanism calculation on N feature vectors of dimension M to generate N hidden vectors, and sequentially input the N hidden vectors into a pre-trained fully connected neural network model to generate N defect confidences, where the value range of the defect confidence is (0, 1);

[0081] A determination module is used to perform numerical statistics on N defect confidence levels. If the number of defect confidence levels less than 0.5 among the N defect confidence levels reaches 0.2N, the optical glass is determined to be an unqualified product with edge defects.

[0082] Through the above detailed description of an optical glass edge defect detection method in this specification, those skilled in the art can clearly understand an optical glass edge defect detection system in this embodiment. Since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For relevant matters, please refer to the method section.

[0083] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned optical glass edge defect detection method when executing the computer program.

[0084] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned optical glass edge defect detection method are implemented.

[0085] In one embodiment, a computer program product is provided, comprising a computer program or instructions, which implement the steps of the above-mentioned optical glass edge defect detection method when executed by a processor.

[0086] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are 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.

[0087] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting edge defects of optical glass, characterized in that: The method comprises the following steps: Step 1: Using an adsorption device to adsorb the optical glass, suspending the optical glass horizontally in the air, and using four digital optical camera devices to capture four images of the edge of the optical glass. The four digital optical camera devices are placed on the same horizontal plane as the optical glass and are evenly distributed around the optical glass. Step 2: Grayscale the four optical glass edge images to generate four grayscale images. Segment the four grayscale images using the pre-trained FCN network model, retaining only the optical glass edge portion to generate four target images. Step 3: stitch the four target images together horizontally to generate a stitched image; Step 4: Extract the pixel grayscale value of each column in the vertical direction of the stitched image and convert it into N feature vectors with a dimension of M, where N is the width of the stitched image and M is the height of the stitched image; Step 5: Perform self-attention calculations on the N feature vectors of dimension M to generate N hidden vectors. These N hidden vectors are sequentially input into the pre-trained fully connected neural network model to generate N defect confidence levels, where the defect confidence level has a value range of (0, 1). Step 6: Perform numerical statistics on the N defect confidence levels. If the number of defect confidence levels less than 0.5 among the N defect confidence levels reaches 0.2N, the optical glass is determined to be an unqualified product with edge defects.

2. The optical glass edge defect detection method according to claim 1, wherein: The step 2 specifically includes the following steps: Step 2.1: Use formula (1) to perform weighted summation of the values ​​of each pixel in the red, green, and blue channels of the four optical glass edge images. The result of the weighted summation of each pixel is used as the grayscale value of each pixel to generate four grayscale images, where R is the value of the red channel, G is the value of the green channel, B is the value of the blue channel, and H is the grayscale value: H = 0.257R + 0.504G + 0.098B + 16 Formula (1); Step 2.2: Segment the four grayscale images using the pre-trained FCN network model. The pre-trained FCN network model is used to segment the background and the edge of the optical glass in the grayscale image. Step 2.3: Crop and remove the background portion of the four grayscale images, retaining only the edge of the optical glass to generate four target images.

3. The optical glass edge defect detection method according to claim 2, wherein: The step 4 specifically includes the following steps: Step 4.1: Extract the pixel grayscale value of the i-th column in the vertical direction of the stitched image Where i = 1, 2, ..., N, is used to indicate the column number; Step 4.2: Convert the pixel grayscale value of each column in the vertical direction of the spliced ​​image into a feature vector of N dimensions M 4. The optical glass edge defect detection method according to claim 3, wherein: The step 5 specifically includes the following steps: Step 5.1: Calculate the cosine similarity between each pair of N feature vectors using formula (2), where j = 1, 2, ..., N, used to indicate the column number, s i,j Used to represent vector X i and X j The cosine similarity between: Step 5.2: Use formula (3) to perform normalization and generate self-attention scores, where a i,j Used to represent vector X i and X j Self-attention score between: Step 5.3: Use formula (4) to perform weighted summation using self-attention scores, where Y i Used to represent the hidden vector: Step 5.4: Transform the N hidden vectors Y i The pre-trained fully connected neural network model is input in sequence, and the fully connected neural network model outputs N defect confidences respectively. The fully connected neural network model includes an input layer, two hidden layers and an output layer.

5. An optical glass edge defect detection system, comprising: An optical camera module, wherein the optical glass is adsorbed by an adsorption device so that the optical glass is suspended horizontally, and four digital optical camera devices are used to capture four images of the edge of the optical glass. The four digital optical camera devices are placed on the same horizontal plane as the optical glass and are evenly distributed around the optical glass. A preprocessing module is used to grayscale the four optical glass edge images to generate four grayscale images, and segment the four grayscale images using a pre-trained FCN network model to retain only the optical glass edge portion to generate four target images; A stitching module, configured to stitch the four target images together horizontally to generate a stitched image; A conversion module is used to extract the pixel grayscale value of each column in the vertical direction of the stitched image and convert it into N feature vectors with a dimension of M, where N is the width of the stitched image and M is the height of the stitched image; A confidence module, which is used to perform a self-attention mechanism calculation on N feature vectors of dimension M to generate N hidden vectors, and sequentially input the N hidden vectors into a pre-trained fully connected neural network model to generate N defect confidences, where the value range of the defect confidence is (0, 1); A determination module is used to perform numerical statistics on N defect confidence levels. If the number of defect confidence levels less than 0.5 among the N defect confidence levels reaches 0.2N, the optical glass is determined to be an unqualified product with edge defects.

6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the optical glass edge defect detection method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the optical glass edge defect detection method according to any one of claims 1 to 4 are implemented.

8. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the optical glass edge defect detection method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Glass boundary defect detection method and device, terminal and storage medium

    CN110596120A

  • Glass surface defect detection method and system based on unsupervised pre-training

    CN115880298A