Model Training Method, Core Alignment Method, Device, Medium and Electronic Device

By pre-training the target model and using it to adjust the core, the problems of long core adjustment time and poor quality of traditional optical lenses are solved, and efficient and accurate lens core adjustment is achieved.

CN120014388BActive Publication Date: 2025-06-20ZHEJIANG UNIV +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510495173.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-06-20
Estimated Expiration
2045-04-21

AI Technical Summary

Technical Problem

During the core adjustment process of traditional optical lenses, there are problems such as long manual core adjustment time and poor core adjustment quality, especially when adjusting cores in multiple groups of lenses, it is more cumbersome and inefficient.

Method used

By pre-training the target model, the core adjustment is performed using the target model. The specific steps include obtaining the first image of the target object, obtaining the sample image and training the sample data set based on the first image, and training the initial model through the sample data set until the initial model meets the preset conditions, and obtaining the target model. Then, the core is adjusted using the target model, and the mirror group position is adjusted through the mechanical motion structure until the imaging quality meets the requirements.

Benefits of technology

This method significantly reduces the core adjustment time, improves the core adjustment efficiency and accuracy, and is suitable for single-group and multi-group lens core adjustment, reducing production costs and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014388B_ABST
    Figure CN120014388B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a model training method, a centering adjustment method, a device, a medium, and an electronic device. The model training method includes: obtaining a first image of a target object; obtaining a sample image based on the first image; obtaining a training sample data set based on the sample image, where the training sample data set includes a second image, and the second image is an image obtained after the first image passes through the optical system; training an initial model through the sample data set until the initial model meets a preset condition to obtain a target model. Through the target model, the present application can accurately perform centering adjustment on the model to be centered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of artificial intelligence and relates to the technical field of optical system assembly, and particularly relates to a model training method, a centering method, a device, a medium, and an electronic device. Background Art

[0002] With the progress of technology, optical lenses are widely used, but their performance is significantly affected by processing and assembly errors. Assembly errors (such as eccentricity, tilt, and spacing errors) can cause aberrations and resolution degradation, affecting the imaging quality. In the early stage, alignment relied on mechanical adjustment and empirical judgment, with low precision and poor efficiency; later, high-precision sensors (such as lasers and wavefront sensors) were used to improve the precision, but they are costly and the devices are complex, making it difficult to popularize. Existing intelligent centering methods train machine learning models through measured data to predict the centering position, but they require a large amount of data collection, which is time-consuming and laborious, especially when centering multiple groups of lenses, it is more cumbersome and inefficient. Summary of the Invention

[0003] Embodiments of this application provide a model training method, a centering method, a device, a medium, and an electronic device to solve the technical problems of long manual centering time and poor centering quality in traditional technologies.

[0004] In a first aspect of the embodiments of this application, a model training method is provided, which is applied to an electronic device. The electronic device is communicatively connected to an optical system. The method includes: obtaining a first image of a target object; obtaining a sample image based on the first image; obtaining a training sample data set based on the sample image, where the training sample data set includes a second image, and the second image is an image obtained after the first image passes through the optical system; training an initial model through the sample data set until the initial model meets a preset condition to obtain a target model.

[0005] In some possible implementation manners of this application, obtaining the sample image based on the first image includes: setting the image information of the first image according to the parameters of the optical system; obtaining the sample image based on the image information and the parameters of the first image.

[0006] In some possible implementation manners of this application, obtaining the training sample data set based on the sample image further includes: obtaining the second image based on the sample image and the optical system; obtaining the training sample data set based on the error of the optical system and the second image.

[0007] In some possible embodiments of the present application, the errors in the optical system include a first error and a second error. Among them, the first error includes the machining error corresponding to the relay lens in the optical system and / or the assembly error corresponding to the relay lens, the machining and assembly errors corresponding to the non-core-aligning lens group in the lens to be core-aligned, and the machining error of the core-aligning lens group; the second error includes the assembly error corresponding to the core-aligning lens group in the lens to be core-aligned.

[0008] In some possible embodiments of the present application, the method further includes: classifying the data in the training sample data set according to the type of the error.

[0009] In some possible embodiments of the present application, the image information of the first image includes the image size, the image height, and the image size.

