Optical meta-structure surface structure parameter design model training and application method and related device
Through the optical metasurface structure parameter design model based on the Transformer architecture, the problems of long design cycle and insufficient generalization capability in the existing technology are solved, and efficient design suitable for different structural types and spectral targets is achieved.
Patent Information
- Application Number
- CN202510767872.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-19
AI Technical Summary
Existing inverse design methods for optical metasurfaces have problems such as long design cycles, high computational costs, difficulty in handling high-dimensional parameter spaces, and insufficient multi-objective optimization capabilities. In addition, existing deep learning models are difficult to adapt to changes in different structural types and spectral targets.
An optical metasurface structural parameter design model based on the Transformer architecture is adopted. By obtaining sample data of various optical metasurfaces for word embedding and position encoding, feature extractors and structural parameter generators are used for training to generate design models suitable for different structural types and spectral targets. A joint optimization loss function is introduced to address the problems of multi-solution and parameter sensitivity.
The generalization capability of optical metasurface structural parameter design has been improved, which can effectively adapt to the design requirements of different structural types and spectral targets, and improve design efficiency and accuracy.
Smart Images

Figure CN120669409A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of nanophotonics and nanostructure design technology, and in particular to a method for training and applying an optical metasurface structure parameter design model and related devices. Background Art
[0002] Optical metasurfaces are artificial microstructured films with special optical properties formed by micro-nano processing of optical materials on a subwavelength scale. As artificially designed subwavelength structure arrays, they exhibit important application value in structural color generation, optical filtering, holographic imaging, and other fields by precisely controlling the phase, amplitude, and polarization characteristics of electromagnetic waves. However, traditional optical metasurface inverse design methods (i.e., methods for designing the structural parameters of optical metasurfaces) mainly rely on parameter trial-and-error methods guided by physical empirical formulas. These methods have inherent drawbacks such as long design cycles, high computational costs, and difficulty in processing high-dimensional parameter spaces. In recent years, with the development of inverse design theory, global optimization methods represented by topology optimization and genetic algorithms have been gradually applied to the inverse design of optical metasurfaces. However, these global optimization methods are still limited by the large number of iterations, local optimal solution traps, and insufficient multi-objective optimization capabilities. In particular, when the design objectives involve wide spectral response or multi-physical field coupling, traditional global optimization methods often fail due to the explosion of the search space dimension.
[0003] With the rise of deep learning technology, reverse design models based on deep learning models have improved design efficiency to a certain extent. However, existing deep learning models mostly adopt a single-task training mode. For each structural type of optical metasurface, it is necessary to use spectral targets as input and structural parameters as output to train a reverse design model based on a deep learning model. If the structural type or spectral target changes, the original reverse design model will no longer be applicable, and a new reverse design model needs to be trained. It is difficult to simultaneously meet the generalization requirements of different structural types and different spectral targets. Summary of the Invention
[0004] The purpose of this application is to provide a method and related device for training and applying a structural parameter design model for an optical metasurface, which can be applied to the structural parameter design of optical metasurfaces of different structural types and different spectral targets, and improve the generalization ability.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a method for training a model for designing parameters of an optical metasurface structure, the method comprising:
[0007] Acquire a data set; the data set includes multiple sets of sample data of each optical metasurface among the multiple optical metasurfaces, the sample data including sample structure name, sample structure parameters and sample spectral response;
[0008] Performing word embedding and position encoding embedding on the sample structure name and the sample structure parameter respectively to obtain the embedded sample structure name and the embedded sample structure parameter, and performing block and position encoding embedding on the sample spectral response to obtain the embedded sample spectral response;
[0009] Taking the embedded sample structure name and the embedded sample spectral response as input, a feature extractor is used to extract fusion features, and taking the fusion features as input, a structure parameter generator is used to generate a predicted value of the embedded sample structure parameter;
[0010] Processing the embedded sample structure parameter prediction value to obtain a sample structure parameter prediction value, performing simulation calculation based on the sample structure parameter prediction value to obtain a sample spectral response prediction value, and performing block and position encoding embedding on the sample spectral response prediction value to obtain an embedded sample spectral response prediction value;
[0011] Calculating a total loss based on the embedded sample structure parameter, the embedded sample spectral response, the embedded sample structure parameter prediction value, and the embedded sample spectral response prediction value;
[0012] Determine whether the iteration termination condition is met; if so, generate an optical metasurface structure parameter design model, the optical metasurface structure parameter design model including a feature extractor and a structure parameter generator connected in sequence; if not, update the feature extractor and the structure parameter generator based on the total loss to obtain an updated feature extractor and an updated structure parameter generator, and use the updated feature extractor as the feature extractor of the next iteration, and use the updated structure parameter generator as the structure parameter generator of the next iteration, and return to the step of "using the embedded sample structure name and the embedded sample spectral response as input, and using the feature extractor to extract the fusion feature".
[0013] In a second aspect, the present application provides a method for applying a design model for optical metasurface structure parameters, the method comprising:
[0014] Obtain the structure name and spectral response of the target optical metasurface;
[0015] Performing word embedding and position encoding embedding on the structure name to obtain an embedded structure name, and performing block segmentation and position encoding embedding on the spectral response to obtain an embedded spectral response;
[0016] The method comprises the following steps: using the embedded structure name and the embedded spectral response as input, and generating a predicted value of the embedded structure parameter using an optical metasurface structure parameter design model; wherein the optical metasurface structure parameter design model is an optical metasurface structure parameter design model trained using the above-mentioned optical metasurface structure parameter design model training method;
[0017] The predicted values of the embedded structural parameters are processed to obtain the structural parameters of the target optical metasurface.
[0018] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned optical metasurface structure parameter design model training method or the above-mentioned optical metasurface structure parameter design model application method.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned optical metasurface structure parameter design model training method or the above-mentioned optical metasurface structure parameter design model application method.
[0020] According to the specific embodiments provided in this application, this application has the following technical effects:
[0021] The present application provides a method for training and applying a structural parameter design model for an optical metasurface and related devices, which obtains a data set, wherein the data set includes multiple groups of sample data for each of a plurality of optical metasurfaces, the sample data including sample structure names, sample structure parameters and sample spectral responses, performs word embedding and position encoding embedding on the sample structure names and sample structure parameters respectively, and obtains embedded sample structure names and embedded sample structure parameters, further utilizes a feature extractor to extract fusion features, and uses the fusion features as input to generate predicted values of the embedded sample structure parameters using a structure parameter generator, and subsequently further calculates the total loss, which is iteratively updated based on the total loss until an optical metasurface structural parameter design model is obtained. The present application introduces structure names and spectral responses, and utilizes sample structure names, sample structure parameters and sample spectral responses to train an optical metasurface structural parameter design model. The obtained optical metasurface structural parameter design model can be applied to the design of structural parameters of optical metasurfaces of different structural types and different spectral targets, thereby improving generalization capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 This is a diagram of the application environment of an optical metasurface structure parameter design model training method provided in Example 1 of the present application.
[0024] Figure 2 A flowchart of a method for training an optical metasurface structure parameter design model provided in Example 1 of the present application.
[0025] Figure 3 Schematic diagram of the structural parameters of the seven optical metasurfaces provided in Example 1 of the present application.
[0026] Figure 4 This is a model architecture diagram and training effect diagram of the data expansion model provided in Example 1 of the present application.
[0027] Figure 5 This is a model architecture diagram of the optical metasurface structure parameter design model provided in Example 1 of the present application.
[0028] Figure 6 This is a comparison chart of the target spectral response and generated spectral response of different optical metasurfaces provided in Example 1 of the present application. Figure 6 In the figure, the horizontal axis represents the wavelength and the vertical axis represents the value of the spectral response.
[0029] Figure 7 A flowchart illustrating an application method of an optical metasurface structure parameter design model provided in Example 2 of the present application.
[0030] Figure 8 A comparison diagram of the application process and effects of structural color design provided in Example 2 of this application.
[0031] Figure 9 A comparison chart of the application process and effects in filter design provided in Example 2 of this application.
[0032] Figure 10 A comparison diagram of the design process and effects of combining a large language model provided in Example 2 of this application.
[0033] Figure 11 A schematic diagram of the structure of a computer device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0035] Example 1
[0036] The optical metasurface structure parameter design model training method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The terminal can send a training request to be processed to the server. After the server receives the training request to be processed, the server obtains a data set for the training request to be processed. The data set includes multiple groups of sample data of each optical metasurface in a variety of optical metasurfaces. The sample data includes sample structure name, sample structure parameters and sample spectral response; the sample structure name and the sample structure parameters are word embedded and position encoded and embedded respectively to obtain the embedded sample structure name and the embedded sample structure parameters, and the sample spectral response is divided into blocks and position encoded and embedded to obtain the embedded sample spectral response; the embedded sample structure name and the embedded sample spectral response are used as input, and the feature extractor is used to extract the fusion feature, and the fusion feature is used as input to generate the embedded sample structure parameter prediction value using the structure parameter generator; the embedded sample structure parameter prediction value is processed to obtain the sample structure parameter prediction value, and the simulation calculation is performed based on the sample structure parameter prediction value to obtain To the sample spectral response prediction value, the sample spectral response prediction value is divided into blocks and positionally encoded and embedded to obtain the embedded sample spectral response prediction value; based on the embedded sample structure parameters, the embedded sample spectral response, the embedded sample structure parameter prediction value and the embedded sample spectral response prediction value, the total loss is calculated; it is determined whether the iteration termination condition is met; if so, an optical metasurface structure parameter design model is generated, and the optical metasurface structure parameter design model includes a feature extractor and a structure parameter generator connected in sequence; if not, the feature extractor and the structure parameter generator are updated based on the total loss to obtain an updated feature extractor and an updated structure parameter generator, and the updated feature extractor is used as the feature extractor of the next iteration, and the updated structure parameter generator is used as the structure parameter generator of the next iteration, and the step of "using the embedded sample structure name and the embedded sample spectral response as input, and using the feature extractor to extract the fusion feature" is returned. The server can feedback the training result of the optical metasurface structure parameter design model obtained for the training request to the terminal.
[0037] In addition, in some embodiments, the optical metasurface structure parameter design model training method can also be implemented independently by a server or a terminal. For example, the terminal can directly process the pending training request, or the server can obtain the pending training request from the data storage system and process the pending training request.
[0038] The terminals may include, but are not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. The server may be implemented as a standalone server or a server cluster consisting of multiple servers, or as a cloud server.
[0039] In an exemplary embodiment, Figure 2 As shown, a method for training a design model of optical metasurface structure parameters is provided. The method is executed by a computer device, specifically a computer device such as a terminal or a server, and can also be executed by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The following steps are used as an example to illustrate the server.
[0040] Step S1, acquiring a data set; the data set includes multiple sets of sample data of each optical metasurface among multiple optical metasurfaces, and the sample data includes a sample structure name, sample structure parameters, and sample spectral response.
[0041] Step S2, respectively performing word embedding and position encoding embedding on the sample structure name and the sample structure parameters to obtain the embedded sample structure name and the embedded sample structure parameters, and performing block and position encoding embedding on the sample spectral response to obtain the embedded sample spectral response.
[0042] Step S3: using the embedded sample structure name and the embedded sample spectral response as input, extracting fusion features using a feature extractor, and using the fusion features as input, generating a predicted value of the embedded sample structure parameter using a structure parameter generator.
[0043] Step S4: Process the sample structure parameter prediction value after embedding to obtain the sample structure parameter prediction value, perform simulation calculation based on the sample structure parameter prediction value to obtain the sample spectral response prediction value, and perform block and position encoding embedding on the sample spectral response prediction value to obtain the embedded sample spectral response prediction value.
[0044] Step S5 , calculating a total loss based on the embedded sample structural parameters, the embedded sample spectral response, the embedded sample structural parameter prediction value, and the embedded sample spectral response prediction value.
[0045] Step S6, judging whether the iteration termination condition is met; if so, generating an optical metasurface structure parameter design model, the optical metasurface structure parameter design model including a feature extractor and a structure parameter generator connected in sequence; if not, updating the feature extractor and the structure parameter generator based on the total loss to obtain an updated feature extractor and an updated structure parameter generator, and using the updated feature extractor as the feature extractor of the next iteration, and using the updated structure parameter generator as the structure parameter generator of the next iteration, returning to the step of "using the embedded sample structure name and the embedded sample spectral response as input, and using the feature extractor to extract the fusion feature".
[0046] By implementing the above-mentioned steps S1 to S6, this embodiment introduces the structure name and spectral response, and utilizes the structure name and spectral response to participate in the training process, thereby utilizing multiple sets of sample data (including sample structure name, sample structure parameters, and sample spectral response) of each of the multiple optical metasurfaces to train the feature extractor and the structure parameter generator, and generate an optical metasurface structure parameter design model. The optical metasurface structure parameter design model can be used to design the structure parameters of optical metasurfaces of different structure types and different spectral targets, thereby improving the generalization ability.
[0047] This embodiment designs a method for training an optical metasurface structure parameter design model based on the Transformer architecture, obtains an optical metasurface structure parameter design model through training, and subsequently uses the optical metasurface structure parameter design model to realize the reverse design of the optical metasurface, which specifically includes the following steps.
[0048] (1) The initial data set containing structural parameters and spectral responses is constructed using the finite-difference time-domain method.
[0049] This embodiment specifically designs optical metasurfaces of various structural types and multiple structural parameters related to each structural type of optical metasurface, writes a script, and inputs the script into full-wave electromagnetic simulation software (Finite-Difference Time-Domain, FDTD) for simulation calculation. Specifically, the simulation calculation is performed using the finite-difference time-domain method to obtain the spectral response, collect the structural parameters and their corresponding spectral responses. The spectral response can be a reflection spectrum or a scattering spectrum, and other types of spectral responses can also be selected according to user needs to construct an initial data set of [structural parameters, spectral response].
[0050] Specifically, such as Figure 3 As shown, this embodiment designs 7 optical metasurfaces with a fixed height of 200 nm. The optical metasurfaces are all periodic structures, that is, structures that are repeatedly arranged in space. Figure 3In [1], Px is the horizontal periodicity and Py is the vertical periodicity. These shapes include ellipse, rectangle, double rectangle, double ellipse, donut, cross, and incomplete rectangle. For each optical metasurface, multiple structural parameters are designed, and the finite-difference time-domain method (FDTD) is used to calculate the spectral response of each structural parameter in the 400-800 nm band. The spectral response is a physical quantity that describes the responsiveness of a material, device, or system to light of different wavelengths. For example, the spectral response is a scattering spectrum consisting of 500 discrete sampling points, each representing the scattering intensity at a specific wavelength. Ultimately, an initial dataset containing 14,000 pairs of [structural parameter, spectral response] is constructed. In this example, the spectral response of 500 discrete wavelength points (i.e., sampling points) within the 400-800 nm band is calculated for each optical metasurface with different structural parameters. A total of 14,000 pairs of [structural parameter, spectral response] data pairs are collected to form an initial dataset. This initial dataset, consisting of seven typical optical metasurfaces, is constructed using the FDTD method.
[0051] (2) Use a parameterized convolutional neural network to expand the initial dataset and generate an expanded dataset.
[0052] This embodiment uses the collected initial data set consisting of 14,000 groups of [structural parameters, spectral responses] to construct a parameterized convolutional neural network to perform data expansion on the initial data set and generate a data set.
[0053] Specifically, such as Figure 4 As shown in (a), first, the structural parameters are converted into a two-dimensional image, that is, Figure 3The two-dimensional structural image shown converts the initial data set consisting of [structural parameters, spectral response] into an intermediate data set consisting of [(structural parameters, two-dimensional structural image), spectral response], where the size of the two-dimensional structural image can be 64×64. Secondly, a data augmentation model is built, which adopts a parameterized convolutional neural network. The processing process of the parameterized convolutional neural network is as follows: the two-dimensional structural image is subjected to feature extraction through a three-layer convolutional architecture (each convolutional architecture includes a convolution layer and a maximum pooling layer), and the local spatial pattern of the two-dimensional structural image is extracted using a convolutional layer containing a 3×3 convolution kernel. After dimensionality reduction by the maximum pooling layer, a 64-dimensional feature vector is output to extract the spatial features of the two-dimensional structural image and obtain the structural parameter image features. The structural parameters are subjected to feature extraction through the NTN (Neural Tensor Network) model and the spatial tiling unit (specifically, Spatial tiling is translated as spatial tiling, and its essence is to broadcast a one-dimensional vector to a two-dimensional vector). Specifically, the structural parameters are processed by the NTN model to obtain a one-dimensional attribute vector, and then the one-dimensional attribute vector is expanded to the same spatial size as the two-dimensional feature map of the structural parameter image feature by broadcasting to obtain the numerical features of the structural parameters, so that the numerical features of the structural parameters can be fused with the structural parameter image features. Subsequently, the 128-dimensional spliced features obtained by splicing the extracted structural parameter image features and the structural parameter numerical features are input into the fully connected network. The high-dimensional features are nonlinearly combined and mapped through the fully connected network, and the nonlinear transformation of the high-dimensional space is realized through the ReLU activation function in the fully connected network, and the spectral response with a dimension of 500 is finally output. Finally, for each optical metasurface, the intermediate data set consisting of [(structural parameters, two-dimensional structural image), spectral response] corresponding to the optical metasurface is used to train the data augmentation model. During the training process, the mean squared error (MSE) is used to measure the error between the generated spectral response and the actual spectral response. After 10,000 epochs (cycles) of training, the final training effect is as follows: Figure 4 As shown in (b), the predicted determination coefficient R 2 Reaching 98%, a trained data expansion model corresponding to each optical metasurface is obtained. For each optical metasurface, a large number of structural parameters are randomly generated, and the trained data expansion model corresponding to the optical metasurface is used for prediction. The amount of data in the initial data set is expanded to 800,000, and then the initial data set is accumulated to obtain the data set.
[0054] At this time, in this embodiment, a data set is acquired, and the data set includes multiple groups of sample data of each optical metasurface among the multiple optical metasurfaces, and the sample data includes a sample structure name, sample structure parameters, and a sample spectral response.
[0055] The sample structure names include ellipse, rectangle, double rectangle, double ellipse, ring, cross and incomplete rectangle. When the sample structure name is ellipse, the sample structure parameters include the major axis length b, minor axis length a and rotation angle of the ellipse. Rotation angle The angle of rotation of the ellipse around the center point of the rectangle; when the sample structure name is rectangle, the sample structure parameters include the length L, width W and rotation angle of the rectangle Rotation angle The angle of rotation of the rectangle around the center point of the rectangle; when the sample structure name is double rectangle, the sample structure parameters include the length L1 and width W1 of the first rectangle, the length L2 and width W2 of the second rectangle, and the rotation angle of the double rectangle Rotation angle is the angle of rotation of the double rectangle around the center point of the rectangle; when the sample structure name is double ellipse, the sample structure parameters include the major axis length b, minor axis length a and tilt angle θ of the ellipse and the rotation angle of the double ellipse Rotation angle is the angle of rotation of the double ellipse around the center point of the rectangle; when the sample structure name is ring, the sample structure parameters include the outer diameter R, inner diameter r, notch angle θ and rotation angle of the ring The notch angle θ is the central angle of the missing part of the ring, and the rotation angle The angle of rotation of the circle around the center point of the rectangle; when the sample structure name is cross, the sample structure parameters include the length L1, width W1 and offset of the first rectangle, the length L2 and width W2 of the second rectangle, and the rotation angle of the cross The offset is the vertical distance from the center point of the first rectangle to the center point of the second rectangle, and the rotation angle is the angle of rotation of the cross around the center point of the rectangle; when the sample structure name is incomplete rectangle, the sample structure parameters include the length L, width W, gap length L*β, gap width W*α, gap distance W*γ and rotation angle of the incomplete rectangle The gap distance W*γ is the distance between the long side of the gap and the long side of the rectangle, and the rotation angle is the angle of rotation of the incomplete rectangle around the center point of the rectangle, where α, β, and γ are incomplete coefficients, all constants in the range of 0 to 1. The sample spectral response is a scattered spectrum.
[0056] Obtaining a data set specifically includes:
[0057] (1) For each optical metasurface, a plurality of first sample structure parameters are determined, simulation calculations are performed based on the first sample structure parameters to obtain a first sample spectral response corresponding to the first sample structure parameter, the first sample structure parameter is used as input, the first sample spectral response is used as a label, a data expansion model is trained to obtain a trained data expansion model, a plurality of second sample structure parameters are determined, the second sample structure parameter is used as input, and the trained data expansion model is used to generate a second sample spectral response corresponding to the second sample structure parameter, the first sample structure parameter and the second sample structure parameter are both recorded as sample structure parameters, the first sample spectral response and the second sample spectral response are both recorded as sample spectral responses, and for each sample structure parameter, a set of sample data is formed by combining the sample structure name of the optical metasurface, the sample structure parameter, and the sample spectral response corresponding to the sample structure parameter.
[0058] Performing simulation calculation based on the first sample structure parameter to obtain the first sample spectral response corresponding to the first sample structure parameter specifically includes: using the first sample structure parameter as input, performing simulation calculation using the time-domain finite difference method, and obtaining the first sample spectral response corresponding to the first sample structure parameter.
[0059] The trained data expansion model uses a parameterized convolutional neural network, which includes a first feature extraction module, a second feature extraction module, a splicing module and a prediction module. The output of the first feature extraction module and the output of the second feature extraction module are both connected to the input of the splicing module, and the output of the splicing module is connected to the input of the prediction module. The first feature extraction module is used to extract features of the two-dimensional structural image corresponding to the structural parameters of the first sample to obtain structural parameter image features. The second feature extraction module is used to extract features of the structural parameters of the first sample to obtain structural parameter numerical features. The splicing module is used to splice the structural parameter image features and the structural parameter numerical features to obtain splicing features. The prediction module is used to make predictions based on the splicing features to obtain a predicted value of the spectral response of the first sample.
[0060] Among them, the first feature extraction module includes multiple convolutional pooling blocks connected in sequence, the convolutional pooling blocks include convolutional layers and maximum pooling layers connected in sequence, the second feature extraction module includes a neural tensor network model and spatial tiling units connected in sequence, and the prediction module is a fully connected network.
[0061] (2) All sample data are combined into a data set.
[0062] (3) Word embedding is performed on the structure names and structure parameters, the spectral response is segmented, and learnable positional codes are further embedded in the structure names, structure parameters, and spectral responses after word embedding and segmentation. During the word embedding process, a balance between discrete dictionary size and continuous numerical expression is achieved through digital labeling methods.
[0063] Since the mixed expression of continuous numerical parameters and discrete structural types in the inverse design of optical metasurfaces has not been effectively solved, there is an inherent contradiction between the maintenance of numerical accuracy and the control of dictionary size in conventional word embedding methods. In order to solve this problem, when performing word embedding, this embodiment includes word segmentation and encoding. If the vocabulary obtained by word segmentation is a numerical value, a mixed granularity digital marking is implemented on the continuous numerical parameters through a digital marking method. The specific steps are: (1) Digital decomposition: split the numerical value into three independent marking units: integer part, decimal part, and decimal part; (2) Digital encoding: encode the split numerical values separately, for example: 3.14→Token <3> ,Token<.>,Token <14> By splitting integers and decimals, we successfully controlled (or compressed) the dictionary size to 2000 tokens, achieving a compression rate of over 60% while maintaining three decimal places of accuracy. This means that while the length of the numerical sequence was reduced by 60%, the accuracy of the three decimal places was maintained.
[0064] For structure names and structure parameters, such as Figure 5 As shown in Figure 2, the structure name and structure parameters are extracted through word embedding to extract vector features, and then the learnable position code (or trainable position vector) is embedded in the structure name and structure parameters after word embedding. For example, for the structure parameters, the learnable position code is d model is the embedding dimension. In this embodiment, the embedding dimension can be 128, that is, d model Set to a 128-dimensional embedding space, the learnable positional encoding adaptively learns the positional correlation between wavelengths through back-propagation.
[0065] For spectral response, such as Figure 5 As shown in the figure, different optical tasks are converted into spectral response representations. The spectral response is divided into blocks and then embedded into spectral position encoding. The spectral position encoding adopts learnable position encoding. Specifically, the spectral response is first divided into patches of fixed size. Each patch is represented as:
[0066]
[0067] Among them, z iis the linear embedding vector of the i-th patch; Linear is the linear layer; x is the spectral response, P is the patch size, x (i-1)·P+1:i·P is a sequence consisting of the (i-1)·P+1th sampling point to the i·Pth sampling point in the spectral response x; N is the number of patches. In this embodiment, the number of patches is 100, and the size of each patch is 5.
[0068] Then construct the learnable position encoding PE={p1,p2,…,p N}, Represents the encoding vector of the i-th position.
[0069] Finally, we add a learnable positional encoding based on the linear embedding vector of the patch, specifically let z i +p i .
[0070] At this time, in this embodiment, the sample structure name and sample structure parameters are word embedded and position encoded embedded respectively to obtain the embedded sample structure name and embedded sample structure parameters, and the sample spectral response is blocked and position encoded embedded to obtain the embedded sample spectral response.
[0071] Among them, word embedding and position encoding embedding are performed on the sample structure name and the sample structure parameters respectively to obtain the embedded sample structure name and the embedded sample structure parameters, specifically including: word segmentation and encoding are performed on the sample structure name and the sample structure parameters respectively to perform word embedding to obtain the word embedded sample structure name and the word embedded sample structure parameters; position encoding embedding is performed on the word embedded sample structure name and the word embedded sample structure parameters respectively to obtain the embedded sample structure name and the embedded sample structure parameters.
[0072] Among them, the sample structure name and the sample structure parameters are segmented and encoded respectively to perform word embedding to obtain the sample structure name after word embedding and the sample structure parameters after word embedding, specifically including: segmenting the sample structure name and the sample structure parameters respectively to obtain multiple first words corresponding to the sample structure name and multiple second words corresponding to the sample structure parameters; encoding the multiple first words to obtain the sample structure name after word embedding; encoding the multiple second words to obtain the sample structure parameters after word embedding.
[0073] Among them, when encoding multiple first words and encoding multiple second words, if the first word or the second word is a number, the number is decomposed and split into an integer part, a decimal part and a fractional part, and the integer part, decimal part and fractional part are encoded respectively.
[0074] (4) Constructing a feature extractor, which includes an encoder based on visual Transformer, extracting structure name features (which are semantic features of structure names) and spectral response features (which are global features of spectral responses), and performing multimodal fusion of the structure name features and the spectral response features to obtain fused features.
[0075] Considering that the Convolutional Neural Network (CNN) model has significant bottlenecks in long-distance spectral feature modeling (the local receptive field characteristics of traditional convolution operations make it difficult to effectively capture the global dependencies of spectral data, resulting in the loss of high-frequency detail information) and serialized parameter generation, the sequence generation model based on the Recurrent Neural Network (RNN) can handle the temporal relationship between parameters, but its serial computing characteristics lead to low training efficiency and difficulty in dealing with the problem of vanishing gradients in long sequences. This embodiment introduces the Transformer model, which leverages the advantages of the Transformer model itself to address the defects of the above-mentioned CNN model and RNN model.
[0076] In order to better extract features, the encoder of the visual Transformer is used to process the embedded structure name and the embedded spectral response respectively, such as Figure 5 As shown in the figure, the encoder's processing flow is as follows: first input the multi-head attention mechanism module, which calculates the global context information using the following formula:
[0077]
[0078] Among them, Attention is the attention mechanism; Q, K, and V are query matrix, key matrix, and value matrix, respectively. The query matrix Q, key matrix K, and value matrix V are obtained by linear transformation of input features. k is the dimension of the attention head. In this embodiment, the dimension of the attention head is 128.
[0079] The output of the multi-head attention mechanism module is then input into the feedforward neural network (FNN) through residual connection and layer normalization. The feedforward neural network performs a nonlinear transformation on the input feature vector, and its calculation formula is:
[0080] FNN(X)=ReLU(XW1+b1)W2+b2;
[0081] Wherein, FNN is a feedforward neural network; X is the eigenvector of the input feedforward neural network; W1 and W2 are the first weight matrix and the second weight matrix of the feedforward neural network respectively; b1 and b2 are the first bias term and the second bias term of the feedforward neural network respectively.
[0082] After obtaining the structural name features and spectral response features through the encoder, the extracted structural name features and spectral response features are input into the fusion layer and feature fusion is performed using the following formula:
[0083] F fusion =Concat(F spectra ,F name )W f +b f ;
[0084] Among them, F fusion is the fusion feature; Concat is splicing; F spectra is the spectral response characteristic; F name is the structural name feature; W f and b f are the weight matrix and bias term of the fusion layer respectively.
[0085] (5) Constructing a structural parameter generator, the structural parameter generator includes a decoder of a Transformer that includes self-attention and cross-attention mechanisms, and generates corresponding structural parameters based on fusion feature autoregression.
[0086] like Figure 5 As shown in the figure, the Transformer decoder adopts a cascade structure of a masked self-attention mechanism (i.e., a masked multi-head attention mechanism module) and a cross-attention mechanism (i.e., a multi-head attention mechanism module). The masked multi-head attention mechanism module uses an upper triangular matrix M to mask future token information. Its calculation formula is:
[0087]
[0088] Among them, Self Attention is a self-attention mechanism.
[0089] By shielding future token information, the temporal causality of the generation process can be ensured.
[0090] The multi-head attention mechanism module converts the decoder query matrix With the encoder key-value matrix Perform alignment and calculate spectral context weights:
[0091]
[0092] Among them, CrossAttention is a cross attention mechanism.
[0093] The hidden state of the decoder output is passed through the linear layer and the Softmax layer Probability distribution mapped to 2000-dimensional token:
[0094] P(y t |y <t ,F fusion )=softmax(W o h t +b o );
[0095] Among them, P(y t |y <t ,F fusion ) is the generated tth token y t The probability of y <t Represents the first t-1 tokens generated; F fusion is the fusion feature; W o and b o are the weight matrix and bias term of the linear layer respectively.
[0096] Based on the above content, the structural parameter generator generates structural parameters step by step in an autoregressive manner, predicting the next token based on the previously generated token at each step until the complete structural parameters are generated.
[0097] At this time, in this embodiment, the embedded sample structure name and the embedded sample spectral response are used as input, and the feature extractor is used to extract the fusion feature, and the fusion feature is used as input to generate the embedded sample structure parameter prediction value using the structure parameter generator.
[0098] The feature extractor includes a first encoding module, a second encoding module, and a fusion module. The output of the first encoding module and the output of the second encoding module are both connected to the input of the fusion module. The first encoding module is used to extract features from the embedded sample structure name to obtain a structure name feature. The second encoding module is used to extract features from the embedded sample spectral response to obtain a spectral response feature. The fusion module is used to fuse the structure name feature and the spectral response feature to obtain a fused feature. The first encoding module and the second encoding module each include several encoders connected in sequence, the encoders being the encoders of the Transformer model, and the fusion module is a fusion layer.
[0099] The structural parameter generator includes a decoding module, a linear mapping module and a Softmax layer connected in sequence, wherein the decoding module includes several decoders connected in sequence, the decoder is the decoder of the Transformer model, and the linear mapping module is a linear layer.
[0100] (6) Solve the problems of multi-solution and parameter sensitivity in inverse design by jointly optimizing cross entropy loss, mean square error loss and auxiliary loss of forward prediction model.
[0101] Considering that related technologies lack an effective constraint mechanism for the multi-solution problem, this embodiment designs a joint loss function that includes the following composite loss terms:
[0102] (1) Cross entropy loss: used to measure the difference between the model output probability distribution and the target distribution. Its calculation formula is:
[0103]
[0104] Among them, L ce is the cross entropy loss; T is the length of the final generated structural parameter; C is the number of categories, corresponding to the dictionary size of 2000; y t,c is the true probability that the tth parameter in the structure parameter belongs to the cth category, which is determined based on the sample structure parameters. If the tth parameter belongs to the cth category, then y t,c is 1; is the predicted probability that the tth parameter in the structural parameters belongs to the cth category, determined based on the structural parameter generator.
[0105] (2) Mean square error loss: It is used to constrain the accuracy of numerical parameters in structural parameters. Numerical parameters refer to parameters whose values are numerical. For example, the structural parameters are: ellipse, the parameter: major_axis (long axis length): 168, minor_axis (short axis length): 135, phi (rotation angle): 21, Px: 223, Py: 375, then 168, 135, 21, 223, 375 are numerical parameters, and the calculation formula is:
[0106]
[0107] Among them, L mse is the mean square error loss; N1 is the number of numerical parameters in the structural parameters; p i is the true value of the i-th numerical parameter in the structural parameters, which is determined based on the sample structural parameters; is the predicted value of the i-th numerical parameter in the structural parameters, determined based on the structural parameter generator.
[0108] The mean square error loss is used to ensure the accuracy of numerical parameters, and the cross entropy loss is used to ensure the accuracy of the entire output structure of the structural parameters. For example, a rectangle should not have a major axis and a minor axis.
[0109] (3) Forward prediction model auxiliary loss: The spectral matching degree of the generated structural parameters is evaluated by serial forward simulation, and the calculation formula is:
[0110]
[0111] Among them, L fwd is the auxiliary loss of the forward prediction model, and the mean square error loss function is also used; M is the number of sampling points of the spectral response, which can be 500 sampling points in this embodiment; s j is the true spectral response value of the jth sampling point, determined based on the sample spectral response; The simulated spectral response value of the j-th sampling point obtained by simulation calculation based on the generated structural parameters is determined based on the sample spectral response prediction value.
[0112] The above loss terms are balanced by dynamic weight coefficients, and the calculation formula is:
[0113] L=αL ce +βL mse +βL fwd ;
[0114] Where L is the total loss; α, β, and γ are adaptive weight coefficients optimized by the validation set, satisfying α+β+γ=1.
[0115] At this time, in this embodiment, the sample structure parameter prediction value after embedding is processed to obtain the sample structure parameter prediction value, and simulation calculation is performed based on the sample structure parameter prediction value. Specifically, the sample structure parameter prediction value is used as input, and the time-domain finite difference method is used to perform simulation calculation to obtain the sample spectral response prediction value, and the sample spectral response prediction value is blocked and position-coded and embedded to obtain the embedded sample spectral response prediction value. Based on the embedded sample structure parameters, the embedded sample spectral response, the embedded sample structure parameter prediction value and the embedded sample spectral response prediction value, the total loss is calculated.
[0116] Among them, based on the embedded sample structure parameters, the embedded sample spectral response, the embedded sample structure parameter prediction value and the embedded sample spectral response prediction value, the total loss is calculated, specifically including: based on the embedded sample structure parameters and the embedded sample structure parameter prediction value, the cross entropy loss L is calculated ce and the first mean square error loss L mse Based on the embedded sample spectral response and the predicted value of the embedded sample spectral response, the second mean square error loss L is calculated fwd; For cross entropy loss L ce , the first mean square error loss L mse and the second mean square error loss L fwd Perform weighted summation to obtain the total loss L.
[0117] During training, the feature extractor and structural parameter generator are trained by minimizing the total loss, which effectively solves the multi-solution problem in reverse design while ensuring the logical coherence of sequence generation, thereby further improving the accuracy of model prediction.
[0118] Determine whether the iteration termination condition is met, for example, the total loss may be less than the preset loss or the number of iterations reaches the maximum number of iterations; if so, generate an optical metasurface structure parameter design model, the optical metasurface structure parameter design model including a feature extractor and a structure parameter generator connected in sequence; if not, update the feature extractor and the structure parameter generator based on the total loss to obtain an updated feature extractor and an updated structure parameter generator, and use the updated feature extractor as the feature extractor for the next iteration, and use the updated structure parameter generator as the structure parameter generator for the next iteration, and return to the step of "using the embedded sample structure name and the embedded sample spectral response as input, and using the feature extractor to extract the fusion feature".
[0119] This embodiment designs a feature extractor and structure parameter generator based on the Transformer architecture, and introduces multimodal feature fusion of structure name, spectral response, structure name and spectral response, digital labeling method and joint loss function optimization to solve the problems of insufficient generalization ability, low parameter encoding efficiency and difficulty in constraining multiple solutions in existing optical metasurface inverse design methods. Through multimodal feature fusion, autoregressive generation mechanism and joint loss function optimization, high-degree-of-freedom and high-precision optical metasurface inverse design is achieved.
[0120] As an example, the dataset used for training consists of 14,000 simulated data (i.e., the data in the initial dataset) and 800,000 augmented data (i.e., the data generated by the model augmented with the trained data). In order to prevent the impact of excessive augmented data on the network model (including the feature extractor and the structural parameter generator), a pre-training + fine-tuning training strategy is adopted. The network model is first pre-trained using augmented data, and then further fine-tuned using simulated data after the network model has basically converged. First, the dataset is divided, with 80% of the data used as a training set, 10% of the data used as a validation set, and 10% of the data used as a test set. The input is the structure name and spectral response, with 500 sampling points, and the output is the structural parameters of the corresponding structure. The network model is built and the divided training set is fed into the network model for iterative cycle training. The optimizer uses Adam (Adaptive Moment Estimation), the initial learning rate is 0.001, the number of layers of the encoder and decoder are both 3, the number of attention heads in the encoder and decoder is 8, and the batch size of each training is 128. During the training process, the joint loss function L = αL is minimized. ce +βL mse +γL fwd To optimize the network model, the initial α is set to 0.5, and the initial β and γ are set to 0.25 respectively. When the total loss of the network model stops decreasing, β and γ are gradually increased to improve the model parameter values and the accuracy of the predicted spectrum. Training is stopped when α is 0.2, β and γ are 0.4, and the total loss no longer decreases. Character Accuracy Rate (CAR) and Mean Squared Error (MSE) are used to measure the effectiveness of the network model. Character Accuracy can measure the accuracy of parameter prediction. The formula is as follows:
[0121]
[0122] Among them, CAR is the character accuracy; N2 is the length of the predicted sequence P; D(P i ,T i ) means to convert T i Convert to T i The minimum number of insertion, deletion, and replacement operations required, P i Represents the value of the i-th element of the prediction sequence P (i.e., the predicted structural parameters), T iThe character accuracy of the network model for different optical metasurface types can be clearly reflected by calculating the character accuracy. Combined with the mean square error (MSE), the prediction effect on the final spectral response can be measured. Ultimately, the network model of this embodiment achieved a character accuracy of 88% and an MSE of 0.01155, achieving high accuracy and meeting the requirements for fast and accurate design.
[0123] Examples are extracted from the test set to reflect the reverse design effect of the network model of this embodiment under optical metasurfaces of different structural types, such as Figure 6 As shown in Table 1, by specifying different structures, the network model can accurately generate the corresponding structural parameters. These predicted structural parameters are input into the full-wave electromagnetic simulation software for simulation. By comparing the generated spectral response (i.e. Figure 6 The predicted value in ) is compared with the target spectral response of the original input (i.e. Figure 6 ), it is clear that the peak positions, amplitudes, and overall spectral morphology of the two are highly consistent, demonstrating that the network model demonstrates extremely high accuracy and robustness in capturing spectral responses. Even though the structural parameters of the different structures vary, the final simulation results (i.e., the generated spectral response) are nearly identical to the input target spectral response, fully demonstrating the versatility of network models in achieving efficient inverse design.
[0124] Table 1 Structural parameters generated by the network model
[0125]
[0126] This embodiment relates to a training method for a structural parameter design model for an optical metasurface based on a Transformer architecture, belonging to the technical field of intelligent design of optical metasurfaces. To address the technical issues of insufficient generalization capabilities of traditional design methods and the difficulty of single-task models in meeting high-degree-of-freedom design requirements, a deep learning framework that integrates multimodal features and autoregressive generation is innovatively constructed. The framework comprises: first, constructing an initial data set using the finite-difference time-domain method, and performing data augmentation through a parameterized convolutional neural network; second, embedding learnable positional encodings in the structure name, structure parameters, and spectral response; innovatively adopting a digital labeling method to balance the dictionary size and numerical continuity expression; then constructing an encoder based on a visual Transformer, extracting spectral response features through a multi-head attention mechanism, and performing multimodal feature fusion with the structure name features; employing a Transformer decoder, and realizing autoregressive generation of structure parameters through self-attention and cross-attention mechanisms; and finally, innovatively designing a multi-objective joint loss function system, including cross-entropy loss, mean squared error loss, and forward prediction model auxiliary loss, which effectively addresses the problems of multi-solution and parameter sensitivity in inverse design.
[0127] Compared with the prior art, this embodiment has the following advantages and beneficial effects:
[0128] (1) This embodiment effectively captures the global spectral dependencies through the encoder and multi-head attention mechanism of the visual Transformer, and generates structural parameters through the autoregressive characteristics of the Transformer decoder.
[0129] (2) This embodiment pioneered a digital tag and multimodal feature fusion architecture, which solved the problem of mixed encoding of continuous numerical values and discrete structures in reverse design. The cross-modal alignment mechanism of structural name features and spectral response features enables the model to generate different structural parameters according to different structural requirements.
[0130] (3) This embodiment adopts the joint loss function collaborative optimization for the first time, which effectively solves the multi-solution problem in the reverse design while ensuring the logical coherence of sequence generation, thereby further improving the accuracy of model prediction.
[0131] Example 2
[0132] This embodiment provides an optical metasurface structure parameter design model application method, such as Figure 7 As shown, the optical metasurface structure parameter design model application method includes:
[0133] Step T1: Obtain the structure name and spectral response of the target optical metasurface.
[0134] Step T2: word embedding and position encoding embedding are performed on the structure name to obtain the embedded structure name, and block and position encoding embedding are performed on the spectral response to obtain the embedded spectral response.
[0135] Step T3, using the embedded structure name and the embedded spectral response as input, and using the optical metasurface structure parameter design model to generate the predicted value of the embedded structure parameter; the optical metasurface structure parameter design model is an optical metasurface structure parameter design model trained using the optical metasurface structure parameter design model training method described in Example 1.
[0136] Step T4: Processing the predicted values of the embedded structural parameters to obtain the structural parameters of the target optical metasurface.
[0137] The application method of the optical metasurface structural parameter design model of this embodiment in structural color design includes the following steps: first, the target spectral response corresponding to the target structural color is calculated using a differential mutation algorithm. The calculated target spectral response and the preset structure name are input into the optical metasurface structural parameter design model, and the autoregressive characteristics of the Transformer are used to generate the structural parameters of the corresponding optical metasurface. The generated structural parameters are then input into full-wave electromagnetic simulation software for simulation, and the actual RGB values in the simulation results are extracted to obtain the predicted color. Finally, the predicted color is compared with the target color of the target structural color, and the color difference ΔE ≤ 0.1 is verified, verifying the high accuracy and reliability of the optical metasurface structural parameter design model in structural color design.
[0138] Specifically, in optical metasurface technology, structural color design requires precise control of the spectral response characteristics of micro-nanostructures to achieve high-fidelity presentation of the target color. This embodiment demonstrates the entire process of structural color reverse design based on the Transformer-based optical metasurface structural parameter design model, verifying its application performance in the field of color generation.
[0139] Implementation process such as Figure 8 As shown in the figure, the target RGB value (i.e., target color) is first converted into the target spectral response using the differential mutation algorithm. The initial population size is set to 1500, the coefficient of variation range is (0.5, 1.0), the crossover probability CR = 0.7, and the optimization objective function is:
[0140]
[0141] Among them, Loss(S) is the objective function, S is the spectral response; ΔE is the color difference, and the color difference ΔE is calculated using the CIEDE2000 standard; RGB is the color, RGB target is the target color, RGB sis the calculated color calculated from the spectral response S; Used to constrain the smoothness of the spectral curve; α1 is the spectral smoothing factor, which can generally be set to α1 = 100; n is the total number of sampling points of the spectral response S; the second-order differential term The physical feasibility of the constrained spectral curve indicates that the spectral curve corresponding to the spectral response S is at a wavelength λ i The second derivative at represents the curvature of the spectrum, λ i is the wavelength of the i-th sampling point of the spectral response S. Through this optimization process, a target spectral response that meets color requirements and is physically manufacturable is obtained.
[0142] The optimized target spectral response and the specified structure name (such as "rectangle") are input into the optical metasurface structural parameter design model. The input target spectral response is divided into blocks and positionally encoded before entering the encoder. The input structure name is word-embedded and positionally encoded before entering the encoder. The spectral response features and structure name features are extracted under the 8-head attention mechanism, and further fused to obtain the fused features. The fused features are then input into the decoder, which generates the structural parameters through autoregression.
[0143] The generated structural parameters are imported into the full-wave electromagnetic simulation software for full-wave simulation, such as Figure 8 As shown, for the target color RGB (27, 85, 70), the structural parameters generated by the optical metasurface structural parameter design model were verified by simulation to produce a predicted color that was highly consistent with the target color, with the difference being virtually invisible to the naked eye. This example demonstrates the engineering practicality of structural color design. Compared to traditional trial-and-error methods, the design cycle was shortened from weeks to minutes, providing an efficient design tool for applications such as dynamic color display devices and optical anti-counterfeiting labels.
[0144] The application of the optical metasurface structure parameter design model application method of this embodiment in filter design includes the following steps: first, construct a target spectral response, which presents a peak response in a specific band and maintains low reflectivity in other bands. For example, a peak with a peak height of 0.95 and a peak width of 100nm is presented in the 550nm band, and the reflectivity in the band outside 500-600nm is only 0.05. Then, the target spectral response and the preset structure name are input into the optical metasurface structure parameter design model to generate structural parameters matching the target spectral response, and the generated structural parameters are input into full-wave electromagnetic simulation software for simulation, and the simulated spectral response in the simulation results is extracted. The simulated spectral response is compared with the target spectral response, and the mean square error between the simulated spectral response and the target spectral response is ≤1e -3 , verifying the high precision and reliability in filter design.
[0145] As the core component of the photonic system, the optical filter plays an irreplaceable role in wavelength selection, noise suppression and signal enhancement. This embodiment targets the requirements of typical bandpass filters, such as Figure 9 As shown, the target spectral response is first constructed: a peak reflectivity of 0.95 (half-maximum width 100nm) is achieved at a central wavelength of 550nm, and the reflectivity is lower than 0.05 outside the 500-600nm band, verifying its ability in complex spectral control tasks.
[0146] The optimized target spectral response and the specified structure name (such as "rectangle") are then input into the optical metasurface structural parameter design model. The input target spectral response is divided into blocks and positionally encoded before entering the encoder, and the input structure name is word-embedded and positionally encoded before entering the encoder. The spectral response features and structure name features are extracted under the 8-head attention mechanism, and further fused to obtain the fused features. The fused features are then input into the decoder, and the decoder generates the structural parameters through autoregression.
[0147] The structural parameters were input into the full-wave electromagnetic simulation software for simulation, and the simulated spectral response was extracted from the simulation results. The results showed that the simulated spectral response of the simulation output was highly consistent with the expected target spectral response, such as Figure 9 As shown, the high accuracy and reliability in filter design are verified.
[0148] At the engineering application level, the existing design process relies on multiple tool chains for discrete operations (such as parameter generation, structural drawing, electromagnetic simulation, etc.), requiring manual repeated switching of software platforms and manual writing of simulation scripts, resulting in high technical barriers, redundant operations, and easy introduction of human errors. Therefore, it is urgent to build an intelligent design framework that takes into account global feature modeling, multimodal fusion, and serialized parameter generation to break through the core bottlenecks of existing technologies in terms of multi-solution suppression, numerical continuity expression, and cross-task generalization. To solve this problem, this embodiment implements the following functions through deep integration with a large language model: (1) natural language parsing, receiving the design requirements described by the user in natural language and converting them into target spectral responses that can be processed by the model; (2) automated design process, calling the optical metasurface structural parameter design model to generate the structural parameters of the optical metasurface, and visualizing the generated structural parameters as a structural diagram; (3) automatic script generation, based on the generated structural parameters, automatically outputting script code that meets the requirements of the full-wave electromagnetic simulation software; (4) full-process closed-loop verification, importing the generated script code into the full-wave electromagnetic simulation software platform for simulation, and verifying the consistency of the final simulated spectral response with the input target spectral response. Through the above integration method, the user's technical threshold is lowered, the entire process from design requirements to simulation verification is automated, and design efficiency and flexibility are significantly improved.
[0149] In this embodiment, the optical metasurface structural parameter design model is integrated into the large language model. Acquiring the structural name and spectral response of the target optical metasurface specifically includes: obtaining a user-entered design requirement described in natural language; using the design requirement as input, and determining the structural name and spectral response of the target optical metasurface using the large language model. After obtaining the structural parameters of the target optical metasurface, the optical metasurface structural parameter design model application method of this embodiment further includes: using the structural parameters as input, and generating a structural diagram and script code of the target optical metasurface using the large language model. The script code is used to perform simulation calculations based on the structural parameters in simulation software to complete simulation verification of the target optical metasurface.
[0150] In the traditional optical metasurface reverse design process, traditional designers often face many challenges in model deployment, data processing, and type conversion. The professional and technical threshold is high, which limits the practical application of advanced design models. To solve this problem, this embodiment deeply integrates the optical metasurface structural parameter design model with the big language model, and uses the big language model to automatically call and manage complex design tasks. With the powerful capabilities of the big language model in natural language processing and multimodal data fusion, it is easy to achieve functions such as forward prediction, reverse prediction, structure diagram drawing, and automatic generation of FDTD script language.
[0151] like Figure 10 As shown in the figure, a simple filter design is used as an example. The goal is to construct a rectangular metasurface optical structure (i.e., a rectangular optical metasurface) that reflects signals in the 725nm to 775nm band. First, a target spectral response is constructed based on the target wavelength, and the design requirements are communicated to the large language model through natural dialogue. After parsing the instructions, the large language model, leveraging its intelligent integration capabilities for a large amount of relevant data, automatically invokes the optical metasurface structural parameter design model, rapidly completing the optical metasurface design and outputting accurate structural parameters. It also automatically generates script code that meets the requirements for FDTD simulation. The generated script code is then imported into the FDTD platform for simulation. The resulting simulated spectral response closely matches the preset target spectral response, fully validating the efficiency and reliability of this intelligent design process. This integration not only simplifies user operations during data preprocessing and model invocation, lowering the technical threshold, but also, through the large language model's intelligent scheduling of the underlying models, automates the entire process, from parameter prediction to structural verification. Without in-depth knowledge of the specific algorithmic details, users can quickly obtain high-quality design solutions and simulation scripts through natural language instructions or simple interface calls, significantly improving design efficiency and flexibility.
[0152] Experimental results show that this method demonstrates excellent performance in typical scenarios such as structural color control and optical filters. Combined with a large language model, it realizes a one-stop design process of inverse prediction-structural mapping-FDTD simulation, significantly reducing the technical threshold and improving design efficiency.
[0153] The present application also provides an application scenario, which applies the above-mentioned optical metasurface structure parameter design model application method. Specifically, the optical metasurface structure parameter design model application method provided in this embodiment can be applied in an optical device design scenario. The optical device design scenario includes a structure parameter determination link and a design link. The structure parameter determination link is used to determine the structural parameters of the optical metasurface in the optical device based on the optical metasurface structure parameter design model. The design link is used to design the optical device based on the structure parameters. The optical device is a device with an optical metasurface. The optical metasurface structure parameter design model application method provided in this embodiment belongs to the structure parameter determination link.
[0154] Example 3
[0155] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 11 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for training an optical metasurface structure parameter design model or a method for applying an optical metasurface structure parameter design model is implemented.
[0156] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0157] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the optical metasurface structure parameter design model training method in Example 1 or the optical metasurface structure parameter design model application method in Example 2 is implemented.
[0158] Example 4
[0159] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the optical metasurface structure parameter design model training method in Example 1 or the optical metasurface structure parameter design model application method in Example 2.
[0160] Example 5
[0161] In an exemplary embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the optical metasurface structure parameter design model training method in Example 1 or the optical metasurface structure parameter design model application method in Example 2.
[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0163] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0164] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for training a model for designing optical metasurface structure parameters, characterized in that: The optical metasurface structure parameter design model training method comprises: Acquire a data set; the data set includes multiple sets of sample data of each optical metasurface among the multiple optical metasurfaces, the sample data including sample structure name, sample structure parameters and sample spectral response; Performing word embedding and position encoding embedding on the sample structure name and the sample structure parameter respectively to obtain the embedded sample structure name and the embedded sample structure parameter, and performing block and position encoding embedding on the sample spectral response to obtain the embedded sample spectral response; Taking the embedded sample structure name and the embedded sample spectral response as input, a feature extractor is used to extract fusion features, and taking the fusion features as input, a structure parameter generator is used to generate a predicted value of the embedded sample structure parameter; Processing the embedded sample structure parameter prediction value to obtain a sample structure parameter prediction value, performing simulation calculation based on the sample structure parameter prediction value to obtain a sample spectral response prediction value, and performing block and position encoding embedding on the sample spectral response prediction value to obtain an embedded sample spectral response prediction value; Calculating a total loss based on the embedded sample structure parameter, the embedded sample spectral response, the embedded sample structure parameter prediction value, and the embedded sample spectral response prediction value; Determine whether the iteration termination condition is met; if so, generate an optical metasurface structure parameter design model, the optical metasurface structure parameter design model including a feature extractor and a structure parameter generator connected in sequence; if not, update the feature extractor and the structure parameter generator based on the total loss to obtain an updated feature extractor and an updated structure parameter generator, and use the updated feature extractor as the feature extractor of the next iteration, and use the updated structure parameter generator as the structure parameter generator of the next iteration, and return to the step of "using the embedded sample structure name and the embedded sample spectral response as input, and using the feature extractor to extract the fusion feature".
2. The optical metasurface structure parameter design model training method according to claim 1, characterized in that: The sample structure names include oval, rectangle, double rectangle, double oval, donut, cross and incomplete rectangle; When the sample structure name is ellipse, the sample structure parameters include the major axis length, minor axis length and rotation angle of the ellipse; when the sample structure name is rectangle, the sample structure parameters include the length, width and rotation angle of the rectangle; when the sample structure name is double rectangle, the sample structure parameters include the length and width of the first rectangle, the length and width of the second rectangle and the rotation angle of the double rectangle; when the sample structure name is double ellipse, the sample structure parameters include the major axis length, minor axis length and tilt angle of the ellipse and the rotation angle of the double ellipse; when the sample structure name is ring, the sample structure parameters include the length, width and rotation angle of the first rectangle, the length and width of the second rectangle and the rotation angle of the double rectangle; The sample structure parameters include the outer diameter, inner diameter, notch angle and rotation angle of the ring, where the notch angle is the central angle corresponding to the missing part of the ring; when the sample structure name is a cross, the sample structure parameters include the length, width and offset of the first rectangle, the length and width of the second rectangle, and the rotation angle of the cross, where the offset is the vertical distance from the center point of the first rectangle to the center point of the second rectangle; when the sample structure name is an incomplete rectangle, the sample structure parameters include the length, width, notch length, notch width, notch distance and rotation angle of the incomplete rectangle, where the notch distance is the distance between the long side of the notch and the long side of the rectangle; The sample spectral response is a reflection spectrum or a scattering spectrum.
3. The optical metasurface structure parameter design model training method according to claim 1, characterized in that: Get the dataset, including: For each optical metasurface, a plurality of first sample structure parameters are determined, simulation calculations are performed based on the first sample structure parameters to obtain first sample spectral responses corresponding to the first sample structure parameters, a data augmentation model is trained using the first sample structure parameters as input and the first sample spectral responses as labels to obtain a trained data augmentation model, a plurality of second sample structure parameters are determined, a second sample spectral response corresponding to the second sample structure parameters is generated using the trained data augmentation model using the second sample structure parameters as input, the first sample structure parameters and the second sample structure parameters are both recorded as sample structure parameters, and the first sample spectral response and the second sample spectral response are both recorded as sample spectral responses. For each sample structure parameter, a set of sample data is formed by combining the sample structure name of the optical metasurface, the sample structure parameters, and the sample spectral responses corresponding to the sample structure parameters; Combining all the sample data into a data set; The trained data expansion model adopts a parameterized convolutional neural network, which includes a first feature extraction module, a second feature extraction module, a splicing module and a prediction module. The output end of the first feature extraction module and the output end of the second feature extraction module are both connected to the input end of the splicing module, and the output end of the splicing module is connected to the input end of the prediction module. The first feature extraction module is used to extract features from the two-dimensional structure image corresponding to the first sample structure parameter to obtain structure parameter image features; The second feature extraction module is used to extract features of the first sample structure parameters to obtain numerical features of the structure parameters; The splicing module is used to splice the structural parameter image feature and the structural parameter numerical feature to obtain a splicing feature; The prediction module is used to perform prediction based on the splicing features to obtain a predicted value of the first sample spectral response; Among them, the first feature extraction module includes multiple convolutional pooling blocks connected in sequence, and the convolutional pooling blocks include convolutional layers and maximum pooling layers connected in sequence; the second feature extraction module includes a neural tensor network model and a spatial tiling unit connected in sequence; and the prediction module is a fully connected network.
4. The optical metasurface structure parameter design model training method according to claim 1, characterized in that: Performing word embedding and position encoding embedding on the sample structure name and the sample structure parameter respectively to obtain the embedded sample structure name and the embedded sample structure parameter, specifically comprising: performing word segmentation and encoding on the sample structure name and the sample structure parameter respectively to perform word embedding to obtain the word-embedded sample structure name and the word-embedded sample structure parameter; performing position encoding embedding on the word-embedded sample structure name and the word-embedded sample structure parameter respectively to obtain the embedded sample structure name and the embedded sample structure parameter; The sample structure name and the sample structure parameter are segmented and encoded respectively to perform word embedding to obtain the sample structure name after word embedding and the sample structure parameter after word embedding, specifically comprising: segmenting the sample structure name and the sample structure parameter respectively to obtain a plurality of first words corresponding to the sample structure name and a plurality of second words corresponding to the sample structure parameter; encoding the plurality of first words to obtain the sample structure name after word embedding; encoding the plurality of second words to obtain the sample structure parameter after word embedding; When encoding multiple first words and encoding multiple second words, if the first word or the second word is a number, the number is decomposed and split into an integer part, a decimal part and a fractional part, and the integer part, the decimal part and the fractional part are encoded respectively.
5. The optical metasurface structure parameter design model training method according to claim 1, characterized in that: The feature extractor includes a first encoding module, a second encoding module and a fusion module, wherein the output end of the first encoding module and the output end of the second encoding module are both connected to the input end of the fusion module, the first encoding module is used to extract the features of the structure name of the embedded sample to obtain the structure name feature, the second encoding module is used to extract the features of the spectral response of the embedded sample to obtain the spectral response feature, and the fusion module is used to fuse the structure name feature and the spectral response feature to obtain a fusion feature; The structural parameter generator includes a decoding module, a linear mapping module and a Softmax layer connected in sequence; Among them, the first encoding module and the second encoding module both include several encoders connected in sequence, and the encoders are encoders of the Transformer model; the fusion module is a fusion layer; the decoding module includes several decoders connected in sequence, and the decoder is a decoder of the Transformer model; the linear mapping module is a linear layer.
6. The optical metasurface structure parameter design model training method according to claim 1, characterized in that: The total loss is calculated based on the embedded sample structure parameter, the embedded sample spectral response, the embedded sample structure parameter prediction value, and the embedded sample spectral response prediction value, specifically including: Based on the embedded sample structure parameter and the predicted value of the embedded sample structure parameter, a cross entropy loss and a first mean square error loss are calculated; Calculating a second mean square error loss based on the embedded sample spectral response and the predicted value of the embedded sample spectral response; A total loss is obtained by performing a weighted summation on the cross entropy loss, the first mean square error loss, and the second mean square error loss.
7. An application method for an optical metasurface structure parameter design model, characterized in that: The optical metasurface structure parameter design model application method includes: Obtain the structure name and spectral response of the target optical metasurface; Performing word embedding and position encoding embedding on the structure name to obtain an embedded structure name, and performing block segmentation and position encoding embedding on the spectral response to obtain an embedded spectral response; Using the embedded structure name and the embedded spectral response as input, an optical metasurface structure parameter design model is used to generate a predicted value of the embedded structure parameter; the optical metasurface structure parameter design model is an optical metasurface structure parameter design model trained using the optical metasurface structure parameter design model training method according to any one of claims 1 to 6; The predicted values of the embedded structural parameters are processed to obtain the structural parameters of the target optical metasurface.
8. The optical metasurface structure parameter design model application method according to claim 7, characterized in that: The optical metasurface structural parameter design model is integrated into the large language model. At this time, obtaining the structural name and spectral response of the target optical metasurface specifically includes: obtaining design requirements described in natural language input by a user; using the design requirements as input, and using the large language model to determine the structural name and spectral response of the target optical metasurface; After obtaining the structural parameters of the target optical metasurface, the optical metasurface structural parameter design model application method further includes: using the structural parameters as input, using the large language model to generate a structural diagram and script code of the target optical metasurface, and the script code is used to perform simulation calculations based on the structural parameters in simulation software to complete simulation verification of the target optical metasurface.
9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the optical metasurface structure parameter design model training method according to any one of claims 1 to 6 or the optical metasurface structure parameter design model application method according to any one of claims 7 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the optical metasurface structure parameter design model training method described in any one of claims 1-6 or the optical metasurface structure parameter design model application method described in any one of claims 7-8 is implemented.
Citation Information
Cited By
Methane column concentration inversion method and system based on physically-driven variational auto-encoder
CN121027002A
Quick prediction method for two-dimensional field distribution of whole metasurface
CN121905372A