Training methods, detection methods, equipment and media for impurity detection models

Through deep learning of the optical surface impurity detection model, convolutional neural networks are used to detect impurities on the optical surface, which solves the problem of surface impurity detection of precision optical devices, improves detection accuracy and stability, and achieves highly accurate identification of optical surface impurities.

CN113312964BActive Publication Date: 2024-10-15ZHEJIANG SCI-TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110405271.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-15
Publication Date
2024-10-15
Estimated Expiration
2041-04-15

AI Technical Summary

Technical Problem

Surface impurities and defects in precision optical devices will affect their working performance and lead to faster damage and shortened service life in high-power laser applications. It is difficult for existing technology to efficiently detect and identify impurities on optical surfaces.

Method used

Using the deep learning optical surface impurity detection model training method, the training samples containing impurities are input into the neural network through the convolutional neural network (CNN), and the predicted optical signals and positions are used for classification, the loss function is calculated and the neural network parameters are adjusted to improve Precision and accuracy of impurity detection.

Benefits of technology

It achieves a more stable and highly accurate optical surface impurity detection, transforms the regression problem into a classification problem, enhances the training stability and accuracy of the neural network, and verifies the wide applicability of the detection method through generalization testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113312964B_ABST
    Figure CN113312964B_ABST
Patent Text Reader

Abstract

The present application relates to a training method, a detection method, a device and a medium for an impurity detection model. The training method includes: inputting a training sample containing impurities into a neural network to be trained, obtaining an output result of the impurity position of the training sample, wherein the training sample includes known position information and known optical signals of the impurities, and the output result includes the predicted position and predicted optical signals of the impurities of the training sample; classifying the predicted optical signals and the predicted positions to obtain a first probability distribution; classifying the known position information and known optical signals of the impurities to form known classification data of known impurities, and one-hot encoding the known classification data to obtain a second probability distribution; using the first probability distribution and the second probability distribution, calculating the loss function; adjusting the grid parameters of the neural network to reduce the loss function. The neural network has strong stability and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of detection technology, and in particular to a training method, a detection method, a device and a medium for an impurity detection model. Background Art

[0002] Precision optical components are an indispensable part of modern optical experiments and laser applications. For example, optical crystals, spectroscopes, optical glass slides, etc. are widely used in quantum optics and quantum computing and quantum communication experiments based on photons. In daily life, everything from mobile phone lenses and LCD screens to satellite navigation and laser positioning cannot be separated from optical devices such as optical films. However, the surface of precision optical devices is often the most important but most vulnerable to damage. A large number of studies have shown that impurities and defects on the optical surface will not only greatly affect the working performance of the optical device, but also, in high-power laser applications, optical surfaces with impurities and defects are more susceptible to laser damage, thereby greatly reducing the service life of the optical device. Therefore, the detection of impurities on the optical surface is an important research topic. Summary of the invention

[0003] The present application provides a training method, a detection method, a device and a medium for an impurity detection model, which can improve the precision and accuracy of detecting light on surface impurities.

[0004] In order to solve the above technical problems, the present application provides a training method for a deep learning optical surface impurity detection model, comprising:

[0005] Inputting a training sample containing impurities into a neural network to be trained, and obtaining an output result of the impurity position of the training sample, wherein the training sample includes known position information and known optical signals of the impurities, and the output result includes a predicted position and predicted optical signal of the impurities of the training sample;

[0006] Classifying the predicted optical signal and the predicted position to obtain a first probability distribution;

[0007] Classifying the known position information of the impurities and the known optical signals to form known classification data of the known impurities, and one-hot encoding the known classification data to obtain a second probability distribution;

[0008] Calculate the loss function using the first probability distribution and the second probability distribution;

[0009] Adjust the grid parameters of the neural network to reduce the loss function.

[0010] The present application also includes a second technical solution, a neural network detection method, comprising:

[0011] Inputting a test sample containing impurities into a neural network to obtain test information of the impurity position of the test sample, wherein the test sample includes known information of the impurity position of the test sample;

[0012] Comparing the impurity position detection information with the known information of the impurity position of the detection sample to obtain the accuracy of the impurity position;

[0013] If the accuracy of the impurity position is greater than a preset value, it is determined that the neural network has generalization ability.