[0010] A second aspect of the embodiments of the present application provides a core-aligning method, and the method includes: obtaining a target image; inputting the target image into a pre-trained target model to obtain the misalignment amount corresponding to the core-aligning lens group, where the target model is obtained according to the above model training method; after controlling the mechanical motion structure to move according to the misalignment amount, obtaining the target image again; determining whether the core alignment of the lens to be core-aligned corresponding to the core-aligning lens group is completed according to the quality of the target image obtained again.

[0011] A third aspect of the embodiments of the present application provides a model training device, and the model training device includes: an obtaining module, configured to obtain a first image of a target object; a processing module, configured to obtain a sample image based on the first image; the processing module is further configured to obtain a training sample data set based on the sample image, where the training sample data set includes a second image, and the second image is an image obtained after the first image passes through the optical system; the processing module is further configured to train an initial model through the sample data set until the initial model meets a preset condition to obtain a target model.

[0012] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the above-mentioned core-aligning method is implemented.

[0013] A fifth aspect of the embodiments of the present application provides an electronic device, including: a memory, and a processor, where the processor executes computer-readable instructions stored in the memory to implement the above-mentioned core-aligning method.

[0014] The centering method provided by the embodiment of the present application includes: obtaining a first image of an object; obtaining a sample image based on the first image; obtaining a training sample data set based on the sample image, where the training sample data set includes a second image, and the second image is an image obtained after the first image passes through the optical system; training an initial model through the sample data set until the initial model meets a preset condition to obtain a target model; and then performing centering using the template model. Description of the Drawings

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0016] Figure 1 It is a schematic diagram of the application environment of a model training method provided by the embodiment of the present application.

[0017] Figure 2 It is a schematic diagram of the structure of a six-degree-of-freedom displacement stage provided by the embodiment of the present application.

[0018] Figure 3 It is a schematic flowchart of the model training method provided by the embodiment of the present application.

[0019] Figure 4 It is an error combination diagram required for the training sample data set provided by the embodiment of the present application.

[0020] Figure 5 It is a schematic flowchart of the centering method provided by the embodiment of the present application.

[0021] Figure 6 It is a principle block diagram of a model training device provided by the embodiment of the present application.

[0022] Figure 7 It is a schematic diagram of the structure of an electronic device provided by the embodiment of the present application. Detailed Embodiments

[0023] In order to make the purpose, technical solutions, and advantages of the present application clearer, the present application will be described in detail below with reference to the drawings and specific embodiments.

[0024] It should be noted that in this application, "at least one" means one or more, and "a plurality" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0025] In the embodiments of this application, words such as "exemplary" or "for example" are used to give examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0026] With the rapid progress of technology, optical lenses are increasingly widely used in various fields, and the requirements for their performance are also rising. However, the performance of optical lenses is not only affected by optical design, but also greatly restricted by errors in the processing and assembly processes. Currently, although many lenses have reached quite high imaging quality standards in design, in actual applications, due to processing and assembly errors, their imaging effects often fail to reach the expected ideal state. Therefore, how to effectively solve the processing and assembly errors of lenses has become the key to improving the performance of optical lenses.

[0027] During the lens assembly process, various assembly errors such as eccentricity, tilt, and spacing errors between lenses are inevitable. These errors will not only cause additional aberrations in the optical system, but also significantly reduce the resolution of the lens, thereby affecting the imaging quality. In actual applications, such a decrease in imaging quality may affect the performance of the product and even determine its success or failure.

[0028] Early optical system alignment mainly relied on mechanical adjustment and empirical judgment. This method not only had limited accuracy but also low efficiency. Although subsequent alignment solutions using high-precision sensors such as lasers and wavefront sensors could significantly improve the centering accuracy, the high hardware costs and complex device structures limited their wide application. Although there are already some devices on the market that can search for the best alignment position in a traversing manner, these devices often take a long time, and may even be slower than manual alignment, which obviously cannot meet the huge current demand for high-quality lenses. Therefore, it is necessary to find an alignment method that can ensure both high precision and high efficiency.

