Smart design method and apparatus for metasurface sensor based on dual-branch architecture

CN122528588APending Publication Date: 2026-08-07浙江优众新材料科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
浙江优众新材料科技有限公司
Filing Date
2026-04-07
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

在设计方法上,传统数值优化方法需大量参数扫描与冗长模拟计算,消耗巨额计算资源与时间;人工智能技术推动下,深度学习为超表面设计提供新路径,早期多层感知机、卷积神经网络等模型虽加速设计进程,但存在“黑盒”特性导致内部机制难解释、难以精确捕捉高品质因子光学响应关键光谱特征等局限,影响传感器精准设计

Benefits of technology

[0015]与现有技术相比,本发明的采用双分支架构、超线性自注意力与跨分支门控融合组合策略,实现局部与非局部特征的精准提取、强化及自适应融合,通过多任务联合优化策略保障设计精度与正逆向设计任务逻辑统一性,结合对称性及可量化物理约束的端到端训练,构建全流程一体化智能设计体系,提升设计效率与可靠性,实现超表面传感器从智能设计到落地应用的闭环。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122528588A_ABST
    Figure CN122528588A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of optical device design, and relates to a metasurface sensor intelligent design method and device based on a double-branch architecture. The method comprises the following steps: obtaining a metasurface sensor multi-element physical information dataset and preprocessing; inputting a pre-constructed double-branch feature extraction network to obtain corresponding output features. After complementary extraction of the output features, the output features are strengthened through a super-linear self-attention mechanism; bidirectional information complementation is realized through a cross-branch attention mechanism, and the output features after interaction are input into a gated fusion network to obtain fusion features. The fusion features are refined and adaptively weighted and aggregated, and are projected to a target space to obtain a target prediction result. The learnable parameters are updated through a multi-task joint optimization strategy, the updated learnable parameters are loaded, the updated target prediction result is subjected to symmetry preservation and quantifiable physical constraint processing, the network is trained end to end, and a metasurface sensor design scheme is output, so that the design efficiency and reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of optical device design technology, and relates to an intelligent design method and device for metasurface sensors based on a dual-branch architecture. Background Technology

[0002] In recent years, metasurface sensors have demonstrated enormous application potential in fundamental fields such as physics, chemistry, and biology, as well as in medical detection. Among them, metasurface structures based on the continuous-domain bound-state mechanism can generate high-quality factor resonance responses, significantly enhancing the near-field localization capability and detection sensitivity of sensors. Continuous-domain bound states possess the characteristics of regulating radiation loss and increasing local optical field intensity. By breaking symmetry protection, they can be transformed into quasi-continuous-domain bound-state modes with controllable radiation loss. With their excellent resonance lifetime and high-quality factor, they perform outstandingly in scenarios such as molecular fingerprint detection and refractive index sensing. In terms of design methods, traditional numerical optimization methods require a large number of parameter scans and lengthy simulation calculations, consuming huge amounts of computational resources and time. Driven by artificial intelligence technology, deep learning provides a new path for metasurface design. Although early models such as multilayer perceptrons and convolutional neural networks accelerated the design process, they had limitations such as "black box" characteristics, making it difficult to interpret the internal mechanisms and accurately capture the key spectral features of the high-quality factor optical response, thus affecting the precise design of sensors.

[0003] The multi-head self-attention mechanism of the Transformer architecture can flexibly allocate input sequence weights and efficiently capture long-range dependencies and complex feature relationships, bringing new opportunities for metasurface sensor design. Existing research has proposed meta-transformer models based on spectral segmentation strategies, which reduce the scale of training parameters and maintain high accuracy by dividing spectral segments. Different attention heads can adaptively focus on feature regions such as resonance peaks, achieving a certain degree of interpretability. However, when processing multi-dimensional information such as fingerprint features and optical sensitivity, there are still problems such as insufficient representation of complex physical features and a lack of deep multi-element correlation mining. Currently, intelligent design of metasurface sensors faces three core challenges: complex multi-element physical information requires a more efficient representation learning architecture, and simple Transformer models cannot fully mine multi-level features; traditional self-attention mechanisms have limitations in capturing local and global feature dependencies, especially in adapting to optical features with significant scale differences; and existing methods lack the ability to explicitly model the complex relationships between metasurface structure, optical response, and environmental changes. Summary of the Invention

[0004] The purpose of this invention is to address the aforementioned problems in existing technologies by proposing a smart design method for metasurface sensors based on a dual-branch architecture.

[0005] The objective of this invention can be achieved through the following technical solution: a smart design method for metasurface sensors based on a dual-branch architecture, comprising: Acquire a multi-element physical information dataset of the metasurface sensor, and preprocess the multi-element physical information dataset; The preprocessed multi-element physical information dataset is used as an input sequence and input into a pre-constructed dual-branch feature extraction network. Based on the self-attention mechanism of each branch, the output features of the first feature branch and the output features of the second feature branch are obtained. Complementary feature extraction is performed between the output features of the first feature branch and the output features of the second feature branch. Through a superlinear self-attention mechanism, the output features of the first feature branch and the output features of the second feature branch after the extraction of complementary features are enhanced. Through a cross-branch attention mechanism, the enhanced output features of the first feature branch and the output features of the second feature branch obtain supplementary information bidirectionally. The output features after interaction are then input into the gated fusion network to obtain fused features. The fused features are refined and aggregated to obtain aggregated features after adaptive weighted fusion of refined features. The aggregated features are then projected onto the target space to obtain the target prediction result. The target prediction result is optimized through a multi-task joint optimization strategy, which includes calculating task loss and consistency loss, weighting the task loss result and consistency loss result to obtain the total loss result, and updating the learnable parameters of the metasurface sensor design network according to the total loss result. The updated learnable parameters are loaded into the metasurface sensor design network to obtain the updated target prediction results. Symmetry preservation constraint processing and quantifiable physical constraint processing are performed based on the updated target prediction results. The metasurface sensor design network is trained end-to-end to output the metasurface sensor design scheme.

[0006] As an optional embodiment of the present invention, a multi-element physical information dataset of a metasurface sensor is obtained, and the multi-element physical information dataset is preprocessed, including: The multi-factor physical information dataset includes design parameter vectors and physical response vectors; The design parameter vector is standardized to adjust the mean and variance. The physical response vector is subjected to min-max normalization and mapped to a preset finite interval.

[0007] As an optional embodiment of the present invention, the input is fed into a pre-constructed dual-branch feature extraction network, and the output features of the first feature branch and the second feature branch are obtained according to the self-attention mechanism of each branch, including: The first feature branch is a local feature extraction branch, which extracts local features of the input sequence based on a restricted context self-attention mechanism; The second feature branch is a non-local feature extraction branch, which extracts non-local features of the input sequence based on a global context self-attention mechanism.

[0008] As an optional embodiment of the present invention, the output features of the first feature branch and the second feature branch after extracting complementary features are enhanced by a superlinear self-attention mechanism, including: The output features of each feature branch are transformed linearly to generate the corresponding query matrix, key matrix, and value matrix. The query matrix and the key matrix are subjected to superlinear transformation through a learnable parameterized nonlinear transformation component to enhance the corresponding nonlinear representation capability. Calculate the superlinear self-attention weights of the enhanced query matrix and key matrix corresponding to the output features of each feature branch, and obtain the enhanced output features of the first feature branch and the second feature branch by adjusting the matrix to balance the importance of the output features.

