Metal superstructure inverse design method of physical heuristic neural network based on finite difference hard constraint embedding
By employing a finite difference hard constraint embedded physical-inspired neural network method, the problems of high computational cost, difficult convergence, and complex constraint control in the design of complex electromagnetic structures in existing technologies are solved. This method enables high-degree-of-freedom optimization design of complex metal structures and is applicable to electromagnetic wave communication, wireless power transmission, and the design of novel electromagnetic devices.
Patent Information
- Application Number
- CN202511487057.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies suffer from high computational costs, difficulty in convergence, complex constraint control, and limited structural expression in the design of complex electromagnetic structures. Traditional PINN methods are difficult to handle discontinuous boundaries in the design of metal structures, and have high computational complexity and lack explicit physical information exchange.
A physically inspired neural network method with finite difference hard constraint embedding is adopted to transform physical constraints from soft constraints to hard constraints. By replacing automatic differentiation with finite difference, the discrete boundaries of complex metal structures are directly processed, the physical information exchange between sampling points is explicitly established, the loss function term is simplified, and the training stability and design freedom are improved.
It significantly reduces computational costs, improves training stability and physical consistency, enables rapid inverse design of complex electromagnetic devices, is applicable to both metallic and dielectric structures, and enhances design freedom and applicability.
Smart Images