[0029] With the development of optical technology and intelligent algorithms, the alignment accuracy and efficiency of lens modules are of vital importance to the improvement of imaging quality. In the prior art, the lens alignment can be performed by using measured data to obtain a data set to train an intelligent alignment method. This method adds assembly errors to the lens module to be aligned, collects data such as the modulation transfer function (MTF) curve and aberration characteristics of the lens, trains neural networks or other machine learning models, and realizes intelligent prediction of the alignment position. However, this intelligent alignment method based on measured data training still has certain limitations in practical applications. For each lens module to be aligned, a large amount of data collection work is required to generate the corresponding data set in order to achieve accurate prediction of the alignment position. This data collection process not only consumes time and resources, but also directly affects the measurement efficiency of the production line.

[0030] Especially when facing the core adjustment of multiple groups of lenses, the problem becomes more complicated. Multiple groups of lenses need to adjust the position of each lens group separately, and the relative position relationship between the lens groups must also be considered comprehensively. In this case, the method of collecting data one by one to train the model will be particularly cumbersome and inefficient, further increasing the production cost and time cost. In addition, during the core adjustment of multiple groups of lenses, the differences in the characteristics of different lens groups make the unified processing of data and the adaptability of the model face higher challenges. Therefore, how to reduce the collection needs for single or multiple groups that need to be adjusted, simplify the data collection process, and at the same time improve the core adjustment efficiency and measurement accuracy has become an important issue that needs to be urgently solved in this field.

[0031] In order to solve the above problems, this application provides a model training method and a core tuning method, which pre-trains the target model and then uses the target model to perform core tuning. Figure 1 , is a schematic diagram of an application environment of a core adjustment method provided in an embodiment of the present application. The core adjustment method is applied to an optical system. Figure 1 As shown, the optical system 100 includes a first image 1, a relay lens 2, and a lens to be aligned.

[0032] 3, alignment lens group 4, image sensor 5, second image 6 and mechanical motion structure 7. The optical system 100 is connected to the electronic device 200 for communication. For example, the image sensor 5 and the mechanical motion structure 7 in the optical system 100 are connected to the electronic device 200 for communication.

[0033] In some embodiments of the present application, the first image 1 is an object-side pattern, which is an image corresponding to a target object, for example, an image obtained by photographing the target object with a camera.

[0034] In some embodiments of the present application, the lens 3 to be centered can be an infinity conjugate lens, a finite conjugate lens, or an incomplete lens. The centering lens group 4 is the first part of the lens 3 to be centered. When the lens 3 to be centered is an infinity conjugate lens, a relay lens 2 needs to be added to the optical system, and the first image 1 is located on the working surface of the relay lens 2. Since the design of the infinity conjugate lens is suitable for parallel light incidence, the relay lens 2 is required to convert the pattern on the object side into parallel light to meet the imaging requirements of the infinity conjugate lens. When the lens 3 to be centered is a finite conjugate lens, the relay lens 2 does not need to be added to the optical system, and the first image 1 is located on the object surface of the lens 3 to be centered. Since the finite conjugate lens can directly image the first image 1, the relay lens 2 is not required. The first image 1 can be directly located on the object surface of the lens 3 to be centered. When the second lens 3 is an incomplete lens, a compensating lens needs to be added to the optical system, and the first image 1 is located on the working surface of the compensating lens. Since the incomplete lens lacks some optical functions and cannot image when the second lens is an incomplete lens, a compensating lens is needed to complete the optical path, and the function of the relay lens 2 is replaced by the compensating lens.

[0035] In some embodiments of the present application, the lens 3 to be centered includes a non-centering lens group and a centering lens group. The non-centering lens group is a fixed part that has been assembled, and the centering lens group is a lens or lens group to be centered that has not been fully assembled. The non-centering lens group and the lens or lens group to be centered together form a lens, and only a complete lens can image.

[0036] In some embodiments of the present application, the centering lens group 4 is located inside the lens 3 to be centered and is connected to the mechanical motion structure 7. The position of the centering lens group 4 can be adjusted by controlling the movement of the mechanical motion structure 7.