[0009] As an optional embodiment of the present invention, through a cross-branch attention mechanism, supplementary information is obtained bidirectionally between the output features of the enhanced first feature branch and the output features of the second feature branch. The output features after interaction are then input into a gated fusion network to obtain fused features, including: By using a cross-branch attention mechanism, the output features of one feature branch are used as the query matrix, and the output features of the other feature branch are used as the key matrix and value matrix, respectively. Calculate the cross-attention weights of the query matrix and the key matrix, and perform a weighted summation on the value matrix based on the cross-attention weights, so that the output features of one feature branch obtain supplementary information from the output features of the other feature branch; The output features after interaction are spliced ​​together, and a weight vector is generated through a learnable parameterized gating network. The spliced ​​output features are then processed according to the weight vector, and the fusion ratio of each output feature is adjusted to obtain the fused features.

[0010] As an optional embodiment of the present invention, the fused features are refined and aggregated to obtain aggregated features after adaptive weighted fusion of refined features. The aggregated features are then projected onto the target space to obtain the target prediction result, including: The fused features are input into a feature refinement layer, which includes sequentially connected feature refinement units. Each feature refinement unit captures key correlation information of the input and performs nonlinear transformation and dimensional optimization on the input based on the key correlation information to obtain the corresponding refined features. The input of each feature refinement unit is the refined feature output by the previous feature refinement unit, and the input of the first feature refinement unit is the fused features. The refined features obtained are input into a multi-scale aggregation layer, which includes multiple receptive field extractors. Each receptive field extractor processes the refined features to obtain corresponding scale features. The scale features are adaptively weighted and fused to obtain aggregated features. The target space includes a design parameter vector space and a physical response vector space. The aggregated features are projected onto the design parameter vector space and the physical response vector space respectively to obtain the design parameter vector prediction result and the physical response vector prediction result.

[0011] As an optional embodiment of the present invention, the target prediction result is optimized through a multi-task joint optimization strategy. The multi-task joint optimization strategy includes calculating task loss and consistency loss, weighting the task loss result and the consistency loss result to obtain a total loss result, and updating the target prediction result based on the total loss result, including: Mission losses include losses from the first mission and losses from the second mission; The first task loss is calculated by calculating the difference loss between the predicted design parameter vector and the standardized design parameter vector, and obtaining the first difference loss result. The second task loss is calculated by calculating the difference loss between the predicted physical response vector and the physical response vector after min-max normalization, and obtaining the second difference loss result. The design parameter vector prediction result is projected onto the physical response vector space to obtain the secondary physical response vector prediction result. The physical response vector prediction result is then projected onto the design parameter vector space to obtain the secondary design parameter response vector prediction result. The consistency loss is calculated by summing the difference loss between the predicted result of the quadratic physical response vector and the physical response vector after min-max normalization, and the difference loss between the predicted result of the quadratic design parameter response vector and the design parameter vector after standardization. By constructing a multi-task loss function, the first difference loss result, the second difference loss result, and the consistency loss result are weighted by hyperparameters to obtain the total loss result, and the target prediction result is updated based on the total loss result.

[0012] As an optional embodiment of the present invention, symmetry-preserving constraint processing and quantifiable physical constraint processing are performed based on the updated target prediction results, and the metasurface sensor design network is trained end-to-end to output a metasurface sensor design scheme, including: Based on the symmetry characteristics of metasurface sensors and combined with the regularization constraint mechanism for symmetry preservation, a symmetry sensing loss function is constructed. The symmetry sensing loss function is used to perform a preset symmetry transformation on the metasurface structure corresponding to the updated target prediction result, calculate the difference before and after the transformation, and obtain the symmetry loss result. The prior physical knowledge corresponding to the multi-element physical information dataset is transformed into quantifiable physical constraints. By combining the multi-task loss function and the symmetry perception loss function, and taking the minimization of the comprehensive loss result as the training objective, the metasurface sensor design network is trained end-to-end. During the training process, the updated target prediction results generated during training are constrained in real time by the quantifiable physical constraints, the learnable parameters are optimized, and a metasurface sensor design scheme that conforms to symmetry constraints and physical laws is output.

[0013] This invention also proposes a smart design device for metasurface sensors based on a dual-branch architecture, comprising: The data collection and processing module is used to acquire a multi-element physical information dataset of the metasurface sensor and to preprocess the multi-element physical information dataset. The feature extraction module is used to input the preprocessed multi-element physical information dataset as an input sequence into a pre-constructed dual-branch feature extraction network, and obtain the output features of the first feature branch and the output features of the second feature branch according to the self-attention mechanism of each branch. The feature enhancement module is used to extract complementary features between the output features of the first feature branch and the output features of the second feature branch. Through a superlinear self-attention mechanism, the output features of the first feature branch and the output features of the second feature branch after the complementary features are extracted are enhanced. The feature interaction fusion module is used to obtain supplementary information bidirectionally between the enhanced output features of the first feature branch and the output features of the second feature branch through a cross-branch attention mechanism, and inputs the interactive output features into the gated fusion network to obtain fused features. The target prediction module is used to refine and aggregate the fused features to obtain aggregated features after adaptive weighted fusion of refined features, and to project the aggregated features onto the target space to obtain the target prediction result. The parameter update module is used to optimize the target prediction result through a multi-task joint optimization strategy. The multi-task joint optimization strategy includes calculating task loss and consistency loss, weighting the task loss result and consistency loss result to obtain the total loss result, and updating the learnable parameters of the metasurface sensor design network according to the total loss result. The output module is used to load the updated learnable parameters into the metasurface sensor design network to obtain the updated target prediction results, perform symmetry preservation constraint processing and quantifiable physical constraint processing based on the updated target prediction results, train the metasurface sensor design network end-to-end, and output the metasurface sensor design scheme.

[0014] The present invention also provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to implement the aforementioned intelligent design method for metasurface sensors based on a dual-branch architecture when executing executable instructions.

[0015] Compared with existing technologies, this invention adopts a dual-branch architecture, a superlinear self-attention and cross-branch gating fusion strategy to achieve accurate extraction, enhancement and adaptive fusion of local and non-local features. Through a multi-task joint optimization strategy, it ensures the consistency of design accuracy and forward and reverse design task logic. Combined with end-to-end training based on symmetry and quantifiable physical constraints, it constructs a fully integrated intelligent design system, improves design efficiency and reliability, and realizes a closed loop from intelligent design to practical application of metasurface sensors. Attached Figure Description

[0016] Figure 1 This is a flowchart of the intelligent design method for metasurface sensors based on a dual-branch architecture according to an embodiment of the present invention; Figure 2 This is a block diagram of a metasurface sensor intelligent design device based on a dual-branch architecture according to an embodiment of the present invention. Detailed Implementation

[0017] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings to further illustrate the technical solutions of the present invention. However, the present invention is not limited to these embodiments.

[0018] Example 1

