Automatic substrate glass surface defect detection method and system based on machine vision

By combining machine vision with multimodal data and graph neural networks, efficient and accurate detection of surface defects of substrate glass is achieved, solving the inefficiency and inaccuracy problems of traditional manual inspection and improving detection accuracy and stability.

CN120807388APending Publication Date: 2025-10-17无锡感声科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510662929.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Traditional manual visual inspection of substrate glass surface defects is time-consuming and labor-intensive, and the inspection results are inconsistent and inaccurate. Existing automated inspection methods have poor adaptability to complex defect morphologies, and manual inspection is easily affected by subjective factors, resulting in a high missed detection rate, especially low detection accuracy for defects on the glass edges.

Method used

A machine vision-based method is used, combining image, acoustic and thermal imaging data. Through multimodal feature fusion and graph neural network, line laser is used to generate light strips for glass edge contour analysis. Combined with sub-pixel algorithms and multi-task learning networks, precise positioning and type identification of defects are achieved, and final identification is achieved through cloud-based collaborative processing.

Benefits of technology

It improves the accuracy and robustness of defect detection, reduces labor costs, can detect complex defects quickly and stably, improves detection precision and efficiency, and reduces missed detection rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807388A_ABST
    Figure CN120807388A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic substrate glass surface defect detection method and an automatic substrate glass surface defect detection system based on machine vision, which can more comprehensively characterize the defect information of the substrate glass surface and improve the accuracy and robustness of defect detection by fusing the data of three modalities of image, acoustics and thermal imaging. Different modal data can complement different side features of the defect, and the defect detection performance can be improved. A topological relation between pixels is established by using the graph neural network, so that the structure and context information of the defect can be effectively extracted, and the overall feature of the defect is captured, not only limited to local pixel information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of detection methods, more particularly, it relates to a substrate glass surface defect automatic detection method and system based on machine vision. BACKGROUND

[0002] Substrate glass is an important component of panel display devices, and its surface quality directly affects the display effect. In the production process, various defects such as scratches, particles, stains, etc. may occur on the surface of the substrate glass, which will seriously affect the display quality and even cause the entire display device to be scrapped. The traditional manual visual detection method is time-consuming and laborious, and it is difficult to ensure the consistency and accuracy of the detection results. Therefore, an efficient and accurate automatic detection method is urgently needed to meet the requirements of modern production, and the development of machine vision technology provides strong support for automatic defect detection. Existing defect detection methods mainly include traditional methods based on image processing and intelligent methods based on deep learning. Traditional methods usually use image filtering, edge detection and other hand-designed image processing algorithms to locate and classify defect areas. However, these methods are sensitive to noise and complex background, and are difficult to adapt to variable defect morphology. At present, the precision of the results has always been the focus of attention in the measurement scheme of the gap between the screen and the main body of the mobile phone. The accuracy of the results directly determines the quality of the product. At present, the measurement methods used in factories are mainly simple methods with low precision such as visual inspection and caliper measurement. Moreover, manual operation is inevitably affected by dust and static electricity. From the results of assembly, the error in the size of the gap and the shift in the angle will cause the unqualified rate of the product to rise, waste raw materials, shorten the service life of the product, and reduce the user experience. In the glass manufacturing process, the glass is first formed by a calendering process, and then cut to obtain a glass sheet. However, the appearance size and shape quality of such a glass sheet cannot meet the quality requirements of users for assembly and use, especially in the 3C and other intelligent industries. This requires the glass sheet to be edge-ground, and the four edge portions and the transition with an arc are processed. However, during the subsequent edge grinding process, defects such as edge collapse and angle collapse may occur, and such glass is unqualified and needs to be selected out. In the prior art, the edge defect detection of the glass is mainly performed by manual online detection. However, manual detection has low accuracy and high omission rate, and is easily affected by subjective factors of the detection personnel, which may cause omission of glass defects, especially small distortion defects. Workers are prone to visual fatigue, especially during night shifts, and the stability is not high. Moreover, the labor cost is high. SUMMARY