[0014] The present application also includes a third technical solution, a deep learning optical surface impurity detection method, comprising:

[0015] Inputting the medium into a neural network, wherein the neural network is trained using the method of any one of claims 1 to 5;

[0016] Determine whether there are impurities on the surface of the medium;

[0017] If yes, determine the location of the impurities on the surface of the medium.

[0018] The present application also includes a fourth technical solution, an electronic device, including a memory and a processor coupled to each other, the processor being used to execute computer instructions stored in the memory to implement the above method.

[0019] The present application also includes a fifth technical solution, a storage medium storing instructions, which implement the above method when the instructions are executed.

[0020] Beneficial effects:

[0021] The training method of the embodiment of the present application classifies the predicted optical signal and the predicted position, and classifies the known position information of the impurity and the known optical signal, so that the coordinate z 0 The regression problem is transformed into a discrete coordinate z c classification problem, making the training of neural networks more stable and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1a It is a schematic diagram of an embodiment of a theoretical model of deep learning optical surface impurity detection in the present application;

[0023] Figure 1b Light intensity distribution diagram of the detection signal intensity after passing through a small impurity on the optical surface in the embodiment of the present application;

[0024] Figure 2 is a schematic diagram of a convolutional neural network according to an embodiment of the present application;

[0025] Figure 3aIt is a schematic diagram of an embodiment of the change of the loss function with epoch during the training process of the deep learning optical surface impurity detection model of the present application;

[0026] Figure 3b It is a schematic diagram of an embodiment of the change of accuracy with epoch during the training process of the deep learning optical surface impurity detection model of the present application;

[0027] Figure 3c is a predicted probability distribution diagram of a network trained by a reflection signal according to an embodiment of the present application;

[0028] Figure 3d The predicted probability distribution diagram of the network trained by the transmission signal of the embodiment of the present application;

[0029] Figure 4a A generalization accuracy graph of impurity size generalization in the detection method of the neural network in the embodiment of the present application;

[0030] Figure 4b A prediction probability graph under typical data of impurity size generalization in the detection method of the neural network in the embodiment of the present application;

[0031] Figure 4c A generalization accuracy graph of the generalization of the impurity refractive index in the detection method of the neural network in the embodiment of the present application;

[0032] Figure 4d A predicted probability graph under typical data of generalization of impurity refractive index in the detection method of the neural network in the embodiment of the present application;

[0033] Figure 4e A generalization accuracy graph of impurity shape generalization in the detection method of the neural network in the embodiment of the present application;

[0034] Figure 4f A predicted probability graph under typical data of impurity shape generalization in the detection method of the neural network in the embodiment of the present application;

[0035] Figure 5 It is a schematic diagram of a fully connected neural network;

[0036] Figure 6a It is a generalization accuracy graph of network impurity size under reflection signal training of two neural networks in this application;

[0037] Figure 6b It is a generalization accuracy graph of network impurity size under transmission signal training of two neural networks in this application;

[0038] Figure 6c It is a generalization accuracy graph of the network impurity refractive index under the reflection signal training of the two neural networks of the present application;

[0039] Figure 6dIt is a generalization accuracy graph of the network impurity refractive index under the transmission signal training of the two neural networks of the present application;

[0040] Figure 6e It is a generalization accuracy graph of network impurity shape under reflection signal training of two neural networks in this application;

[0041] Figure 6f It is a generalization accuracy graph of network impurity shape under transmission signal training of two neural networks in this application;

[0042] Figure 7a It is a schematic diagram of an embodiment of the change of the loss function with epochs during the training process of the concave impurity deep learning optical surface impurity detection model in the embodiment of the present application;

[0043] Figure 7b Yes, the generalization accuracy graph of the impurity size of the concave impurity in the embodiment of the present application;

[0044] Figure 8 It is a flowchart of an embodiment of a training method for a deep learning optical surface impurity detection model of the present application;

[0045] Fig. 9 This is a flow chart of another embodiment of the training method of the deep learning optical surface impurity detection model of the present application.

[0046] Fig.10 It is a flow chart of an embodiment of a neural network detection method of the present application;

[0047] Fig.11 This is a flow chart of an embodiment of a deep learning optical surface impurity detection method of the present application;