[0019] Based on the technical problems highlighted in the background, this embodiment proposes a smart design method for metasurface sensors based on a dual-branch architecture, such as... Figure 1 As shown, it includes: S1, acquire the multi-element physical information dataset of the metasurface sensor, and preprocess the multi-element physical information dataset; S2, the preprocessed multi-element physical information dataset is used as an input sequence and input into a pre-constructed dual-branch feature extraction network. Based on the self-attention mechanism of each branch, the output features of the first feature branch and the output features of the second feature branch are obtained. S3, complementary feature extraction is performed between the output features of the first feature branch and the output features of the second feature branch. Through nonlinear enhanced self-attention, the output features of the first feature branch and the output features of the second feature branch after the complementary features are extracted are enhanced. S4, through the cross-branch attention interaction mechanism, the enhanced output features of the first feature branch and the output features of the second feature branch obtain supplementary information bidirectionally, and the output features after interaction are input into the gated fusion network to obtain fused features; S5, perform feature iteration and aggregation on the fused features to obtain the aggregated features after adaptive weighted fusion of refined features, and project the aggregated features onto the target space to obtain the target prediction result; S6, optimize the target prediction result through a multi-task joint optimization strategy. The multi-task joint optimization strategy includes calculating task loss and consistency loss, weighting the task loss result and the consistency loss result to obtain the total loss result, and updating the learnable parameters of the metasurface sensor design network according to the total loss result. S7, the updated learnable parameters are loaded into the metasurface sensor design network to obtain the updated target prediction results. Symmetry preservation constraint processing and quantifiable physical constraint processing are performed based on the updated target prediction results. The metasurface sensor design network is trained end-to-end to output the metasurface sensor design scheme.

[0020] First, a multi-element physical information dataset of the metasurface sensor is acquired and preprocessed, dividing it into training and testing sets. The preprocessed multi-element physical information training and testing sets are then output as input data for the subsequent training and validation of the dual-branch feature extraction network. Second, a dual-branch feature extraction network is used to comprehensively capture features. Each branch extracts features from the preprocessed multi-element physical information dataset according to its corresponding self-attention mechanism, resulting in the output features of the first and second feature branches. The output features of both branches are processed through residual connections and layer normalization to achieve complementary feature extraction and avoid gradient vanishing or exploding problems.

[0021] The output features, after residual connection and layer normalization, serve as the input features for superlinear self-attention representation. This superlinear self-attention mechanism replaces traditional standard self-attention, enhancing the metasurface sensor design network's ability to represent complex optical features. It's important to note that superlinearity belongs to a narrow subset of nonlinearity. The core difference between superlinearity and ordinary nonlinearity lies in their reliance on fixed transformation logic (such as ReLU activation functions), limiting representation flexibility. Superlinearity, however, dynamically optimizes the nonlinear transformation logic through learnable parameterized components, adapting to the metasurface structure-spectral data dynamics and capturing complex feature dependencies more accurately than ordinary nonlinearity. A query matrix Q, a key matrix K, and a value matrix V are generated through linear transformation of the output features. A superlinear transformation is then applied to the query matrix Q and the key matrix K, incorporating learnable parameterized nonlinear transformation components to enhance their nonlinear representation capabilities. Finally, the superlinear self-attention weights of the enhanced query matrix Q and the key matrix K are calculated, with an adjustment matrix M introduced to balance the importance of different features. Based on this, a multi-head expansion strategy is adopted for each feature sequence, that is, the enhanced query matrix Q, key matrix K and value matrix V corresponding to the feature sequence are split into multiple attention heads. Each attention head reuses the logic of superlinear self-attention weight calculation and matrix balance adjustment in parallel to achieve multi-dimensional feature capture, obtain dimensional feature capture results, and fuse the multi-dimensional feature capture results through the output projection matrix to output the output features of the first feature branch and the second feature branch after being enhanced by the superlinear self-attention mechanism.

[0022] By employing a cross-branch attention mechanism, the output features of the enhanced first feature branch and the output features of the second feature branch are mutually complementary. The output features of one branch obtain supplementary information from the output features of the other branch. Then, the bidirectional complementary output features are spliced ​​together through the feature gating fusion mechanism of the gating fusion network. A weight vector is generated through a learnable parameterized gating network. Finally, the fusion ratio of each output feature is adjusted according to the weight vector, and the final fused feature is calculated. This enables the metasurface sensor design network to adaptively adjust the contribution ratio of each input feature according to the characteristics of the input features.

[0023] Next, a multi-level feature aggregation strategy is used to refine the fused features. This multi-level approach includes a feature refinement layer, a multi-scale aggregation layer, and an output projection layer. Multiple feature refinement units in the feature refinement layer capture key correlation information from the input and perform nonlinear transformations and dimensionality optimization based on this information to obtain refined features. In the multi-scale aggregation layer, extractors with different receptive fields extract multi-scale information from the refined features to obtain scale features. These scale features are then weighted and fused using an attention pooling mechanism to obtain the aggregated features after adaptive weighted fusion. In the output projection layer, the aggregated features are mapped to the target space, outputting a target prediction result that conforms to physical laws, also known as a design task. Different design tasks map to different target spaces, resulting in different target prediction results. These target prediction results serve as the optimization object for the multi-task joint optimization strategy.

[0024] The multi-task joint optimization strategy optimizes the reverse design and forward design tasks by calculating task losses and consistency losses. Optimization of the reverse and forward design tasks is based on quantified difference loss results. During the optimization of both design tasks, the optimization direction is further strengthened based on the consistency loss results, ensuring that the optimization directions of the two tasks are aligned and strengthening logical consistency. Finally, the weight of the three loss results is balanced by hyperparameters to calculate the total loss result. This total loss result is then used to update the learnable parameters used in the preceding steps, achieving synchronous improvement in the accuracy of both design tasks.

[0025] The updated learnable parameters are fully loaded into the entire metasurface sensor design network. The network repeats all steps prior to obtaining the target prediction result, updating the prediction and applying symmetry-preserving and quantifiable physical constraints. This is primarily achieved by incorporating the core symmetry characteristics of metasurface sensors, such as geometric and spectral response symmetry, and introducing a symmetry-preserving regularization constraint mechanism. A symmetry-sensing loss function is constructed, and a pre-defined symmetry transformation is performed on the metasurface structure corresponding to the target prediction result generated by the network. The difference before and after the transformation is calculated, and the symmetry strength is determined based on the magnitude of the difference. On the other hand, a physical constraint module is built to transform prior physical knowledge in metasurface design into quantifiable physical constraints. These constraints can be represented by a constraint model. Through the physical relationships of these constraints, the network is trained end-to-end, outputting a metasurface sensor design scheme that conforms to symmetry constraints and physical laws. This design scheme provides a directly applicable technical basis for the construction of physical metasurface sensors. In other words, through intelligent design and optimization of the entire metasurface sensor network, the key structural parameters of the sensor, such as geometric dimensions, period, and thickness, are ultimately determined.

[0026] Preferably, a multi-element physical information dataset of the metasurface sensor is acquired, and the multi-element physical information dataset is preprocessed, including: The multi-factor physical information dataset includes a design parameter vector, a physical response vector, and a performance index vector. The design parameter vector is standardized to adjust the mean and variance. The physical response vector is subjected to min-max normalization and mapped to a preset finite interval.