[0003] (I) Technical problems solved

[0004] In view of the problems in the prior art, the present application provides a substrate glass surface defect automatic detection method and system based on machine vision to solve the technical problems mentioned in the background art.

[0005] (II) Technical solutions

[0006] To achieve the above-mentioned purpose, the present application provides the following technical solutions: a substrate glass surface defect automatic detection method based on machine vision, comprising the following steps:

[0007] Step one: acquire multi-modal data of the substrate glass surface and perform preprocessing, the multi-modal data including image data, acoustic data and thermal imaging data, perform feature extraction on the preprocessed image data, preprocessed acoustic data and preprocessed thermal imaging data, and perform cross-modal feature fusion on the extracted image features, acoustic features and thermal imaging features to obtain a fused feature map;

[0008] Step two: irradiate a line laser of a specified wavelength on the surface of the screen of the device to be detected to generate a light bar; wherein the light bar is composed of reflected light from the screen glass surface, diffuse reflected light from the main body of the device to be detected, and dark parts generated by the gap between the screen glass and the main body of the device to be detected;

[0009]

[0009] Step three: extract the glass edge contour, then perform curvature smoothing and curvature upsampling on the extracted contour points to fit the outer contour of the glass edge, and realize defect detection of the existing edge collapse, convex point, sawtooth cutting and other forms of the glass edge;

[0010] Step four: scan and image the glass edge in the measurement area to obtain a glass edge image; extract the glass edge contour of the glass edge image;

[0011] Step five: acquire an image containing the light bar through an industrial camera; according to the light and dark pixel information of the light bar in the image, obtain the gap width between the screen glass and the main body of the device to be detected through a sub-pixel algorithm;

[0012] Step six: input the fused feature map into a pre-constructed graph neural network, establish the topological relationship between pixels in the fused feature map through node embedding and graph convolution operation, extract the structure and context information of the defect, and obtain a topological feature map representing the defect structure; concatenate the topological feature map with the fused feature map, input into a multi-task learning network, and use the multi-task learning network to simultaneously complete the segmentation of the defect area and the preliminary classification of the defect type in the concatenated feature map, to obtain the segmented suspected defect area and the corresponding defect type.

[0013] The application is further provided that step six is to locate defects in the segmented suspected defect area by using a pre-trained target detection model, determine the accurate position of the defect by boundary box regression, and obtain a target defect area image; upload the target defect area image to the cloud, use the defect detection model deployed in the cloud to accurately identify the defect type of the target defect area, and obtain the final defect detection result.

[0014] The application is further provided that the gap width between the screen glass and the device body to be detected is obtained by sub-pixel algorithm according to the light strip bright-dark pixel information in the image, including: obtaining the number of pixel points of the dark part in a specified row; obtaining the gray level of the gray part between the reflected light pixel and the dark part pixel in the specified row; obtaining the gap width between the screen glass and the device body to be detected as the sum of the number of pixel points of the dark part and the reciprocal of the gray level; obtaining the gray level of the gray part between the reflected light pixel and the dark part pixel in the specified row, including: dividing the pixel value 0-255 into n equal parts in proportion, then the pixel value range corresponding to the nth gray level is [M*256 / n-1, (M+1)*256 / n]; the value range of n is 2-256, and 256 is divisible by n; the value range of M is 1-255; the minimum value of M*256 / n-1 is 0, and the maximum value of (M+1)*256 / n is 255.

[0015] The application is further provided that the extraction of the edge contour is divided into four parts: the first part is to perform projection processing on the glass edge image in the measurement area; the projection processing method is to scan the glass edge to be detected in the vertical direction to obtain projection lines distributed on both sides of the glass edge, and then obtain the average concentration of each projection line; the average concentration waveform of the projection line is called a projection waveform. The second part is to perform differential processing based on the projection waveform to obtain the corresponding differential waveform; the third part is to correct the differential value in the differential waveform; and the fourth part is to perform sub-pixel processing.