Figure CN121328211A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electromagnetic wave propagation, and particularly relates to a metal superstructure inverse design method based on a finite difference hard constraint embedded physical heuristic neural network. BACKGROUND
[0002] At present, the design of electromagnetic devices mainly relies on a forward design method, that is, based on prior models and experimental experience, an initial structure of the device is first determined, then parameters are continuously adjusted to meet target performance, and finally different functional modules are combined. This "decoupled design" and "building block integration" method not only has a long design cycle, but also has a strong dependence on prior knowledge, resulting in limited design freedom. At the same time, the module integrated device is often bulky, which is difficult to meet the demand of miniaturization and multifunctionalization of modern electromagnetic systems.
[0003] To overcome the limitations of the forward design, inverse design methods have gradually attracted attention. Among them, topology optimization can optimize the structure or material distribution globally according to the target, has a large search space, but the calculation cost is extremely high, needs a large number of full-wave simulation verification, and lacks commonality between different designs, which is difficult to reuse. In recent years, neural networks have been used to establish the correspondence between structure and target due to their strong non-linear mapping ability, which can quickly generate device structures that meet the requirements. However, the training of traditional neural networks is heavily dependent on large-scale simulation data, and the data collection and calculation overhead is large.
[0004] In view of the above problems, a physical heuristic neural network (PINN) is proposed and applied to electromagnetic inverse design. PINN directly introduces physical constraints (partial differential equations, boundary conditions, etc.) into the loss function of the neural network, thereby reducing the dependence on data while realizing the unified solution of the forward problem and the inverse problem in the same framework. However, the existing PINN method based on automatic differentiation still has the following technical problems in complex problems:
[0005] (1) Automatic differentiation is easily disturbed by errors in gradient calculation, affecting network convergence effect;
[0006] (2) As the problem size increases, the computational complexity increases exponentially, and the calculation overhead rises sharply;
[0007] (3) Physical constraints are usually integrated into the loss function in the form of soft constraints, making it difficult to control the weights and complicating the training process;
[0008] (4) There is a lack of explicit physical information exchange between sampling points, making it difficult to ensure global physical continuity;
[0009] (5) In metal structure design, automatic differentiation is difficult to handle discontinuous boundaries, and needs to rely on analytical modeling, which limits the design freedom.
[0010] In summary, the existing PINN-based inverse design method still has problems such as high computational cost, convergence difficulty, complex constraint regulation, and limited structure expression in the design of complex electromagnetic structures, and a new method is needed to improve the efficiency, accuracy and applicability of inverse design. SUMMARY
[0011] The purpose of the present application is to overcome the above-mentioned defects of the prior art, and to provide a metal superstructure inverse design method based on finite difference hard constraint embedding of a physically inspired neural network. By replacing automatic differentiation with finite difference, the physical constraints are converted from "soft constraints" to "hard constraints", which reduces the computational cost while explicitly establishing the physical information exchange between sampling points, thereby improving the training stability and physical consistency. In addition, this method can directly handle the discrete boundary of complex metal structures, avoiding the dependence on analytical modeling, and significantly improving the degree of freedom and applicability of inverse design.
[0012] The technical problem proposed in the present application is solved as follows:
[0013] A metal superstructure inverse design method based on finite difference hard constraint embedding of a physically inspired neural network, comprising the following steps:
[0014] Step 1: Establish a calculation model;
[0015] Construct a finite calculation domain in three-dimensional free space , and set an optimization domain in the finite calculation domain as the region of the metal superstructure to be designed, i.e. denoted as the scattering domain, represents the removal operation;
[0016] Step 2: Construct an optimization problem;
[0017] Introduce a plane wave as an incident field in the finite calculation domain , denoted as the finite calculation domain , which is equivalent to a two-dimensional propagation problem of TM waves along the y-axis direction; in the finite calculation domain , the incident field interacts with the metal superstructure to produce a scattered field; the scattered field satisfies the Helmholtz equation, and the boundary of the finite calculation domain satisfies the Mur absorbing boundary condition, and the total field in the region where the metal superstructure is located is zero;
[0018] By adjusting , the total field is focused in the selected target region , and an optimization problem is constructed;
[0019] Step three, constructing a finite difference model;
[0020] According to the finite difference, the non-zero term in the Helmholtz equation is discretized to obtain the residual term of the discretized partial differential equation;
[0021] Step four, constructing a structure optimization network model;
[0022] The structure optimization neural network is a full connection neural network, including an input layer, a normalization layer, a sine activation function, a plurality of intermediate layers, a softmax activation function, a discrimination layer and an output layer connected in sequence;
[0023] The input of the structure optimization neural network is the optimization domain uniformly sampled coordinate points ; in the normalization layer, the input is scaled to the wavelength scale to convert to normalized coordinates, and the normalized coordinates are multiplied by 2π; then sequentially through the sine activation function, the intermediate layer and the softmax activation function; the intermediate layer selects the tanh activation function;
[0024] When forward propagating, the discrimination layer performs binary processing on the output of the softmax activation function, and adopts a straight-through estimation strategy to output from the output layer; the output of the structure optimization neural network is ; when back propagating, the discrimination operation of the discrimination layer is skipped, and the structure parameter gradient of the structure optimization neural network is directly transmitted back from the softmax activation function layer to each layer;
[0025] Step five, field prediction network construction;
[0026] The field prediction network includes a main network and a fine-tuning layer connected in sequence; the main network selects a residual neural network, including an input layer, a plurality of residual hidden layers and an output layer connected in sequence; the fine-tuning layer is composed of variables same in number as the sampling points of the field prediction network, and each sampling point has a corresponding trainable variable in the fine-tuning layer to adjust the output field value of each sampling point;
[0027] Step six, embedding boundary conditions and metal superstructures to be optimized in the form of hard constraints;
[0028] The scattered field output by the field prediction network is converted into a two-dimensional field distribution format; the Mur absorbing boundary condition is discretized in the central difference format, the scattered field of the boundary point is expressed as a linear combination of the internal points, the scattered field of the boundary point output by the field prediction network is modified, and the modified scattered field after embedding the absorbing boundary condition is obtained; the metal superstructure to be optimized is embedded in the modified scattered field after embedding the absorbing boundary condition in the form of hard constraints;
[0029] Step seven, loss function construction;
[0030] Constructing a loss function using the residuals of discretized partial differential equations Construct the target loss function using the total field of the scattering domain and the target focusing region. and auxiliary loss function Construct the total loss function ,in , and They represent , and The weights;
[0031] Step 8: Construct a training strategy;
[0032] A periodic alternating training strategy is adopted. During the training process, the structure optimization network is first frozen, and only the field prediction network is updated to fit the current metal superstructure. Then the structure optimization network is unfrozen to optimize the parameters of the metal superstructure.
[0033] The field prediction network uses an exponentially decaying learning rate, while the structure optimization network uses a cosine annealing strategy. A periodic save and rollback mechanism is set up to automatically roll back to the historical optimal parameters when a significant increase in the loss function or a deviation from the constraints is detected.
[0034] Step 9: Based on the total loss function constructed in Step 7, train the structure optimization network and the field distribution network using the training strategy constructed in Step 8 to obtain a metal superstructure that satisfies the set target field distribution.
[0035] Furthermore, the specific process of step two is as follows:
[0036] Introducing a plane wave as the incident field into a finite computational domain, it can be expressed as:
[0037]
[0038] in, Let x represent the incident field, and x, y, and z represent the finite computational fields, respectively. Position coordinates in the x, y, and z directions. The incident field amplitude, The symbol for the imaginary part. Represents the propagation constant in free space;
[0039] Denote the finite computational field Extending along the y-axis and remaining constant, the wave propagation model is equivalent to the two-dimensional propagation problem of TM waves. Equivalent to ;
[0040] In a finite computational domain In the process, the incident field interacts with the metallic superstructure, generating a scattered field. ;
[0041] make The scattered field satisfies the following condition:
[0042]
[0043] in, It is a two-dimensional Laplace operator;
[0044] Finite computational domain Limited, making In a finite computational domain boundary The following Mur absorption boundary conditions apply:
[0045]
[0046] Where n is the boundary The normal vector, This indicates taking the partial derivative in the n direction;
[0047] In the region where the metallic superstructure is located The main field inside Let it be zero. It can be expressed as the following formula:
[0048]
[0049] Among them, binary functions , Indicates a removal operation;
[0050] By adjusting This makes the total field In the selected target area To achieve focus, the inverse design problem can be represented as the following optimization problem:
[0051]
[0052] in, This indicates a modulo operation.
[0053] Furthermore, the specific process of step three is as follows:
[0054] According to finite difference pairs Discretization yields the discretized partial differential equation residuals. Represented as:
[0055]
[0056] in, After discretization Corresponding grid coordinates Represents grid points The scattered field at that location, This represents the grid step size in the x-direction. Let the grid step size in the z-direction be denoted by ; let the residual term of the partial differential equation be denoted by . .
[0057] Furthermore, the specific process of step five is as follows:
[0058] The field prediction network consists of a main network and fine-tuning layers cascaded together, as follows:
[0059]
[0060] in, The complex electric field output represents the scattered field. express The complex number field, where N represents the number of sampling points; input , and These represent the main network and the fine-tuning layer, respectively. and These are the sets of network parameters for the main network and the fine-tuning layer, respectively.
[0061] The main network uses a residual neural network, consisting of a cascaded input layer, several residual hidden layers, and an output layer; the layers of the main network are sequentially numbered from layer 1 to layer K, and each layer is represented by a [missing information - likely a typo]. ~ The main network is represented as follows:
[0062]
[0063] in, Indicates wavelength. , and These represent the input, weight matrix, and bias vector of the k-th layer of the main network, respectively.
[0064] The fine-tuning layer consists of variables with the same number of sampling points as the field prediction network, and each sampling point has a relative value in the fine-tuning layer.
[0065] The corresponding trainable variables can adjust the output field value at each sampling point. The set of trainable variables is denoted as . .
[0066] Furthermore, the specific process of step six is as follows:
[0067] The scattering field output by the field prediction network is denoted as This is converted into a two-dimensional field distribution format consistent with physical space. ;
[0068] The Mur absorbing boundary conditions are discretized in the form of central difference, and the field values at the boundary points are represented as a linear combination of the interior points.
[0069] After embedding the absorbing boundary condition, the corrected scattering field corresponding to the boundary point is expressed as:
[0070]
[0071] in, Let P represent the corrected scattered field after embedding the absorption boundary conditions, where 1 ≤ i ≤ P and 1 ≤ i ≤ Q, and P and Q represent the number of sampling points along the x and z directions, respectively. The scattered field is represented by the output of the field prediction network;
[0072] The modified scattering field after the absorbing boundary conditions is embedded into the metallic superstructure to be optimized in the form of hard constraints. Represented as:
[0073]
[0074] in, This indicates element-wise multiplication of matrices.
[0075] Furthermore, the specific process of step seven is as follows:
[0076] Constructing the scattering field loss function Represented as:
[0077]
[0078] in, This indicates the number of sampling points within the metal superstructure region. express The residual term of the partial differential equation at the location, where p is the order;
[0079] Construct the target loss function :
[0080]
[0081] The scattering domain is divided into several parts, and the scattering domain where the target focusing region is located is denoted as . The scattering domain that does not include the target focusing region is denoted as ;Target Indicates the scattering domain where the target focusing area is located. Number of internal sampling points; Represents the target ideal focusing matrix. This indicates the target focusing area, and max indicates taking the maximum value;
[0082] Constructing an auxiliary loss function :
[0083]
[0084] in, Indicates the number of sampling points in the target focus area;
[0085] Construct the total loss function :
[0086]
[0087] in, , and They represent , and The weight.
[0088] The beneficial effects of this invention are:
[0089] The method described in this invention replaces automatic differentiation with finite difference, and applies PDE constraints directly to the neural network output in a hard constraint manner, realizing the direct exchange of physical information between different sampling points and ensuring the global continuity of field prediction. Compared with the existing AD-PINN technology, it avoids the interference of small errors in the hidden layer on gradient calculation, and decouples the partial differential calculation cost in PDE constraints from the scale of the neural network, significantly reducing the consumption of computing resources.
[0090] The method described in this invention handles boundary conditions and the structure to be optimized through hard constraints, enabling discrete structural parameters to directly affect the neural network output. This simplifies the loss function term, reduces the training instability problem caused by the difficulty in adjusting the weights of the loss function in the existing PINN technology, and realizes high-degree-of-freedom optimization design for complex structures.
[0091] The method described in this invention can be applied to the inverse design of both metal and dielectric structures. To address the problem that gradients cannot be propagated in discontinuous regions of metal structures, this invention utilizes a hard constraint mechanism to allow structural changes to directly participate in network training without interfering with network convergence, thereby solving the problem of limited design domain in the inverse design of metal structures using automatic differentiation PINN in the prior art.
[0092] The method described in this invention outperforms existing technologies such as AD-PINN and full-wave simulation-driven neural network design methods in terms of computational efficiency and adaptability. The method described in this invention can significantly reduce computational costs while maintaining prediction accuracy, realize rapid inverse design of complex electromagnetic devices, and is applicable to any network architecture, with good scalability and compatibility. Attached Figure Description
[0093] Figure 1 This is a flowchart illustrating the reverse design method for metal superstructures described in this invention.
[0094] Figure 2 This is a schematic diagram illustrating the inverse design of a two-dimensional free-space transmitted wave focusing metallic superstructure using the method described in the embodiments.
[0095] Figure 3 This is a schematic diagram of the structure optimization neural network in the method described in the embodiment;
[0096] Figure 4 This is a schematic diagram of the structure of the field prediction network in the method described in the embodiment;
[0097] Figure 5 This is a comparison chart of center-focusing prediction and simulation results in the method described in the embodiment;
[0098] Figure 6 This is a comparison chart of off-axis focusing prediction and simulation results in the method described in the embodiment. Detailed Implementation
[0099] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0100] This embodiment provides a method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding, applied to target device design. It establishes the metallic superstructure to be optimized and its physical boundary conditions within the design region, and uses a Python program to jointly optimize the structural parameters and electromagnetic field distribution. In this process, the partial differential equations are approximated using the finite difference method, and the structure to be optimized is embedded as a hard constraint in the training process of the neural network, allowing structural changes to directly affect the network output without interfering with computational stability. Simultaneously, the mapping relationship between the structure and the field is modeled and iteratively optimized through the neural network, gradually adjusting the structural parameters to meet the predetermined electromagnetic functional objectives, thereby obtaining an electromagnetic device structure that meets the design requirements. This method balances design freedom, computational efficiency, and prediction accuracy, enabling inverse design of complex structures without relying on a large amount of full-wave simulation data.
[0101] The flowchart of the method described in this embodiment is shown below. Figure 1 As shown, it includes the following steps:
[0102] Step 1: Establish a computational model;
[0103] Constructing a finite computational domain in three-dimensional free space And within the domain, the region of the metal superstructure to be designed, i.e., the optimization domain, is defined. , Let it be denoted as the scattering domain. This represents a removal operation. The finite computational domain model is used to implement electromagnetic functions such as focusing and beam control.
[0104] Step two, construct the optimization problem;
[0105] Introducing a plane wave as the incident field into a finite computational domain, it can be expressed as:
[0106]
[0107] in, Let x represent the incident field, and x, y, and z represent the finite computational fields, respectively. Position coordinates in the x, y, and z directions. The incident field amplitude, The symbol for the imaginary part. This represents the propagation constant in free space.
[0108] Assuming the finite computational domain (containing the metallic superstructure) extends invariantly along the y-axis, the wave propagation model within this finite computational domain can be equivalent to a two-dimensional propagation problem of TM waves, eliminating the y-direction variable. Equivalent to Therefore, it is possible In-plane creation such as Figure 2 The model shown.
[0109] Within a finite computational domain, the incident field interacts with the metallic superstructure, generating a scattered field. .
[0110] make The scattered field should satisfy the following condition:
[0111]
[0112] in, It is a two-dimensional Laplace operator.
[0113] Due to the finite computational domain Limited, making In a finite computational domain boundary The following Mur absorption boundary conditions should apply:
[0114]
[0115] Where n is the boundary The normal vector, This indicates taking the partial derivative in the n direction.
[0116] For any metallic structure, electromagnetic waves cannot propagate within it, and its internal total field... Zero; in the region where the metallic superstructure is located. The total field size is zero, so let This constraint can be expressed as follows:
[0117]
[0118] Among them, binary functions , This indicates a removal operation, used to describe the distribution of free space and metal structures in the computational region.
[0119] Expectation Adjustment This makes the total field In the selected target area To achieve focus, this inverse design problem can be represented as the following optimization problem:
[0120]
[0121] in, This indicates a modulo operation.
[0122] Step 3: Construct a finite difference model;
[0123] The partial differential equations that control the propagation of electromagnetic waves Discretization is performed using the finite difference method. The residual terms of the partial differential equation are discretized based on the finite difference method, making the solution accuracy and computational cost dependent only on the number of samples, and no longer affected by the complexity of the network structure.
[0124] Specifically, the residual terms of the partial differential equation can be... Discretization:
[0125]
[0126] in, After discretization Corresponding grid coordinates Represents grid points The scattered field at that location, This represents the grid step size in the x-direction. Let the grid step size in the z-direction be denoted by ; let the residual term of the partial differential equation be denoted by . .
[0127] Secondly, to improve training stability and physical accuracy, boundary conditions are incorporated into the PDE loss function as hard constraints, so that the optimization process of the neural network is simultaneously constrained by both structural parameters and physical laws.
[0128] Step 4: Construct a structurally optimized network model;
[0129] The structure-optimized neural network is a fully connected neural network, and its structure is as follows: Figure 3As shown, it includes an input layer, a normalization layer, a sinusoidal activation function, several intermediate layers, a softmax activation function, a discriminant layer, and an output layer, which are cascaded in sequence.
[0130] The input to the structural optimization neural network is the region of the metallic superstructure to be designed, i.e., the optimization domain. The input coordinates (x, z) are uniformly sampled within the network. To enhance the network's ability to represent subwavelength details and high-frequency features, the input coordinates are scaled to the wavelength scale in the normalization layer, converted to normalized coordinates, and then multiplied by 2π. After passing through a sinusoidal activation function, the nonlinear response energy of the sinusoidal basis function is effectively excited. The tanh activation function is used in the intermediate layers to enhance nonlinear modeling capabilities while maintaining the continuity of the output and the transmissibility of the gradient. The softmax activation function is used to classify the output of the intermediate layers.
[0131] During forward propagation, the discriminant layer binarizes the output of the softmax activation function and uses a pass-through estimation strategy to output the result from the output layer; the output of the structure-optimized neural network is... , representing the presence or absence of the metallic superstructure at the corresponding coordinates. During backpropagation, the discrimination operation is skipped, and the parameter gradients of the neural network structure are directly transmitted from the softmax layer back to each layer of the network. This forward and backward propagation mechanism ensures the binary representation of the metallic superstructure while maintaining the effective transmission of the parameter gradients of the neural network structure.
[0132] Step 5: Construction of the field prediction network;
[0133] The field prediction network is used to predict and model electromagnetic fields. The overall network architecture is as follows: Figure 4 As shown, the main network and fine-tuning layers are cascaded in sequence, forming the following overall mapping relationship:
[0134]
[0135] in, This represents the corresponding complex electric field output, which is the original scattered field. express The complex number field, where N represents the number of sampling points; input , and These are the main network and the fine-tuning layer, respectively. and These are the sets of network parameters for the main network and the fine-tuning layer, respectively.
[0136] The main network uses a residual neural network, consisting of a cascaded input layer, several residual hidden layers, and an output layer; the layers of the main network are sequentially numbered from layer 1 to layer K, and each layer of the neural network uses... ~ The mathematical expression of the main network is as follows:
[0137]
[0138] in, Indicates wavelength. , and These represent the input, weight matrix, and bias vector of the k-th layer of the main network, respectively.
[0139] Since neural networks are essentially parameterized representations of continuous functions, when their predicted values are substituted into discretized... When calculating the residuals, a certain discrete approximation error is introduced. If this error is not handled properly, the residual terms may not accurately reflect the physical deviations, thus affecting the overall training effect and network convergence performance. Therefore, a fine-tuning layer is introduced after the main network. The fine-tuning layer consists of variables with the same number of sampling points as the field network. Each sampling point has a corresponding trainable variable in the fine-tuning layer, which can adjust the output field value of each sampling point to a certain extent. The set of trainable variables is denoted as . .
[0140] Step six: Embed boundary conditions and the metal superstructure to be optimized in the form of hard constraints;
[0141] First, consider the embedding of absorbing boundary conditions. The original scattered field output by the field prediction network needs to be converted into a two-dimensional field distribution format consistent with physical space in order to apply hard constraints. The corrected scattered field after embedding the absorbing boundary conditions is denoted as... .
[0142] Based on the finite difference model, the absorbing boundary conditions are further discretized using a central difference format. By representing the boundary point field values as a linear combination of interior points and modifying the boundary point field values output by the field prediction network accordingly, it is possible to achieve... It propagates in an approximately open space at the boundary.
[0143] After embedding the absorbing boundary condition, the corrected scattering field corresponding to the boundary point is expressed as:
[0144]
[0145] in, Let P represent the corrected scattered field after embedding the absorbing boundary conditions (as can be seen from the above equation, only the boundary points need to be corrected), 1≤i≤P, 1≤i≤Q, where P and Q represent the number of sampling points along the x and z directions, respectively. This represents the original scattered field output by the field prediction network.
[0146] Secondly, we consider the embedding of the metallic superstructure distribution. We introduce a zero-field hard constraint, embedding the metallic superstructure to be optimized into the corrected scattering field after the absorbing boundary conditions, in the form of a hard constraint. The corrected scattering field after embedding the zero-field hard constraint is expressed as:
[0147]
[0148] in, This indicates element-wise multiplication of matrices.
[0149] Based on the above equation, the optimized distribution of the metallic superstructure is directly embedded into the expression of the scattering field.
[0150] Step 7: Construction of the loss function;
[0151] The physical loss calculations involved in subsequent training only need to consider Corresponding conditions. However, if the scattered field is calculated directly based on the above equation over the entire computational domain... The loss arises from the opposite analytic field introduced in the metallic superstructure region due to the zero total field. This field easily generates approximation errors independent of the network during discrete computation. These errors cannot be effectively reduced by the optimizer and can easily interfere with the convergence of other regions, affecting the overall stability and efficiency of training.
[0152] To avoid this problem, based on the 0-1 binary representation of the metallic superstructure and free space, an indicator function is introduced for the metallic superstructure region. Residuals are masked to improve training stability while ensuring structural updates. Building on this, a higher-order norm is introduced as the PDE loss metric to penalize local residuals more strongly than the existing L² norm, thereby enhancing physical consistency at boundaries and improving the efficiency of physical information transmission in space.
[0153] Scattered field loss Represented as:
[0154]
[0155] in, This indicates the number of sampling points within the metal superstructure region. express The residual term of the partial differential equation at the location, where p is the order, and in this embodiment p is taken as 4.
[0156] The target field distribution cannot be realized through any structure within the design region. Directly applying hard constraints may lead to non-physical understanding and training failure. To avoid this problem, a soft constraint approach is adopted during training. By introducing a target field loss term, the field prediction network is guided to approximate the target field distribution as closely as possible while satisfying physical constraints. When the loss function is defined only in the focusing region, the field prediction network tends to retain the incident field to satisfy local constraints, causing the structure optimization network to tend to generate empty structures, thus failing to reflect the scattering modulation effect.
[0157] To avoid this problem, it is necessary to constrain the target field distribution in a wider spatial range, and suppress the field strength in non-target areas while strengthening the field strength in the focused region, so as to guide the structure optimization network to generate a metal superstructure with practical functions.
[0158] Therefore, a target loss function is introduced. :
[0159]
[0160] The scattering domain is divided into several parts, and the scattering domain where the target focusing region is located is denoted as . The scattering domain that does not include the target focusing region is denoted as ;Target Indicates the scattering domain where the target focusing area is located. Number of internal sampling points; Represents the ideal focusing matrix. This indicates the target focus area, and max indicates taking the maximum value.
[0161] Although the above formula introduces constraints on the field distribution outside the focused region, the residual value generated is easily influenced by the non-focused region due to the small size of the focused region. Information overload can easily lead to the following local optima: the optimization domain It is completely filled with metal, so that electromagnetic waves exist only in the scattering domain. , and scattering domain The total field size was zero, failing to achieve effective focusing.
[0162] To avoid the above situation, an auxiliary loss function is introduced. :
[0163]
[0164] in, This indicates the number of sampling points in the target focus area.
[0165] By measuring the relative field strength difference between the target focusing region and the background region, the field prediction network is guided to suppress the field strength in the non-focusing region or enhance the field strength in the focusing region during training, thereby enabling the metal superstructure generated by the structure optimization network to have focusing characteristics.
[0166] Total loss function As shown in the following formula:
[0167]
[0168] in, ( ) represents the weights of each loss function. By reasonably adjusting the weight ratio of each loss term, an effective trade-off can be achieved between different constraints, enabling the network to improve its ability to fit the target output while following physical laws.
[0169] Step 8: Construct a training strategy;
[0170] To achieve coordinated control of structural design and field distribution, this embodiment employs a periodic alternating training strategy. During training, the structure optimization network is first frozen, and only the field prediction network is updated to fully fit the physical properties of the current metallic superstructure. Subsequently, the structure optimization network is unfrozen, and the parameters of the metallic superstructure are optimized under the guidance of the now accurate field distribution. This alternating process avoids the network from getting trapped in local optima or trivial solutions.
[0171] To address the differences between the two types of network tasks, the field prediction network employs an exponentially decaying learning rate to ensure convergence stability, while the structure optimization network uses a cosine annealing strategy to enhance global search capabilities. A periodic save and rollback mechanism is also implemented, automatically reverting to historically optimal parameters when a significant increase in loss or a solution deviating from physical constraints is detected, thus preventing performance degradation.
[0172] Through the above-mentioned alternating update and differentiated control strategies, stable collaborative optimization of the field prediction network and the structure optimization network can be achieved, so that the final design result gradually approaches the target field distribution while satisfying physical constraints.
[0173] Step 9: Based on the total loss function constructed in Step 7, train the structure optimization network and the field distribution network using the training strategy constructed in Step 8 to obtain a metal superstructure that satisfies the set target field distribution.
[0174] This embodiment uses a typical focusing problem as an example to demonstrate the effectiveness of a hard-constraint physics-inspired neural network-based inverse design method for metallic superstructures using finite difference physics. The operating frequency of this case is 0.1 GHz, and the computational domain is... scattering domain Design Domain and scattering domain The sizes are 8λ×2.5λ, 8λ×0.5λ, 8λ×1λ and 8λ×1λ, respectively. Set a focus target area with a size of 0.5λ × 0.5λ. A uniform grid is used to discretize the computational domain, and the distance d between adjacent grid points is 1 / 20λ.
[0175] The physical partial differential equation chosen is the Helmholtz equation, with absorbing boundary conditions selected around the perimeter, and the loss function... Set to:
[0176]
[0177] The field prediction network employs a residual network with 10 hidden layers, each containing 128 neurons, and all activation functions are sinusoidal. The structure network uses a 4-layer fully connected neural network. The first layer of this network uses a sinusoidal activation function, while the remaining hidden and output layers use tanh and softmax activation functions, respectively. Throughout training, the parameters of both the field and structure networks are initialized using Xavier and updated separately using the Adam optimizer.
[0178] The learning rate adjustment for the field prediction network employs a contrastive decay strategy. The initial learning rate is set to... When the difference in the loss function between two consecutive generations is less than a preset threshold ( When the learning rate is adjusted, the current learning rate is multiplied by the decay factor γ (set to 0.9). To prevent frequent decay, the learning rate is frozen after each decay, with a freeze period of 500 steps. The loss difference is evaluated again only after the freeze period has expired.
[0179] The learning rate adjustment for the structure-optimized network employs a cosine annealing strategy. The learning rate changes periodically during training, with a maximum learning rate of [missing value]. The minimum learning rate is The annealing cycle is set to 100,000 steps. In addition, to improve structural stability, the structural parameters are frozen every 10,000 steps to postpone updates, and the current loss value is compared with the loss value of the previous 10,000 steps before the structural update, retaining the better solution.
[0180] On the loss function, Use Norms are used to enhance local physical constraints. Based on the convergence of the loss function in experimental tests, [the following is discussed]. , , Set them to 1.5, 4, and 6 respectively.
[0181] The above network configuration and training strategy were implemented using Python, and numerical experiments with a total training step count of 600,000 were conducted on a computer platform equipped with an Nvidia A800 80G. A comparison of center-focusing prediction and simulation results is shown in the figure below. Figure 5 As shown in the figure, the comparison between the off-axis focusing prediction and simulation results is as follows: Figure 6 As shown.
[0182] The training and simulation results show good consistency within the target region. Although there is a slight amplitude error in the focusing region, the overall field distribution is consistent, indicating that FD-hPINN can effectively achieve the expected field control objective. Overall, the field focusing design goal has been largely achieved, verifying the feasibility and effectiveness of the proposed inverse design model at different focusing positions.
[0183] (1) Traditional topology optimization methods and forward design methods require frequent calls to full-wave simulation or rely on prior models, which restricts the degree of design freedom and has high computational cost. However, this invention directly embeds physical constraints in the training of neural networks through FD-hPINN to achieve high degree of freedom inverse design, which greatly reduces the computational cost.
[0184] (2) Traditional AD-PINN has problems such as hidden layer error interference, dimensionality curse, difficulty in adjusting the weight of loss function and lack of physical information exchange between sampling points when solving PDE. This invention overcomes the above limitations through finite difference and hard constraint mechanism, and ensures gradient numerical accuracy, training stability and global continuity of field prediction.
[0185] (3) In the inverse design of metal structures, the traditional PINN cannot backpropagate gradients due to its discontinuous structure, thus limiting the design domain and structural degrees of freedom. This invention directly applies the metal structure parameters to the network output through hard constraints, enabling the network to be trained stably and significantly improving the feasibility and accuracy of inverse design of complex metal structures.
[0186] (4) This invention realizes the joint training of PDE constraints, structural optimization and field prediction, breaks the high dependence of traditional methods on different design goals and different device types, improves the universality and adaptability of the method, and provides a new, efficient and reliable approach for the intelligent design of electromagnetic devices.
[0187] This invention can be applied to technical fields where electromagnetic field distribution control is desired, including but not limited to electromagnetic wave communication, wireless power transfer, radar imaging, and the design of novel electromagnetic devices. For mobile communication systems, traditional methods often rely on pre-designed metasurface units for beam control, frequently requiring extensive structural adjustments and experimental iterations. However, the Finite Difference-Hard Constraint Physics-Inspired Neural Network (FD-hPINN) method provided by this invention can directly perform rapid optimization within a finite design area near the base station. By combining the scattering characteristics of the surrounding complex environment, it enhances the user's received signal and focuses energy, thereby reducing communication costs and improving communication efficiency. For wireless power transfer, this invention, by designing the optimal reflection-free transmission path in complex media environments, can minimize energy scattering loss, maximizing the power received by the receiving antenna, thereby improving transmission efficiency and reducing energy loss.
[0188] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding, characterized in that, Includes the following steps: Step 1: Establish a computational model; Constructing a finite computational domain in three-dimensional free space and in a finite computational domain Internal optimization domain As the region of the metal superstructure to be designed, i.e. Let it be denoted as the scattering domain. Indicates a removal operation; Step two, construct the optimization problem; For finite computational domains Introducing a plane wave as the incident field, let the finite computational domain be... Extending along the y-axis and remaining constant, the wave propagation model is equivalent to a two-dimensional propagation problem of TM waves; within a finite computational domain... Within the structure, the incident field interacts with the metallic superstructure, generating a scattered field. This scattered field satisfies the Helmholtz equation and has a finite computational domain. boundary The region where the metallic superstructure satisfies the Mur absorption boundary condition. The total field size within the area is zero; By adjusting Make the total field in the selected target area Achieve focus and construct an optimization problem; Step 3: Construct a finite difference model; Discretize the non-zero terms in the Helmholtz equation using finite differences to obtain the discretized residual terms of the partial differential equation. Step 4: Construct a structurally optimized network model; The structure-optimized neural network is constructed as a fully connected neural network, which includes an input layer, a normalization layer, a sinusoidal activation function, several intermediate layers, a softmax activation function, a discriminant layer, and an output layer, which are cascaded in sequence. The input to a structural optimization neural network is the optimization domain. Coordinates of uniformly sampled points ; In the normalization layer, the input is scaled to the wavelength scale and converted into normalized coordinates, and the normalized coordinates are multiplied by 2π; then it is passed through the sinusoidal activation function, the intermediate layer and the softmax activation function in sequence; The intermediate layer uses the tanh activation function; During forward propagation, the discriminant layer binarizes the output of the softmax activation function and uses a pass-through estimation strategy to output the result from the output layer; the output of the structure-optimized neural network is... During backpropagation, the discrimination operation of the discrimination layer is skipped, and the gradient of the structural parameters of the structure optimization neural network is directly passed back to each layer from the softmax activation function layer. Step 5: Construction of the field prediction network; The field prediction network consists of a main network and fine-tuning layers cascaded together. The main network is a residual neural network, which includes an input layer, several residual hidden layers, and an output layer cascaded together. The fine-tuning layer consists of variables with the same number of sampling points as the field prediction network. Each sampling point has a corresponding trainable variable in the fine-tuning layer that can adjust the output field value of each sampling point. Step six: Embed boundary conditions and the metal superstructure to be optimized in the form of hard constraints; The scattered field output by the field prediction network is converted into a two-dimensional field distribution format; the Mur absorbing boundary condition is discretized in the form of central difference, and the scattered field at the boundary point is represented as a linear combination of the internal points. The scattered field at the boundary point output by the field prediction network is corrected to obtain the corrected scattered field after embedding the absorbing boundary condition; the metal superstructure to be optimized is embedded in the corrected scattered field after the absorbing boundary condition in the form of hard constraints. Step 7: Construction of the loss function; Constructing a loss function using the residuals of discretized partial differential equations Construct the target loss function using the total field of the scattering domain and the target focusing region. and auxiliary loss function Construct the total loss function ,in , and They represent , and The weights; Step 8: Construct a training strategy; A periodic alternation training strategy is adopted; During training, the structure optimization network is first frozen, and only the field prediction network is updated to fit the current metallic superstructure; then the structure optimization network is unfrozen, and the parameters of the metallic superstructure are optimized. The field prediction network uses an exponentially decaying learning rate, while the structure optimization network uses a cosine annealing strategy. A periodic save and rollback mechanism is set up to automatically roll back to the historical optimal parameters when a significant increase in the loss function or a deviation from the constraints is detected. Step 9: Based on the total loss function constructed in Step 7, train the structure optimization network and the field distribution network using the training strategy constructed in Step 8 to obtain a metal superstructure that satisfies the set target field distribution.
2. The method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding as described in claim 1, characterized in that, The specific process of step two is as follows: Introducing a plane wave as the incident field into a finite computational domain, it can be expressed as: ; in, Let x represent the incident field, and x, y, and z represent the finite computational fields, respectively. Position coordinates in the x, y, and z directions. The incident field amplitude, The symbol for the imaginary part. Represents the propagation constant in free space; Denote the finite computational field Extending along the y-axis and remaining constant, the wave propagation model is equivalent to the two-dimensional propagation problem of TM waves. Equivalent to ; In a finite computational domain In the process, the incident field interacts with the metallic superstructure, generating a scattered field. ; make The scattered field satisfies the following condition: ; in, It is a two-dimensional Laplace operator; Finite computational domain Limited, making In a finite computational domain boundary The following Mur absorption boundary conditions apply: ; Where n is the boundary The normal vector, This indicates taking the partial derivative in the n direction; In the region where the metallic superstructure is located The main field inside Let it be zero. It can be expressed as the following formula: ; Among them, binary functions , Indicates a removal operation; By adjusting This makes the total field In the selected target area To achieve focus, the inverse design problem can be represented as the following optimization problem: ; in, This indicates a modulo operation.
3. The method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding as described in claim 2, characterized in that, The specific process of step three is as follows: According to finite difference pairs Discretization yields the discretized partial differential equation residuals. Represented as: ; in, After discretization Corresponding grid coordinates Represents grid points The scattered field at that location, This represents the grid step size in the x-direction. Let the grid step size in the z-direction be denoted by ; let the residual term of the partial differential equation be denoted by . .
4. The method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding as described in claim 3, characterized in that, The specific process of step five is as follows: The field prediction network consists of a main network and fine-tuning layers cascaded together, as follows: ; in, The complex electric field output represents the scattered field. express The complex number field, where N represents the number of sampling points; input , and These represent the main network and the fine-tuning layer, respectively. and These are the sets of network parameters for the main network and the fine-tuning layer, respectively. The main network uses a residual neural network, consisting of a cascaded input layer, several residual hidden layers, and an output layer; the layers of the main network are sequentially numbered from layer 1 to layer K, and each layer is represented by a [missing information - likely a typo]. ~ The main network is represented as follows: ; in, Indicates wavelength. , and These represent the input, weight matrix, and bias vector of the k-th layer of the main network, respectively. The fine-tuning layer consists of variables with the same number of sampling points as the field prediction network, and each sampling point has a relative value in the fine-tuning layer. The corresponding trainable variables can adjust the output field value at each sampling point. The set of trainable variables is denoted as . .
5. The method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding as described in claim 4, characterized in that, The specific process of step six is as follows: The scattering field output by the field prediction network is denoted as This is converted into a two-dimensional field distribution format consistent with physical space. ; The Mur absorbing boundary conditions are discretized in the form of central difference, and the field values at the boundary points are represented as a linear combination of the interior points. After embedding the absorbing boundary condition, the corrected scattering field corresponding to the boundary point is expressed as: ; in, Let P represent the corrected scattered field after embedding the absorption boundary conditions, where 1 ≤ i ≤ P and 1 ≤ i ≤ Q, and P and Q represent the number of sampling points along the x and z directions, respectively. The scattered field is represented by the output of the field prediction network; The modified scattering field after the absorbing boundary conditions is embedded into the metallic superstructure to be optimized in the form of hard constraints. Represented as: ; in, This indicates element-wise multiplication of matrices.
6. The method for inverse design of metallic superstructures based on a physically inspired neural network with finite difference hard constraint embedding as described in claim 5, characterized in that, The specific process of step seven is as follows: Constructing the scattering field loss function Represented as: ; in, This indicates the number of sampling points within the metal superstructure region. express The residual term of the partial differential equation at the location, where p is the order; Construct the target loss function : ; The scattering domain is divided into several parts, and the scattering domain where the target focusing region is located is denoted as . The scattering domain that does not include the target focusing region is denoted as ;Target Indicates the scattering domain where the target focusing area is located. Number of internal sampling points; Represents the target ideal focusing matrix. This indicates the target focusing area, and max indicates taking the maximum value; Constructing an auxiliary loss function : ; in, Indicates the number of sampling points in the target focus area; Construct the total loss function : ; in, , and They represent , and The weight.