[0027] In this embodiment, the design parameter vector is the structural parameter, and the physical response vector is the spectral response. The multi-factor physical information dataset includes not only the original structural parameters and spectral response but also sensitivity performance. Therefore, the multi-factor physical information dataset consists of samples in the form of {structural parameter - spectral response - sensitivity performance} triplets. The structural parameters correspond to the geometric parameters of the metasurface sensor, the spectral response corresponds to the optical response characteristics of the metasurface sensor, and the sensitivity performance corresponds to the sensing performance index of the metasurface sensor. The structural parameter vector is represented as... It includes K geometric parameters such as period, patch length, height, and gaps between adjacent patches along the x and y axes; the spectral response vector is represented as... Where N represents the number of spectral sampling points, and the sensitivity performance vector is expressed as... It includes M performance indicators such as volume sensitivity and surface sensitivity. Data preprocessing includes preprocessing the original structural parameters and the original spectral response. Specifically, the original spectral response vector S is min-max normalized to compress it to the [0, 1] interval. The specific processing formula is as follows:

[0028] The original structural parameter vector P is Z-score standardized to have a mean of 0 and a standard deviation of 1, as shown in the formula:

[0029] in, The mean vector of structural parameters. The standard deviation vector is used. Differential preprocessing is adopted to address the differences in characteristics between the original structural parameters and the original spectral response. Standardization eliminates the influence of dimensions, and minimum-maximum normalization is mapped to a preset interval. This effectively avoids training bias caused by differences in data magnitude, making the data distribution more regular and stable, improving the convergence speed of training of metasurface sensor design networks, and reducing noise interference.

[0030] Preferably, the input is fed into a pre-constructed dual-branch feature extraction network, and the output features of the first feature branch and the second feature branch are obtained according to the self-attention mechanism of each branch, including: The first feature branch is a local feature extraction branch, which extracts local features of the input sequence based on a restricted context self-attention mechanism; The second feature branch is a non-local feature extraction branch, which extracts global features of the input sequence based on a global context self-attention mechanism.

[0031] The pre-built dual-branch feature extraction network in this embodiment consists of a local feature extraction branch and a non-local feature extraction branch based on the Transformer architecture. The receptive field ranges of the self-attention mechanisms of the two branches are different. The local feature extraction branch adopts a local self-attention mechanism, namely a restricted context self-attention mechanism; the non-local feature extraction branch adopts a non-local self-attention mechanism, namely a global context self-attention mechanism, forming a complementary feature extraction structure.

[0032] The preprocessed samples are used as the input sequence and fed into a dual-branch feature extraction network. The first feature branch is a local feature extraction branch, which adopts a multi-layer Transformer encoder structure. This branch segments the spectral sequence in the input sequence into multiple local segments, performs linear embedding and positional encoding on each local segment, and then feeds it into the local Transformer encoder. The encoder consists of multiple identical layers, each containing a local self-attention mechanism and a feedforward neural network. The calculation formula for the local self-attention mechanism is as follows:

[0033] in, This represents the query matrix for that branch. This represents the key matrix of that branch. This represents the value matrix of that branch. Let be the dimension of the key vector. This is a local attention mask used to restrict each location to focusing only on its neighboring region. Therefore, extracting local features from the input sequence involves segmenting the spectral sequence, linear embedding, positional encoding, and a local self-attention mechanism to extract local spectral details and short-range dependencies.

[0034] The second feature branch is the non-local feature extraction branch, which also adopts a multi-layer Transformer encoder structure. This branch maintains the integrity of the input sequence, does not perform segmentation processing, and directly extracts features from the overall spectrum. The non-local self-attention mechanism is calculated as follows:

[0035] in, This represents the query matrix for that branch. This represents the key matrix of that branch. The value matrix representing this branch differs from local attention; nonlocal attention allows each position to focus on all positions in the sequence, thus establishing a global contextual understanding. Therefore, extracting nonlocal features from the input sequence is based on a nonlocal self-attention mechanism to capture global spectral dependencies and long-range interactions of the overall spectral sequence. The local and nonlocal feature branches complement each other, capturing detailed short-range dependencies and overall long-range associations through constrained and global contextual self-attention, respectively. Compared to a single attention mechanism, this approach comprehensively covers both local and global features of metasurface physical information, avoiding feature omissions and providing a comprehensive foundation for subsequent fusion and enhancement, thereby improving the adaptability of metasurface sensor design networks to complex data.

[0036] Preferably, the output features of the first feature branch and the second feature branch after extracting complementary features are enhanced through a superlinear self-attention mechanism, including: The output features of each feature branch are transformed linearly to generate the corresponding query matrix, key matrix, and value matrix. The query matrix and the key matrix are subjected to superlinear transformation through a learnable parameterized nonlinear transformation component to enhance the corresponding nonlinear representation capability. Calculate the superlinear self-attention weights of the enhanced query matrix and key matrix corresponding to the output features of each feature branch, and obtain the enhanced output features of the first feature branch and the second feature branch by adjusting the matrix to balance the importance of the output features.

[0037] The output features of the first feature branch are local features, and the output features of the second feature branch are nonlocal features. Complementary feature extraction involves stabilizing the output features of both branches through residual connections and layer normalization to prevent gradient vanishing or exploding. The local feature extraction branch captures spectral details, such as formant shapes and local extrema, while the nonlocal feature extraction branch captures the overall spectral shape and long-range correlations between resonance modes, forming complementary feature representations.

[0038] This embodiment introduces a superlinear self-attention mechanism to replace the standard self-attention in the traditional Transformer. Superlinearity belongs to a narrow subset of nonlinearity, specifically referring to nonlinear transformations with higher complexity than linear transformations and the ability to be enhanced by parameterization. The core is to enhance the model's ability to capture complex features on the basis of nonlinearity through learnable parameter components, rather than simply relying on fixed nonlinear functions, so as to enhance the ability of metasurface sensor design networks to represent complex optical responses.

[0039] For the aforementioned local and non-local features that have already formed complementary feature representations, a superlinear self-attention mechanism is used to perform a linear transformation on the local or non-local feature sequences to generate the corresponding query matrix Q, key matrix K, and value matrix V:

[0040] in, , , The weight matrix is ​​a learnable matrix, where X represents a local or non-local feature sequence. Then, the query matrix Q and the key matrix K undergo a superlinear transformation using a learnable parameterized nonlinear transformation component to enhance their nonlinear representation capabilities.

[0041] The learnable parameterized nonlinear transformation component includes a learnable projection matrix. and Nonlinear activation function and and bias vector and .

[0042] Then, using Gaussian error linear units as activation functions, the superlinear self-attention weights of the enhanced query matrix Q and key matrix K are calculated as follows:

[0043] in Represents element-wise product. To adjust the matrix, which balances the importance of different features, enhanced local and non-local features are obtained. Superlinear self-attention, by introducing a nonlinear transformation, enhances the ability of metasurface sensor design networks to capture complex spectral features, especially for the accurate prediction of high Q-factor resonance peaks.