[0048] Fig.12 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0049] Fig.13 It is a structural diagram of an embodiment of an application storage medium. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] The terms "first", "second", "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second", "third" can expressly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the embodiments of this application, all directional indications (such as up, down, left, right, front, back ...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the steps or units listed, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.

[0052] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments without conflict.

[0053] In the embodiment of the present application, the establishment of the deep learning optical surface impurity detection theoretical model is as follows:

[0054] A pulsed laser polarized along the z direction irradiates an optical medium vertically along the x direction. The thickness of the medium is L. Figure 1a As shown. There is a protruding impurity somewhere on the surface of the medium, and the size of the impurity is l. The electric field intensity E(r,t) of the pulsed laser satisfies the wave equation:

[0055]

[0056] Among them, r is the spatial coordinate, c is the speed of light, and ε(r) is the relative dielectric constant, whose distribution inside and outside the medium is

[0057]

[0058] The relationship between ε(r) and the optical refractive index n is: To simplify theoretical calculations, the embodiment of the present application constrains impurities to move only in the z direction, and considers that the field strength E(r, t) is uniformly distributed in the y direction, thereby reducing equation (1.1) to a two-dimensional wave equation of {x, z}. Next, the embodiment of the present application uses the Euler-Fourier spectral method to numerically solve equation (1.1), and the initial condition of the evolution equation is

[0059]

[0060] The initial electric field E(x,z,t=0) is a series of wave vectors k along the x direction. m The linear superposition of plane waves has a Gaussian distribution in the z direction, and σ is the width of the Gaussian wave packet. For the optical system described by equation (1.1), the following length scale relationship exists: σLλl, that is, the width σ of the Gaussian wave packet and the thickness L of the medium are much larger than the wavelength λ of the electromagnetic wave and the impurity size l, and the minimum unit length Δ of the spatial differential dispersion is smaller than all the above length scales, which makes the numerical calculation amount of the embodiment of the present application huge. In the actual calculation process, the embodiment of the present application selects Δ=80nm as the length unit, and takes σ=2L=100Δ. The impurity side length l can vary between Δ and 5Δ, that is, the impurity size varies between 55 and 275nm. The total solution space of the system is x∈[-256Δ,256Δ], z∈[-512Δ,512Δ]. In order to facilitate the calculation, the embodiment of the present application selects the incident light as several wave vectors k. m The superposition of plane waves, where k m =2πm / 512Δ, where m∈[40,60] is an integer. It can be seen that the wavelength of the incident light is in the visible light range λ≈470 700nm, and the light pulse width is 1 / ω SD Indicates that represents the standard deviation of the spectrum distribution of N = 21 frequency modes. In the selected mode, the pulse width is about 0.5×10 -15 s, i.e. 0.5 femtoseconds. Another advantage of choosing such a wave packet is that the signal can be transmitted from the source to the receiver without distortion within the system evolution time. The selection of the above system parameters can control the amount of calculation within a reasonable range.

[0061] After the detection pulse is reflected and transmitted through the medium, in the embodiment of the present application, the intensity signals of the reflected light (R) and the transmitted light (T) are collected before and after the medium, respectively. ∝|E(x,z,t)| 2 , and integrate it in the x direction to obtain the distribution I along the z direction R,T (z). Figure 1b The intensity of the detected signal (solid line) is shown after a small impurity l = Δ diffraction on the optical surface. R,T (z), where Figure 1b The solid line represents the incident light signal, and the dashed line and dotted line represent the reflected light I R and transmitted light I T .from Figure 1b It can be seen that the initial pulse distribution I is a standard Gaussian distribution, and the intensity signal of the reflected and transmitted signals will form a spatial oscillation after being diffracted by impurities. It contains impurity information, and decoding it can obtain the position information of the impurity. However, it is obvious that simply observing the oscillation curve is not enough to accurately locate the impurity position. The embodiment of the present application uses a neural network to learn the functional relationship between the impurity position and the light intensity distribution after diffraction by the impurity, so that the network can learn from the intensity signal I R,T The ability to extract impurity location information.

[0062] In one embodiment of the present application, Figure 8 As shown, a training method for a deep learning optical surface impurity detection model is provided, comprising:

[0063] S110: Input the training sample containing impurities into the neural network to be trained to obtain the output result of the impurity position of the training sample, wherein the training sample includes the known position information and known optical signal of the impurity, and the output result includes the predicted position and predicted optical signal of the impurity of the training sample.

[0064] In the embodiment of the present application, the training data set is first generated by the method of numerically solving the wave equation. The impurity parameters selected for the training data are square impurities with a side length of l = 4Δ and an impurity refractive index of Different data in G are obtained by changing the position of impurities, where each set of data contains the optical pulse signal I R,T (z) and the corresponding impurity position z c The training data set of the embodiment of the present application includes known position information and known optical signals of training samples containing impurities.

[0065] In the embodiment of the present application, the training data set G train The size of the training dataset is N train =800, in the embodiment of the present application, the neural network is a convolutional neural network (CNN). Figure 2As shown in the figure, the neural network consists of an input layer 11 (Input layer), a convolutional layer 12 (Convolutional layers), a flatten layer 13 (Flatten layer), a fully connected layer 14 (Denselayer) and an output layer 15 (Output layer), wherein the convolutional layer 12 has three layers, with depths of 10, 20 and 50 respectively, a convolution kernel size of 20, and "Relu" is selected as the activation function. After each convolutional layer 12, an average pooling layer is added to reduce the number of neurons, and the pooling size is 2; the number of neurons in the fully connected layer is 48, and the activation function is also the "Relu" function; the number of neurons in the output layer is 32, and the activation function is the "softmax" function, thereby converting the output into a probability distribution P(z c |I). The total trainable parameters in the neural network are about 5.7×10 5 indivual.

[0066] S120: Classify the predicted optical signal and the predicted position to obtain a first probability distribution.

[0067] In the embodiment of the present application, the predicted position information is converted into a class number of the predicted position according to a preset number of categories, and the predicted optical signal is matched to the optical intensity signal corresponding to the class number of the predicted position to obtain a first probability distribution.

[0068] In the embodiment of the present application, the center of mass z of the constrained impurity 0 In the range where the detection light signal intensity is large, 0 ∈[-64Δ,64Δ], then z 0 The coordinate range is further divided into 32 classes, each class corresponds to an integer class number z c ∈[1,32], which is consistent with the real coordinate z of the impurity 0 The relationship between c = int[z 0 / 4Δ]+17, where int means rounding, and the data set G is a data pair consisting of intensity signals and impurity class numbers. The above is only an example. In other embodiments, 0 The coordinate range is further divided into other number of classes.

[0069] In the embodiment of the present application, the input of the neural network is I R,T (z), and the output is a c The probability distribution P on R,T (z c |I), which reflects the classification prediction probability distribution made by the network after analyzing the specified input signal I.

[0070] S130: Classify the known position information and known optical signals of the impurities to form known classification data of the known impurities, and one-hot encode the known classification data to obtain a second probability distribution.

[0071] In an embodiment of the present application, impurities are constrained within the detection light signal intensity range of the neural network, and the location range of the impurities is divided into a preset number of categories.

[0072] The known position information is converted into a class number of the known position according to a preset number of categories, and the known optical signal is matched to the optical intensity signal corresponding to the class number of the known position to obtain the known classification data of the known impurity, and the classification data includes the class number of the known position and the corresponding optical intensity.

[0073] The actual impurity category number z in the impurity known classification data c One-hot encoding is performed to obtain the second probability distribution, where Q i (z c |I) is the second probability distribution function.

[0074] S140: Calculate the loss function using the first probability distribution and the second probability distribution.

[0075] The loss function used in this embodiment of the application is the cross entropy

[0076]

[0077] Where Q i (z c |I) is the real class number of the impurity in the impurity known classification data z c The one-hot encoding second probability distribution function. The cross entropy essentially reflects the relative distance between the network's predicted first probability distribution P and the true second probability distribution Q. The smaller the cross entropy, the closer the network's prediction is to the true value.

[0078] In addition, during the training process, the embodiment of the present application measures whether the network training is effective by monitoring the average accuracy (VA). VA is defined as

[0079]

[0080] in

[0081]

[0082] From the definition, we can see that a i It means that for a given test data i, its P(z c |I) Whether the class with the highest probability is consistent with the true class of impurity, if it is consistent, it contributes 1, otherwise it does not contribute. VA is ai The average of all test data. Therefore, for training, the loss function L decreases while the monitored average accuracy VA increases.

[0083] S150: Adjust the grid parameters of the neural network to reduce the loss function.

[0084] In the present application embodiment, Figure 3a As shown in the figure, the loss function L changes with the number of training epochs during the training process, where epoch is defined as the number of times all training data flows through the neural network as a whole. In Figure 3a, the solid line and the dotted line are the independent reflection signal I R and the transmission signal I T The training curve is used as the network input. The results show that the network can R or I T The network learns to extract the impurity position information and converges in about 40 epochs, which is manifested by the loss function L dropping to near zero. The network convergence indicates that the training is completed.

[0085] After the training is completed, the embodiment of the present application selects any set of test data and plots the predicted first probability distribution like Figure 3c and 3d As shown, it can be seen that the network's first prediction probability distribution is highly concentrated, indicating that the network has a high confidence in its judgment of the impurity location.

[0086] The training method of the embodiment of the present application classifies the predicted optical signal and the predicted position, and classifies the known position information of the impurity and the known optical signal, so that the coordinate z 0 The regression problem is transformed into a discrete coordinate z c classification problem, making the training of neural networks more stable and accurate.

[0087] In another embodiment of the present application, Fig. 9 As shown, a training method for a deep learning optical surface impurity detection model includes:

[0088] S110: Input the training sample containing impurities into the neural network to be trained to obtain the output result of the impurity position of the training sample, wherein the training sample includes the known position information and known optical signal of the impurity, and the output result includes the predicted position and predicted optical signal of the impurity of the training sample.

[0089] The same as the above embodiment, no further details will be given here.

[0090] S120: Classify the predicted optical signal and the predicted position to obtain a first probability distribution.

[0091] The same as the above embodiment, no further details will be given here.

[0092] S130: Classify the known position information and known optical signals of the impurities to form known classification data of the known impurities, and one-hot encode the known classification data to obtain a second probability distribution.

[0093] S140: Calculate the loss function using the first probability distribution and the second probability distribution.

[0094] The same as the above embodiment, no further details will be given here.

[0095] S150: Adjust the grid parameters of the neural network to reduce the loss function.

[0096] The same as the above embodiment, no further details will be given here.

[0097] S160: Supervise the training process and obtain supervised test data.

[0098] In the embodiment of the present application, the training process is supervised to obtain monitoring accuracy.

[0099] In the present application embodiment, Figure 3b As shown in Figure 1, the curve of monitoring accuracy VA changing with the number of training epochs during training is presented, where epoch is defined as the number of times all training data flows through the neural network as a whole. Figure 3b In the figure, the solid line and the dotted line are independent reflection signals I R and the transmission signal I T The training curve that is used as input to the network.

[0100] S170: Determine that the supervised test data reaches a preset value and stop training.

[0101] In the embodiment of the present application, it is determined that the monitoring accuracy reaches 100%, and the training is stopped, such as Figure 3b As shown, when VA reaches about 100% at about 40 epochs, the neural network converges, indicating that the training is completed. In other embodiments, when the monitoring accuracy reaches 90%, it can be determined that the neural network converges, indicating that the training is completed and the training is stopped.

[0102] In one embodiment of the present application, Fig.10 As shown, a neural network detection method includes:

[0103] S210: Inputting a test sample containing impurities into a neural network to obtain detection information of the impurity position of the test sample, wherein the test sample includes known information of the impurity position of the test sample.

[0104] In the embodiment of the present application, the "detection samples containing impurities" include: impurity training samples whose number of impurity edges is different odd and even numbers, impurity training samples of various shapes, impurity training samples of various refractive indices, and any one or more combinations of protrusions where impurities are located on the surface of the medium and pits where impurities are located on the surface of the medium.

[0105] The present embodiment tests the generalization ability of the trained network in the following three aspects: generalization of impurity size l, generalization of impurity refractive index n, and generalization of impurity shape (geometry). The results of these three generalization tests are presented in Figure 4a , 4c and 4e, where Figure 4a The fixed impurity refractive index is and the shape is square and the length of the impurity side is changed, Figure 4c The impurity side length is fixed to l = 4Δ and the shape is square, while the impurity refractive index is changed. Figure 4d Fixed side length l = 4Δ and refractive index And change the shape of impurities. Figure 4a , 4c and 4d represent the prediction accuracy of the network trained using the reflection / transmission signal, Figure 4b , 4d and 4f present the predicted probability distribution P of the network trained with the reflection signal under a typical set of data. R (z c |I). The size of all test sets used in the generalization test is 200. Their generation method is the same as the training data set generation method mentioned above. The difference is that the generation of the generalization set needs to change Figures 4a-4f Relevant properties of the impurities shown.

[0106] S220: Compare the impurity position detection information with the known information of the impurity position of the detection sample to obtain the accuracy of the impurity position.

[0107] The embodiment of the present application includes the following three aspects: generalization test of impurity size l, generalization test of impurity refractive index n and generalization test of impurity shape (geometry). In the embodiment of the present application, under the training parameters (l=4Δ, The square impurity has the highest prediction accuracy.

[0108] 1) In the generalization test of impurity size l, the prediction of the neural network for impurities of different sizes showed some oscillations, but the overall accuracy was not less than 75% (e.g. Figure 4a As shown in the figure, the reason why the prediction accuracy oscillates is related to the parity of the impurity side length l. This phenomenon is related to the rounding int in the definition of the impurity class number. When the impurity side length l is an even multiple of Δ, the impurity centroid position z0 =nΔ can always be defined at an integer multiple of Δ, but the centroid of an impurity with an odd multiple of Δ is always defined at a half-integer multiple of Δ. 0 =(2n+1)Δ / 2. The results show that this part of the difference is also captured by the neural network. Figure 4b The neural network prediction probability distribution P of the reflected signal training position under a set of typical data is presented. R (z c |I), it can be seen that the network's predicted probability distribution has a high degree of concentration, indicating that the network has a high degree of confidence in its judgment of the impurity location.

[0109] The embodiment of the present application also tests the generalization ability of the network when the training data set is l=3Δ. The results show that the accuracy is higher on the impurity generalization test set with odd Δ, and lower on the test set with even multiple Δ. This odd-even difference will gradually disappear as Δ→0, but the reduction of Δ corresponds to infinitely fine discretization of space, which brings huge computational overhead in numerical simulation.

[0110] 2) In the generalization test of impurity refractive index n, such as Figure 4c As shown, the neural network of the embodiment of the present application performs better in generalizing the refractive index for the reflection signal than for the transmission signal, but the prediction accuracy of both gradually decays to zero as the refractive index n decreases to 1. This is reasonable because n=1 corresponds to the disappearance of impurities, so neither the reflection nor the transmission signal carries any information about impurities. Figure 4d The neural network prediction probability distribution P of the reflected signal training position under a set of typical data is presented. R (z c |I), it can be seen that the network's predicted probability distribution has a high degree of concentration, indicating that the network has a high confidence in its judgment of the impurity location.

[0111] 3) In the generalization test of impurity geometry, such as Figure 4e As shown in FIG. 1 , it is shown that the network trained with square impurities also has a high prediction accuracy on impurities of other geometric shapes, and the prediction accuracy is also related to the reflection symmetry of the impurities. Because the neural network of the embodiment of the present application is trained on square impurities with left-right reflection symmetry, Figure 4c As shown, the generalization ability is higher on the strip and wedge-shaped impurities that also have reflection symmetry, while the generalization ability is weaker on the "L" type that lacks reflection symmetry. Figure 4f The neural network prediction probability distribution P of the reflected signal training position under a set of typical data is presented. R (z c|I), it can be seen that the network's predicted probability distribution has a high degree of concentration, indicating that the network has a high confidence in its judgment of the impurity location.