[0016] The application is further provided that the fused feature map is input into a pre-constructed graph neural network model, the topological relationship between pixels in the fused feature map is established through node embedding and graph convolution operation, the structure and context information of the defect are extracted, and a topological feature map representing the defect structure is obtained, including: dividing the fused feature map into multiple local regions, each local region corresponding to a node in the graph, and obtaining node features by performing average pooling on the pixel features in each local region.

[0017] The application is further configured to construct an adjacency matrix of the graph according to the similarity between the node features, the elements of the adjacency matrix representing the topological connection relationship between the nodes; construct positive and negative sample pairs, wherein the positive sample pairs are composed of different pixel features of the same local region, and the negative sample pairs are composed of graph representations of different local regions; design a graph contrast loss function by minimizing the distance between the positive sample pairs and maximizing the distance between the negative sample pairs; construct a joint loss function based on the obtained graph contrast loss function and graph classification loss function; update the parameters of the graph neural network model based on the joint loss function through a gradient optimization algorithm, and finally obtain a trained graph neural network model; update and propagate the node features using the trained graph neural network model, learn the high-level feature representation of the node by aggregating the neighborhood information of the node; and aggregate the high-level features of the node into graph-level feature representation by using graph pooling operation, extract the structure and context information of the defect, and obtain a topological feature graph representing the structure of the defect.

[0018] The application is further configured that the sub-pixel processing process is to find out three adjacent pixels centered on the highest peak point of the differential waveform, and perform interpolation operation in the waveform formed by the three pixels to obtain a new edge profile.

[0019] The application is further configured that the structure light generator emits the linear laser of the specified wavelength.

[0020] The application is further configured that the included angle formed by the linear laser and the edge of the equipment to be detected is a right angle.

[0021] A substrate glass surface defect automatic detection system based on machine vision, comprising:

[0022] The first unit is configured to acquire multi-modal data of the substrate glass surface and perform preprocessing, the multi-modal data including image data, acoustic data and thermal imaging data, perform feature extraction on the preprocessed image data, preprocessed acoustic data and preprocessed thermal imaging data respectively, perform cross-modal feature fusion on the extracted image features, acoustic features and thermal imaging features, and obtain a fused feature map;

[0023] The second unit is configured to input the fused feature map into a pre-constructed graph neural network, establish topological relationships between pixels in the fused feature map through node embedding and graph convolution operation, extract structure and context information of the defect, and obtain a topological feature map representing the structure of the defect; cascade the topological feature map and the fused feature map, and input them into a multi-task learning network, use the multi-task learning network to simultaneously complete segmentation of the defect area and preliminary classification of the defect type in the cascaded feature map, and obtain a segmented suspected defect area and a corresponding defect type;

[0024] The third unit is configured to locate defects in the segmented suspected defect area by using a pre-trained target detection model, determine the accurate position of the defects by boundary box regression, and obtain a target defect area image; upload the target defect area image to the cloud, and use a defect detection model deployed on the cloud to accurately identify the defect type of the target defect area, and obtain a final defect detection result.

[0025] (III) Beneficial Effects

[0026] Compared with the prior art, the substrate glass surface defect automatic detection method and system based on machine vision provided by the present application have the following beneficial effects:

[0027] The present application can more comprehensively represent the defect information of the substrate glass surface by fusing the data of three modalities of images, acoustics and thermal imaging, and improve the accuracy and robustness of defect detection. Different modal data can complement the different side features of defects, which is beneficial to improve the performance of defect detection. The topological relationship between pixels is established by using a graph neural network, which can effectively extract the structure and context information of defects and capture the overall features of defects, rather than being limited to local pixel information. This helps to more accurately detect and locate complex defect morphologies. The defect detection task is divided into two stages, and this end-cloud collaborative processing mode can balance the computing resources and detection accuracy, complete the preliminary processing on the edge device, reduce the computing pressure on the cloud, and at the same time use the powerful computing power of the cloud for more detailed defect recognition. Through the multi-task learning network, the defect region segmentation and preliminary classification are completed at the same time, which can share the parameters of the feature extractor, promote each other, and improve the generalization ability and detection efficiency of the model. The target detection model is used to accurately locate the defect area, and then the defect detection model of the cloud is used for accurate identification, which can obtain more accurate defect type and position information, and provide reliable basis for subsequent defect processing. In addition, the glass edge defect detection method and system based on machine vision of the present application can segment and extract the edge of the glass based on machine vision, and quickly and stably find out defects such as corner collapse, jagged edge and convex point on the edge of the glass through edge analysis algorithm. The detection precision is high, the size specification is controllable, the labor cost is reduced, the performance is excellent, and the use is convenient. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 FIG. 1 is a schematic diagram of the overall structure of the substrate glass surface defect automatic detection method and system based on machine vision in the present application. DETAILED DESCRIPTION

[0029] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0030] It should be noted that all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs unless otherwise specifically defined herein.

[0031] In the present application, unless otherwise specified, the orientation such as "upper", "lower" is generally directed to the direction shown in the drawings, or is directed to the vertical, perpendicular or gravity direction; similarly, for the convenience of understanding and description, "left", "right" is generally directed to the left and right shown in the drawings; "inner", "outer" refers to the inner and outer relative to the contour of each component itself, but the above orientation words are not used to limit the present application.

[0032] Referring to Figure 1 , the method for automatically detecting surface defects of substrate glass based on machine vision comprises the following steps:

[0033] Step one: acquire multi-modal data of the substrate glass surface and pre-process, the multi-modal data includes image data, acoustic data and thermal imaging data, the pre-processed image data, pre-processed acoustic data and pre-processed thermal imaging data are respectively subjected to feature extraction, and the extracted image features, acoustic features and thermal imaging features are subjected to cross-modal feature fusion to obtain a fused feature map;

[0034] Step two: irradiate a line laser of a specified wavelength on the surface of the screen of the device to be detected to generate a light bar; wherein the light bar is composed of reflected light from the screen glass surface, diffuse reflected light from the main body of the device to be detected, and dark parts generated by the gap between the screen glass and the main body of the device to be detected;

[0035] Step three: by extracting the glass edge contour, then respectively performing curvature smoothing processing and curvature upsampling processing on the extracted contour points to fit the outer contour of the glass edge, realizing the detection of defects such as edge collapse, convex point and sawtooth cutting existing in the glass edge;

[0036] Step four: scan the glass edge in the measurement area to obtain a glass edge image; extract the glass edge contour of the glass edge image;

[0037] Step five: acquire an image containing the light bar through an industrial camera; according to the light and dark pixel information of the light bar in the image, obtain the gap width between the screen glass and the main body of the device to be detected through a sub-pixel algorithm;

[0038] Step six: input the fused feature map into a pre-constructed graph neural network, establish the topological relationship between the pixels in the fused feature map through node embedding and graph convolution operation, extract the structure and context information of the defect, and obtain a topological feature map representing the defect structure; concatenate the topological feature map with the fused feature map, input into a multi-task learning network, and use the multi-task learning network to simultaneously complete the segmentation of the defect area and the preliminary classification of the defect type in the concatenated feature map, to obtain the segmented suspected defect area and the corresponding defect type.

[0039] Embodiment 2:

[0040] In the above embodiment 1, in step six, the suspected defect area after segmentation is located using a pre-trained target detection model, and the precise position of the defect is determined by bounding box regression to obtain an image of the target defect area; the image of the target defect area is uploaded to the cloud, and the defect detection model deployed on the cloud is used to accurately identify the defect type of the target defect area to obtain the final defect detection result; according to the light and dark pixel information of the light strips in the image, the width of the gap between the screen glass and the main body of the device to be detected is obtained by a sub-pixel algorithm, including: obtaining the number of pixels in the dark part in a specified row; obtaining the grayscale level of the gray part between the reflected light pixel and the dark part pixel in the specified row; obtaining the width of the gap between the screen glass and the main body of the device to be detected as the sum of the number of pixels in the dark part and the inverse of the grayscale level; obtaining The grayscale levels of the gray area between the reflected light pixel and the dark pixel in the specified row include: dividing the pixel value 0-255 into n equal parts in equal proportion, then the pixel value range corresponding to the nth grayscale level is [M×256 / n-1, (M+1)×256 / n]; the value range of n is 2-256, and 256 is divisible by n; the value range of M is 1-255; the minimum value of M×256 / n-1 is 0, and the maximum value of (M+1)×256 / n is 255; the extraction of the edge contour is divided into four parts: the first part is to project the glass edge image in the measurement area; the projection processing method is: scanning the glass edge to be detected in the vertical direction to obtain projection lines distributed on both sides of the glass edge, and then obtaining the average concentration of each projection line; the average concentration waveform of the projection line is called the projection waveform.The second part is to obtain a corresponding differential waveform by differentiating the projection waveform; the third part is to correct the differential value in the differential waveform; and the fourth part is to perform sub-pixel processing; the fused feature map is input into a pre-constructed graph neural network model, a topological relationship between pixels in the fused feature map is established through node embedding and graph convolution operations, structure and context information of the defect are extracted, and a topological feature map representing the structure of the defect is obtained, including: the fused feature map is divided into a plurality of local regions, each local region corresponds to a node in the graph, node features are obtained by performing average pooling on pixel features in each local region; an adjacency matrix of the graph is constructed according to the similarity between the node features, and elements of the adjacency matrix represent the topological connection relationship between the nodes; positive and negative sample pairs are constructed, wherein the positive sample pairs are composed of different pixel features in the same local region, and the negative sample pairs are composed of graph representations of different local regions; a graph contrast loss function is designed by minimizing the distance between the positive sample pairs and maximizing the distance between the negative sample pairs; a joint loss function is constructed based on the obtained graph contrast loss function and graph classification loss function; parameters of the graph neural network model are updated based on the joint loss function through a gradient optimization algorithm, and finally a trained graph neural network model is obtained; the trained graph neural network model is used to update and propagate the node features, high-level feature representations of the nodes are learned by aggregating neighborhood information of the nodes; graph pooling operations are used to aggregate the high-level features of the nodes into feature representations at the graph level, structure and context information of the defect are extracted, and a topological feature map representing the structure of the defect is obtained; the sub-pixel processing process is to find 3 adjacent pixels centered on the highest peak point of the differential waveform, and perform interpolation operation in the waveform formed by the 3 pixels to obtain a new edge contour; the line laser of the specified wavelength is emitted by the structured light generator; the included angle between the line laser and the edge of the device to be detected is a right angle.

[0041] Embodiment 3

[0042] A substrate glass surface defect automatic detection system based on machine vision, comprising:

[0043] A first unit is configured to acquire multi-modal data of a substrate glass surface and perform preprocessing, the multi-modal data including image data, acoustic data, and thermal imaging data, perform feature extraction on the preprocessed image data, preprocessed acoustic data, and preprocessed thermal imaging data, respectively, perform cross-modal feature fusion on the extracted image features, acoustic features, and thermal imaging features, and obtain a fused feature map;

[0044] The second unit is configured to input the fused feature map into a pre-constructed graph neural network, establish a topological relationship between pixels in the fused feature map through node embedding and graph convolution operation, extract structure and context information of the defect, and obtain a topological feature map representing the structure of the defect; and cascade the topological feature map and the fused feature map, input the cascaded feature map into a multi-task learning network, and simultaneously complete segmentation of a defect region and preliminary classification of a defect type in the cascaded feature map by using the multi-task learning network, to obtain a segmented suspected defect region and a corresponding defect type.