[0044] Different attention heads focus on different types of spectral features; for example, some attention heads focus on Q-BIC resonance peaks, while others focus on non-resonant regions, forming a collaborative feature extraction mechanism. Superlinear transformation overcomes the limitations of traditional fixed nonlinear transformations through learnable parameterized components, adaptively optimizing the mapping logic between the query matrix and the key matrix. Combined with adjustment matrices to calibrate attention weights and balance feature importance, it enhances the nonlinear characterization capability of metasurface sensor design networks and eliminates invalid feature interference.

[0045] Preferably, through a cross-branch attention interaction mechanism, the enhanced output features of the first feature branch and the output features of the second feature branch bidirectionally acquire supplementary information, and the interacted output features are input into a gated fusion network to obtain fused features, including: By using a cross-branch attention mechanism, the output features of one feature branch are used as the query matrix, and the output features of the other feature branch are used as the key matrix and value matrix, respectively. Calculate the cross-attention weights of the query matrix and the key matrix, and perform a weighted summation on the value matrix based on the cross-attention weights, so that the output features of one feature branch obtain supplementary information from the output features of the other feature branch; The output features after interaction are spliced ​​together, and a weight vector is generated through a learnable parameterized gating network. The spliced ​​output features are then processed according to the weight vector, and the fusion ratio of each output feature is adjusted to obtain the fused features.

[0046] This embodiment achieves effective fusion of dual-branch features by designing a local-nonlocal feature interaction module in a metasurface sensor design network. This module comprises two parts: a cross-branch attention mechanism and a feature-gated fusion mechanism. The cross-branch attention mechanism allows information interaction between local and nonlocal feature branches. Specifically, using the output features of one branch as the query matrix and the output of the other branch as the key and value matrices, the similarity between the query matrix and the key matrix is ​​first calculated and normalized to obtain the cross-attention weights. Then, the value matrix is ​​weighted and summed according to the cross-attention weights to complete one cross-attention calculation. The calculation is repeated by reversing the branch roles. The cross-attention calculation formula is as follows: ,

[0047] in, A query matrix representing local features. The query matrix represents non-local features. The key matrix representing nonlocal features. The key matrix representing local features. The value matrix representing nonlocal features, The value matrix represents the local features, so that the output features of one feature branch can obtain supplementary information from the output features of another feature branch. For example, local features can obtain contextual information from non-local features, and non-local features can obtain detailed information from local features, thus achieving bidirectional information complementarity.

[0048] The feature-gated fusion mechanism is used to dynamically adjust the fusion weights of the output features from the two branches. Specifically, after the interaction of local and non-local feature information, the local and non-local features are concatenated. The concatenated output features are not yet fused; a weight vector is generated through a gating network.

[0049] in, It is the Sigmoid activation function. and The control parameters are initialized to 0. By designing the convolutional network as a gating network, the... To merge, and It can also be updated during the training of the gated network, adjusting the fusion ratio of local and non-local features according to the weight vector G. The final fused feature is calculated as follows:

[0050] in, Represents element-wise product. Indicates local features, This represents non-local features. The feature-gated fusion mechanism enables the metasurface sensor design network to adaptively adjust the contribution ratio of local and non-local features based on the characteristics of the input features. For complex spectral regions, the weight of local features is increased to improve detail preservation, while for smooth spectral regions, the weight of global features is increased to maintain overall consistency. The cross-branch attention mechanism achieves bidirectional complementarity of features in both branches, breaking down branch barriers and solving the problem of feature partiality. The learnable parameterized gating network adaptively generates weight vectors, dynamically adjusting the fusion ratio of local and global features, avoiding redundancy or weakening of key information in fixed-ratio fusion, and outputting highly targeted, high-quality fused features.

[0051] Preferably, the fused features are refined and aggregated to obtain aggregated features after adaptive weighted fusion of refined features. The aggregated features are then projected onto the target space to obtain the target prediction result, including: The fused features are input into a feature refinement layer, which includes sequentially connected feature refinement units. Each feature refinement unit captures key correlation information of the input and performs nonlinear transformation and dimensional optimization on the input based on the key correlation information to obtain the corresponding refined features. The input of each feature refinement unit is the refined feature output by the previous feature refinement unit, and the input of the first feature refinement unit is the fused features. The refined features obtained are input into a multi-scale aggregation layer, which includes multiple receptive field extractors. Each receptive field extractor processes the refined features to obtain corresponding scale features. The scale features are adaptively weighted and fused to obtain aggregated features. The target space includes a design parameter vector space and a physical response vector space. The aggregated features are projected onto the design parameter vector space and the physical response vector space respectively to obtain the design parameter vector prediction result and the physical response vector prediction result.

[0052] After fusing local and non-local features to obtain fused features, a multi-level feature aggregation strategy is adopted. In this embodiment, a multi-level feature aggregation module is designed in the metasurface sensor design network to progressively refine the feature representation and generate the final output. This module includes a feature refinement layer, a multi-scale aggregation layer, and an output projection layer.

[0053] The feature refinement layer includes feature refinement units, which are Transformer blocks. Multiple Transformer blocks are sequentially connected. Each Transformer block contains a superlinear self-attention mechanism and a feedforward neural network, progressively refining the fused feature representation. Specifically, the fused feature serves as the input to the first Transformer block. The superlinear self-attention mechanism and feedforward neural network capture key correlation information of the fused feature. Based on this key correlation information, nonlinear transformations and dimensionality optimizations are performed on the fused feature to refine it. After the first Transformer block is refined, the output of the refined feature is used as the input to the next Transformer block, until the last Transformer block is refined, yielding the final refined feature. The feature refinement layer also employs residual connections and layer normalization to ensure the stability of the metasurface sensor design network training. The formula is: ;

[0054] For the superlinear attention network layer mentioned above, It is a multilayer perceptron network layer. It is a normalized network layer. It is a feature of fusion. yes Further feature optimization of fused features, The final refined features are the purified features. The multi-scale aggregation layer includes multiple receptive field extractors. In this embodiment, the different receptive field extractors are convolutional kernels of different sizes. The final refined features are input into the multi-scale aggregation layer, and the refined feature sequence is processed using convolutional kernels of different sizes to extract multi-scale information and obtain the corresponding scale features.

[0055] The above , as well as These correspond to different scale features. Multi-scale features are fused using an attention pooling mechanism, and the contributions of different scale features are adaptively weighted according to the design task requirements:

[0056] The above This represents the aggregated features obtained after adaptive weighting.

[0057] The output projection layer is used to map the aggregated features to the target space, which includes the design parameter vector space and the physical response vector space. In this embodiment, the design parameter vector space is the structural parameter space and the physical response vector space is the spectral response space. Therefore, the corresponding design parameter vector prediction result after mapping is the structural parameter prediction result, and the corresponding physical response vector prediction result is the spectral response prediction result.

[0058] The specific target space to which the features are mapped is determined based on the design task requirements. The design task includes inverse design and forward design tasks. In this embodiment, the requirement for the inverse design task is to map high-dimensional features to the structural parameter space, while the requirement for the forward design task is to map high-dimensional features to the spectral response space. Therefore, the aggregated features are mapped to the structural parameter space and the spectral response space respectively. The mapping to the structural parameter space is achieved using the following formula, and the structural parameter prediction results are obtained:

[0059] Mapping to the spectral response space is achieved using the following formula, yielding the spectral response prediction result:

[0060] and , and All are control parameters initialized to 0. By designing the convolutional network as a gating network, Weighting, and , and It can also be updated as the gating network is trained. This module also includes an output layer, which uses the Tanh activation function to limit the structural parameter prediction results and spectral response prediction results to a reasonable range, ensuring that the generated structural parameter prediction results are within the achievable range and that the spectral response prediction results conform to physical laws.

[0061] The feature refinement layer repeatedly refines features and strengthens key correlations. The multi-scale aggregation layer captures multi-dimensional features through different receptive field extractors and adaptively weights and fuses them, taking into account both design details and overall trends. It projects onto the design parameter and physical response vector spaces respectively, realizing bidirectional design tasks in both directions, improving the versatility of the method, and reducing the cost of subsequent constraint processing.

[0062] Preferably, the target prediction result is optimized using a multi-task joint optimization strategy. This strategy includes calculating task loss and consistency loss, weighting the task loss and consistency loss results to obtain a total loss, and updating the target prediction result based on the total loss. This includes: Mission losses include losses from the first mission and losses from the second mission; The first task loss is calculated by calculating the difference loss between the predicted design parameter vector and the standardized design parameter vector, and obtaining the first difference loss result. The second task loss is calculated by calculating the difference loss between the predicted physical response vector and the physical response vector after min-max normalization, and obtaining the second difference loss result. The design parameter vector prediction result is projected onto the physical response vector space to obtain the secondary physical response vector prediction result. The physical response vector prediction result is then projected onto the design parameter vector space to obtain the secondary design parameter response vector prediction result. The consistency loss is calculated by summing the difference loss between the predicted result of the quadratic physical response vector and the physical response vector after min-max normalization, and the difference loss between the predicted result of the quadratic design parameter response vector and the design parameter vector after standardization. By constructing a multi-task loss function, the first difference loss result, the second difference loss result, and the consistency loss result are weighted by hyperparameters to obtain the total loss result, and the target prediction result is updated based on the total loss result.

[0063] This embodiment employs a multi-task joint optimization strategy, simultaneously optimizing both the reverse design and forward design tasks to enhance the generalization ability and robustness of the metasurface sensor design network. Specifically, based on the aforementioned structural parameter prediction results and preprocessed structural parameters, and spectral response prediction results and preprocessed spectral responses, a "prediction result-real data" data pair is constructed to provide a foundation for subsequent optimization.

[0064] The multi-task joint optimization strategy specifically involves constructing a multi-task loss function:

[0065] Where α, β, and γ are trade-off hyperparameters, the function consists of three weighted parts, including the task loss and consistency loss. The task loss further includes the first task loss and the second task loss. The calculation of the first task loss specifically involves calculating the difference loss between the predicted structural parameters and the preprocessed structural parameters:

[0066] The first difference loss result is obtained, which is the reverse design task loss, reflecting the mean square error between the predicted structural parameters and the actual structural parameters.

[0067] The second task loss is specifically calculated by calculating the difference loss between the predicted spectral response and the preprocessed spectral response:

[0068] The second difference loss result is obtained, which is the forward design task loss, reflecting the mean square error between the predicted spectral response and the actual spectral response.

[0069] Calculating the consistency loss requires the following steps: First, input the previously obtained structural parameter prediction results into the forward design task. Map these predictions to the spectral response space to obtain the secondary physical response vector prediction result, which here refers to the secondary spectral response prediction result. Then, input the previously obtained spectral response prediction result into the reverse design task. Map these predictions to the structural parameter space to obtain the secondary design parameter response vector prediction result, which here refers to the secondary structural parameter prediction result.

[0070] The difference loss between the predicted second-order spectral response and the preprocessed spectral response, as well as the difference loss between the predicted second-order structural parameters and the preprocessed structural parameters, are calculated. These two difference loss results are then added together to obtain the consistency loss result, which is used to ensure the consistency between the results of the reverse design task and the forward design task.

[0071] in This represents the predicted secondary spectral response generated from the structural parameter prediction results through a forward design task. This indicates the predicted secondary structure parameters generated from the spectral response prediction results through a reverse design task.

[0072] The core of the multi-task joint optimization strategy is to simultaneously optimize the reverse design task and the forward design task. The reverse design task is optimized by quantifying the difference between the predicted and actual structural parameters, while the forward design task is optimized by quantifying the difference between the predicted and actual spectral responses. During the optimization of both tasks, a consistency loss is used to reinforce the optimization direction and ensure the logical consistency of the forward and reverse design results. Since the reverse design loss focuses on reverse accuracy, the forward design loss focuses on forward accuracy, and the consistency loss focuses on logical consistency, and the numerical magnitudes of these different losses may differ, this process also requires the introduction of trade-off hyperparameters to prevent the metasurface sensor design network from excessively favoring the optimization of losses with large numerical values.

[0073] The essence of hyperparameter balancing is to pre-set weighting coefficients to weight and fuse three independent scalar loss values ​​into a single multi-task total loss result. This multi-task total loss result is the sole optimization objective. Taking "minimizing the multi-task total loss result" as the core of the joint optimization operation, the metasurface sensor design network calculates the gradient of the multi-task total loss result with respect to the learnable parameters of each of the preceding steps through the backpropagation algorithm. Then, it adjusts the learnable parameters along the gradient descent direction. Since the learnable parameters are updated, the corresponding structural parameter prediction results and spectral response prediction results are also updated accordingly. This multi-task joint optimization strategy is repeated until the multi-task total loss result is minimized. At this point, the corresponding learnable parameters are the optimal learnable parameters of the metasurface sensor design network. The optimal learnable parameters will feed back and update the previous steps, ultimately generating more accurate structural parameter prediction results and spectral response prediction results that are more in line with physical laws.

[0074] This step also includes an interpretability analysis module, which reveals the spectral regions and features that the metasurface sensor design network focuses on by visualizing the superlinear attention weights, calculating the attention weights of different attention heads on the input sequence, generating an attention heatmap, and showing the degree of attention the metasurface sensor design network pays to different spectral regions during the decision-making process. By analyzing these attention distributions, it is possible to understand how the metasurface sensor design network captures key optical features such as Q-BIC resonance peaks, thereby enhancing the interpretability and credibility of the metasurface sensor design network.

[0075] The structure→spectral and spectral→structure bidirectional consistency loss verification is adopted to fully ensure the logical self-consistency of forward and reverse design tasks. The multi-task loss function integrates three types of losses through hyperparameter weighting, which can flexibly adjust the optimization priority. Based on the total loss result, the prediction bias is iteratively corrected, allowing the metasurface sensor design network to learn accurate design rules and significantly improve the reliability and credibility of the target prediction results.

[0076] Preferably, the metasurface sensor design network is trained end-to-end based on the updated target prediction results, performing symmetry-preserving constraint processing and quantifiable physical constraint processing, and outputting a metasurface sensor design scheme, including: Based on the symmetry characteristics of metasurface sensors and combined with the regularization constraint mechanism for symmetry preservation, a symmetry sensing loss function is constructed. The symmetry sensing loss function is used to perform a preset symmetry transformation on the metasurface structure corresponding to the updated target prediction result, calculate the difference before and after the transformation, and obtain the symmetry loss result. The prior physical knowledge corresponding to the multi-element physical information dataset is transformed into quantifiable physical constraints. By combining the multi-task loss function and the symmetry perception loss function, and taking the minimization of the comprehensive loss result as the training objective, the metasurface sensor design network is trained end-to-end. During the training process, the updated target prediction results generated during training are constrained in real time by the quantifiable physical constraints, the learnable parameters are optimized, and a metasurface sensor design scheme that conforms to symmetry constraints and physical laws is output.

