Neural network algorithm detection model and neural network-based liquid optical lens quality detection method
By designing a new loss function that includes uniformity measurement, center position deviation and light source distribution regular terms, the problem of insufficient quality detection accuracy of liquid optical lenses in the prior art is solved, and a higher accuracy detection effect is achieved.
Patent Information
- Application Number
- CN202411172171.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-03
AI Technical Summary
The prior art liquid optical lens quality detection method based on neural networks has insufficient detection accuracy and cannot meet the requirements of quality detection on the assembly line.
A neural network algorithm detection model is designed, and a new loss function including uniformity measurement regular terms, center position deviation regular terms and light source distribution regular terms are used to constrain and calculate the output of the neural network through these regular terms and adjust the output of the neural network. Network parameter weight to improve detection accuracy.
It effectively improves the output accuracy of the neural network, improves the performance of liquid lens detection equipment, and meets the needs of quality inspection on assembly lines.
Smart Images

Figure CN119067947A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of liquid lens quality detection, and in particular to a neural network algorithm detection model and a liquid optical lens quality detection method based on the neural network. Background Art
[0002] The quality detection method of liquid lenses relies on the image content captured by the camera to determine the uniformity of the distribution of image pixel values and the coordinates of the center point. The traditional method is to use grayscale values and coordinate multiplication and addition operations to obtain sub-pixel coordinates. This type of traditional method has poor accuracy. In recent years, neural network algorithms have been used in industry to realize the quality detection of liquid lenses. The uniformity estimation and center point position of hundreds of images are obtained in advance through manual subjective judgment or traditional methods, and then the images are annotated to ensure the one-to-one correspondence between image files and annotated files, and the corresponding network training data set is established. The network training data set is then input into the artificial intelligence algorithm, that is, the parameter weights of the training network in the neural network. When the training is completed, the weights of the neural network are retained. When the detection method needs to be applied, the same neural network as the training is rebuilt. The network is defined as an inference network, and the parameters are loaded into the neural network for initialization. Finally, the image to be tested is input into the inference network to achieve the estimation of uniformity and center point position.
[0003] The quality inspection method of liquid optical lens based on neural network involves three processes, namely: designing the method and network structure of network structure, designing the loss function of neural network training, and designing the network training method. The method designed by these three processes in the prior art has disadvantages such as insufficient detection accuracy and cannot meet the needs of quality inspection on the assembly line. Summary of the invention
[0004] The present invention aims to solve the technical problems in the prior art and provides a neural network algorithm detection model and a liquid optical lens quality detection method based on the neural network.
[0005] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0006] A neural network algorithm detection model, the neural network algorithm detection model is obtained by training a loss function, the loss function includes: a uniformity measurement regularization term, a center position deviation regularization term and a light source distribution regularization term;
[0007] The uniformity measurement regularization term is: by measuring the error of the uniformity information and calculating the average value of the error, a scalar value is obtained as the uniformity measurement regularization term Loss plat ;
[0008] The center position deviation regularization term is: the center position estimated by the neural network includes the x-coordinate and the y-coordinate. By comparing these two points with the annotation information, the difference in the x-direction and the y-direction is calculated, and the average value of the absolute value of the difference is used as the center position deviation regularization term Loss cen ;
[0009] The light source distribution regularization term is: compare the image output by the network with the generated Gaussian distribution map, calculate the gray value difference pixel by pixel, and use it as the light source distribution regularization term Loss gauss .
[0010] In the above technical solution, the formula of the uniformity measurement regularization term is as follows:
[0011]
[0012] Among them, N cir Represents the number of pixels covered by the circle, N unc represents the number of pixels that do not conform to uniformity, I(p') represents the gray value of the image at position p', and I cir (p) represents the gray value of position p in the image, V represents the set of non-conforming points, V cir Represents the set of points covered by the circle.
[0013] In the above technical solution, the formula of the center position deviation regularization term is as follows:
[0014]
[0015] Among them, Loss cen is the center position deviation, x is the x-axis coordinate of the center point of the network input image light source, y is the y-axis coordinate; x' is the x-axis coordinate of the Gaussian spot, and y' is the y-axis coordinate of the Gaussian spot.
[0016] In the above technical solution, the formula of the light source distribution regularization term is as follows:
[0017]
[0018] Where p = (x, y), I(p) represents the grayscale value of the network output image at point p, and G(p) represents the grayscale value of the Gaussian image at point p.
[0019] In the above technical solution, the uniformity measurement regularization term, the center position deviation regularization term and the light source distribution regularization term are respectively assigned a specific weight, which are α1, α2 and α3.
[0020] A method for detecting the quality of a liquid optical lens based on a neural network comprises the following steps:
[0021] The above-mentioned neural network algorithm detection model is applied to liquid optical lens quality detection.
[0022] The present invention has the following beneficial effects:
[0023] The neural network algorithm detection model of the present invention and the liquid optical lens quality detection method based on the neural network propose a new loss function design method and calculation formula, which can effectively improve the output accuracy of the neural network and have positive significance for the performance of the liquid lens detection equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0025] Figure 1 This is a schematic diagram of a normal light source image.
[0026] Figure 2 Schematic diagram of non-uniform light source image.
[0027] Figure 3 This is a schematic diagram of the network structure image. DETAILED DESCRIPTION
[0028] The inventive concept of the present invention is:
[0029] The present invention designs a new loss function through basic mathematical theory methods, and uses the new loss function to constrain and calculate the output of the network structure, propagates the calculation results to the parameter weights in the network through a public training method, and adjusts the parameter weights.
[0030] The present invention adopts the network structure ResNet disclosed in the paper as the basic encoding module of the network, and adopts the disclosed DispNet network as the basic decoding module. The entire network structure design adopts the combined application of the disclosed technologies in the industry.
[0031] The present invention realizes a high-precision neural network detection algorithm model and process by designing a new loss function and adopting a public method to perform network training.
[0032] The present invention is described in detail below with reference to the accompanying drawings.
[0033] The loss function of the neural network algorithm determines the final network model of the neural network algorithm. The same neural network algorithm model can be trained using the same data set, the same network structure, the same loss function and the same training method. Different neural network algorithm models will be obtained if any of the data set, structure, loss function and training method are designed in different ways.
[0034] 1. Network structure design
[0035] The present invention adopts a combination of the ResNet network and the DispNet network disclosed in the industry as the network structure of the neural network algorithm. Since these two networks are disclosed methods in the industry, no redundant description is given in the specific implementation of the present invention. The network structure of the algorithm is as follows Figure 3 shown.
[0036] 2. Loss Function Design
[0037] The neural network algorithm detection model of the present invention is obtained by training a new type of loss function, and the loss function includes three parts: a uniformity measurement regularization term, a center position deviation regularization term, and a light source distribution regularization term.
[0038] 1. Uniformity measurement regularization term Loss plat
[0039] According to the uniformity information annotated in the pre-annotated data set, the uniformity measurement regularization term can measure the error of the uniformity information, calculate the average value of the error, and finally obtain a scalar value, which is the uniformity measurement mismatch.
[0040] A point light source, after passing through the liquid lens, shines on the camera plane. The standard spot image is as follows: Figure 1 As shown, the non-uniform light source image is Figure 2 shown.
[0041] In a specific implementation of the present invention, a common circle fitting method in the industry is used to find the center of the circle and the position of the circle of the corresponding image, and then count whether the grayscale values of the pixels in the area covered by the circle edge are close, for example, the grayscale value sequence is [126, 123, 126, 124, 128, 126]. If the difference between the maximum and minimum values of the area covered by the circle edge is within 5, it is considered that the pixels in the area covered by the circle edge are uniform and consistent. If the pixels in the area covered by the circle edge exceed the average grayscale value of the pixels by more than 3, it is considered that the pixel at this point does not meet the uniform and consistent assumption.
[0042] First, count the number of pixels that do not meet the uniform assumption and their grayscale values, and then calculate them using the following formula:
[0043]
[0044] Among them, N cir Represents the number of pixels covered by the circle, N unc represents the number of pixels that do not conform to uniformity, I(p') represents the gray value of the image at position p', and I cir (p) represents the gray value of position p in the image, V represents the set of non-conforming points, V cir Represents the set of circle coverage points. The final Lossplat It will be used as a regular term in the loss function.
[0045] 2. Center position deviation regularization term Loss cen
[0046] The center position estimated by the neural network mainly includes the x-coordinate and the y-coordinate. These two coordinates together determine the position of the center point on the image. By comparing these two points with the annotation information, the difference in the x-direction and the y-direction is calculated, and the average of the absolute value of the difference is used as the loss. cen , the formula is as follows:
[0047]
[0048] Among them, Loss cen is the deviation of the center position, x is the x-axis coordinate of the center point of the network input image light source, y is the y-axis coordinate; x' is the x-axis coordinate of the Gaussian spot, and y' is the y-axis coordinate of the Gaussian spot. 3. Light source distribution regularization term Loss gauss .
[0049] The pattern of the point light source image after passing through a high-quality liquid lens with good uniformity and transmittance is close to a Gaussian distribution. Therefore, the image output by the network is compared with the generated Gaussian distribution map, and the grayscale value difference is calculated pixel by pixel as the final Loss. gauss :
[0050]
[0051] Where p = (x, y), I(p) represents the grayscale value of the network output image at point p, and G(p) represents the grayscale value of the Gaussian image at point p.
[0052] In the liquid optical lens quality detection method based on neural network of the present invention, the neural network algorithm detection model is obtained by training the above loss function. The loss function is designed to be implemented by taking the sum of three regularization terms: uniformity measurement regularization term, center position deviation regularization term and light source distribution regularization term. Each regularization term is assigned a weight, which are α1, α2 and α3 respectively. These three weights can be set arbitrarily.
[0053] The experimental process of the liquid optical lens quality detection method based on neural network of the present invention is as follows:
[0054] First, a standard light source and a liquid lens are used to build an optical system, and a finished camera is used to collect the light output by the optical system to form a spot image. Then the spot image is input into the neural network model, and the neural network is used to calculate the deviation between the spot and the standard Gaussian spot. The deviation is then used as an indicator parameter to measure the quality of the liquid lens to complete the full system detection. The standard light source, liquid lens, and optical system are all existing commonly used components. Experiments show that the liquid optical lens quality detection method based on neural network of the present invention is practical and effective.
[0055] The neural network algorithm detection model of the present invention and the liquid optical lens quality detection method based on the neural network propose a new loss function design method and calculation formula, which can effectively improve the output accuracy of the neural network and have positive significance for the performance of the liquid lens detection equipment.
[0056] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A neural network algorithm detection model, characterized in that: The neural network algorithm detection model is obtained by training the loss function, and the loss function includes: a uniformity measurement regularization term, a center position deviation regularization term, and a light source distribution regularization term; The uniformity measurement regularization term is: by measuring the error of the uniformity information and calculating the average value of the error, a scalar value is obtained as the uniformity measurement regularization term Lossplat; The center position deviation regularization term is: the center position estimated by the neural network includes the x-coordinate and the y-coordinate. By comparing these two points with the annotation information, the difference in the x-direction and the y-direction is calculated, and the average value of the absolute value of the difference is used as the center position deviation regularization term Loss cen ; The light source distribution regularization term is: compare the image output by the network with the generated Gaussian distribution map, calculate the gray value difference pixel by pixel, and use it as the light source distribution regularization term Loss gauss .
2. The neural network algorithm detection model according to claim 1, characterized in that: The formula for the uniformity measurement regularization term is as follows: Among them, N cir Represents the number of pixels covered by the circle, N unc represents the number of pixels that do not conform to uniformity, I(p') represents the gray value of the image at position p', and I cir (p) represents the gray value of position p in the image, V represents the set of non-conforming points, V cir Represents the set of points covered by the circle.
3. The neural network algorithm detection model according to claim 1, characterized in that: The formula for the center position deviation regularization term is as follows: Among them, Loss cen is the center position deviation, x is the x-axis coordinate of the center point of the network input image light source, y is the y-axis coordinate; x' is the x-axis coordinate of the Gaussian spot, and y' is the y-axis coordinate of the Gaussian spot.
4. The neural network algorithm detection model according to claim 1, characterized in that: The formula for the regularization term of light source distribution is as follows: Where p = (x, y), I(p) represents the grayscale value of the network output image at point p, and G(p) represents the grayscale value of the Gaussian image at point p.
5. The neural network algorithm detection model according to any one of claims 1 to 4, characterized in that: The uniformity measurement regularization term, the center position deviation regularization term and the light source distribution regularization term are each assigned a specific weight, which are α1, α2 and α3 respectively.
6. A liquid optical lens quality detection method based on neural network, characterized in that: The following steps are involved: The neural network algorithm detection model described in any one of claims 1 to 5 is applied to the quality detection of liquid optical lenses.