[0045] The third unit is configured to perform defect positioning on the segmented suspected defect region by using a pre-trained target detection model, determine an accurate position of the defect by boundary box regression, and obtain a target defect region image; upload the target defect region image to a cloud, and perform accurate identification of a defect type of the target defect region by using a defect detection model deployed on the cloud, to obtain a final defect detection result.

[0046] Although the embodiments of the present application have been shown and described, it is to be understood that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.

Claims

1. A method for automatically detecting defects on a glass substrate surface based on machine vision, comprising the following steps: Step 1: Acquire and preprocess multimodal data of the substrate glass surface, wherein the multimodal data includes image data, acoustic data, and thermal imaging data; extract features from the preprocessed image data, acoustic data, and thermal imaging data; perform cross-modal feature fusion on the extracted image features, acoustic features, and thermal imaging features to obtain a fused feature map; Step 2: Irradiate the screen surface of the device to be tested with a line laser of a specified wavelength to generate a light stripe; wherein the light stripe is composed of light reflected from the screen glass surface, diffusely reflected light from the main body of the device to be tested, and a dark area generated by the gap between the screen glass and the main body of the device to be tested; Step 3: By extracting the glass edge contour, and then performing curvature smoothing and curvature upsampling on the extracted contour points, the outer edge contour of the glass edge is fitted, and defects such as chipping, convex points, and sawtooth cuts on the glass edge can be detected; Step 4: Scan and image the glass edge within the measurement area to obtain a glass edge image; extract the glass edge contour from the glass edge image; Step 5: Acquire an image containing the light strip using an industrial camera; and obtain the width of the gap between the screen glass and the main body of the device to be inspected using a sub-pixel algorithm based on the light and dark pixel information of the light strip in the image; Step 6: Input the fused feature map into the pre-built graph neural network, establish the topological relationship between the pixels in the fused feature map through node embedding and graph convolution operations, extract the structure and context information of the defect, and obtain a topological feature map that represents the defect structure; cascade the topological feature map and the fused feature map, and input them into the multi-task learning network. Use the multi-task learning network to simultaneously complete the segmentation of the defect area in the cascaded feature map and the preliminary classification of the defect type, and obtain the segmented suspected defect area and the corresponding defect type.

2. The method for automatically detecting substrate glass surface defects based on machine vision according to claim 1, wherein: In step 6, the segmented suspected defect area is located using a pre-trained target detection model, and the precise position of the defect is determined by bounding box regression to obtain an image of the target defect area; The image of the target defect area is uploaded to the cloud, and the defect detection model deployed on the cloud is used to accurately identify the defect type of the target defect area to obtain the final defect detection result.

3. The method for automatically detecting defects on a glass substrate surface based on machine vision according to claim 2, wherein: According to the light stripe and dark pixel information in the image, obtaining the gap width between the screen glass and the main body of the device to be detected through a sub-pixel algorithm includes: obtaining the number of pixels in the dark part in a specified row; obtaining the grayscale level of the gray part between the reflected light pixel and the dark part pixel in the specified row; obtaining the gap width between the screen glass and the main body of the device to be detected as the sum of the number of pixels in the dark part and the inverse of the grayscale level; obtaining the grayscale level of the gray part between the reflected light pixel and the dark part pixel in the specified row includes: dividing the pixel value 0-255 into n equal parts in equal proportion, then the pixel value range corresponding to the nth grayscale level is [M×256 / n-1, (M+1)×256 / n]; the value range of n is 2-256, and 256 is divisible by n; the value range of M is 1-255; the minimum value of M×256 / n-1 is 0, and the maximum value of (M+1)×256 / n is 255.