[0037] In some embodiments of the present application, the image sensor 5 is used to capture the second image after imaging by the lens 3 to be centered and send the second image to the electronic device 200. The electronic device 200 analyzes the image quality based on the received second image and determines the performance of the lens 3 to be centered according to the image quality. Among them, the mechanical motion structure 7 can be a six-degree-of-freedom displacement stage. Refer to Figure 2 , this six-degree-of-freedom displacement stage has six degrees of freedom: roll, pitch, yaw, lift, surge, and transverse shift. Among them, roll, pitch, and yaw are angular rotation degrees of freedom around the x, y, and z directions. Lift, surge, and transverse shift are axial displacement degrees of freedom in the x, y, and z directions. In this embodiment, parallel high-precision six-degree-of-freedom displacement stages can be used to control the displacement and angle of the lens 3 to be centered in the x, y, and z directions respectively.

[0038] According to actual requirements, the optical system 100 may further include other auxiliary optical elements, such as filters, etc., to further improve the system performance. The above structure will be adjusted according to actual requirements in the specific implementation manner, and the examples Figure 1 are not shown in detail.

[0039] In some possible scenarios, the electronic device 200 may also be network-connected to the image sensor 5 and / or the mechanical motion structure 7. The network can be wired network communication or wireless network communication. The wired network can be any one of a local area network, a metropolitan area network, and a wide area network, and any one of wireless fidelity (Wi-Fi), ZigBee wireless networks (ZigBee), ultra-wideband (UWB) technology, wireless universal serial bus (USB), etc.

[0040] Figure 3 is a flowchart of the core alignment method provided by an embodiment of the present application. As Figure 3 shown, the core alignment method is applied to an electronic device. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.

[0041] Step S1, obtain a first image of the target object.

[0042] Step S2, obtain a sample image based on the first image.

[0043] In the embodiment of the present application, obtaining a sample image based on the first image includes: setting the image information of the first image according to the parameters of the optical system; obtaining a sample image based on the image information and the parameters of the first image. Specifically, according to the magnification, resolution, and core alignment field of view of the optical system, the image information of the first image is set. Among them, the image information of the first image includes image size, image height, and image size. After setting the image information of the first image, a first image with a preset size, preset height, and preset size can be obtained, and N sample images are obtained according to the parameters of the set first image. Among them, the parameters include image uniformity and installation error, etc. For example, N sample images a1, a2... an are obtained according to different image uniformities and installation errors.

[0044] In the embodiment of the present application, the core alignment field of view is a specific field of view range used to evaluate and correct the imaging quality of the optical system during the core alignment process, and is an important parameter to ensure the optimization of the optical system performance.

[0045] Step S3, obtain a training sample data set based on the sample image, where the training sample data set includes a second image.

[0046] In the embodiment of the present application, obtaining a training sample data set based on a sample image includes: obtaining a second image based on the sample image and an optical system; obtaining a training sample data set based on the errors of the inherent devices in the optical system and the second image. The data in the training sample data set includes the sample image, a first error, and a second error. For example, the data including the first error in the training sample data set is regarded as the same category; the data including the second error in the training sample data set is regarded as the same category.

[0047] Specifically, after building the optical system as Figure 1 shown, the actual image of the first image is collected by the image sensor in the optical system to obtain a second image. Among them, when N sample images a1, a2... an are input into the optical simulation software corresponding to the optical system, errors are added to the inherent devices of the optical system in the optical simulation software, and a training sample data set is obtained after the optical system processes the N sample images. Among them, adding errors to the inherent devices of the optical system includes adding first errors b1, b2... bn to the relay lens and the lens to be core-adjusted, and adding second errors c1, c2... cn to the core-adjusting lens group. The first error and / or the second error can be obtained by processing the N sample images through the optical system with added errors to obtain a training sample data set.

[0048] In the embodiment of the present application, the first error includes the processing error and assembly error corresponding to the relay lens, the processing and assembly errors corresponding to the non-core-adjusting lens group in the lens to be core-adjusted, and the processing error corresponding to the core-adjusting lens group in the lens to be core-adjusted; the second error includes the assembly error corresponding to the core-adjusting lens group in the lens to be core-adjusted.

[0049] In the embodiment of the present application, the model training method further includes: classifying the data in the training sample data set according to the type of the errors of the inherent devices.