[0112] 4) The present embodiment also tests the learning ability of the neural network for the location of concave impurities, and presents the typical results in Figure 7a and 7b among Figure 7a and 7b They represent the training loss curve of concave impurity learning and the generalization test of the network after training to the impurity size l. The results show that the neural network also has a strong learning ability for concave impurities.

[0113] S230: If it is determined that the impurity position accuracy is greater than a preset value, it is determined that the neural network has generalization ability.

[0114] In an embodiment of the present application, for example, when the accuracy rate is greater than 75%, it is determined that the neural network has a strong generalization ability. In other embodiments, when the accuracy rate is greater than 60%, 70%, 80% or 90%, it is determined that the neural network has a good generalization ability.

[0115] The neural network used in the embodiment of the application is a convolutional neural network (CNN). The embodiment of the application also compares the learning ability of the convolutional neural network (CNN) with that of a pure fully connected neural network (FCNN). To ensure the fairness of the comparison, the embodiment of the application controls the number of layers and the total number of parameters of the FCNN network to be close to that of the previous CNN network.

[0116] like Figure 5 As shown, the embodiment of the present application specifically shows the architecture and parameters of the FCNN network, wherein the number of neurons in the input layer 21 (Input Layer) is 512; the number of neurons in the hidden layer 22 (Hidden Layer) are 256, 310, 448, 310, and 237, respectively, and the corresponding activation function is the "Relu" function; the number of neurons in the output layer 23 (Output Layer) is 32, and the activation function is the "softmax" function. Figure 6a-6f The CNN and FCNN networks were compared in terms of impurity size, impurity refractive index and impurity shape. Figure 6a , 6c , Figure 6d and Figure 6e They correspond to the results of reflection signal training respectively, and Figure 6b , 6d , Figure 6d and Figure 6fThe results of the corresponding transmission signal training are shown in Figure 2. It can be seen that both networks have good performance on the generalization set, but CNN performs better than the other two. The diffraction of a single impurity is spatially invariant. The translation invariance here means that the local features of the reflection / transmission signal generated by the impurity diffraction do not depend on the location of the impurity. In the problem of extracting features with translation invariance, CNN has a greater advantage because its convolution kernel can be reused. If the fully connected neural network is to achieve the same effect as the convolutional neural network, more parameters need to be introduced.