4. The method for automatically detecting substrate glass surface defects based on machine vision according to any one of claims 1 to 3, wherein: The edge contour extraction process consists of four steps: the first involves projecting the glass edge image within the measurement area. This projection processing involves scanning the glass edge vertically to obtain projection lines distributed on both sides of the glass edge, and then calculating the average concentration of each projection line. The average concentration waveform of the projection lines is called the projection waveform. The second step involves performing differential processing based on the projection waveform to obtain the corresponding differential waveform. The third step involves correcting the differential value within the differential waveform. The fourth step involves performing sub-pixel processing.

5. The method for automatically detecting defects on a glass substrate surface based on machine vision according to claim 4, wherein: The fused feature map is input into a pre-built graph neural network model. Through node embedding and graph convolution operations, the topological relationship between pixels in the fused feature map is established, the structure and context information of the defect are extracted, and a topological feature map representing the defect structure is obtained. The method includes: dividing the fused feature map into multiple local areas, each local area corresponds to a node in the graph, and obtaining node features by averaging the pixel features in each local area.

6. The method for automatically detecting substrate glass surface defects based on machine vision according to claim 5, wherein: An adjacency matrix of the graph is constructed according to the similarity between node features, and the elements of the adjacency matrix represent the topological connection relationship between nodes; positive and negative sample pairs are constructed, where the positive sample pairs are composed of different pixel features of the same local area, and the negative sample pairs are composed of graph representations of different local areas. By minimizing the distance between positive sample pairs and maximizing the distance between negative sample pairs, a graph comparison loss function is designed, and a joint loss function is constructed based on the obtained graph comparison loss function and graph classification loss function. Based on the joint loss function, the parameters of the graph neural network model are updated through the gradient optimization algorithm, and finally a trained graph neural network model is obtained; the trained graph neural network model is used to update and propagate node features, and the high-level feature representation of the node is learned by aggregating the neighborhood information of the node; the graph pooling operation is used to aggregate the high-level features of the node into a graph-level feature representation, and the structure and context information of the defect are extracted to obtain a topological feature map representing the defect structure.

7. The method for automatically detecting substrate glass surface defects based on machine vision according to claim 1, wherein: The sub-pixel processing process is to find three adjacent pixels centered on the highest peak point of the differential waveform, and perform interpolation calculations on the waveform composed of these three pixels to obtain a new edge contour.

8. The method for automatically detecting substrate glass surface defects based on machine vision according to claim 1, wherein: A structured light generator is used to emit a line laser of the specified wavelength.

9. The method for automatically detecting substrate glass surface defects based on machine vision according to claim 1, wherein: The angle formed by the line laser and the edge of the device to be detected is a right angle.

10. The present invention also includes a system for automatically detecting defects on the surface of glass substrates based on machine vision, which is characterized by: include: The first unit is configured to obtain and preprocess multimodal data of a glass substrate surface, the multimodal data including image data, acoustic data, and thermal imaging data, perform feature extraction on the preprocessed image data, the preprocessed acoustic data, and the preprocessed thermal imaging data, respectively, and perform cross-modal feature fusion on the extracted image features, acoustic features, and thermal imaging features to obtain a fused feature map; The second unit is used to input the fused feature map into a pre-built graph neural network, establish the topological relationship between the pixels in the fused feature map through node embedding and graph convolution operations, extract the structure and context information of the defect, and obtain a topological feature map representing the defect structure; cascade the topological feature map with the fused feature map and input it into a multi-task learning network. The multi-task learning network is used to simultaneously complete the segmentation of the defect area and the preliminary classification of the defect type in the cascaded feature map, and obtain the segmented suspected defect area and the corresponding defect type; The third unit is used to locate the suspected defect area after segmentation using a pre-trained target detection model, determine the exact location of the defect through bounding box regression, and obtain the target defect area image; The image of the target defect area is uploaded to the cloud, and the defect detection model deployed on the cloud is used to accurately identify the defect type of the target defect area to obtain the final defect detection result.