[0050] Such as Figure 4As shown, machining and assembly errors b1, b2... bn are added to the lenses in the relay lens or lens groups in the lens to be aligned, and assembly errors c1, c2... cn are added to the lens to be aligned that needs to be aligned, obtaining a series of second images after the N sample images pass through the optical system with different assembly errors as the training sample data set. For example, combining the assembly error c1, and the sample patterns a1, a2... an with the first errors b1, b2... bn, data {[a1, b1, c1]... [a1, bn, c1]... [an, bn, c1]} is obtained; combining the assembly error c2, and the sample images a1, a2... an with the first errors b1, b2... bn, data {[a1, b1, c2]... [a1, bn, c2]... [an, bn, c2]} is obtained; combining the assembly error c2, and the sample images a1, a2... an with the first errors b1, b2... bn, data {[a1, b1, c3]... [a1, bn, c3]... [an, bn, c3]} is obtained; and so on. Combining the assembly error cn, and the sample images a1, a2... an with the first errors b1, b2... bn, data {[a1, b1, cn]... [a1, bn, cn]... [an, bn, cn]} is obtained.

[0051] In some embodiments, the installation error c of the lens or lens group to be aligned itself can also be used as a category, and this category includes a series of error combinations such as (a1, b1) (a2, b1)... (an, b1) (a1, b2) (a2, b2)... (an, b2)... (a1, bn) (a2, bn)... (an, bn). Similarly, these categories of c2, c3,... cn all contain these error combinations.

[0052] Step S4, training the initial model with the sample data set until the initial model meets the preset conditions to obtain the target model.

[0053] In the embodiment of the present application, what the target model outputs is the misalignment amount corresponding to the lens or lens group to be aligned, that is, the assembly error, the second error. The second error is input into the model as a variable to obtain the corresponding second image (such as, the image-side image), then inputting the second image can also inversely deduce the second error. All other uncertain variables (the first error) are within the model. According to the target model, all error values can be obtained from the second pattern.

[0054] In the embodiment of the present application, the initial model is a convolutional neural network for image regression problems. Among them, the structure of the initial model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. Among them, the input layer is used to receive input data (for example, a training set), and represent the image obtained through the optical system and its associated error in the form of an array; the convolutional layer can be a one-dimensional convolutional layer (1D Convolutional Layer), which is used to extract high-dimensional feature data from the array data; the pooling layer is used to reduce the dimension of the extracted feature values, reduce redundant information, and improve the training efficiency; the fully connected layer is used to map the extracted high-dimensional feature data to a low-dimensional representation to obtain the target feature vector of the initial model; the output layer is used to output the regression target value, corresponding to the assembly error or adjustment amount of the centering optical element.

[0055] In the embodiment of the present application, before training the initial model with the training sample data set, the focusing method further includes: dividing the training sample data set into a training set and a test set.

[0056] In the embodiment of the present application, the training sample data set can be randomly divided into a training set and a test set according to a preset ratio. Among them, the preset ratio can be 4:1 or 7:3. For example, 80% of the training sample data set is divided into the training set, and 20% of the training sample data set is divided into the test set. Among them, the training set is used to train the model, modulate the weights of the neural network in the model, and optimize the model; the test set is used to verify the performance of the model and evaluate the generalization ability of the model. When dividing the data set, it is necessary to ensure the randomness and uniformity of the division to avoid bias in certain feature values or target values in the data set.

[0057] In some embodiments of the present application, before dividing the training sample data set into a training set and a test set, the centering method further includes: preprocessing the data in the training sample data set, and the preprocessing includes: normalization processing and standardization processing.

[0058] In some embodiments of the present application, the preset condition includes that the loss value corresponding to the preset loss function is less than the preset loss threshold. The preset loss function includes a regression loss function (such as mean square error, MSE), and its formula is expressed as follows:

[0059]

[0060] Among them, Y i represents the supervised data, represents the predicted value of the neural network, and n represents the number of samples. By modulating the weights of the loss function to minimize the error between the predicted value and the true value. The data input is passed into the network batch by batch in the form of an array, and iteratively trained in combination with an optimization algorithm (such as Adam or SGD) until convergence.