[0117] In the embodiment of the present application, Fig.11 As shown, a third technical solution is also included: a deep learning optical surface impurity detection method, comprising:

[0118] S310: Inputting the medium into a neural network, wherein the neural network is trained using the above method.

[0119] S320: Determine whether the medium surface contains impurities.

[0120] In the embodiment of the present application, the reflection signal and the transmission signal of the neural network are obtained to obtain an optical pulse signal, and whether there are impurities is determined according to the optical pulse signal. For example, it can be determined whether the optical pulse signals at various positions of the medium are the same. If they are the same, there are no impurities on the surface of the medium. If they are not the same, there are impurities on the surface of the medium.

[0121] If yes, then S330: determine the location of the impurities on the surface of the medium.

[0122] In the embodiment of the present application, if there are impurities on the surface of the medium, the position of the impurities is determined according to the optical pulse signal and the corresponding position of the impurities. If there are no impurities on the surface, it means that the surface of the medium is smooth.

[0123] See also Fig.12 , Fig.12 Schematic diagram of the structure of an embodiment of the electronic device of the present application. Fig.12As shown, the electronic device 400 includes a memory 410 and a processor 420 coupled to each other, wherein the memory 410 stores instructions for implementing the method of any of the above embodiments; the processor 420 is used to execute the instructions stored in the memory 410 to implement the method of any of the above embodiments. The processor 420 may also be referred to as a CPU (Central Processing Unit). The processor 420 may be an integrated circuit chip with signal processing capabilities. The processor 420 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0124] See also Fig.13 , Fig.13 It is a structural diagram of an embodiment of the application storage medium. The storage medium 500 of the embodiment of the present application stores instructions, and the above method is implemented when the instructions are executed. Among them, the instructions can form a program file and be stored in the above storage medium in the form of a software product, so that a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) executes all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, and a tablet.

