Deformable mirror control method and device based on machine learning
By detecting the basic characteristics of the deformable mirror, collecting multiple modes of data and building a fully connected neural network model based on machine learning methods, the problem of difficulty in balancing control accuracy and efficiency in the existing technology has been solved, and a high-precision, universal deformable mirror has been achieved. Deformable mirror control, suitable for a variety of application scenarios.
Patent Information
- Application Number
- CN202310347148.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2024-10-15
AI Technical Summary
Existing deformable mirror control methods are difficult to meet the requirements of control accuracy and efficiency at the same time, and lack sufficient processing of face data and model training strategies, resulting in low accuracy of the control model and difficulty in adapting to different application needs.
A deformable mirror control method based on machine learning is adopted to establish a high-precision control model by detecting basic characteristics, collecting data in multiple modes, building a fully connected neural network model, and performing structural hyperparameter optimization and staged training. Preliminary feature detection and post-surface shape testing remove data interference and improve model adaptability.
It achieves efficient and accurate deformable mirror control, is suitable for a variety of application scenarios, significantly improves control efficiency and model accuracy, and enhances versatility and adaptability.
Smart Images

Figure CN118778431A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photoelectric detection, and in particular to a deformable mirror control method based on machine learning, and a deformable mirror control device based on machine learning. Background Art
[0002] Deformable mirror (DM), also known as wavefront corrector, is one of the core components in adaptive optical systems and has important applications in astronomical observation, biomedicine, laser beam shaping, long-distance communication, free-form surface detection and other fields.
[0003] The deformable mirror mainly includes a surface composed of a voltage-controlled driver and a flexible metal layer. By setting the control driver voltage according to the surface shape information to be compensated, the DM surface shape can be controlled to change the optical path of wavefront transmission to dynamically correct the wavefront of the optical system. It can be seen that in the above process, the setting of the control voltage directly affects the wavefront correction accuracy of the deformable mirror. The role of the automatic control method of the deformable mirror is to automatically output the control voltage according to the characteristic vector of the target surface shape. Therefore, the accuracy and efficiency of the control method determine the accuracy and efficiency of the deformable mirror wavefront compensation. For example, in the application of free-form surface detection, the processed surface shape of the free-form surface to be measured can be used as the target surface shape input into the deformable mirror control system, and the deformable mirror is controlled to generate a surface shape similar to the surface to be measured to achieve zero-difference interference. At this time, the accuracy and efficiency of the deformable mirror control method also directly determine the accuracy and efficiency of free-form surface detection.
[0004] According to the above analysis, the high rate and high precision of the deformable mirror control method have an important impact on the development and application requirements of the deformable mirror. However, it is difficult for the existing deformable mirror control method to meet the requirements of control accuracy and efficiency at the same time. Commonly used deformable mirror control methods include optimization control methods and model-based control methods. When there is no prior knowledge at all, search optimization control methods can be used, such as hill climbing algorithm, random parallel gradient descent algorithm, etc. This method only optimizes the control voltage according to the compensation effect of the deformable mirror. Although it does not require modeling in advance, the convergence speed is slow, so the control efficiency is very low. In order to achieve higher control efficiency, model-based control methods are often used. However, it is very difficult to accurately obtain the control model using traditional methods. For example, the commonly used physical modeling solution method contains many necessary approximate conditions that limit the accuracy. The method of solving the control model by optimizing the influence function matrix cannot fully characterize the problems of driver coupling, nonlinear response, etc., and each control needs to be re-optimized, which is time-consuming and has low control efficiency. Therefore, a deformable mirror control method that can obtain the control model without approximation and optimization is necessary for efficient and high-precision control of the deformable mirror.
[0005] Neural networks have a powerful ability to fit complex multi-dimensional nonlinear functions and can directly build high-precision control models. The model establishes a data set based on the fitting and learning of the data set without any approximate conditions. The trained neural network control model can directly output the control voltage as long as the surface data is input, without the need for an optimization process. Therefore, the control method based on neural networks has advantages in efficiency and accuracy. For a fully connected network, after the surface to be compensated is represented by a one-dimensional feature vector, the nonlinear relationship between the surface shape and the control voltage can be effectively fitted. This control model based on a fully connected network has a simple structure, high control efficiency, and strong generalization ability.
[0006] Although some patents and papers have introduced the control methods of deformable mirrors with fully connected networks, these existing control methods have some defects in data processing and model training. For example, if a single method is used to control the deformable mirror and the surface data is not processed, the collected data set will not be sufficiently accurate. It is difficult to effectively fit the data using traditional training strategies to train the data set, and the model accuracy is low. Moreover, the existing control methods lack the early basic characteristic testing and the later surface testing steps in the design steps, making it difficult to evaluate the adaptability and effectiveness of the control model to actual needs. In summary, the above defects make it difficult for the existing fully connected network method to generate a high-precision control model to meet different application requirements. Summary of the invention
[0007] In order to overcome the defects of the prior art, the technical problem to be solved by the present invention is to provide a deformable mirror control method based on machine learning, which is simple, efficient, and versatile. It can control the deformable mirror to generate complex surface shapes with high precision, and can reasonably evaluate the effectiveness of the model in different application scenarios, thereby guiding the deformable mirror to more effectively realize complex wavefront correction and aberration compensation in various applications.
[0008] The technical solution of the present invention is: the deformable mirror control method based on machine learning comprises the following steps:
[0009] (1) Detecting the basic characteristics of the deformable mirror: First, determine the deformable mirror driving scheme and appropriate characteristic evaluation indicators according to the characteristics of different basic characteristics; then drive the deformable mirror according to the scheme and collect the surface shape after each deformation; after characterizing and processing the surface shape data, calculate the evaluation index value of the corresponding characteristic to evaluate whether the current deformable mirror is sufficient to provide the hardware conditions required by the machine learning-based control method and provide targeted adjustments;
[0010] (2) Controlling the deformable mirror in multiple modes and collecting voltage data in the data set: First, one or more control modes of the deformable mirror driver are selected according to the deformable mirror driving mechanism used and the characteristics of the wavefront to be compensated. Each control mode includes a weight distribution method for multiple drivers and a limit range for the total voltage, thereby generating deformable mirror shapes of different types and amplitudes;
[0011] First, one is selected from all the required modes, and the deformable mirror is driven in sequence using various weight distribution methods in the currently selected control mode; a continuously changing total voltage is applied to each weight distribution method to change the change amplitude of the deformable mirror until the maximum limit voltage is reached;
[0012] Until all weight types in the current control mode are collected, change the control mode and repeat the above process; in each driving process, multiply the total voltage by the assigned weight to calculate the voltage data of each driver in each driving process, and record it in the form of a one-dimensional vector; according to actual application requirements, choose to store the data of multiple control modes separately as their own data sets, or store them mixedly as one data set;
[0013] (3) Collecting, representing and processing the surface data in the data set: The collected two-dimensional deformable mirror surface data is represented as a one-dimensional feature vector, and then processed to remove the interference introduced by the installation error such as translation and tilt; the processed surface data is recorded and imported into the data set;
[0014] (4) Build the basic framework of the fully connected neural network control model: first allocate the data set, then preliminarily select the structural hyperparameters of the fully connected network, and determine the various analysis and evaluation indicators of the model in each link of training, verification, and testing;
[0015] (5) Optimizing the structural hyperparameters of the fully connected neural network control model: Select optimization variables from the structural hyperparameters of step (4), set appropriate initial values according to general rules to facilitate subsequent optimization; and use the index that can evaluate the control accuracy of the neural network model as the optimization objective function; select an optimization algorithm to iteratively update the values of the optimization variables, use the optimized variables after each update to establish the neural network framework, retrain, and calculate the new objective function value; and use the change trend of the objective function to guide the update of the optimization variables, iterate repeatedly until the objective function value reaches the optimal value and no longer changes, and use the optimization variable value at this time as the final structural hyperparameter to form the optimal structural framework;
[0016] (6) Training the fully connected neural network control model: Dynamically adjust the training hyperparameters in stages as the training progresses, divide the total training process into multiple stages, adjust the training parameters step by step from the first stage, and screen according to the training effect; after the parameters of the current stage have been adjusted to the optimal, keep the parameters of this stage unchanged, and then adjust and screen the training parameters of the next stage; meet the training requirements of each stage and jump out of the local optimum to improve the training effect and model training accuracy;
[0017] (7) Experimental test of surface shape control accuracy: First, determine the evaluation index of surface shape control accuracy; then apply the real voltage and predicted voltage of the test set to the target surface shape and actual surface shape obtained by the deformable mirror in turn, subtract the two surface shapes point by point to obtain the difference surface shape, and then calculate the surface shape control accuracy based on the parameters of the difference surface shape.
[0018] The present invention establishes a deformable mirror control model based on machine learning through the steps of basic characteristic detection, data set collection and modeling, model structure optimization and training, and experimental testing. The present invention does not require optimization when controlling the deformable mirror, and has high control efficiency. Compared with other methods of obtaining control models by neural networks, the present invention proposes many necessary adjustments in terms of the versatility of the control model and the accuracy of the control model in order to meet various actual application requirements. In the design process, attention is paid to the early basic characteristic detection and the later surface shape accuracy test, and the whole process is targeted to analyze and evaluate the control effect of the fully connected network control model in practical applications. In the data collection process, attention is paid to the diversity of control modes to enrich the data, which is suitable for different needs and also enhances the versatility. When establishing the surface shape data set, the surface shape is processed to remove interference factors to improve the control accuracy, and in the modeling and training process, an effective parameter optimization strategy and a staged training strategy are adopted to improve the fitting effect of the network and significantly improve the model accuracy. In summary, the present invention has advantages in terms of deformable mirror control efficiency, versatility of control method and control accuracy.
[0019] A deformable mirror control device based on machine learning is also provided, comprising:
[0020] The detection module is configured to detect the basic characteristics of the deformable mirror: first, according to the characteristics of different basic characteristics, a deformable mirror driving scheme and a suitable characteristic evaluation index are determined;
[0021] Then, the deformable mirror is driven according to the scheme, and the surface shape after each deformation is collected; after characterizing and processing the surface shape data, the evaluation index values of the corresponding characteristics are calculated to evaluate whether the current deformable mirror is sufficient to provide the hardware conditions required by the machine learning-based control method, and provide targeted adjustments;
[0022] A driving module is configured to control a deformable mirror in multiple modes and collect voltage data in a data set: first, one or more control modes of the deformable mirror driver are selected according to the deformable mirror driving mechanism used and the characteristics of the wavefront to be compensated, each control mode includes a weight distribution method of multiple drivers and a limit range of the total voltage, so as to produce deformable mirror shapes of different types and amplitudes; first, one is selected from all the required modes, and the deformable mirror is driven in sequence using various weight distribution methods in the currently selected control mode; a continuously changing total voltage is applied to each weight distribution method to change the change amplitude of the deformable mirror until the maximum limit voltage is reached; until all weight types in the current control mode are collected, the control mode is changed and the above process is repeated; in each driving process, the total voltage is multiplied by the allocated weight to calculate the voltage data of each driver in each driving process, and recorded in the form of a one-dimensional vector; according to actual application requirements, it is selected to store the data of multiple control modes separately as their own data sets, or to store them mixedly as one data set;
[0023] The acquisition module is configured to acquire, characterize and process the surface data in the data set: the acquired two-dimensional deformable mirror surface data is characterized as a one-dimensional feature vector, and then the interference introduced by the installation error such as translation and tilt is removed through processing; the processed surface data is recorded and imported into the data set;
[0024] The module is configured to build the basic framework of the fully connected neural network control model: first allocate the data set, then preliminarily select the structural hyperparameters of the fully connected network, and determine the various analysis and evaluation indicators of the model in each link of training, verification, and testing;
[0025] The optimization module is configured to optimize the structural hyperparameters of the fully connected neural network control model: select optimization variables from the structural hyperparameters, set appropriate initial values according to general rules to facilitate subsequent optimization; and use indicators that can evaluate the control accuracy of the neural network model as the optimization objective function; select an optimization algorithm to iteratively update the values of the optimization variables, use the optimized variables after each update to establish the neural network framework, retrain, and calculate new objective function values; and use the change trend of the objective function to guide the update of the optimization variables, iterate repeatedly until the objective function value reaches the optimal value and no longer changes, and use the optimization variable values at this time as the final structural hyperparameters to form the optimal structural framework;
[0026] The training module is configured to train the fully connected neural network control model: the training hyperparameters are dynamically adjusted in stages as the training progresses, the total training process is divided into multiple stages, and the training parameters are adjusted stage by stage from the first stage, and screened according to the training effect; after the parameters of the current stage have been adjusted to the optimal value, the parameters of this stage are kept unchanged, and then the training parameters of the next stage are adjusted and screened; the training requirements of each stage are met and the local optimum is jumped out to improve the training effect and model training accuracy;
[0027] A control module is configured to control the experimental test surface accuracy: first, determine the evaluation index of the surface control accuracy; then apply the real voltage and predicted voltage of the test set to the target surface and the actual surface obtained on the deformable mirror in turn, subtract the two surface shapes point by point to obtain the difference surface shape, and then calculate the surface control accuracy through the parameters of the difference surface shape. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a flow chart of a deformable mirror control method based on machine learning according to the present invention.
[0029] Figure 2 It is the flow chart of genetic algorithm implementation. DETAILED DESCRIPTION
[0030] like Figure 1 As shown, the deformable mirror control method based on machine learning includes the following steps:
[0031] (1) Detecting the basic characteristics of the deformable mirror: First, determine the deformable mirror driving scheme and appropriate characteristic evaluation indicators according to the characteristics of different basic characteristics; then drive the deformable mirror according to the scheme and collect the surface shape after each deformation; after characterizing and processing the surface shape data, calculate the evaluation index value of the corresponding characteristic to evaluate whether the current deformable mirror is sufficient to provide the hardware conditions required by the machine learning-based control method and provide targeted adjustments;
[0032] (2) Controlling the deformable mirror in multiple modes and collecting voltage data in the data set: First, one or more control modes of the deformable mirror driver are selected according to the deformable mirror driving mechanism used and the characteristics of the wavefront to be compensated. Each control mode includes a weight distribution method for multiple drivers and a limit range for the total voltage, thereby generating deformable mirror shapes of different types and amplitudes;
[0033] First, select one of all the required modes, and use various weight distribution methods in the currently selected control mode to drive the deformable mirror in turn; apply a continuously changing total voltage to each weight distribution method to change the change amplitude of the deformable mirror until the maximum limit voltage; until all weight types in the current control mode are collected, change the control mode and repeat the above process; in each driving process, multiply the total voltage by the allocated weight to calculate the voltage data of each driver in each driving process, and record it in the form of a one-dimensional vector; according to actual application requirements, choose to store the data of multiple control modes separately as their own data sets, or store them mixedly as one data set;
[0034] (3) Collecting, representing and processing the surface data in the data set: The collected two-dimensional deformable mirror surface data is represented as a one-dimensional feature vector, and then processed to remove the interference introduced by the installation error such as translation and tilt; the processed surface data is recorded and imported into the data set;
[0035] (4) Build the basic framework of the fully connected neural network control model: first allocate the data set, then preliminarily select the structural hyperparameters of the fully connected network, and determine the various analysis and evaluation indicators of the model in each link of training, verification, and testing;
[0036] (5) Optimizing the structural hyperparameters of the fully connected neural network control model: Select optimization variables from the structural hyperparameters of step (4), set appropriate initial values according to general rules to facilitate subsequent optimization; and use the index that can evaluate the control accuracy of the neural network model as the optimization objective function; select an optimization algorithm to iteratively update the values of the optimization variables, use the optimized variables after each update to establish the neural network framework, retrain, and calculate the new objective function value; and use the change trend of the objective function to guide the update of the optimization variables, iterate repeatedly until the objective function value reaches the optimal value and no longer changes, and use the optimization variable value at this time as the final structural hyperparameter to form the optimal structural framework;
[0037] (6) Training the fully connected neural network control model: Dynamically adjust the training hyperparameters in stages as the training progresses, divide the total training process into multiple stages, adjust the training parameters step by step from the first stage, and select them according to the training effect; after the parameters of the current stage have been adjusted to the optimal value, keep the parameters of this stage unchanged, and then adjust and select the training parameters of the next stage;
[0038] Meet the training requirements of each stage and escape from the local optimum to improve the training effect and model training accuracy;
[0039] (7) Experimental test of surface shape control accuracy: First, determine the evaluation index of surface shape control accuracy;
[0040] The real voltage and predicted voltage of the test set are then applied to the deformable mirror in turn to obtain the target surface shape and the actual surface shape. The point-to-point subtraction of the two surface shapes can obtain the difference surface shape, and then the surface shape control accuracy is calculated through the parameters of the difference surface shape.
[0041] The present invention establishes a deformable mirror control model based on machine learning through the steps of basic characteristic detection, data set collection and modeling, model structure optimization and training, and experimental testing. The present invention does not require optimization when controlling the deformable mirror, and has high control efficiency. Compared with other methods of obtaining control models by neural networks, the present invention proposes many necessary adjustments in terms of the versatility of the control model and the accuracy of the control model in order to meet various actual application requirements. In the design process, attention is paid to the early basic characteristic detection and the later surface shape accuracy test, and the whole process is targeted to analyze and evaluate the control effect of the fully connected network control model in practical applications. In the data collection process, attention is paid to the diversity of control modes to enrich the data, which is suitable for different needs and also enhances the versatility. When establishing the surface shape data set, the surface shape is processed to remove interference factors to improve the control accuracy, and in the modeling and training process, an effective parameter optimization strategy and a staged training strategy are adopted to improve the fitting effect of the network and significantly improve the model accuracy. In summary, the present invention has advantages in terms of deformable mirror control efficiency, versatility of control method and control accuracy.
[0042] Preferably, in the step (1), the basic characteristics include the repeatability and stability of the deformable mirror. The repeatability driving scheme in step (1) is to repeatedly apply the same control voltage to the deformable mirror, measure multiple pieces of surface shape data at equal intervals, and calculate the mean of these surface shape data point by point; the repeatability characteristic index is the root mean square rms and peak-to-peak value pv of the difference surface shape obtained by subtracting each surface shape data from the mean surface shape; the driving scheme of the stability test in step (1) applies voltage to the deformable mirror to flatten it, and records the surface shape data at equal intervals for a long time; the stability characteristic index is the pv of the difference surface shape between the subsequent time point and the initial surface shape; the difference between the repeatability and stability indicators is that the repeatability difference surface shape is obtained by subtracting the mean surface shape, while the stability is obtained by subtracting the surface shape at the initial moment.
[0043] Preferably, in the step (2), the control modes are pure defocus mode and Group mode; wherein, the weight distribution mode of the pure defocus control mode is that the same voltage is applied to each driver, and the surface shape generated by the deformable mirror is a defocus surface shape, or the weight of each driver is regarded as 1; the Group control mode has 25 voltage weight distribution modes, Group1 to Group25, which respectively drive DM to generate 25 basic aberration surfaces; the weight range of each weight distribution mode is between -1 and 1, and the total voltage limit intervals of different distribution modes are not exactly the same, but are all within the range of -300V to 300V.
[0044] Preferably, in step (3), the surface shape data is the deformable mirror surface shape data generated after each set of control voltages in step (2) is applied to the deformable mirror, and the surface shape data and the voltage data correspond to each other and serve as the input and output of the neural network control model data set respectively; the acquisition is completed by Fizeau interferometry detection; the surface shape characterization is selected by Zernike standard polynomial, and the characterization formula is shown in formula (1):
[0045]
[0046] Where m is the number of terms in the Zernike polynomial used, c k is the coefficient of the Kth term of the Zernike polynomial of the surface shape W, Z k The Kth term in the Zernike polynomial is removed, and the first three terms of the fitted Zernike coefficients representing the translation and tilt components are used, and the remaining coefficients starting from the fourth term are used as the input of the control model.
[0047] Preferably, in the step (4), data set allocation refers to dividing the data set into three parts: a training set, a validation set, and a test set; the structural hyperparameter refers to the number of all hidden layers and the number of neurons in each hidden layer; the multiple analysis and evaluation indicators in step (4) are used to measure the difference between the model output value and the true value in the data set, and are expressed by root mean square, mean absolute deviation, and relative deviation; the above parameter indicators are divided into: a loss function for analyzing the training effect and a result evaluation indicator for the verification and testing stages according to the application process.
[0048] Preferably, in step (5), the optimization variable is the number of neurons in the hidden layer, and the objective function is the evaluation index of the validation set in step (4), which is defined by the relative deviation between the real voltage and the predicted voltage; the optimization algorithm is a genetic algorithm, and its updating method is to hybridize and mutate the genes on the parent individuals in a certain proportion on the basis of the established initial population to generate new offspring individuals to be added to the population; and the survival of the fittest is carried out, and the individuals with the best objective function value are found from the new population to replace the individuals with the smallest fitness.
[0049] Preferably, in step (5), the selection process is represented as a roulette wheel, and the higher the objective function value, the greater the probability of being selected and retained; in this optimization problem, gene refers to the number of neurons in a hidden layer, individual refers to a one-dimensional vector composed of the number of neurons in all hidden layers, and population refers to an array composed of all individuals containing various numbers of neurons.
[0050] Preferably, in step (6), the training hyperparameters include: learning rate, learning rate decay parameter, optimization criterion parameter, and batch training size.
[0051] Preferably, in the step (7), the surface shape control accuracy index is given by the index of the difference surface shape obtained by point-to-point subtraction of the target surface shape and the actual surface shape, and the experimental step refers to applying the real voltage and the predicted voltage of the test set to the deformable mirror in turn to obtain the target surface shape and the actual surface shape, subtracting the two surface shapes point-to-point to obtain the difference surface shape, and then calculating the surface shape control accuracy through the parameters of the difference surface shape.
[0052] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes the steps of the above-mentioned embodiment method, and the storage medium can be: ROM / RAM, disk, optical disk, memory card, etc. Therefore, corresponding to the method of the present invention, the present invention also includes a deformable mirror control device based on machine learning, which is usually represented in the form of functional modules corresponding to the steps of the method. The device includes:
[0053] A detection module is configured to detect the basic characteristics of the deformable mirror: first, according to the characteristics of different basic characteristics, a deformable mirror driving scheme and appropriate characteristic evaluation indicators are determined; then the deformable mirror is driven according to the scheme, and the surface shape after each deformation is collected; after characterizing and processing the surface shape data, the evaluation index value of the corresponding characteristic is calculated to evaluate whether the current deformable mirror is sufficient to provide the hardware conditions required by the machine learning-based control method, and provide targeted adjustments;
[0054] A driving module is configured to control a deformable mirror in multiple modes and collect voltage data in a data set: first, one or more control modes of the deformable mirror driver are selected according to the deformable mirror driving mechanism used and the characteristics of the wavefront to be compensated, each control mode includes a weight distribution method of multiple drivers and a limit range of the total voltage, so as to produce deformable mirror shapes of different types and amplitudes; first, one is selected from all the required modes, and the deformable mirror is driven in sequence using various weight distribution methods in the currently selected control mode; a continuously changing total voltage is applied to each weight distribution method to change the change amplitude of the deformable mirror until the maximum limit voltage is reached; until all weight types in the current control mode are collected, the control mode is changed and the above process is repeated; in each driving process, the total voltage is multiplied by the allocated weight to calculate the voltage data of each driver in each driving process, and recorded in the form of a one-dimensional vector; according to actual application requirements, it is selected to store the data of multiple control modes separately as their own data sets, or to store them mixedly as one data set;
[0055] The acquisition module is configured to acquire, characterize and process the surface data in the data set: the acquired two-dimensional deformable mirror surface data is characterized as a one-dimensional feature vector, and then the interference introduced by the installation error such as translation and tilt is removed through processing; the processed surface data is recorded and imported into the data set;
[0056] The module is configured to build the basic framework of the fully connected neural network control model: first allocate the data set, then preliminarily select the structural hyperparameters of the fully connected network, and determine the various analysis and evaluation indicators of the model in each link of training, verification, and testing;
[0057] The optimization module is configured to optimize the structural hyperparameters of the fully connected neural network control model: select optimization variables from the structural hyperparameters, set appropriate initial values according to general rules to facilitate subsequent optimization; and use indicators that can evaluate the control accuracy of the neural network model as the optimization objective function; select an optimization algorithm to iteratively update the values of the optimization variables, use the optimized variables after each update to establish the neural network framework, retrain, and calculate new objective function values; and use the change trend of the objective function to guide the update of the optimization variables, iterate repeatedly until the objective function value reaches the optimal value and no longer changes, and use the optimization variable values at this time as the final structural hyperparameters to form the optimal structural framework;
[0058] The training module is configured to train the fully connected neural network control model: the training hyperparameters are dynamically adjusted in stages as the training progresses, the total training process is divided into multiple stages, and the training parameters are adjusted stage by stage from the first stage, and screened according to the training effect; after the parameters of the current stage have been adjusted to the optimal value, the parameters of this stage are kept unchanged, and then the training parameters of the next stage are adjusted and screened; the training requirements of each stage are met and the local optimum is jumped out to improve the training effect and model training accuracy;
[0059] A control module is configured to control the experimental test surface accuracy: first, determine the evaluation index of the surface control accuracy; then apply the real voltage and predicted voltage of the test set to the target surface and the actual surface obtained on the deformable mirror in turn, subtract the two surface shapes point by point to obtain the difference surface shape, and then calculate the surface control accuracy through the parameters of the difference surface shape.
[0060] A specific implementation example of the present invention is described in detail below. The deformable mirror control method based on machine learning is implemented in the following manner:
[0061] The process of establishing a deformable mirror control method based on machine learning is as follows Figure 1 As shown, the specific implementation steps are:
[0062] Step 1: Test the basic characteristics of the deformable mirror, such as stability and repeatability.
[0063] In the experiment, the deformable mirror was controlled by using different voltage weights and total voltages, and the data were measured at an interval of 0.5s after the deformable mirror was controlled. A total of 38 groups of surface data with different types and different pv were obtained. These included 25 groups of surface data with a total control voltage of 100V from Group2-25 and pure defocus, and 13 groups of surface data with a total voltage of -300V to 300V in Group1 at intervals of 50V. Each group of surface data was measured 11 times to obtain 11 pieces of surface data. The difference between each surface data and the mean value was used as the evaluation index of repeatability. The specific implementation process is to subtract the 11 surface data of each group from the mean surface data of this group point by point, obtain 11 difference surface data, and calculate the maximum value of the pv of the 11 difference surface data as the confidence interval of the repeatability of the deformable mirror. That is, under normal environmental conditions, the same voltage is applied to the deformable mirror, and the difference in the measured surface data is within the range of this pv value. In the example, the standard deviation of the two-dimensional surface data is also used as an auxiliary indicator to obtain the spatial distribution of repeatability on the mirror surface.
[0064] In this example, 8 sets of surface shape data were measured at intervals of 10 seconds within a total of 80 seconds. The type of surface shape is the unfolded plane of the deformable mirror. Since the surface shape at 0 seconds cannot be obtained, the surface shape at the 10th second is used as the initial surface shape, and 7 sets of difference surface shapes are obtained. The above operation is repeated twice, and the final result is the average of the two measurements.
[0065] Step 2: Use multiple modes to control the deformable mirror and collect voltage data in the data set.
[0066] In the example, two deformable mirror control methods, pure defocus method and Group method, are used to control the deformable mirror. Among them, the total voltage limit range of the pure defocus method is -300V to 300V, and 601 sets of data are collected at intervals of 1V within this range. In the Group method, the deformable mirror is driven at a voltage interval of 2V within the limit range of each group, and data is collected in sequence from Group1 to Group25, and a total of 6501 sets of voltage data are collected. However, since 16 groups contain data with a total voltage of 0V, in order to eliminate interference, only the surface data with a total voltage of 0V in Group1 is retained, so there are 6486 sets of valid data in total.
[0067] The deformable mirror used has 52 actuators, so all voltage data are recorded as a one-dimensional vector with 52 elements. In the example, three data sets are generated according to actual needs. The voltage data of the two modes are first distributed and stored separately into two data sets, and then the two are mixed and imported and stored as the third data set.
[0068] Step 3: Collection, characterization and processing of facial data in the dataset.
[0069] In this example, the surface data is collected by the zygo interferometer. The zygo interferometer is set to the QPSI mode for automatic measurement, and the results are saved as an int file. The characterization and processing process is implemented using matlab. The characterization process flow is as follows. First, read the int file and arrange the surface data in the file into a matrix of 1200×1200 pixels. Since the CCD is square and the deformable mirror surface is circular, the area data near the edge is invalid. In this example, only the 20mm diameter part of the mirror surface is taken. The circular area data of the required part needs to be cut out from all the data. The cutting first needs to determine the centroid and radius. Since the centroid position in the matrix is related to the position of the deformable mirror, the center of the matrix cannot be directly used as the centroid. Instead, the pixel position of the centroid is determined according to the centroid coordinate calculation formula, and the maximum distance of the remaining coordinates from the centroid is used as the number of pixels of the radius. Finally, the divided surface data is an inscribed circular domain of a square area of 223×223 pixels. The coordinates in the circular domain are normalized to the coordinate values of the unit circle domain, and can be substituted into equation (1) for fitting calculation. The processing process is to remove the first 3 coefficients after fitting the first 153 Zernike coefficients, and only use the 4th to 153th coefficients as the input of the control model and store them in the data set.
[0070] Step 4: Build the basic framework of the fully connected neural network control model
[0071] In this example, taking the Group data set as an example, the test set and the validation set are selected at equal voltage intervals in each Group, and the rest are training sets. Under this allocation method, the 6486 groups of data in the Group data set are divided into 5746 training sets, 150 validation sets, and 590 test sets.
[0072] The initial setting of the number of hidden layers in the setting of structural hyperparameters is related to the complexity of the functions that the model needs to implement. The larger the input and output dimensions, the more complex the functions, and the more hidden layers. However, if there are too many hidden layers, the number of weights to be trained in the model will increase significantly, the amount of calculation will increase, which will affect the training time and test efficiency of the model and easily cause overfitting. Therefore, the number of layers selected in this example is 5.
[0073] The number of neurons in each hidden layer is determined by the input and output dimensions. When the input dimension is greater than the output dimension, the number of units in the first hidden layer is less than the input dimension, the number of units in the last layer is greater than the output dimension, and the number of units in the middle layer is an integer close to the arithmetic progression of the units from the first layer to the last layer. In this example, the input dimension is 150 and the output dimension is 52, so the number of neurons in the middle 5 hidden layers can be initially set to 140, 120, 100, 80, and 60.
[0074] In this example, the loss function is shown in formula (2):
[0075]
[0076] Where N is the number of all output data, which is the product of the number of samples and the output dimension; y predict,i ,y real,i are the model output value and the true value in the data set for the i-th output data, respectively. The traditional root mean square loss function is modified here by multiplying the coefficient k=10 on the original function to find the appropriate training parameters more quickly. The indicators used for verification and testing are the mean absolute error and the accuracy defined by relative deviation.
[0077] The mean absolute deviation is shown in formula (3).
[0078]
[0079] Where i is the serial number of the test sample, N is the total number of test set samples, k is the serial number of the driver, and n is the total number of drivers. The accuracy acc is defined as the proportion of samples with voltage relative deviation less than a certain threshold t to the total number of samples, as shown in formula (4):
[0080]
[0081] Among them, t is the threshold value, which is 2% and 10% in this example, respectively expressed as acc 2% and acc 10% .
[0082] Step 5: Optimize the structural hyperparameters of the fully connected neural network control model
[0083] In this example, the optimization function is the validation set accuracy of the neural network, which is given in equation (4). The optimization process of the genetic algorithm is as follows: Figure 2 The specific instructions are as follows
[0084] First, set the initial population. The initial population contains 50 individuals, each of which has 5 genes (the number of neurons in the 5 hidden layers), and each gene is randomly generated within its own given interval. The interval setting is centered on the number of neurons in the initial model, with a range of ±20. The initial value ranges of the first to fifth genes are 120-160, 100-140, 80-120, 60-100, and 40-80, respectively. After that, hybridization and mutation are used to generate new individuals to update the population. The initial population is used as the parent individual. During the reproduction iteration process, there is a 10% probability of hybridization and a 10% probability of mutation to generate new individuals of the offspring. The method of implementing hybridization is to generate a random number between 0 and 1 at each iteration. When the random number is less than the hybridization probability of 0.1, two individuals are randomly selected and a gene is randomly selected to exchange with each other. The implementation of mutation is similar to this. When the output random number is less than the mutation probability of 0.1, a certain individual is randomly selected, and a random one of the five genes is changed within a given interval. The range of mutation is set to be the same as the generation range of the initial population gene, that is, 120-160, 100-140, 80-120, 60-100, 40-80. After the population is updated, the fitness of each individual is calculated, and the individual with the smallest fitness is replaced by the individual with the largest fitness. The above iterative process is performed 50 times to obtain the individual with the highest fitness in the final population.
[0085] Step 6: Use reasonable training strategies to train the fully connected neural network control model
[0086] Parameter settings for staged training. The main basis for determining the number of stages for staged training is the effect of the newly added stages on the improvement of the training effect. Generally, 2 to 3 stages are appropriate. The number of stages can be gradually increased first, and then selected based on the comparison of the model training effect, similar to the process of determining the network depth or the number of training times. The reason why it is not advisable to set too many is not only because too many stages will take too long to train, but also because the increase in the number of stages will significantly increase the number of training times, which is very likely to cause overfitting. In addition, some training hyperparameters have certain rules for setting the initial values of the previous and next stages. For example, the initial learning rate in the later stage should be set lower than that in the previous stage, and the batch training volume in the later stage should be set larger than that in the previous stage. Generally, all stages use the same loss function and learning rate update method to keep the loss function stable and convergent. However, the parameters within the optimization criteria and the learning rate decay method can be optimized and adjusted. The settings of the staged training of the parameters not specified can be optimized separately in each stage according to the optimization strategy of non-segmented training. It should be noted that structural parameters such as the number of neurons and regularization parameters cannot be modified during staged training. Otherwise, it will not achieve the purpose of two-stage training of the same network, but will instead result in the sequential training of two unrelated networks.
[0087] Step 7: Experimental test of surface shape control accuracy
[0088] In the example, the surface shape control accuracy index is the pv and rms of the difference surface shape. In the example, 30 groups of test surface shapes in the Group data set were verified, including 24 groups of surface shapes with a total voltage of about -100V in Group2 to 25, and 5 groups of surface shapes with voltages of -178V, -100V, -46V, 86V, and 218V in Group1, which can basically reflect the control accuracy of the model for different types and amplitudes of surface shapes. The pv and rms distribution of each group of difference surface shapes of the fully connected model of the Group data set were tested, and their mean values were calculated.
[0089] Combining the above steps, the surface shape control of the deformable mirror can be achieved.
[0090] The beneficial effects of the present invention are as follows:
[0091] 1. The deformable mirror control method and device based on machine learning disclosed in the present invention collect data sets using different control methods, and conduct preliminary basic characteristic detection and later surface accuracy test. The whole process specifically analyzes and evaluates the control effect of the fully connected network control model in practical applications, which is more suitable for practical application scenarios with many needs.
[0092] 2. The deformable mirror control method and device based on machine learning disclosed in the present invention, the surface data in the data set has been processed to remove interference, the best structural hyperparameters have been optimized, and training has been carried out in stages, which improves the fitting effect of the network and improves the actual control accuracy of the model.
[0093] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention are still within the protection scope of the technical solution of the present invention.
Claims
1. A deformable mirror control method based on machine learning, characterized in that: It includes the following steps: (1) Detecting the basic characteristics of the deformable mirror: First, determine the deformable mirror driving scheme and appropriate characteristic evaluation indicators according to the characteristics of different basic characteristics; then drive the deformable mirror according to the scheme and collect the surface shape after each deformation; After characterizing and processing the surface data, the evaluation index values of the corresponding characteristics are calculated to assess whether the current deformable mirror is sufficient to provide the hardware conditions required for the machine learning-based control method and provide targeted adjustments; (2) Controlling the deformable mirror with multiple modes and collecting voltage data in the data set: First, one or more control modes of the deformable mirror driver are selected according to the deformable mirror driving mechanism used and the characteristics of the wavefront to be compensated. Each control mode includes a weight distribution method for multiple drivers and a limit range of the total voltage to produce deformable mirror shapes of different types and amplitudes; First, select one from all the required modes, and use various weight distribution methods in the currently selected control mode to drive the deformable mirror in turn; Apply a continuously changing total voltage to each weight distribution method to change the change amplitude of the deformable mirror until the maximum limit voltage; After all weight types in the current control mode are collected, change the control mode and repeat the above process; During each driving process, multiply the total voltage by the allocated weight to calculate the voltage data of each driver in each driving process, and record it in the form of a one-dimensional vector; According to actual application requirements, choose to store the data of multiple control modes separately as their own data sets, or store them mixedly as one data set; (3) Collecting, representing and processing the surface data in the data set: The collected two-dimensional deformable mirror surface data is represented as a one-dimensional feature vector, and then processed to remove the interference introduced by the installation error such as translation and tilt; the processed surface data is recorded and imported into the data set; (4) Build the basic framework of the fully connected neural network control model: first allocate the data set, then preliminarily select the structural hyperparameters of the fully connected network, and determine the various analysis and evaluation indicators of the model in each link of training, verification, and testing; (5) Optimizing the structural hyperparameters of the fully connected neural network control model: Select optimization variables from the structural hyperparameters of step (4), set appropriate initial values according to general rules to facilitate subsequent optimization; and use the index that can evaluate the control accuracy of the neural network model as the optimization objective function; select an optimization algorithm to iteratively update the values of the optimization variables, use the optimized variables after each update to establish the neural network framework, retrain, and calculate the new objective function value; and use the change trend of the objective function to guide the update of the optimization variables, iterate repeatedly until the objective function value reaches the optimal value and no longer changes, and use the optimization variable value at this time as the final structural hyperparameter to form the optimal structural framework; (6) Training the fully connected neural network control model: Dynamically adjust the training hyperparameters in stages as the training progresses, divide the total training process into multiple stages, adjust the training parameters step by step from the first stage, and screen according to the training effect; after the parameters of the current stage have been adjusted to the optimal, keep the parameters of this stage unchanged, and then adjust and screen the training parameters of the next stage; meet the training requirements of each stage and jump out of the local optimum to improve the training effect and model training accuracy; (7) Experimental test of surface shape control accuracy: First, determine the evaluation index of surface shape control accuracy; then apply the real voltage and predicted voltage of the test set to the target surface shape and actual surface shape obtained by the deformable mirror in turn, subtract the two surface shapes point by point to obtain the difference surface shape, and then calculate the surface shape control accuracy based on the parameters of the difference surface shape.
2. The method for controlling a deformable mirror based on machine learning according to claim 1, characterized in that: In the step (1), the basic characteristics include the repeatability and stability of the deformable mirror. The repeatability driving scheme in step (1) is to repeatedly apply the same control voltage to the deformable mirror, measure multiple face shape data at equal intervals, and calculate the mean of these face shape data point by point; the repeatability characteristic index is the root mean square (RMS) and peak-to-peak value (PV) of the difference face shape obtained by subtracting each face shape data from the mean face shape; the driving scheme of the stability test in step (1) applies voltage to the deformable mirror to flatten it, and records the face shape data at equal intervals for a long time; the stability characteristic index is the PV of the difference face shape between the subsequent time point and the initial face shape; the difference between the repeatability and stability indicators is that the repeatability difference face shape is obtained by subtracting the mean face shape, while the stability is obtained by subtracting the face shape at the initial moment.
3. The deformable mirror control method based on machine learning according to claim 2, characterized in that: In the step (2), the control mode is a pure defocus mode and a Group mode; Among them, the weight distribution method of the pure defocus control method is to apply the same voltage to each driver, and the surface shape generated by the deformable mirror is the defocus surface shape, or the weight of each driver is regarded as 1; the Group control method has 25 voltage weight distribution methods, Group1 to Group25 drives DM to generate 25 basic aberration surfaces respectively; the weight range of each weight distribution method is between -1 and 1, and the total voltage limit range of different distribution methods is not exactly the same, but is within the range of -300V to 300V.
4. The deformable mirror control method based on machine learning according to claim 3, characterized in that: In the step (3), the surface shape data is the deformable mirror surface shape data generated after each set of control voltages in the step (2) is applied to the deformable mirror. The surface shape data and the voltage data correspond to each other and serve as the input and output of the neural network control model data set respectively. The acquisition is completed by using Fizeau interferometry detection. The Zernike standard polynomial is selected for surface shape characterization, and the characterization formula is shown in formula (1): Where m is the number of terms in the Zernike polynomial used, c k is the coefficient of the Kth term of the Zernike polynomial of the surface shape W, Z k The Kth term in the Zernike polynomial is removed, and the first three terms of the fitted Zernike coefficients representing the translation and tilt components are used, and the remaining coefficients starting from the fourth term are used as the input of the control model.
5. The method for controlling a deformable mirror based on machine learning according to claim 4, characterized in that: In the step (4), data set allocation refers to dividing the data set into three parts: training set, validation set, and test set; structural hyperparameters refer to the number of all hidden layers and the number of neurons in each hidden layer; the multiple analysis and evaluation indicators in step (4) are used to measure the difference between the model output value and the true value in the data set, and are expressed by root mean square, mean absolute deviation, and relative deviation; the above parameter indicators are divided into: loss function for analyzing training effects and result evaluation indicators for verification and testing stages according to the application process.
6. The method for controlling a deformable mirror based on machine learning according to claim 5, characterized in that: In the step (5), the optimization variable is the number of neurons in the hidden layer, and the objective function is the evaluation index of the validation set in step (4), which is defined by the relative deviation between the real voltage and the predicted voltage; the optimization algorithm is a genetic algorithm, and its updating method is to generate new offspring individuals to join the population after hybridizing and mutating the genes on the parent individuals in a certain proportion on the basis of the established initial population; and to select the individuals with the best objective function value from the new population to replace the individuals with the smallest fitness.
7. The deformable mirror control method based on machine learning according to claim 5, characterized in that: In the step (5), the selection process is represented as a roulette wheel, and the higher the objective function value, the greater the probability of being selected and retained; In this optimization problem, gene refers to the number of neurons in a hidden layer, individual refers to a one-dimensional vector composed of the number of neurons in all hidden layers, and population refers to an array composed of all individuals containing various numbers of neurons.
8. The deformable mirror control method based on machine learning according to claim 6 or 7, characterized in that: In step (6), the training hyperparameters include: learning rate, learning rate decay parameter, optimization criterion parameter, and batch training size.
9. The method for controlling a deformable mirror based on machine learning according to claim 8, characterized in that: In the step (7), the surface shape control accuracy index is given by the difference surface shape index obtained by point-to-point subtraction of the target surface shape and the actual surface shape. The experimental step refers to applying the real voltage and the predicted voltage of the test set to the target surface shape and the actual surface shape obtained on the deformable mirror in turn, subtracting the two surface shapes point-to-point to obtain the difference surface shape, and then calculating the surface shape control accuracy through the parameters of the difference surface shape.
10. A deformable mirror control device based on machine learning, characterized in that: It includes: The detection module is configured to detect the basic characteristics of the deformable mirror: first, according to the characteristics of different basic characteristics, a deformable mirror driving scheme and appropriate characteristic evaluation indicators are determined; then the deformable mirror is driven according to the scheme, and the surface shape after each deformation is collected; After characterizing and processing the surface data, the evaluation index values of the corresponding characteristics are calculated to assess whether the current deformable mirror is sufficient to provide the hardware conditions required for the machine learning-based control method and provide targeted adjustments; A driving module is configured to control a deformable mirror in multiple modes and collect voltage data in a data set: first, one or more control modes of a deformable mirror driver are selected according to the deformable mirror driving mechanism used and the characteristics of the wavefront to be compensated, each control mode includes a weight distribution method of multiple drivers and a limit range of the total voltage, and produces deformable mirror shapes of different types and amplitudes; first, one is selected from all the required modes, and the deformable mirror is driven in sequence using various weight distribution methods in the currently selected control mode; a continuously changing total voltage is applied to each weight distribution method to change the change amplitude of the deformable mirror until the maximum limit voltage is reached; until all weight types in the current control mode are collected, the control mode is changed and the above process is repeated; in each driving process, the total voltage is multiplied by the allocated weight to calculate the voltage data of each driver in each driving process, and recorded in the form of a one-dimensional vector; According to actual application requirements, choose to store the data of multiple control modes separately as their own data sets, or store them mixedly as one data set; The acquisition module is configured to acquire, characterize and process the surface data in the data set: the acquired two-dimensional deformable mirror surface data is characterized as a one-dimensional feature vector, and then the interference introduced by the installation error such as translation and tilt is removed through processing; the processed surface data is recorded and imported into the data set; The module is configured to build the basic framework of the fully connected neural network control model: first allocate the data set, then preliminarily select the structural hyperparameters of the fully connected network, and determine the various analysis and evaluation indicators of the model in each link of training, verification, and testing; The optimization module is configured to optimize the structural hyperparameters of the fully connected neural network control model: select optimization variables from the structural hyperparameters, set appropriate initial values according to general rules to facilitate subsequent optimization; and use indicators that can evaluate the control accuracy of the neural network model as the optimization objective function; select an optimization algorithm to iteratively update the values of the optimization variables, use the optimized variables after each update to establish the neural network framework, retrain, and calculate new objective function values; and use the change trend of the objective function to guide the update of the optimization variables, iterate repeatedly until the objective function value reaches the optimal value and no longer changes, and use the optimization variable values at this time as the final structural hyperparameters to form the optimal structural framework; The training module is configured to train the fully connected neural network control model: the training hyperparameters are dynamically adjusted in stages as the training progresses, the total training process is divided into multiple stages, and the training parameters are adjusted stage by stage from the first stage, and screened according to the training effect; after the parameters of the current stage have been adjusted to the optimal value, the parameters of this stage are kept unchanged, and then the training parameters of the next stage are adjusted and screened; the training requirements of each stage are met and the local optimum is jumped out to improve the training effect and model training accuracy; A control module is configured to control the experimental test surface accuracy: first, determine the evaluation index of the surface control accuracy; then apply the real voltage and predicted voltage of the test set to the target surface and the actual surface obtained on the deformable mirror in turn, subtract the two surface shapes point by point to obtain the difference surface shape, and then calculate the surface control accuracy through the parameters of the difference surface shape.
Citation Information
Cited By
Piezoelectric deformable mirror flattening control method
CN120065499A
Method and device for constructing digital real-time simulation model of generator stator
CN120068668A
Control method, device and equipment of multi-loop fast reflecting mirror and medium
CN120406269A