[0077] The learnable parameters optimized by the multi-task joint optimization strategy are fully loaded into the metasurface sensor design network to ensure that the network possesses the accurate feature processing capabilities optimized by the multi-task approach. Finally, constraints are used to ensure the physical rationality of the results of each design task. Specifically, on the one hand, considering the core symmetry characteristic of continuous-domain bound-state metasurface sensors, symmetry-preserving regularization constraints are introduced to construct a symmetry-sensing loss function. This function is used to compare the invariance of the metasurface structure corresponding to the predicted structural parameters under symmetry transformations such as rotation and mirroring, calculate the difference before and after the transformation, and obtain the corresponding symmetry loss result.

[0078] Here, T represents a set of symmetry transformations, such as rotation and mirroring. The smaller the difference, the stronger the structural symmetry and the lower the loss value. This symmetry-aware loss function is used to verify that the generated metasurface structure remains stable under specific symmetry transformations, which conforms to the design principle of continuous domain bound state metasurfaces.

[0079] On the other hand, a physical constraint module is built. This module is used to transform the prior physical knowledge about structural parameters, spectral response and sensitivity performance in the field of metasurface design into quantifiable physical constraints, such as the approximate relationship between resonance wavelength and structural parameters, the dependence of quality factor on asymmetry parameters, etc., and integrate them into the metasurface sensor design network. Through physical constraints, the metasurface sensor design network is guided to generate designs that conform to physical laws.

[0080] Based on a metasurface sensor design network loaded with optimized learnable parameters, end-to-end training is conducted using a constructed symmetry-sensing loss function and a physical constraint module. The symmetry-sensing loss function is combined with a multi-task loss function to form a comprehensive loss function that incorporates both accuracy and symmetry. Simultaneously, the physical constraint module applies real-time constraints to the generated structural parameter predictions. For example, if the generated structural parameter predictions violate physical laws, a constraint mechanism is triggered to increase the comprehensive loss. During end-to-end training, the goal is to minimize the comprehensive loss, synchronously optimizing and adjusting the learnable parameters to ensure that parameter optimization meets both accuracy requirements and conforms to symmetry and physical laws. After training, the metasurface sensor design network can accurately map multi-element metasurface information (structure-spectrum-performance) to high-performance sensor designs, ultimately outputting a metasurface sensor design scheme that meets symmetry constraints, conforms to physical laws, and achieves the required performance. This design scheme includes specific structural parameters, corresponding spectral responses, and performance verification results.

[0081] In summary, a dual-branch architecture, superlinear self-attention, and cross-branch gating fusion strategy are adopted to achieve accurate extraction, enhancement, and adaptive fusion of local and non-local features. A multi-task joint optimization strategy ensures the consistency of design accuracy and forward and reverse design task logic. Combined with end-to-end training based on symmetry and quantifiable physical constraints, a fully integrated intelligent design system is constructed to improve design efficiency and reliability, and realize a closed loop from intelligent design to practical application of metasurface sensors.

[0082] Example 2 Furthermore, based on the principles described in Example 1, a smart design device 100 for metasurface sensors based on a dual-branch architecture is proposed, such as... Figure 2 As shown, it includes: The data collection and processing module 110 is used to acquire a multi-element physical information dataset of the metasurface sensor and preprocess the multi-element physical information dataset. The feature extraction module 120 is used to input the preprocessed multi-element physical information dataset as an input sequence into a pre-constructed dual-branch feature extraction network, and obtain the output features of the first feature branch and the output features of the second feature branch according to the self-attention mechanism of each branch. The feature enhancement module 130 is used to extract complementary features between the output features of the first feature branch and the output features of the second feature branch. Through a superlinear self-attention mechanism, it enhances the output features of the first feature branch and the output features of the second feature branch after the complementary features are extracted. The feature interaction fusion module 140 is used to obtain supplementary information bidirectionally between the output features of the enhanced first feature branch and the output features of the second feature branch through a cross-branch attention mechanism, and input the interactive output features into the gated fusion network to obtain fused features. The target prediction module 150 is used to refine and aggregate the fused features to obtain aggregated features after adaptive weighted fusion of refined features, and to project the aggregated features onto the target space to obtain the target prediction result. The parameter update module 160 is used to optimize the target prediction result through a multi-task joint optimization strategy. The multi-task joint optimization strategy includes calculating task loss and consistency loss, weighting the task loss result and the consistency loss result to obtain the total loss result, and updating the learnable parameters of the metasurface sensor design network according to the total loss result. The output module 170 is used to load the updated learnable parameters into the metasurface sensor design network, obtain the updated target prediction results, perform symmetry preservation constraint processing and quantifiable physical constraint processing based on the updated target prediction results, train the metasurface sensor design network end-to-end, and output the metasurface sensor design scheme.

[0083] Example 3 Furthermore, an electronic device is proposed, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to implement, when executing executable instructions, a smart design method for metasurface sensors based on a dual-branch architecture, as described in Embodiment 1.

[0084] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.

[0085] Furthermore, it should be noted that the use of terms such as "first," "second," and "a" in this invention is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified. The terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two elements or the interaction between two elements, unless otherwise explicitly specified. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0086] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.

[0087] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

Claims

1. A smart design method for metasurface sensors based on a dual-branch architecture, characterized in that, include: Acquire a multi-element physical information dataset of the metasurface sensor, and preprocess the multi-element physical information dataset; The preprocessed multi-element physical information dataset is used as an input sequence and input into a pre-constructed dual-branch feature extraction network. Based on the self-attention mechanism of each branch, the output features of the first feature branch and the output features of the second feature branch are obtained. Complementary feature extraction is performed between the output features of the first feature branch and the output features of the second feature branch. Through a superlinear self-attention mechanism, the output features of the first feature branch and the output features of the second feature branch after the extraction of complementary features are enhanced. Through a cross-branch attention mechanism, the enhanced output features of the first feature branch and the output features of the second feature branch obtain supplementary information bidirectionally. The output features after interaction are then input into the gated fusion network to obtain fused features. The fused features are refined and aggregated to obtain aggregated features after adaptive weighted fusion of refined features. The aggregated features are then projected onto the target space to obtain the target prediction result. The target prediction result is optimized through a multi-task joint optimization strategy, which includes calculating task loss and consistency loss, weighting the task loss result and consistency loss result to obtain the total loss result, and updating the learnable parameters of the metasurface sensor design network according to the total loss result. The updated learnable parameters are loaded into the metasurface sensor design network to obtain the updated target prediction results. Symmetry preservation constraint processing and quantifiable physical constraint processing are performed based on the updated target prediction results. The metasurface sensor design network is trained end-to-end to output the metasurface sensor design scheme.