[0125] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0126] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the description and drawings of this application, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present application.

Claims

1. A training method for a deep learning optical surface impurity detection model, characterized in that: include: Inputting a training sample containing impurities into a neural network to be trained, and obtaining an output result of the impurity position of the training sample, wherein the training sample includes known position information and known optical signals of the impurities, and the output result includes predicted positions and predicted optical signals of the impurities of the training sample; By numerically solving the wave equation, we first generate a training data set The impurity parameters selected for the training data are square impurities with a side length of l = 4Δ and an impurity refractive index of Different data in G are obtained by changing the position of impurities, where each set of data contains the optical pulse signal I R,T (z) and the corresponding impurity position z c ; The intensity signals of the reflected light R and the transmitted light T are collected before and after the medium, and the intensity signals are integrated in the x direction to obtain the distribution I along the z direction. R,T (z); Classifying the predicted optical signal and the predicted position to obtain a first probability distribution; The known position information and known optical signals of the impurities are classified to form known classification data of the known impurities, and the known classification data are one-hot encoded to obtain a second probability distribution, wherein the center of mass z of the constrained impurity is 0 In the range where the detection light signal intensity is large, 0 ∈[-64Δ,64Δ], then z 0 The coordinate range of the impurity is further divided into categories, which is consistent with the actual coordinate z 0 The relationship between c = int[z 0 / 4Δ]+17, where int means rounding, and the data set G is a data pair consisting of intensity signal and impurity class number. The input of the neural network, i.e. the optical pulse signal, is I R ,T (z), and the output is a c The probability distribution P on R,T (z c |I), which reflects the classification prediction probability distribution made by the network after analyzing the specified input signal I; Calculating a loss function using the first probability distribution and the second probability distribution; Adjusting a grid parameter of the neural network to reduce the loss function; The “classifying the known position information and known optical signals of the impurities to form known classification data of the known impurities” includes: constraining the impurities to be within the detection light signal intensity range of the neural network, and dividing the location range of the impurities into a preset number of categories; Converting the known position information into a class number of the known position according to the preset number of categories, and corresponding the known optical signal to the optical intensity signal corresponding to the class number of the known position, to obtain known classification data of the known impurity, wherein the classification data includes the class number of the known position and the corresponding optical intensity; The “classifying the predicted optical signal and the predicted position to obtain a first probability distribution” includes: converting the predicted position information into a class number of the predicted position according to the preset number of categories, and matching the predicted optical signal with an optical intensity signal corresponding to the class number of the predicted position to obtain a first probability distribution of the predicted impurity; After "adjusting the grid parameters of the neural network to reduce the loss function", it also includes: Supervise the training process and obtain supervised test data; Determine that the supervised test data reaches a preset value and stop training.

