An optical element surface shape regulation method based on a KAN neural network
Patent Information
- Application Number
- CN202610838690.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2046-06-11
AI Technical Summary
现有建立“支撑力—面形变化”映射关系的方法主要分为两类:一是基于有限元分析的灵敏度矩阵法,该方法假设线性叠加原理,难以准确描述涉及接触非线性或几何非线性的大变形行为,且无法处理高阶非线性耦合问题;二是基于传统多层感知机(MLP)的深度学习方法,该方法虽能拟合部分非线性关系,但存在过拟合风险高、外推能力弱、对多像差耦合难以有效解耦等缺陷,导致在实现特定Zernike像差项的独立调控时精度不足、控制过程不平滑
[0011] This invention presents a method for controlling the surface shape of optical components based on a KAN neural network. Leveraging the powerful nonlinear approximation capability and adaptive mesh refinement strategy of the KAN network, it can accurately model the complex nonlinear mapping relationship between support forces and surface shape, significantly improving prediction accuracy and generalization performance. By constructing a composite optimization objective function that includes target term bias, non-target term coupling penalty, and force constraint, and combining the gradient differentiability of the KAN network for back-optimization, it achieves independent control of specific Zernike aberration terms, effectively suppressing the coupling changes of non-target aberrations. Furthermore, compared to traditional MLPs, the KAN network has fewer parameters and stronger interpretability; the trained spline function can directly reflect the physical contribution of each support point to specific aberrations, providing an intuitive basis for support structure optimization. This invention provides a high-precision, strongly decoupled, and low-cost engineering solution for active surface shape correction in high-precision optical systems.
Smart Images