[0061] In some embodiments of the present application, the training process of the target model can use a supervised training method. Specifically, the training method can include: iteratively updating and training the initial model using the data of the current batch in the training set; using the test set to determine whether the initial model updated each time reaches a preset condition. If the preset condition is not reached, the initial model is updated next using the data of the next batch according to an optimization algorithm (such as the gradient descent algorithm); repeating the above steps until the initial model meets the preset condition. Among them, the preset condition can be that the loss value corresponding to the loss function is less than a preset loss threshold, the performance of the target model (such as accuracy, recall, etc.) reaches a preset performance threshold, the number of iterations of the model reaches a preset number threshold, etc. Among them, the above various thresholds can be set according to actual needs, and the present application does not make specific limitations on this.

[0062] Figure 5 is a flowchart of the centering method provided by the embodiments of the present application. As Figure 5 shown, the centering method is applied to an electronic device. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.

[0063] Step S41, obtain a target image.

[0064] In the embodiments of the present application, a second image corresponding to the first image is obtained through an image sensor in the optical system, and the second image is used as the target image.

[0065] Step S42, input the target image into a pre-trained target model to obtain the misalignment amount corresponding to the centering lens group.

[0066] In the embodiments of the present application, the target image is input into Figure 3 the target model pre-trained by the model training method shown, and the misalignment amount of the lens group to be centered can be output. The input error and the target image are used in the target model training to correspond the error with the image. The centering method provided by the present application is used to output the second error corresponding to the target image regardless of what kind of error exists in the system. Therefore, the input target image is to find the corresponding second error. And when training the target model, all errors should be included as much as possible so that the model can cover all situations as much as possible, or be as close to the real situation as possible to improve the accuracy of the model.

[0067] Step S43, after controlling the mechanical motion structure to move according to the misalignment amount, obtain the target image again.

[0068] In the embodiments of the present application, by controlling the mechanical motion structure through the misalignment amount, the mechanical motion structure can be driven to adjust each degree of freedom of the six-degree-of-freedom displacement stage, so as to adjust the corresponding position of the centering lens group, and then the target image is acquired again through the image sensor. For example, if the misalignment amount output by the target model is a 2-μm offset in the x-axis direction, since the mechanical motion structure is connected to the centering lens or lens group, the mechanical motion structure needs to be moved 2 μm in the opposite direction. At this time, the position of the lens or lens group is the correct position, and the imaging quality of the lens is improved accordingly.

[0069] Step S44: Determine whether the centering of the lens to be centered corresponding to the centering lens group is completed according to the quality of the target image acquired again.

[0070] In the embodiments of the present application, if the quality of the target image acquired again meets the requirements, it is considered that the centering of the lens to be centered is completed; if the quality of the target image acquired again does not meet the requirements, the target image acquired again is input into the pre-trained target model to obtain the misalignment amount corresponding to the centering lens group. After controlling the mechanical motion structure to move according to this misalignment amount, the target image is acquired again until it is determined that the quality of the target image acquired again meets the requirements, and it is determined that the centering of the lens to be centered is completed.

[0071] In some embodiments of the present application, the quality of the target image acquired again can be determined by calculating the resolution of the target image acquired again and comparing the calculated resolution with the preset resolution. When the calculated resolution is greater than or equal to the preset resolution, it is determined that the quality of the target image acquired again meets the requirements; when the calculated resolution is less than the preset resolution, it is determined that the quality of the target image acquired again does not meet the requirements. It should be noted that in other embodiments of the present application, the quality of the image can also be determined according to the modulation transfer function (MTF), signal-to-noise ratio (SNR), dynamic range, color accuracy, distortion, etc. of the target image acquired again.

[0072] The training sample data set of the present application can be collected before the physical system is built, and the simulation image acquisition efficiency is much higher than the actual image acquisition efficiency, greatly shortening the application process; after the model parameters of the neural network are trained, inputting an image can quickly and accurately output the predicted misalignment amount, effectively improving the alignment efficiency and accuracy of the system; the neural network has strong universality. Using the idea of transfer learning, when facing a new optical system to be centered, a small sample is established for training based on the pre-trained neural network model parameters, and the training time is short.