2. The training method of the deep learning optical surface impurity detection model according to claim 1, characterized in that: The "supervised training process, obtaining supervised test data" includes: Supervise the training process and obtain monitoring accuracy; The “determining that the supervised test data reaches a preset value and stopping training” includes: When it is determined that the monitoring accuracy reaches 100%, the training is stopped.

3. The training method of the deep learning optical surface impurity detection model according to claim 1, characterized in that: The “training samples containing impurities” include: impurity training samples in which impurities move to different positions along a preset direction.

4. A method for detecting a neural network, characterized in that: include: The method according to any one of claims 1 to 3 above; Inputting a test sample containing impurities into a neural network to obtain detection information of the impurity position of the test sample, wherein the test sample includes known information of the impurity position of the test sample; Comparing the impurity position detection information with the known information of the impurity position of the detection sample to obtain the accuracy of the impurity position; If it is determined that the impurity position accuracy is greater than a preset value, it is determined that the neural network has generalization ability.

5. The method for detecting a neural network according to claim 4, characterized in that: Also includes: The "detection samples containing impurities" include: impurity training samples with different odd and even numbers of impurity edges, impurity training samples of various shapes, impurity training samples of various refractive indices, and any one or more combinations of protrusions where impurities are located on the surface of the medium and pits where impurities are located on the surface of the medium.

6. A deep learning optical surface impurity detection method, characterized in that: include: Inputting the medium into a neural network, wherein the neural network is trained using the method of any one of claims 1 to 3; Determine whether there are impurities on the surface of the medium; If yes, determine the location of the impurities on the surface of the medium.

7. An electronic device, characterized in that: comprising a memory and a processor coupled to each other, The processor is configured to execute computer instructions stored in the memory to implement the method according to any one of claims 1 to 6.

8. A storage medium storing instructions, characterized in that: When the instructions are executed, the method according to any one of claims 1 to 6 is implemented.