2. The method according to claim 1, characterized in that, Acquire a multi-element physical information dataset from a metasurface sensor, and preprocess the multi-element physical information dataset, including: The multi-factor physical information dataset includes design parameter vectors and physical response vectors; The design parameter vector is standardized to adjust the mean and variance. The physical response vector is subjected to min-max normalization and mapped to a preset finite interval.

3. The method according to claim 1, characterized in that, The input is fed into a pre-built dual-branch feature extraction network. Based on the self-attention mechanism of each branch, the output features of the first feature branch and the output features of the second feature branch are obtained, including: The first feature branch is a local feature extraction branch, which extracts local features of the input sequence based on a restricted context self-attention mechanism; The second feature branch is a non-local feature extraction branch, which extracts non-local features of the input sequence based on a global context self-attention mechanism.

4. The method according to claim 3, characterized in that, By employing a superlinear self-attention mechanism, the output features of the first feature branch and the second feature branch after extracting complementary features are enhanced, including: The output features of each feature branch are transformed linearly to generate the corresponding query matrix, key matrix, and value matrix. The query matrix and the key matrix are subjected to superlinear transformation through a learnable parameterized nonlinear transformation component to enhance the corresponding nonlinear representation capability. Calculate the superlinear self-attention weights of the enhanced query matrix and key matrix corresponding to the output features of each feature branch, and obtain the enhanced output features of the first feature branch and the second feature branch by adjusting the matrix to balance the importance of the output features.

5. The method according to claim 1, characterized in that, Through a cross-branch attention mechanism, the enhanced output features of the first feature branch and the output features of the second feature branch bidirectionally acquire supplementary information. The interacting output features are then input into a gated fusion network to obtain fused features, including: By using a cross-branch attention mechanism, the output features of one feature branch are used as the query matrix, and the output features of the other feature branch are used as the key matrix and value matrix, respectively. Calculate the cross-attention weights of the query matrix and the key matrix, and perform a weighted summation on the value matrix based on the cross-attention weights, so that the output features of one feature branch obtain supplementary information from the output features of the other feature branch; The output features after interaction are spliced ​​together, and a weight vector is generated through a learnable parameterized gating network. The spliced ​​output features are then processed according to the weight vector, and the fusion ratio of each output feature is adjusted to obtain the fused features.

6. The method according to claim 2, characterized in that, The fused features are refined and aggregated to obtain aggregated features after adaptive weighted fusion of refined features. The aggregated features are then projected onto the target space to obtain the target prediction result, including: The fused features are input into a feature refinement layer, which includes sequentially connected feature refinement units. Each feature refinement unit captures key correlation information of the input and performs nonlinear transformation and dimensional optimization on the input based on the key correlation information to obtain the corresponding refined features. The input of each feature refinement unit is the refined feature output by the previous feature refinement unit, and the input of the first feature refinement unit is the fused features. The refined features obtained are input into a multi-scale aggregation layer, which includes multiple receptive field extractors. Each receptive field extractor processes the refined features to obtain corresponding scale features. The scale features are adaptively weighted and fused to obtain aggregated features. The target space includes a design parameter vector space and a physical response vector space. The aggregated features are projected onto the design parameter vector space and the physical response vector space respectively to obtain the design parameter vector prediction result and the physical response vector prediction result.

7. The method according to claim 6, characterized in that, The target prediction result is optimized using a multi-task joint optimization strategy. This strategy includes calculating task loss and consistency loss, weighting the task loss and consistency loss results to obtain a total loss result, and updating the target prediction result based on the total loss result. Mission losses include losses from the first mission and losses from the second mission; The first task loss is calculated by calculating the difference loss between the predicted design parameter vector and the standardized design parameter vector, and obtaining the first difference loss result. The second task loss is calculated by calculating the difference loss between the predicted physical response vector and the physical response vector after min-max normalization, and obtaining the second difference loss result. The design parameter vector prediction result is projected onto the physical response vector space to obtain the secondary physical response vector prediction result. The physical response vector prediction result is then projected onto the design parameter vector space to obtain the secondary design parameter response vector prediction result. The consistency loss is calculated by summing the difference loss between the predicted result of the quadratic physical response vector and the physical response vector after min-max normalization, and the difference loss between the predicted result of the quadratic design parameter response vector and the design parameter vector after standardization. By constructing a multi-task loss function, the first difference loss result, the second difference loss result, and the consistency loss result are weighted by hyperparameters to obtain the total loss result, and the target prediction result is updated based on the total loss result.

8. The method according to claim 7, characterized in that, Based on the updated target prediction results, symmetry-preserving constraints and quantifiable physical constraints are applied. The metasurface sensor design network is trained end-to-end, outputting a metasurface sensor design scheme, including: Based on the symmetry characteristics of metasurface sensors and combined with the regularization constraint mechanism for symmetry preservation, a symmetry sensing loss function is constructed. The symmetry sensing loss function is used to perform a preset symmetry transformation on the metasurface structure corresponding to the updated target prediction result, calculate the difference before and after the transformation, and obtain the symmetry loss result. The prior physical knowledge corresponding to the multi-element physical information dataset is transformed into quantifiable physical constraints. By combining the multi-task loss function and the symmetry perception loss function, and taking the minimization of the comprehensive loss result as the training objective, the metasurface sensor design network is trained end-to-end. During the training process, the updated target prediction results generated during training are constrained in real time by the quantifiable physical constraints, the learnable parameters are optimized, and a metasurface sensor design scheme that conforms to symmetry constraints and physical laws is output.

9. A smart design device for metasurface sensors based on a dual-branch architecture, characterized in that, include: The data collection and processing module is used to acquire a multi-element physical information dataset of the metasurface sensor and to preprocess the multi-element physical information dataset. The feature extraction module is used to input the preprocessed multi-element physical information dataset as an input sequence into a pre-constructed dual-branch feature extraction network, and obtain the output features of the first feature branch and the output features of the second feature branch according to the self-attention mechanism of each branch. The feature enhancement module is used to extract complementary features between the output features of the first feature branch and the output features of the second feature branch. Through a superlinear self-attention mechanism, the output features of the first feature branch and the output features of the second feature branch after the complementary features are extracted are enhanced. The feature interaction fusion module is used to obtain supplementary information bidirectionally between the enhanced output features of the first feature branch and the output features of the second feature branch through a cross-branch attention mechanism, and inputs the interactive output features into the gated fusion network to obtain fused features. The target prediction module is used to refine and aggregate the fused features to obtain aggregated features after adaptive weighted fusion of refined features, and to project the aggregated features onto the target space to obtain the target prediction result. The parameter update module is used to optimize the target prediction result through a multi-task joint optimization strategy. The multi-task joint optimization strategy includes calculating task loss and consistency loss, weighting the task loss result and consistency loss result to obtain the total loss result, and updating the learnable parameters of the metasurface sensor design network according to the total loss result. The output module is used to load the updated learnable parameters into the metasurface sensor design network to obtain the updated target prediction results, perform symmetry preservation constraint processing and quantifiable physical constraint processing based on the updated target prediction results, train the metasurface sensor design network end-to-end, and output the metasurface sensor design scheme.

10. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to implement the intelligent design method for metasurface sensors based on a dual-branch architecture as described in any one of claims 1-8 when executing executable instructions.