[0073] Please refer to Figure 6, which is a schematic block diagram of a model training device provided by an embodiment of the present application. The model training device 400 includes: an acquisition module 401, configured to acquire a first image of a target object; a processing module 402, configured to obtain a sample image based on the first image; the processing module 402 is further configured to obtain a training sample data set based on the sample image, where the training sample data set includes a second image, and the second image is an image obtained after the first image passes through the optical system; the processing module 402 is further configured to train an initial model through the sample data set until the initial model meets a preset condition to obtain a target model.

[0074] Another embodiment of the present application further provides an electronic device. Figure 1 The application environment is only given as an example. In some other exemplary embodiments, a computer program product for implementing the model training method and the core alignment method of the embodiments of the present application can also run on any electronic device with sufficient computing power (such as Figure 1 the electronic device 200 shown), execute each step of the model training method and the core alignment method, so as to provide the core alignment function.

[0075] Please refer to Figure 7 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 7 shown, in an embodiment of the present application, the electronic device 200 can be a mobile phone, a tablet computer, a smart wearable device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, a netbook, etc. The embodiments of the present application do not impose any restrictions on the specific type of the electronic device 200.

[0076] As Figure 7 shown, the electronic device 200 may include, but is not limited to, a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104, and a bus 105. The processor 103 is respectively coupled to the communication module 101, the memory 102, and the I / O interface 104 through the bus 105.

[0077] Those skilled in the art can understand that the schematic diagram is only an example of the electronic device 200, and does not constitute a limitation on the electronic device 200. It may include more or fewer components than shown, or combine some components, or different components. For example, the electronic device 200 may further include a network access device, etc.

[0078] The communication module 101 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more of the solutions for wired communication such as Universal Serial Bus (USB), Controller Area Network (CAN), etc. The wireless communication module may provide one or more of the solutions for wireless communication such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, Frequency Modulation (FM), near field communication (NFC), Infrared (IR) technology, etc.

[0079] The memory 102 can be used to store computer-readable instructions and / or modules. The processor 103 realizes various functions of the electronic device 200 by running or executing the computer-readable instructions and / or modules stored in the memory 102, and by calling the data stored in the memory 102. The memory 102 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, applications required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created according to the use of the electronic device 200. The memory 102 may include non-volatile and volatile memories, such as: hard disk, memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, at least one magnetic disk storage device, flash memory device, or other storage devices.

[0080] The memory 102 may be an external memory and / or an internal memory of the electronic device 200. Further, the memory 102 may be a memory in a physical form, such as a memory stick, a Trans-flash Card (TF card), etc.

[0081] The processor 103 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor 103 is the operation core and control center of the electronic device 200, connecting various parts of the entire electronic device 200 through various interfaces and circuits, and executing the operating system of the electronic device 200 and various installed application programs, program codes, etc.

[0082] Exemplarily, the computer-readable instructions may be divided into one or more modules / sub-modules / units. One or more modules / sub-modules / units are stored in the memory 102 and executed by the processor 103 to complete this application. One or more modules / sub-modules / units may be a series of computer-readable instruction segments capable of completing specific functions, and the computer-readable instruction segments are used to describe the execution process of the computer-readable instructions in the electronic device 200. For example, the computer-readable instructions may be divided into multiple modules of the above model training device.

[0083] If the modules / units integrated in the electronic device 200 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of this application, it may also be completed by computer-readable instructions instructing relevant hardware. The computer-readable instructions may be stored in a computer-readable storage medium, and when executed by the processor, the steps of the above-mentioned various method embodiments may be implemented.

[0084] Among them, the computer-readable instructions include computer-readable instruction codes, and the computer-readable instruction codes may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction codes, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, Read-Only Memories (ROMs), Random Access Memories (RAMs).

[0085] In combination with Figure 2, the memory 102 in the electronic device 200 stores computer-readable instructions, and the processor 103 can execute the computer-readable instructions stored in the memory 102 to implement the Figure 2 centering method as shown.

[0086] Specifically, for the specific implementation method of the processor 103 for the above computer-readable instructions, reference can be made to the Figure 2 description of the relevant steps in the corresponding embodiment, which will not be elaborated here.

