A method and system for detecting microscopic defects on the surface of an optical element
The method uses dark field imaging and neural networks to enhance defect detection on optical elements by accurately identifying weak scratches and reducing background interference, improving detection reliability and precision.
Patent Information
- Application Number
- CN202411244384.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Existing edge detection methods for microscopic defects on optical elements struggle with low recognition accuracy due to weak scratches being buried in the background or extracting background information, affecting the reliability of defect detection.
A method involving dark field imaging, candidate edge pixel point identification, connected domain analysis, shape feature characterization, and neural network model integration to determine a customized gradient threshold for edge detection, enhancing defect recognition accuracy.
Improves the reliability and accuracy of detecting microscopic defects on optical elements by reducing the likelihood of weak scratches being missed and background noise interference, thereby enhancing the precision of defect detection.
Smart Images

Figure CN118781099B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and system for detecting microscopic defects on the surface of an optical element. Background Art
[0002] As the core component of the optical system, the processing quality of optical elements directly affects the stability and accuracy of the optical system. However, during the precision processing of optical elements such as grinding, polishing, and shaping, due to the limitations of process and technical conditions, various microscopic defects will inevitably appear on the surface of the optical elements, affecting the performance and service life of the optical elements.
[0003] In the process of detecting surface defects of optical components, it is usually necessary to perform edge detection processing on the collected surface images of optical components to highlight the characteristics of defects on the surface of optical components in the image. However, microscopic defects on the surface of optical components are also called weak scratches due to their relatively weak intensity. The grayscale value in the surface image of the optical component is close to the background. When edge detection is performed on the surface image of the optical component, if the low gradient threshold is set too high, it is easy to cause the weak scratches in the image to be buried in the background and not detected. If the low gradient threshold is set too low, the background information in the image will also be extracted, and the accuracy of the weak scratch information extraction in the surface image of the optical component cannot be guaranteed, which ultimately affects the recognition accuracy of subsequent surface microscopic defects of the optical component. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide a method and system for detecting microscopic defects on the surface of an optical element. The technical solutions adopted are as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for detecting microscopic defects on the surface of an optical element, the method comprising the following steps:
[0006] Collecting dark field images of the surfaces of the optical element to be inspected and the standard optical element;
[0007] Obtain a set of candidate edge pixel points in the surface dark field image; obtain each suspected defect pixel point of the optical element to be inspected based on the difference between the candidate edge pixel point set of the optical element to be inspected and the standard optical element; obtain each connected domain of the surface dark field image of the optical element to be inspected based on the distribution of the suspected defect pixel points;
[0008] Analyze the shape features of each connected domain to obtain the scratch suspicion degree of each connected domain; combine the scratch suspicion degree and the grayscale difference between the suspected defect pixel point and the background pixel point in the image to obtain the weak scratch suspicion degree of each suspected defect pixel point;
[0009] Based on the suspected degree and gradient of weak scratches of each suspected defect pixel, the low gradient threshold in the edge detection algorithm is determined, and edge detection is performed on the dark field image of the surface of the optical element to be inspected. Combined with the neural network model, the microscopic defect results on the surface of the optical element to be inspected are obtained.
[0010] In one embodiment, the candidate edge pixel set is all pixel points retained in the non-maximum suppression step when edge detection is performed on the surface dark field image.
[0011] In one embodiment, the determining of each suspected defective pixel includes:
[0012] The surface dark field images of the optical element to be inspected and the standard optical element are aligned to obtain the intersection of the candidate edge pixel point sets of the optical element to be inspected and the standard optical element, and the remaining pixel points after removing the intersection from the candidate edge pixel point set of the optical element to be inspected are used as suspected defective pixel points.
[0013] In one embodiment, the determination of each connected domain includes:
[0014] The surface dark field image of the optical element to be inspected is converted into a binary image based on all the suspected defect pixels, and connected domains are extracted from the binary image to obtain each connected domain.
[0015] In one embodiment, the determination of the scratch suspicion level includes:
[0016] The circularity of each connected domain is calculated, the aspect ratio of the minimum circumscribed rectangle of each connected domain is calculated, and the scratch suspicion degree is obtained based on the aspect ratio and the circularity.
[0017] In one embodiment, the difference between the aspect ratio and a preset aspect ratio threshold is calculated, and the ratio of the forward mapping value of the difference to the circularity is used as the scratch suspicion degree.
[0018] In one embodiment, the determination of the suspicion level of the weak scratch comprises:
[0019] Calculate the grayscale mean of all background pixels in the dark field image of the surface of the optical element to be inspected, calculate the difference between the grayscale value of each suspected defective pixel and the grayscale mean, record it as the first difference, and take the ratio of the scratch suspicion degree of the connected domain where each suspected defective pixel is located to the forward mapping value of the first difference as the weak scratch suspicion degree.
[0020] In one embodiment, the gradient low threshold is a fusion result of the gradient amplitude of all suspected defect pixels and the normalized value of the weak scratch suspicion degree.
[0021] In one embodiment, the combining of the neural network model to obtain the microscopic defect result of the surface of the optical element to be inspected includes:
[0022] A preset number of dark field images of the surface of the optical element containing weak scratch defects and not containing weak scratch defects are obtained respectively, and edge detection result images of all the dark field images of the surface are obtained by using an edge detection algorithm as training data of the neural network model;
[0023] The edge detection result image of the optical element to be detected is used as the input of the trained neural network model, and the output of the neural network model is the microscopic defect result on the surface of the optical element to be detected.
[0024] In a second aspect, an embodiment of the present application further provides a system for detecting microscopic defects on the surface of an optical element, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned methods when executing the computer program.
[0025] This application has at least the following beneficial effects:
[0026] The present application acquires a set of candidate edge pixel points in the surface dark field image by collecting surface dark field images of the optical element to be detected and the standard optical element; obtains each suspected defect pixel point of the optical element to be detected based on the difference between the candidate edge pixel point sets of the optical element to be detected and the standard optical element; obtains each connected domain of the surface dark field image of the optical element to be detected based on the distribution of the suspected defect pixel points, characterizes the pixel points corresponding to the surface microscopic defects of the optical element to be detected in the surface dark field image, and improves the reliability of the surface microscopic defect analysis of the optical element to be detected; further, analyzes the shape characteristics of each connected domain to obtain the scratch suspicion degree of each connected domain; combines the scratch suspicion degree and the grayscale difference between the suspected defect pixel point and the background pixel point in the image where it is located to obtain the weak scratch suspicion degree of each suspected defect pixel point, thereby improving the reliability of the surface microscopic defect analysis of the optical element to be detected. The recognition accuracy of the suspected weak scratch defect pixels in the candidate edge pixels in the edge detection algorithm of the surface dark field image of the detected optical element is improved; then, based on the weak scratch suspicion and gradient of each suspected defect pixel, the gradient low threshold in the edge detection algorithm is determined, and by analyzing the distribution characteristics of the suspected defect pixels, the possibility of the weak scratch pixels in the surface dark field image of the optical element to be detected being buried in the background and not detected is reduced, and the possibility of the background information in the surface dark field image of the optical element to be detected is also reduced, thereby improving the accuracy of the determination of the gradient low threshold in the edge detection algorithm; finally, edge detection is performed on the surface dark field image of the optical element to be detected, and the microscopic defect results of the surface of the optical element to be detected are obtained in combination with the neural network model, thereby improving the accuracy of the surface microscopic defect detection of the optical element to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0028] Figure 1 A flowchart of a method for detecting microscopic defects on the surface of an optical element provided in one embodiment of the present application;
[0029] Figure 2 A schematic diagram of a scratch defect in a binary image of a dark field image of a surface of an optical element;
[0030] Figure 3 Get the flow chart for the gradient low threshold. DETAILED DESCRIPTION
[0031] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the optical element surface micro defect detection method and system proposed in the present application, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0032] Unless defined otherwise, 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.
[0033] The specific scheme of the optical element surface micro defect detection method and system provided by the present application is described in detail below with reference to the accompanying drawings.
[0034] See also Figure 1 , which shows a flowchart of a method for detecting microscopic defects on the surface of an optical element provided by an embodiment of the present application, the method comprising the following steps:
[0035] S1, collecting dark field images of the surfaces of the optical element to be inspected and the standard optical element, and performing preprocessing.
[0036] In one embodiment of the present application, a microscopic scattering dark field imaging system is used to respectively collect surface dark field images of the optical element to be inspected and surface dark field images of the standard optical element. This is because the minimum defect size that can be detected by the microscopic scattering dark field imaging system on the surface of the optical element to be inspected is much smaller than the defect size detected under a bright field background, which is beneficial to the surface defect detection of the optical element to be inspected, wherein the standard optical element is an optical element of the same type and specification as the optical element to be inspected and has no surface microscopic defects after manual inspection. The microscopic scattering dark field imaging system mainly includes a CCD camera, a microscope objective, a ring-shaped LED lighting source, a detection platform, etc., which are specifically existing well-known technologies and will not be described in detail in this application.
[0037] Since the surface dark field image may be disturbed by environmental noise during the process of acquisition and transmission, in order to reduce the interference of noise data in the surface dark field image on subsequent image processing, in one embodiment of the present application, a bilateral filtering algorithm is used to perform denoising on the acquired surface dark field images to obtain a denoised surface dark field image A of the optical element to be inspected and a denoised surface dark field image B of the standard optical element, wherein the bilateral filtering algorithm is an existing well-known technology and the specific process will not be repeated here.
[0038] It should be noted that the implementer may select other existing feasible denoising algorithms according to actual conditions, and this application does not limit this.
[0039] S2, obtaining a set of candidate edge pixel points in the surface dark field image; obtaining each suspected defect pixel point of the optical element to be detected based on the difference between the candidate edge pixel point sets of the optical element to be detected and the standard optical element; and obtaining each connected domain of the surface dark field image of the optical element to be detected based on the distribution of the suspected defect pixel points.
[0040] In this embodiment, taking the Canny edge detection algorithm as an example, the gradient low threshold in the process of edge detection processing of the surface dark field image of the optical element using the Canny edge detection algorithm is adaptively adjusted.
[0041] The Canny edge detection algorithm includes four steps: Gaussian blur, image gradient calculation, non-maximum suppression, and double threshold boundary tracking. In the non-maximum suppression step, a group of candidate edge pixels will be retained for the subsequent double threshold boundary tracking step.
[0042] The surface dark field image A and the surface dark field image B are registered using a SURF-based image registration algorithm to obtain the corresponding pixel point in the surface dark field image B for each pixel point in the surface dark field image A. The SURF-based image registration algorithm is an existing well-known technology, and the specific process will not be repeated here. The implementer can choose other existing feasible image registration algorithms according to actual conditions, and this application does not impose any restrictions on this.
[0043] Taking the surface dark field image A as an example, the Canny edge detection algorithm is used to obtain a group of candidate edge pixel points retained in the non-maximum suppression step of the Canny edge detection algorithm of the surface dark field image A, forming a candidate edge pixel point set A1, which is used to characterize the surface contour of the optical element to be detected and the edge of the surface microscopic defects in the surface dark field image A. The set of pixel points corresponding to the surface contour and the edge of the surface microscopic defects is recorded as the candidate edge pixel point set A1 of the surface dark field image A. At the same time, the set of pixel points in the surface dark field image A that do not belong to the candidate edge pixel point set A1 is recorded as the background pixel point set AM of the surface dark field image A, wherein the Canny edge detection algorithm is an existing well-known technology, and the specific process will not be repeated here.
[0044] The same acquisition method as the candidate edge pixel set A1 is used to obtain the candidate pixel set B1 of the surface dark field image B, which is used to characterize the set of pixels corresponding to the edge of the surface contour of the standard optical element in the surface dark field image B.
[0045] The intersection AB between the candidate edge pixel point set A1 and the candidate edge pixel point set B1 is calculated, and the pixel point set A2 obtained by subtracting the intersection AB from the candidate edge pixel point set A1 is calculated to characterize the set of pixel points corresponding to the edge of the surface microscopic defects of the optical element to be detected in the candidate edge pixel point set A1 in the surface dark field image A, and each pixel point in the pixel point set A2 is recorded as each suspected defect pixel point.
[0046] In this embodiment, the pixel points in the surface dark field image A belonging to the pixel point set A2 are assigned 255, and the remaining pixel points are assigned 0, so as to obtain a binary image C after re-assigning the pixel points in the surface dark field image A, which is used to characterize the distribution of the pixel points corresponding to the edge of the surface microscopic defects of the optical element to be detected in the surface dark field image A. The implementer may use other methods to assign values to obtain a binary image according to actual conditions, and this application does not limit this.
[0047] The binary image C is processed using a morphological opening operation to obtain a binary image C1, so as to remove the pixel points corresponding to the small spots or small noise points in the surface dark field image A in the binary image C, wherein the morphological opening operation is an existing well-known technology, and the specific process is not described in detail in this application. The implementer may also choose other algorithms according to the actual situation, and this application does not impose any restrictions on this.
[0048] Connected domains are extracted from the binary image C1 to obtain connected domains of the binary image C1. Each connected domain represents a pixel point corresponding to a surface micro defect of the optical element to be detected in the surface dark field image A.
[0049] S3, analyzing the shape features of each connected domain to obtain the scratch suspicion of each connected domain; combining the scratch suspicion and the grayscale difference between the suspected defect pixel and the background pixel in the image to obtain the weak scratch suspicion of each suspected defect pixel.
[0050] Since scratches on the surface of optical components usually appear as long strips, the shape characteristics of each connected domain are analyzed. Figure 2 shown.
[0051] Taking the i-th connected domain Di of the binary image C1 as an example, the circularity Si of the connected domain Di is calculated. The closer the edge shape of the microscopic defect on the surface of the optical element to be detected corresponding to the connected domain Di is to a circle, the larger the circularity Si of the connected domain Di is, and the lower the possibility that the corresponding defect is a microscopic scratch defect.
[0052] The minimum circumscribed rectangle of the connected domain Di is obtained, the aspect ratio ki of the connected domain Di is calculated, and the scratch suspicion degree of the connected domain Di is determined based on the circularity Si and the aspect ratio ki of the connected domain Di.
[0053] Specifically, the difference between the aspect ratio ki of the connected domain Di and the preset aspect ratio threshold k is calculated, and the ratio of the forward mapping value of the difference to the circularity Si is determined as the scratch suspicion degree of the connected domain Di.
[0054] It should be noted that the difference indicates the degree of difference between two variables, which can be calculated by difference, absolute value of difference, ratio, etc.; forward mapping means that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases.
[0055] In this embodiment, the expression of the scratch suspicion degree Hi of the connected domain Di can be: , where ki represents the aspect ratio of the connected domain Di, k represents the preset aspect ratio threshold, in this embodiment k=4, the implementer can set it according to the actual situation, and this application does not impose any restrictions on this, and it is used to characterize the minimum aspect ratio of the edge of the scratch defect on the surface of the optical element; exp() represents an exponential function with a natural constant as the base, the purpose is to avoid the value of (ki-k) being a negative number that affects the calculation; Si represents the circularity of the connected domain Di.
[0056] The larger the aspect ratio of the edge of the micro defect on the surface of the optical element to be detected is compared to the minimum aspect ratio of the edge of the scratch defect on the surface of the optical element, the larger (ki-k) is, and the less the edge shape of the micro defect on the surface of the optical element to be detected corresponding to the connected domain Di is close to a circle, and the smaller the circularity Si is, the more suspected the connected domain Di is to be the pixel point corresponding to the edge of the scratch defect on the surface of the optical element to be detected, and the larger the scratch suspicion Hi of the connected domain Di is.
[0057] The scratch suspicion degree of each connected domain is obtained by using the same calculation method as that of the scratch suspicion degree of the connected domain Di.
[0058] Since the color of weak scratch defects among the scratch defects on the surface of the optical element is closer to that of the normal area on the surface of the optical element, the grayscale value of the pixel point corresponding to the edge of the weak scratch defect on the surface of the optical element to be detected in the surface dark field image A is closer to the grayscale value of the pixel point corresponding to the normal area on the surface of the optical element to be detected in the surface dark field image A.
[0059] Taking the j-th suspected defective pixel A1(j) as an example, the weak scratch suspicion R(j) of the pixel A1(j) is calculated, specifically: the grayscale mean of all pixels in the background pixel set AM is calculated, the difference between the grayscale value of the suspected defective pixel A1(j) and the grayscale mean is calculated, recorded as the first difference, and the ratio of the scratch suspicion of the connected domain where the suspected defective pixel A1(j) is located to the forward mapping value of the first difference is taken as the weak scratch suspicion of the pixel A1(j).
[0060] In this embodiment, the expression of the weak scratch suspicion R(j) of the pixel point A1(j) can be: , where Hi(j) represents the scratch suspicion of the connected domain where the pixel A1(j) is located in the binary image C1. If the pixel A1(j) is not in the connected domain, Hi(j) is assigned a value of 0; a(j) represents the gray value of the pixel A1(j); a represents the mean gray value of all pixels in the background pixel set AM; exp() represents an exponential function with a natural constant as the base, in order to prevent the value of (a(j)-a) from being negative and affecting the calculation.
[0061] The more suspected the pixel point A1(j) is to be the pixel point corresponding to the scratch defect on the surface of the optical element to be detected in the surface dark field image A, the greater the scratch suspicion Hi(j) of the connected domain where the pixel point A1(j) is located in the binary image C1, and the closer the grayscale value between the pixel point A1(j) and the pixel point corresponding to the normal area of the surface of the optical element to be detected in the surface dark field image A, the smaller (a(j)-a), the more suspected the pixel point A1(j) is to be the pixel point corresponding to the weak scratch defect among the scratch defects on the surface of the optical element to be detected in the surface dark field image A, and the greater the weak scratch suspicion R(j) of the pixel point A1(j).
[0062] The weak scratch suspicion degree of each suspected defective pixel point can be obtained by using the same calculation method as that of the weak scratch suspicion degree of the pixel point A1(j).
[0063] S4, based on the suspected degree and gradient of weak scratches of each suspected defect pixel, determine the low threshold of the gradient in the edge detection algorithm, perform edge detection on the dark field image of the surface of the optical element to be detected, and combine with the neural network model to obtain the micro defect results on the surface of the optical element to be detected.
[0064] The gradient amplitude calculated in the image gradient calculation step of the Canny edge detection algorithm for each suspected defect pixel is obtained, and the weak scratch suspicion degree of each suspected defect pixel is normalized using the softmax function. The gradient low threshold T of the surface dark field image A in the double threshold boundary tracking step of the Canny edge detection algorithm is calculated. Specifically, the gradient amplitude of all suspected defect pixels and the normalized value of the weak scratch suspicion degree are fused as the gradient low threshold T.
[0065] It should be noted that fusion means combining multiple variables, which can be calculated by addition, multiplication, averaging, etc.
[0066] In this embodiment, the expression of the gradient low threshold T can be , where d(j) represents the gradient amplitude of the jth suspected defect pixel; v(j) represents the normalized result of the weak scratch suspicion of the jth suspected defect pixel; and N represents the number of suspected defect pixels. The gradient low threshold acquisition flow chart is as follows: Figure 3 shown.
[0067] According to the obtained surface dark field image A in the dual threshold boundary tracking step of the Canny edge detection algorithm, the Canny edge detection algorithm is used to complete the edge detection processing of the surface dark field image A, and the edge detection image F after the edge detection processing of the surface dark field image A is obtained, wherein the Canny edge detection algorithm is an existing well-known technology, and the specific process is not repeated here.
[0068] M dark field images of the surface of the optical element containing weak scratch defects and M dark field images of the surface of the optical element not containing weak scratch defects are obtained respectively. In one embodiment of the present application, M=100, and the implementer can set it according to the actual situation, and the present application does not limit this. The same method as the surface dark field image A is used to perform edge detection processing on all the acquired surface dark field images respectively, and all images obtained after edge detection processing are used as training data of the convolutional neural network model. The images containing weak scratch defects in the training data are labeled as 1, and the images not containing weak scratch defects are labeled as 0. During the training process, the stochastic gradient descent method and the cross entropy loss function are used as the optimization algorithm and loss function of the convolutional neural network model respectively. The training of the convolutional neural network model is an existing well-known technology, and the specific process will not be repeated.
[0069] It should be noted that the implementer may also choose other existing feasible neural network models according to actual conditions, and this application does not impose any restrictions on this.
[0070] The edge detection image F is used as the input of the trained convolutional neural network model, and the output is the label of the edge detection image F. If the label is 1, it is determined that the optical component to be detected has a weak scratch defect. If the label is 0, it is determined that the optical component to be detected does not have a weak scratch defect.
[0071] Based on the same inventive concept as the above method, an embodiment of the present application also provides a system for detecting microscopic defects on the surface of an optical element, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above-mentioned methods for detecting microscopic defects on the surface of an optical element when executing the computer program.
[0072] In summary, the present application acquires a set of candidate edge pixel points in the surface dark field image by collecting surface dark field images of the optical element to be detected and the standard optical element; obtains each suspected defect pixel point of the optical element to be detected based on the difference between the candidate edge pixel point sets of the optical element to be detected and the standard optical element; obtains each connected domain of the surface dark field image of the optical element to be detected based on the distribution of the suspected defect pixel points, characterizes the pixel points corresponding to the surface microscopic defects of the optical element to be detected in the surface dark field image, and improves the reliability of the surface microscopic defect analysis of the optical element to be detected; further, analyzes the shape characteristics of each connected domain to obtain the scratch suspicion degree of each connected domain; combines the scratch suspicion degree and the grayscale difference between the suspected defect pixel point and the background pixel point in the image where it is located, to obtain the weak scratch suspicion degree of each suspected defect pixel point, and improves the reliability of the surface microscopic defect analysis of the optical element to be detected; The method improves the recognition accuracy of the suspected weak scratch defect pixels among the candidate edge pixels in the edge detection algorithm in the dark field image of the surface of the optical element to be detected; then, based on the weak scratch suspicion and gradient of each suspected defect pixel, the gradient low threshold in the edge detection algorithm is determined, and by analyzing the distribution characteristics of the suspected defect pixels, the possibility of the weak scratch pixels in the dark field image of the surface of the optical element to be detected being buried in the background and not detected is reduced, and the possibility of the background information in the dark field image of the surface of the optical element to be detected is also reduced, thereby improving the accuracy of the determination of the gradient low threshold in the edge detection algorithm; finally, edge detection is performed on the dark field image of the surface of the optical element to be detected, and combined with the neural network model, the microscopic defect results of the surface of the optical element to be detected are obtained, thereby improving the accuracy of the detection of surface microscopic defects of the optical element to be detected.
[0073] It should be noted that the above sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0074] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0075] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for detecting microscopic defects on the surface of an optical element, characterized in that: The method comprises the following steps: Collecting dark field images of the surfaces of the optical element to be inspected and the standard optical element; Obtain a set of candidate edge pixel points in the surface dark field image; obtain each suspected defect pixel point of the optical element to be inspected based on the difference between the candidate edge pixel point set of the optical element to be inspected and the standard optical element; obtain each connected domain of the surface dark field image of the optical element to be inspected based on the distribution of the suspected defect pixel points; Analyze the shape features of each connected domain to obtain the scratch suspicion degree of each connected domain; combine the scratch suspicion degree and the grayscale difference between the suspected defect pixel point and the background pixel point in the image to obtain the weak scratch suspicion degree of each suspected defect pixel point; Based on the suspected degree and gradient of weak scratches of each suspected defect pixel, the low gradient threshold in the Canny edge detection algorithm is determined, and edge detection is performed on the dark field image of the surface of the optical element to be detected. Combined with the neural network model, the microscopic defect results of the surface of the optical element to be detected are obtained; The determination of the suspected degree of the weak scratch includes: Calculate the grayscale mean of all background pixels in the dark field image of the surface of the optical element to be inspected, calculate the difference between the grayscale value of each suspected defective pixel and the grayscale mean, record it as the first difference, and use the ratio of the scratch suspicion degree of the connected domain where each suspected defective pixel is located to the forward mapping value of the first difference as the weak scratch suspicion degree; The gradient low threshold is a fusion result of the gradient amplitude of all suspected defect pixels and the normalized value of the weak scratch suspicion degree.
2. A method for detecting microscopic defects on the surface of an optical element as claimed in claim 1, characterized in that: The candidate edge pixel set is all the pixel points retained in the non-maximum suppression step when Canny edge detection is performed on the surface dark field image.
3. The method for detecting microscopic defects on the surface of an optical element according to claim 1, characterized in that: The determination of each suspected defective pixel point includes: The surface dark field images of the optical element to be inspected and the standard optical element are aligned to obtain the intersection of the candidate edge pixel point sets of the optical element to be inspected and the standard optical element, and the remaining pixel points after removing the intersection from the candidate edge pixel point set of the optical element to be inspected are used as suspected defective pixel points.
4. The method for detecting microscopic defects on the surface of an optical element according to claim 1, characterized in that: The determination of each connected domain includes: The surface dark field image of the optical element to be inspected is converted into a binary image based on all the suspected defect pixels, and connected domains are extracted from the binary image to obtain each connected domain.
5. The method for detecting microscopic defects on the surface of an optical element according to claim 1, characterized in that: The determination of the scratch suspicion degree includes: The circularity of each connected domain is calculated, the aspect ratio of the minimum circumscribed rectangle of each connected domain is calculated, and the scratch suspicion degree is obtained based on the aspect ratio and the circularity.
6. A method for detecting microscopic defects on the surface of an optical element as claimed in claim 5, characterized in that: The difference between the aspect ratio and a preset aspect ratio threshold is calculated, and the ratio of a forward mapping value of the difference to the circularity is used as the scratch suspicion degree.
7. The method for detecting microscopic defects on the surface of an optical element according to claim 1, characterized in that: The combined neural network model is used to obtain microscopic defect results on the surface of the optical element to be detected, including: A preset number of dark field images of the surface of the optical element containing weak scratch defects and not containing weak scratch defects are obtained respectively, and edge detection result images of all the dark field images of the surface are obtained by using an edge detection algorithm as training data of the neural network model; The edge detection result image of the optical element to be detected is used as the input of the trained neural network model, and the output of the neural network model is the microscopic defect result on the surface of the optical element to be detected.
8. An optical element surface microscopic defect detection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