Figure CN122389502B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical element surface shape control technology, and in particular to an optical element surface shape control method based on KAN neural network. Background Technology
[0002] In large-aperture and high-precision optical systems, the surface shape accuracy of optical elements directly determines image quality. Surface distortion caused by factors such as gravity release, temperature changes, and clamping stress is typically compensated for using multi-point active flexible support technology. Existing methods for establishing the "support force-surface shape change" mapping relationship mainly fall into two categories: one is the sensitivity matrix method based on finite element analysis, which assumes the principle of linear superposition and is difficult to accurately describe large deformation behavior involving contact nonlinearity or geometric nonlinearity, and cannot handle high-order nonlinear coupling problems; the other is the deep learning method based on traditional multilayer perceptrons (MLPs), which, although able to fit some nonlinear relationships, suffers from high overfitting risk, weak extrapolation ability, and difficulty in effectively decoupling multiple aberrations, resulting in insufficient accuracy and an unsmooth control process when independently controlling specific Zernike aberration terms. Therefore, there is an urgent need for an optical element surface shape control method that can accurately model the nonlinear force-deformation mapping, possesses good generalization ability, and supports aberration decoupling optimization. Summary of the Invention
[0003] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0004] According to a first aspect of this application, a method for controlling the surface shape of an optical element based on a KAN neural network is provided, the method comprising the following steps:
[0005] S100, establish the APDL parametric finite element model of the optical element and the corresponding multi-point support system;
[0006] S200 generates multiple sets of force load samples within the allowable support force range, performs finite element simulation through APDL batch processing mode, obtains the corresponding optical surface deformation data, and fits the Zernike polynomial coefficients to construct a sample dataset.
[0007] S300, Build a KAN neural network model, train the model using the sample dataset, and establish a nonlinear mapping relationship from the support force input to the Zernike coefficient output;
[0008] S400: For the target Zernike term that needs to be adjusted, construct an optimization objective function that includes the target term deviation, non-target term coupling deviation, and force constraint.
[0009] S500, based on a trained KAN model, uses a gradient optimization algorithm to perform reverse optimization of the input support force, thereby obtaining the optimal support force distribution that achieves the target Zernike term adjustment.
[0010] The present invention has at least the following beneficial effects:
[0011] This invention presents a method for controlling the surface shape of optical components based on a KAN neural network. Leveraging the powerful nonlinear approximation capability and adaptive mesh refinement strategy of the KAN network, it can accurately model the complex nonlinear mapping relationship between support forces and surface shape, significantly improving prediction accuracy and generalization performance. By constructing a composite optimization objective function that includes target term bias, non-target term coupling penalty, and force constraint, and combining the gradient differentiability of the KAN network for back-optimization, it achieves independent control of specific Zernike aberration terms, effectively suppressing the coupling changes of non-target aberrations. Furthermore, compared to traditional MLPs, the KAN network has fewer parameters and stronger interpretability; the trained spline function can directly reflect the physical contribution of each support point to specific aberrations, providing an intuitive basis for support structure optimization. This invention provides a high-precision, strongly decoupled, and low-cost engineering solution for active surface shape correction in high-precision optical systems. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 A flowchart of a method for controlling the surface shape of optical elements based on a KAN neural network, provided in an embodiment of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] It should be noted that, based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Furthermore, this device and / or practice the method can be implemented using other structures and / or functionalities besides one or more of the aspects set forth herein.
[0016] The following will refer to Figure 1 The flowchart shown is a method for controlling the surface shape of optical elements based on KAN neural networks, which introduces such a method.
[0017] The method for controlling the surface shape of optical elements based on KAN neural networks may include the following steps:
[0018] In this embodiment, the implementation object and hardware environment are as follows:
[0019] Optical components: fused silica material transmission mirror, diameter D=200mm, thickness t=30mm.
[0020] Support structure: There are 12 support points evenly distributed on the outer ring of the back, of which 3 are fixed support points that are not adjustable, and the remaining 9 are axially adjustable flexible support points (N=9).
[0021] Computer configuration: Intel Xeon Gold 6248 CPU, 128GB RAM, Windows 10 operating system, ANSYS 2021R1 finite element software, Python 3.8 programming environment.
[0022] S100, establish the APDL parametric finite element model of the optical element and the corresponding multi-point support system.
[0023] In this embodiment, S100 includes the following steps:
[0024] S110 defines the material properties and unit type of the optical element.
[0025] Material properties: fused silica, elastic modulus E=73GPa, Poisson's ratio ν=0.17, density ρ=2200kg / m³.
[0026] Element type: The mirror body is divided using SOLID186 three-dimensional 20-node hexahedral elements; the contact nonlinearity between the support points and the mirror body is simulated using TARGE170 and CONTA174 elements.
[0027] S120, Establish the geometric model and mesh.
[0028] A cylinder with a diameter of 200 mm and a thickness of 30 mm was created using the APDL command CYLIND. Mapped meshing was used, with the element size set to 2 mm, resulting in approximately 15,000 nodes and 8,000 elements.
[0029] S130: Apply force load at the preset support point and set boundary conditions.
[0030] A local coordinate system is established at 12 points on the outer ring of the back, with 3 fixed support points constrained to UZ=0; axial forces Fi (i=1~9) are applied to the 9 adjustable support points, with the force direction perpendicular to the mirror surface. A weak spring constraint is set at the center of the lens to prevent rigid body displacement (spring stiffness 0.1N / mm).
[0031] This step utilizes APDL parametric modeling to achieve a full parametric description of the optical components and support system. This allows for automatic modification of geometric dimensions, material parameters, and support point positions during subsequent batch simulations, eliminating the need for manual remodeling. The parametric model provides a unified input interface for subsequent Latin hypercube sampling and nonlinear static analysis, significantly improving the efficiency and consistency of simulation data generation. Furthermore, the introduction of contact nonlinearity makes the model closer to actual physical behavior, providing a high-quality training data source for the KAN network to learn nonlinear mappings.
[0032] S200 generates multiple sets of force load samples within the allowable support force range, performs finite element simulation through APDL batch processing mode, obtains the corresponding optical surface deformation data, and fits the Zernike polynomial coefficients to construct a sample dataset.
[0033] This step generates a large number of force load samples through Latin hypercube sampling, automatically completes nonlinear finite element simulation using APDL batch processing scripts, and performs coordinate transformation, rigid body displacement removal, and Zernike fitting on the simulation results to construct a standard sample dataset for KAN network training.
[0034] Furthermore, step S200 includes the following steps:
[0035] S210, within the allowable support force range, uses Latin hypercube sampling to generate M sets of force load samples, and automatically calls the finite element solver in M cycles through the APDL batch processing control script to perform nonlinear static analysis, and automatically exports the full-field nodal displacement data of the lens optical surface.
[0036] Furthermore, M=6000, and the value range of each support force is [0.5N, 1.5N].
[0037] The specific implementation of this step is as follows:
[0038] (1) Determine the sampling space
[0039] Assume there are N adjustable flexible support points on the back of the optical element (N=9 in this embodiment). The axial force F at each support point is determined based on the actual actuator capability. i The range of values for is [F min ,F max [0.5N, 1.5N]. This range covers the force range for normal lens operation and leaves a margin to cope with extreme adjustment needs.
[0040] (2) Latin hypercube sampling (LHS)
[0041] M sets of force load samples (M=6000) are generated using the LHS method. The specific algorithm is as follows:
[0042] The range of each support force [0.5, 1.5] is divided into M non-overlapping sub-intervals (each interval has a length of 1.0 / M). A representative value is randomly selected from each sub-interval, resulting in M random numbers. The M random numbers for each support force are randomly arranged to form N random sequences of length M. The N sequences are then combined row-wise to obtain an M×N matrix, where each row represents a force load sample vector F. m =(f_{m1},f_{m2},...,f_{m N To ensure uniform coverage of the sample space, repeat the above process three times and select the combination with the largest maximum and minimum distances; this can be easily achieved using Python's pyDOE library or MATLAB's lhsdesign function.
[0043] (3) APDL batch control script
[0044] / POST1
[0045] SET, LAST
[0046] *DEL,ALL,OBJ ! Clean up residual variables to prevent interference between dynamic programming operations.
[0047] Select target surface
[0048] CMSEL,S,Top_Surface
[0049] *GET,n_cnt,NODE,0,COUNT
[0050] *IF,n_cnt,GT,0,THEN
[0051] Get the current DP number.
[0052] *GET,dp_raw,PARM,_DPN,VALUE
[0053] *IF,dp_raw,LT,0,THEN
[0054] dp_raw = 0
[0055] *ENDIF
[0056] dp_idx = NINT(dp_raw)
[0057] !Vectorized definition array (ID, X, Y, Z, UX, UY, UZ)
[0058] *DIM,v_id,ARRAY,n_cnt
[0059] *DIM,v_x,ARRAY,n_cnt
[0060] *DIM,v_y,ARRAY,n_cnt
[0061] *DIM,v_z,ARRAY,n_cnt
[0062] *DIM,v_ux,ARRAY,n_cnt
[0063] *DIM,v_uy,ARRAY,n_cnt
[0064] *DIM,v_uz,ARRAY,n_cnt
[0065] Batch scraping of raw data
[0066] *VGET,v_id(1),NODE,0,NLIST
[0067] *VGET,v_x(1),NODE,0,LOC,X
[0068] *VGET,v_y(1),NODE,0,LOC,Y
[0069] *VGET,v_z(1),NODE,0,LOC,Z
[0070] *VGET,v_ux(1),NODE,0,U,X
[0071] *VGET,v_uy(1),NODE,0,U,Y
[0072] *VGET,v_uz(1),NODE,0,U,Z
[0073] Open the file named Surface_m_DP_X.csv
[0074] *CFOPEN,Surface_m_DP_%dp_idx%,csv
[0075] Write to the table header.
[0076] *VWRITE,'NodeID','X','Y','Z','UX','UY','UZ'
[0077] (A8,',',A12,',',A12,',',A12,',',A12,',',A12,',',A12)
[0078] Vectorized high-speed writing
[0079] *VWRITE,v_id(1),v_x(1),v_y(1),v_z(1),v_ux(1),v_uy(1),v_uz(1)
[0080] (F10.0,',',G16.8,',',G16.8,',',G16.8,',',G16.8,',',G16.8,',',G16.8)
[0081] *CFCLOSE
[0082] Release array memory
[0083] *DEL,v_id
[0084] *DEL,v_x
[0085] *DEL,v_y
[0086] *DEL,v_z
[0087] *DEL,v_ux
[0088] *DEL,v_uy
[0089] *DEL,v_uz
[0090] *ENDIF
[0091] (4) Parallel acceleration
[0092] Since 6000 simulations involve a large amount of computation (approximately 90 seconds per simulation), the following strategies can be used to accelerate the process:
[0093] The 6,000 samples were divided into 20 batches of 300 samples each; ANSYS batch processing mode was run simultaneously on 20 computing nodes; the total time was reduced to approximately 300×90 / 3600=7.5 hours.
[0094] This step utilizes Latin hypercube sampling to ensure that the 6000 force load samples are uniform and unbiased within the design space, avoiding local clustering and edge omissions inherent in random sampling. This allows the KAN network to fully learn the nonlinear mapping between support forces and surface shape. The APDL batch processing script automates the entire process from force loading and solution to displacement derivation without manual intervention, significantly improving data generation efficiency (traditional manual simulation takes 30 minutes per run, reduced to 90 seconds after automation). The nonlinear statics analysis, with its large deformation option enabled, accurately captures contact and geometric nonlinear effects, laying the physical foundation for subsequent high-precision model training. The parallelization strategy keeps the total simulation time within an acceptable range, ensuring engineering practicality.
[0095] S220, the coordinate transformation and rigid body displacement removal processes are performed on the full-field node displacement data, and then the first 36 coefficients of the Fringe Zernike polynomial are fitted using the Schmidt orthogonalization method to construct the sample dataset.
[0096] The specific implementation of this step is as follows:
[0097] (1) Coordinate transformation
[0098] The node data exported for each working condition includes the original global coordinates (X, Y, Z) and three-dimensional displacements (UX, UY, UZ). First, the coordinate origin is translated to the geometric center of the lens:
[0099] Calculate the average coordinates (X_mean, Y_mean, Z_mean) of all nodes.
[0100] New coordinates: X'=X-X_mean,Y'=Y-Y_mean,Z'=Z-Z_mean.
[0101] If the lens is not an ideal plane (e.g., a sphere or aspherical surface), a best-fit plane or sphere needs to be fitted using the least squares method, and the coordinates are projected onto this reference plane. In this embodiment, the lens is a planar transmission mirror, so only translation is performed.
[0102] (2) Rigid body displacement
[0103] Since tiny rigid body displacements may remain in the finite element model (caused by insufficient constraints or numerical errors), they need to be eliminated.
[0104] Assuming all nodes on the optical surface of the lens constitute a rigid body, calculate its rigid body displacement:
[0105] Average translation: T_x=mean(UX), T_y=mean(UY), T_z=mean(UZ).
[0106] Average rotation: Fit the rotation matrix R using least squares so that Σ||(R·P) i +T)-(P i +U i )|| 2 Minimum, where P i represents the original node coordinates; i represents the node number on the optical surface.
[0107] Subtracting the rigid body component from the actual displacement of each node yields the purely elastic deformation displacement: U_elastic,i=U i -(T+(RI)·P i ).
[0108] The change in nodal elevation (along the mirror normal) after removing the rigid body is the actual change in the optical surface shape. For a plane mirror, the normal is the Z-axis, and the elevation change is Δz = UZ_elastic.
[0109] (3) Fringe Zernike polynomial fitting
[0110] Using the first 36 terms of the Fringe Zernike polynomial as basis functions, its polar coordinate form is: Z j (ρ,θ)=R_n m (ρ)·cos(mθ) or sin(mθ), where j is the single item number (Fringe number 1~36).
[0111] The steps are as follows:
[0112] Convert the node coordinates (X', Y') to normalized polar coordinates (ρ, θ): ρ = sqrt(X', Y') 2 +Y' 2 ) / R_max, where R_max is the half-diameter of the lens (100mm); θ=atan2(Y',X').
[0113] Construct a design matrix A with a size of (number of nodes P) × 36, where A[i,j] = Z. j (ρ i ,θ i );ρ i For the first The normalized polar radius of each node; θ i For the first The polar angle of each node.
[0114] Construct an observation vector b with size P×1, b[i]=Δz i (No. (elastic deformation height of each node after rigid body displacement).
[0115] Solving the least squares problem using the Schmidt orthogonalization method:
[0116] By performing Schmitt orthogonalization on each column of matrix A, we obtain an orthogonal matrix Q.
[0117] Calculate the coefficient vector c=Q T ·b.
[0118] Since the Zernike polynomials are orthogonal within the unit circle, this result is equivalent to direct projection: c j =Σ i Δz i ·Z j (ρ i ,θ i ) / Σ i Z j (ρ i ,θ i ) 2 .
[0119] Output 36 Zernike coefficients c1~c 36 (The unit is length, usually in nm or μm).
[0120] (4) Dataset Construction
[0121] The support force vector F of 6000 samples m The 9-dimensional Zernike coefficients and their corresponding 36 Zernike coefficients (36 dimensions) are stored as a CSV file, with each row formatted as: f1, f2, ..., f9, z1, z2, ..., z 36 At the same time, retain the original node displacement files for subsequent verification.
[0122] This step, through coordinate transformation and rigid body displacement removal, eliminates the overall rigid body motion caused by constraints in the finite element simulation, retaining only pure elastic deformation, thus enabling the Zernike coefficients to accurately characterize lens surface distortion. Schmidt orthogonalization is used to fit the first 36 terms of the Fringe Zernike equation. This leverages the orthogonality and completeness of the Zernike polynomial in the circular domain (stable fitting results and independent coefficients) and covers sufficiently high-order aberration terms (such as second-order astigmatism, second-order coma, and trilobal aberration), capturing mid-frequency ripples that affect image contrast. Compared to traditional Gram-Schmidt orthogonalization, Schmidt orthogonalization offers higher numerical stability and faster computational efficiency (P=15000, 36 terms, single fitting time <0.1 seconds). The final sample dataset contains surface responses under 6000 different force combinations, covering the linear and nonlinear regions of the support system, providing ample and diverse learning materials for training the KAN network. The standardized format of the dataset makes it easy to import directly into deep learning frameworks such as Python, MATLAB, or PyTorch, and it has good portability.
[0123] Furthermore, after step S200 and before step S300, the method further includes the following steps:
[0124] S230, select the 10 terms most sensitive to the support force response from all Zernike coefficients as the output target of the KAN model; the 10 terms are the 5th, 6th, 7th, 8th, 10th, 11th, 17th, 18th, 26th and 27th terms of Fringe Zernike.
[0125] After constructing the sample dataset in step S200 and before building the KAN network in step S300, this method selects the Zernike term, which is most sensitive to changes in support force, as the output target of the KAN model, thereby reducing the model dimensionality and improving training efficiency and generalization ability.
[0126] The specific implementation is as follows:
[0127] (1) Definition of sensitivity index
[0128] For each Zernike item ( ) and each adjustable support force ( In this embodiment (N=9), the Pearson correlation coefficient between the two was calculated. :
[0129] ;
[0130] Where: M is the total number of samples; For the first In the nth sample Zernike coefficient; For the first In the nth sample One supporting force; and These are the means of the corresponding variables.
[0131] (2) Overall sensitivity score
[0132] Since each Zernike term may be affected by multiple supporting forces, the first... The overall sensitivity score of the Zernike coefficient. for:
[0133] ;
[0134] That is, the average of the absolute values of the correlation coefficients between all supporting forces and the Zernike coefficient. The larger the value, the more sensitive the Zernike term is to changes in the overall support force.
[0135] (3) Screening threshold and results
[0136] The 36 Zernike coefficients were sorted according to Sort the data from largest to smallest and select the top 10 items with the highest sensitivity coefficients as the output targets of the KAN network.
[0137] The remaining 22 items had low sensitivity scores, indicating that these items are not sensitive to changes in support and can be regarded as quasi-static background quantities in subsequent regulation.
[0138] (4) Data Reconstruction
[0139] Extract these 10 Zernike coefficients from the original dataset and construct new input-output pairs:
[0140] Input: Support force vector (Same as before).
[0141] Output: Sensitive Zernike coefficient vector Arranged in a fixed order (e.g., [5,6,7,8,10,11,17,18,26,27]).
[0142] The 6000 samples are divided into a training set and a validation set in an 8:2 ratio for use in step S300.
[0143] It should be noted that if the aberration that needs to be adjusted in engineering is not among the above 10 items (e.g., spherical aberration), This can be forcibly added to the output target, and the number of network input nodes can be increased accordingly. The sensitivity screening steps of this invention are not limited to a fixed 10 items, but can be dynamically adjusted according to the aberration characteristics of the actual optical system.
[0144] This step quantitatively assesses the sensitivity of each aberration term to changes in support force by calculating the Pearson correlation coefficient between the Zernike coefficient and the support force, and selects the 10 most sensitive terms as the output targets of the KAN network. This dimensionality reduction process reduces the output dimension of the KAN network from 36 to 10, reducing the number of parameters by approximately 72% (taking the network structure in this embodiment as an example, the number of output layer parameters is reduced from 36×64 to 10×64), increasing the training speed by approximately 3 times, and significantly reducing the risk of overfitting. More importantly, the selected 10 terms are all higher-order astigmatism, coma, and triceps aberration, which are precisely the aberration types most difficult to independently correct in active optical control, and traditional linear methods often lack sufficient decoupling ability for these terms. By focusing on these sensitive terms, this invention enables the KAN network to learn the nonlinear mapping between support force and complex higher-order aberrations, laying a feature foundation for subsequent decoupling optimization. Sensitivity analysis only requires one offline calculation, and this feature set can be directly reused in subsequent training and optimization processes, with negligible computational overhead. Engineers can also use the sensitivity ranking results to deduce which support points contribute the most to a specific aberration, thereby guiding the improvement design of mechanical structures.
[0145] S300, Build a KAN neural network model, train the model using the sample dataset, and establish a nonlinear mapping relationship from the support force input to the Zernike coefficient output.
[0146] Furthermore, the input layer of the KAN neural network model has 9 nodes, which is equal to the number of adjustable support points, and 10 nodes in the output layer. The network contains three hidden layers with 16, 32, and 16 nodes, respectively. The interlayer connections use a learnable B-spline function as the activation function, with a spline order of 3 and a grid range covering the input normalization interval [-1, 1].
[0147] This step uses the sensitive Zernike terms selected in step S230 as the output target to build a KAN neural network, and establishes an accurate nonlinear mapping from support force to Zernike coefficients through adaptive mesh refinement and regularization training.
[0148] Furthermore, step S300 includes the following steps:
[0149] S310, construct a KAN neural network; where the number of nodes in the input layer of the KAN neural network is equal to the number of adjustable support points N, the number of nodes in the output layer is equal to the number of selected sensitive Zernike terms, and the connection edges of each layer are defined as a linear combination of a set of learnable B-spline basis functions.
[0150] The specific implementation is as follows:
[0151] (1) Network structure definition
[0152] Input layer: Number of nodes = Number of adjustable support points (In this embodiment) The input vector is the supporting force. Each component is first normalized to an interval. The normalization formula is ,in N, N.
[0153] Output layer: Number of nodes = Number of sensitive Zernike items (Corresponding to items 5, 6, 7, 8, 10, 11, 17, 18, 26, 27).
[0154] Hidden layers: Three hidden layers are used, with 16, 32, and 16 nodes respectively. The number of hidden layers and nodes can be adjusted according to the complexity of the optical components. This embodiment has been experimentally verified as the optimal configuration.
[0155] (2) KAN layer connection mechanism
[0156] Unlike traditional MLPs that use fixed activation functions on nodes, the KAN network places a learnable linear combination of B-spline basis functions on each layer's connection edge (weight). For the first layer... The first layer The node to the first The first layer The connection of nodes is defined with the activation function as follows:
[0157] ;
[0158] in: The input signal (i.e., the output value of the previous layer node); For the first indivual B-order spline basis functions; This represents the number of grid nodes (initially 5, gradually increasing during training). The order of the spline (in this embodiment, we take...) (i.e., cubic splines). These are the learnable coefficients (i.e., the parameters to be trained in the KAN network).
[0159] B-spline basis functions are defined on the interval [0, 1]. Above (normalized input range). Using an equidistant node sequence: .
[0160] (3) Forward propagation calculation
[0161] No. The first layer The output value of each node is:
[0162] ;
[0163] in, For the first The number of nodes in the layer. Unlike the "non-linear summation" of MLP, KAN is a "non-linear summation" (each connection is activated independently and then summed).
[0164] (4) Initialization
[0165] B-spline coefficients Xavier uniform initialization is used. To stabilize training, a "residual connection" term is added during initialization:
[0166] ;
[0167] in, For activation function, For the B-spline portion, It is a learnable scalar, initialized to 1.
[0168] The KAN network constructed in this step replaces the fixed activation function of the traditional MLP with a learnable combination of B-spline basis functions. This allows the network to adaptively learn arbitrary nonlinear relationships between support forces and Zernike coefficients without requiring a predefined function form. B-spline basis functions possess good local support and smoothness, enabling them to capture complex nonlinear features with fewer parameters (approximately 800 parameters in this embodiment, compared to approximately 5000 parameters for an equivalent MLP). The introduction of residual connections ensures stable gradient propagation during network initialization, accelerating convergence. Compared to the black-box nature of MLPs, the B-spline coefficients trained with KAN can be directly visualized, for example, by plotting the coefficients on a specific connection. The curves can visually demonstrate the nonlinear contribution of the support force to specific aberrations (such as saturation, dead zone, oscillation, etc.), providing physical insights for mechanical design.
[0169] S320 employs an adaptive mesh refinement strategy and a loss function with a regularization penalty term to train the KAN network; among which, the number of mesh nodes of the B-spline function is gradually increased with the increase of training rounds, transitioning from coarse-grained fitting to fine-grained fitting.
[0170] The specific implementation is as follows:
[0171] (1) Adaptive mesh refinement strategy
[0172] The fitting accuracy of B-splines depends on the number of grid nodes. (i.e., the degrees of freedom of the spline function). Initially, a smaller number of nodes are used. The system performs coarse-grained fitting and gradually refines the mesh as the training rounds increase to capture more refined nonlinear features.
[0173] The detailed strategy is as follows:
[0174] Phase 1 (epoch 0~100): With fewer nodes, the model tends to be smoother, avoiding overfitting.
[0175] Phase 2 (epochs 101-200): The initial coefficients with a denser grid are generated by interpolation based on the existing coefficients.
[0176] Phase 3 (epochs 201-300): .
[0177] Phase 4 (epochs 301-500): .
[0178] Coefficient inheritance method during mesh refinement: Let the old mesh node sequence be... The new grid node sequence is By solving the least squares problem, the old coefficients are... Mapping to new coefficients This ensures that the old and new spline functions are as consistent as possible within the interval. Specifically, this can be achieved using the spline interpolation function `scipy.interpolate.splev`.
[0179] (2) Loss function design
[0180] Mean squared error (MSE) is used as the basic loss, and an L2 regularization penalty term is added:
[0181] ;
[0182] in: This is the batch size (64 in this example). This represents the 10-dimensional sensitive Zernike coefficient vector predicted by the KAN network. The actual Zernike coefficients obtained from finite element simulation; For regularization coefficients, this embodiment takes... .
[0183] (3) Training hyperparameter settings
[0184] Optimizer: Adam );
[0185] Initial learning rate: ;
[0186] Learning rate scheduling: multiply by 0.8 every 100 epochs;
[0187] Batch size: 64;
[0188] Total epochs: 500 (but can be ended earlier if stopped early);
[0189] Early stopping condition: Stop if the validation set loss does not decrease for 20 consecutive epochs.
[0190] After training, the KAN-predicted 10 Zernike coefficients were tested on the validation set. The mean absolute error and maximum absolute error of the KAN-predicted 10 Zernike coefficients compared with the true values of the finite element method were both better than those of the MLP with the same number of parameters, proving that KAN has higher fitting accuracy.
[0191] This step employs an adaptive mesh refinement strategy, enabling the KAN network to progressively learn multi-scale features in the force-deformation mapping from coarse to fine mesh. The initial coarse mesh avoids overfitting due to high-frequency noise, while the later fine mesh ensures accurate fitting of higher-order nonlinearities, resulting in faster training speed and higher final accuracy compared to fixed-mesh methods. The regularization penalty term (L2) further suppresses overfitting, making the model's performance on the validation set close to that on the training set, demonstrating good generalization ability.
[0192] S400 constructs an optimization objective function that includes the target term deviation, non-target term coupling deviation, and force constraints for the target Zernike term that needs to be adjusted.
[0193] Furthermore, the optimization objective function L(F) is:
[0194] ;
[0195] in, This is the Zernike coefficient vector predicted by the KAN model, where k is the index of the target term. These are the weighting coefficients, and ; For the first The target value of the Zernike coefficient; For the prediction results, the first Zernike coefficient; For the first The initial values of the Zernike coefficients; is the initial support force vector; F is the support force vector.
[0196] This step addresses the practical optical element control task (e.g., correcting a specific aberration from its current value to a target value while keeping other aberrations as constant as possible and using minimal changes in support force), and constructs a composite optimization objective function. This function will serve as the loss function for backward optimization in step S500, and the optimal support force distribution will be solved using a gradient optimization algorithm. .
[0197] 1. The form and meaning of the objective function.
[0198] ;
[0199] First item: Target deviation
[0200] The KAN model predicted the first Zernike coefficient (i.e., the aberration term that needs to be adjusted).
[0201] The target value for this item (e.g., correcting astigmatism from 10nm to 5nm).
[0202] This forces the optimization algorithm to find a support force distribution that makes the target aberration as close as possible to the target value.
[0203] Second item: Non-target item coupling penalty
[0204] : The predicted first Zernike coefficient ( (i.e., all non-target items).
[0205] : No. The initial value of the Zernike coefficient (the surface shape before adjustment).
[0206] This suppresses changes in other aberrations caused by adjusting the target term, achieving aberration decoupling. The summation sign covers all non-target terms (9 in this embodiment, excluding the target term because the total number of sensitive terms is 10). (9 items remaining).
[0207] Third item: Constraints on changes in support force
[0208] Support force vector to be optimized (dimension) This embodiment ).
[0209] Initial support force vector (usually taken as the force value under the current working state, for example, 1.0N at each point).
[0210] The squared L2 norm of the support force change vector, i.e. .
[0211] This ensures that the optimal force distribution obtained will not deviate too far from the initial state, thus avoiding excessive actuator travel or exceeding the linear working range.
[0212] 2. Weighting coefficients Selection
[0213] Ensure that the adjustment accuracy of the target item is met first, while also considering decoupling requirements. Typical ratio: to This embodiment takes .
[0214] The intensity of the penalty for changes in control. If If the value is too large, it will inhibit force changes, making the target unattainable; if it is too small, it may result in a physically infeasible force distribution (such as negative force or exceeding the actuator's limits). The typical value range is... This embodiment takes .
[0215] The weighting coefficients can be determined through a small number of trial calculations or grid search: test several different weight combinations on the validation set, and select the combination that makes the error of the target term small, the RMS of the change of the non-target term small, and the force change norm moderate.
[0216] 3. Specific operational procedures in actual regulation
[0217] Suppose that the current state of an optical system (measured by a wavefront sensor or interferometer) yields the Zernike coefficient vector. The first one needs to be... Item from Adjust to .but:
[0218] 1. Obtain initial parameters:
[0219] Initial support force The actual output force of each support point at present (can be read by a force sensor or set to a nominal value).
[0220] Initial Zernike coefficients :Right now .
[0221] Target value : Set according to system requirements.
[0222] 2. Construct the optimization objective function:
[0223] Substitute the above values into ,in Calculated by a trained KAN model (with automatic differentiation supported).
[0224] 3. Call the optimizer (described in detail in step S500) to solve the problem. .
[0225] 4. Output optimal force distribution: Send to each actuator in the active support system.
[0226] Furthermore, if it is necessary to adjust multiple Zernike terms simultaneously (such as simultaneously correcting astigmatism and coma), the first term can be expanded into a weighted sum of squares of multiple target terms, and the set of non-target terms can be adjusted accordingly.
[0227] It can be adaptively adjusted during the iteration process. Initially, the decoupling penalty is increased, and later it is reduced to allow for more accurate target tracking.
[0228] The composite optimization objective function constructed in this step, for the first time, unifies the three core objectives of optical element surface shape control—precise correction of target aberrations, stabilization of non-target aberrations, and minimization of support force changes—into a single differentiable expression. Compared to the traditional sensitivity matrix method that relies on linear superposition, this invention achieves explicit decoupling by directly penalizing the offset of non-target terms, effectively extending actuator life and avoiding nonlinear effects. The weighting coefficients can be flexibly adapted to different scenarios, and the objective function is entirely based on KAN predictions. Automatic differentiation allows for efficient gradient calculation, avoiding the tediousness of finite difference calculations. Furthermore, by analyzing the optimal support force distribution, the support points that contribute the most to specific aberrations can be identified, providing a data-driven basis for structural optimization.
[0229] S500, based on a trained KAN model, uses a gradient optimization algorithm to perform reverse optimization of the input support force, thereby obtaining the optimal support force distribution that achieves the target Zernike term adjustment.
[0230] Furthermore, the gradient optimization algorithm employs the L-BFGS algorithm, with the iteration termination condition being that the rate of change of the objective function is less than 1%. Or it can reach the maximum number of iterations of 500.
[0231] This step fixes the parameters of the trained KAN model, only changing the support force vector. As an optimizable variable, the objective function constructed in step S400 is used. The optimal support force distribution that minimizes the objective function is obtained by back-solving using a gradient-based optimization algorithm (L-BFGS). This enables high-precision, decoupled control of specific Zernike terms.
[0232] The specific implementation is as follows:
[0233] 1. Optimize the problem definition
[0234] The KAN model has been trained in step S300, and the model parameters... Fixed and unchanging. For a given control task (target Zernike item index) Target value initial state , ), Define the optimization problem:
[0235] ;
[0236] in, The number of adjustable support points (in this embodiment, ), Each component is subject to physical amplitude constraints by the actuator: This embodiment handles boundary constraints through variable projection or gradient clipping.
[0237] 2. Gradient calculation: using KAN's automatic differentiation
[0238] Since the KAN network is composed of differentiable B-spline basis functions and linear combinations, the entire about gradient It can be calculated accurately and efficiently using automatic differentiation (AD) without the need for manual derivation or finite difference approximation.
[0239] 3. Optimization Algorithm: L-BFGS
[0240] The Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) algorithm, a quasi-Newton method, is employed and is suitable for medium to low dimensions. This addresses unconstrained or boundary-constrained optimization problems. Compared to ordinary gradient descent, L-BFGS approximates the Hessian inverse matrix using historical gradient information, exhibiting superlinear convergence speed, making it particularly suitable for this embodiment. Small-scale optimization.
[0241] 4. Iterative Process and Convergence
[0242] initialization: .
[0243] Forward propagation: computation .
[0244] Loss Calculation: Calculation .
[0245] Backpropagation: Calculating the gradient .
[0246] L-BFGS Update: Calculates search direction based on historical information Execution line search determines step size ,renew .
[0247] Convergence criterion: If the termination condition is met, exit; otherwise, return to forward propagation.
[0248] This step, based on a trained KAN model and a composite objective function, employs the L-BFGS gradient optimization algorithm to achieve efficient and accurate back-optimization of specific Zernike terms. Compared to existing technologies, it offers the following significant advantages: First, leveraging KAN's automatic differentiation capability, a single gradient calculation takes only 0.007 seconds, avoiding the cumbersome and computationally expensive finite difference or adjoint methods. Second, the L-BFGS algorithm achieves a high-precision solution within 369 iterations with superlinear convergence, with a total optimization time of only a few seconds, representing a nearly ten-thousand-fold speedup compared to directly calling finite element optimization. Third, the projected gradient method naturally handles the support force boundary constraints, ensuring the physical realizability of the solution. Fourth, a built-in verification feedback mechanism automatically corrects deviations between the surrogate model's predictions and the actual system through incremental learning, forming a closed loop of "simulation-training-optimization-verification," significantly improving engineering reliability.
[0249] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0250] While specific embodiments of the invention have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention.
Claims
1. A method for controlling a surface shape of an optical element based on a KAN neural network, characterized in that, The method includes the following steps: S100, establish the APDL parametric finite element model of the optical element and the corresponding multi-point support system; S200 generates multiple sets of force load samples within the allowable support force range, performs finite element simulation through APDL batch processing mode, obtains corresponding optical surface deformation data, and fits Fringe Zernike polynomial coefficients to construct a sample dataset. S300, Build a KAN neural network model, train the model using the sample dataset, and establish a nonlinear mapping relationship from the support force input to the Zernike coefficient output; S400, for the target Fringe Zernike term that needs to be adjusted, construct an optimization objective function that includes the target term deviation, non-target term coupling deviation and force constraint; S500, based on a trained KAN model, uses a gradient optimization algorithm to perform reverse optimization of the input support force, thereby obtaining the optimal support force distribution that achieves the target Fringe Zernike term adjustment.
2. The KAN neural network-based optical element surface shape regulation method according to claim 1, wherein, Step S200 includes the following steps: S210, within the allowable support force range, uses Latin hypercube sampling to generate M sets of force load samples, and uses APDL batch processing control script to automatically cyclically call the finite element solver to perform M nonlinear static analyses, and automatically export the full-field nodal displacement data of the lens optical surface. S220, the coordinate transformation and rigid body displacement removal processes are performed on the full-field node displacement data, and then the first 36 coefficients of the Fringe Zernike polynomial are fitted using the Schmidt orthogonalization method to construct the sample dataset.
3. The method for controlling the surface shape of optical elements based on a KAN neural network according to claim 2, characterized in that, M=6000, and the value range of each support force is [0.5N, 1.5N].
4. The method for controlling the surface shape of optical elements based on a KAN neural network according to claim 1, characterized in that, Step S300 includes the following steps: S310, construct a KAN neural network; where the number of nodes in the input layer of the KAN neural network is equal to the number of selected sensitive Fringe-Zernike terms, the number of nodes in the output layer is equal to the number of adjustable support points N, and the connection edges of each layer are defined as a linear combination of a set of learnable B-spline basis functions. S320 employs an adaptive mesh refinement strategy and a loss function with a regularization penalty term to train the KAN network; among which, the number of mesh nodes of the B-spline function is gradually increased with the increase of training rounds, transitioning from coarse-grained fitting to fine-grained fitting.
5. The method according to claim 4, characterized in that, The KAN neural network model has 10 nodes in the input layer and 9 nodes in the output layer, which is equal to the number of adjustable support points. The network contains three hidden layers with 16, 32, and 16 nodes respectively. The inter-layer connections use a learnable B-spline function as the activation function, the spline order is 3, and the grid range covers the input normalization interval [-1, 1].
6. The method for controlling the surface shape of optical elements based on a KAN neural network according to claim 1, characterized in that, After step S200 and before step S300, the method further includes the following steps: S230, Select the 10 terms most sensitive to the support force response from all Fringe Zernike coefficients as input features of the KAN model; the 10 terms are the 5th, 6th, 7th, 8th, 10th, 11th, 17th, 18th, 26th and 27th terms of Fringe Zernike.
7. The method for controlling the surface shape of optical elements based on a KAN neural network according to claim 1, characterized in that, The optimization objective function L(F) is: ; in, This is the Fringe Zernike coefficient vector predicted by the KAN model, where k is the index of the target term. These are the weighting coefficients, and ; For the first The target value of the Fringe Zernike coefficient; For the prediction results, the first Fringe Zernike coefficient; For the first Initial values for the Fringe Zernike coefficients; is the initial support force vector; F is the support force vector.
8. The method for controlling the surface shape of optical elements based on a KAN neural network according to claim 1, characterized in that, In step S500, the gradient optimization algorithm adopts the L-BFGS algorithm, and the iteration termination condition is that the rate of change of the objective function is less than 1%. Or it can reach the maximum number of iterations of 500.
9. The method for controlling the surface shape of optical elements based on a KAN neural network according to claim 1, characterized in that, The multi-point support system of the optical element includes at least 12 support points, of which 3 are fixed support points that are not adjustable, and the remaining 9 are flexible support points that are axially adjustable.
Citation Information
Patent Citations
Construction method of spatial primary mirror structure response prediction model based on IPSO-IGA-BPNN algorithm
CN112966423A
Photo-magnetically actuated deformable mirror
US20240168281A1