[0087] The I / O interface 104 is used to provide a channel for user input or output. For example, the I / O interface 104 can be used to connect various input and output devices, such as a mouse, a keyboard, a touch device, a display screen, etc., so that the user can input information or visualize the information.

[0088] The bus 105 is at least used to provide a communication channel for mutual communication between the communication module 101, the memory 102, the processor 103, and the I / O interface 104 in the electronic device 200.

[0089] In 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 merely illustrative. For example, the division of modules is only a logical function division, and there can be other division methods in actual implementation.

[0090] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0091] In addition, in each embodiment of the present application, the various functional modules can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware, or in the form of a combination of hardware and software function modules.

[0092] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present application is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any associated drawing marks in the claims should not be regarded as limiting the claimed rights.

[0093] In addition, it is obvious that the term "including" does not exclude other units or steps, and the singular form does not exclude the plural form. A plurality of units or devices can also be implemented by one unit or device through software or hardware. Terms such as first and second are used to denote names and do not denote any particular order.

[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. A model training method, applied to an electronic device, wherein the electronic device is communicatively connected to an optical system, characterized in that: The method comprises: Acquire a first image of the target object; obtaining a sample image based on the first image; A training sample data set is obtained based on the sample image, wherein the training sample data set includes a second image, and the second image is an image obtained after the first image passes through the optical system, wherein obtaining the training sample data set based on the sample image also includes: obtaining the second image based on the sample image and the optical system; obtaining the training sample data set based on the error of the optical system and the second image; the error in the optical system includes a first error and a second error, wherein the first error includes a processing error corresponding to a relay lens in the optical system and / or an assembly error corresponding to the relay lens, a processing error corresponding to a non-aligned lens group in the lens to be aligned, and an assembly error of the lens to be aligned; the second error includes an assembly error corresponding to the aligned lens group in the lens to be aligned; The initial model is trained using the sample data set until the initial model meets the preset conditions, thereby obtaining a target model.

2. The model training method according to claim 1, characterized in that: The obtaining a sample image based on the first image comprises: Setting image information of the first image according to parameters of the optical system; The sample image is obtained based on the image information and the parameters of the first image.

3. The model training method according to claim 1, characterized in that: The method further comprises: The data in the training sample data set are classified according to the type of the error.

4. The model training method according to claim 1, characterized in that: The image information of the first image includes image dimension, image height and image size.

5. A core adjustment method, characterized in that: The method comprises: Get the target image; Input the target image to a pre-trained target model to obtain the misalignment amount corresponding to the centering mirror group, wherein the target model is obtained according to any one of the model training methods of claims 1 to 4; After controlling the movement of the mechanical motion structure according to the misalignment amount, acquiring the target image again; Whether the alignment of the lens to be aligned corresponding to the alignment lens assembly is completed is determined according to the quality of the target image acquired again.

6. A model training device, characterized in that: The model training device comprises: An acquisition module, used for acquiring a first image of a target object; A processing module, configured to obtain a sample image based on the first image; The processing module is further used to obtain a training sample data set based on the sample image, wherein the training sample data set includes a second image, and the second image is an image obtained after the first image passes through an optical system, wherein the obtaining of the training sample data set based on the sample image also includes: obtaining the second image based on the sample image and the optical system; obtaining the training sample data set based on an error of the optical system and the second image; the error in the optical system includes a first error and a second error, wherein the first error includes a processing error corresponding to a relay lens in the optical system and / or an assembly error corresponding to the relay lens, a processing error corresponding to a non-aligned lens group in the lens to be aligned, and an assembly error of the lens to be aligned; the second error includes an assembly error corresponding to the aligned lens group in the lens to be aligned; The processing module is also used to train the initial model through the sample data set until the initial model meets the preset conditions to obtain the target model.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by the processor, it implements the model training method according to any one of claims 1 to 4 and the core tuning method according to claim 5.

8. An electronic device, characterized in that: include: Memory, and A processor, wherein the processor executes computer-readable instructions stored in the memory to implement the model training method according to any one of claims 1 to 4 and the core tuning method according to claim 5.

Citation Information

Patent Citations

  • Image processing method, image processing apparatus, storage medium, image processing system, method of generating machine learning model, and learning apparatus

    US20240029321A1