Deep learning-based terahertz filter design method

Through series inverse and forward spectral prediction networks, the terahertz filter is designed using deep learning methods, which solves the problem of time-consuming and inefficient traditional designs and achieves fast, efficient and accurate filter structure generation.

CN120373244APending Publication Date: 2025-07-25FUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510451408.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-11
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Traditional terahertz filter design methods rely on experienced researchers, are time-consuming and inefficient, making it difficult to achieve high-precision design results.

Method used

Deep learning method is used to connect the inverse spectral prediction network and the forward spectral prediction network through tandem, and use the specified terahertz frequency as input parameters to predict the terahertz filter structure, and combine the electromagnetic simulation software FDTD and MATLAB for data set collection and network training.

Benefits of technology

It realizes rapid design and miniaturization of terahertz filters, and can generate target device structures in milliseconds. It has high design efficiency and accurate, which can offset the influence of electric field polarization and reduce the number of simulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120373244A_ABST
    Figure CN120373244A_ABST
Patent Text Reader

Abstract

The invention relates to a terahertz filter design method based on deep learning, and belongs to the field of terahertz filter design and deep learning. The method comprises the following steps: (1) firstly, setting an initial structure size and a substrate material of the terahertz filter, dividing the structure into N * N areas, each area is composed of metal and air, when the area is a metal area, the area is represented by '1', and when the area is an air area, the area is represented by '0', then collecting a data set comprising terahertz filter structure parameters and spectral response, wherein the data set comprises a 1 / 4 structure and the corresponding spectral response; (2) constructing and training a forward spectral prediction convolutional neural network; (3) constructing and training a reverse structure prediction convolutional neural network; and (4) inputting the spectrum needing the target frequency into the reverse network to generate a corresponding terahertz filter structure. Compared with a traditional terahertz filter design method, the method has the advantages of being high in design efficiency and accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of terahertz filter design and deep learning, and particularly relates to a terahertz filter design method based on deep learning. Background Art

[0002] Terahertz (THz) generally refers to electromagnetic waves with frequencies between 0.1 THz and 10 THz, which are located between the microwave and infrared bands in the electromagnetic spectrum. Therefore, it combines the superior performance of macroscopic electronics and microscopic photonics. In recent years, with the development of terahertz science and technology, related terahertz devices, such as isolators, filters, liquid crystal substrate metasurfaces, on-chip devices, etc., have emerged like mushrooms after rain.

[0003] Currently, the design of traditional terahertz functional devices usually relies on the forward design method, which has very high requirements for the experience of researchers. Designers need to master profound optical theory knowledge. Under the existing device structure template, by repeatedly debugging the characteristic parameters of the unit structure, gradually approaching the expected design goal. The traditional design method has significant limitations, consuming a large amount of time and energy. Limited by the setting of the parameter space, it often can only obtain suboptimal design results. Although the forward design method has been widely used in the field of terahertz functional device design, its limitations have prompted researchers to explore more efficient and intelligent design methods to improve the design accuracy and efficiency.

[0004] Deep learning, a cutting-edge discipline that has emerged vigorously in the new century, provides researchers with powerful tools by constructing complex neural networks that simulate the neural structure of the human brain, enabling them to efficiently cope with and solve various challenges in reality. Although current research on deep learning in the field of metasurfaces is very extensive, there are relatively few related studies on metasurface electromagnetic filters using deep learning. Due to the strong practical value of electromagnetic filters and to avoid the deficiencies of conventional design methods, deep learning can be used to conduct reverse design research on metasurface electromagnetic filters. Summary of the Invention

[0005] The purpose of the present invention is to provide a terahertz filter design method based on deep learning for the problems of the existing technology. This design method trains the reverse spectral prediction network and the forward spectral prediction network in series. By using the specified terahertz frequency as an input parameter and predicting through the reverse spectral prediction network, the final terahertz device structure is obtained, which has the characteristics of fast design and miniaturization.

[0006] To achieve the above object, the technical solution of the present invention is: a method for designing a terahertz filter based on deep learning, which serially trains an inverse spectral prediction network and a forward spectral prediction network. By using a specified terahertz frequency as an input parameter, the final terahertz filter structure is predicted through the inverse spectral prediction network.

[0007] Further, the method includes the following steps:

[0008] Set the initial structural dimensions and substrate material of the terahertz filter. Divide the terahertz filter structure into N×N regions, each region consisting of metal and air. When the corresponding region is a metal region, it is represented by 1, and when the corresponding region is an air region, it is represented by 0; collect a dataset containing the structural parameters and spectral responses of the terahertz filter.

[0009] Build a forward spectral prediction network and train the forward spectral prediction network based on the dataset. Through continuous parameter tuning and optimization, a trained forward spectral prediction network is obtained.

[0010] Build an inverse spectral prediction network and connect it in front of the forward spectral prediction network to form a complete network and train it based on the dataset. Through continuous parameter tuning and optimization, a trained inverse spectral prediction network is obtained.

[0011] Input the spectrum of the desired target terahertz frequency into the trained inverse spectral prediction network to generate the corresponding terahertz filter structure.

[0012] Further, the dataset includes the 1 / 4 symmetric structure of the terahertz filter and its corresponding spectral response.

[0013] Further, use the electromagnetic simulation software FDTD and MATLAB for joint simulation to collect the dataset.

[0014] Further, for the forward spectral prediction network, its input is the 0, 1 structure matrix of the terahertz filter, and the output is the spectral response parameter.

[0015] Furthermore, the network structure of the forward spectral prediction network consists of an input layer, a convolutional layer, a fully connected layer, and an output layer; during the construction of the forward spectral prediction network, the input layer inputs a matrix with a size of 10×10 and feeds it into the convolutional layer, and the convolutional layer has a three-layer structure; to extract the structural features of the terahertz filter metasurface, 64 3×3 convolutional kernels are used in the first convolutional layer, and then, a pooling layer with a size of 2×2 is used; 128 3×3 convolutional kernels are used in the second convolutional layer, and 256 3×3 convolutional kernels are used in the third convolutional layer. After three convolution and pooling operations, the 10×10 matrix is converted into a 256×1 format, and the obtained one-dimensional vector data realizes the feature extraction and compression of the original data; the obtained one-dimensional vector data is input into the fully connected layer, and the fully connected layer has a three-layer structure, where the number of neurons in each layer is 256, 512, and 256 in sequence. After each fully connected layer, a batch normalization layer BN is introduced; the last layer is the output layer, which consists of 200 neurons and represents 200 spectral points of the output spectral response parameters.

[0016] Furthermore, in the constructed forward spectral prediction network, the rectified linear unit function ReLU is used as the activation function, and its mathematical expression is:

[0017] f(x) = max{0, x}

[0018] In the formula, when the input x is less than 0, the function output is 0; when the input is greater than or equal to 0, the function output is the input x itself;

[0019] During the training stage of the forward spectral prediction network, the mean squared error MSE is used to guide the training of the forward spectral prediction network and the learning of parameters. The calculation formula of MSE is as follows:

[0020]

[0021] In the formula, n is the number of samples, T prediction is the predicted spectrum of the forward spectral prediction network, and T simulation is the actual simulation spectrum.

[0022] Furthermore, when the complete network composed of the inverse spectral prediction network connected in series in front of the forward spectral prediction network is trained, the weight parameters of the forward spectral prediction network are frozen and do not participate in the training process. Only the parameters of the inverse spectral prediction network are adjusted and optimized. The input of the inverse spectral prediction network is the spectral response parameter, and the output is the structural matrix of the terahertz filter.

[0023] Furthermore, the inverse spectral prediction network consists of a convolutional layer, Leaky ReLU, a pooling layer, a fully connected layer, and an output layer; during the construction of the inverse spectral prediction network, the input is spectral response data of 200×1, which is converted into a one-dimensional vector form and connected to the fully connected layer after being processed by one layer of convolution and pooling operations; the fully connected layer has a three-layer structure, and the number of neurons in each layer of the fully connected layer is set to 512, 256, and 128 in sequence, and a BN layer is configured after each layer of the fully connected layer. The final output layer consists of 100 neurons, which is used to represent a structural matrix with a design dimension of 10×10.

[0024] Furthermore, in the constructed inverse spectral prediction network, the Adam optimizer is selected for parameter optimization, and the Sigmoid function is used in the output layer, which can convert the input data into the numerical range of 0 to 1. The mathematical expression is as follows:

[0025]

[0026] where x is the input variable and f(x) is the output value, representing the probability that the sample belongs to a certain category;

[0027] In the training stage of the inverse spectral prediction network, the mean squared error MSE is used as the loss function. MSE is defined as the error metric between the 0, 1 matrix encoding of the predicted structural matrix of the terahertz filter and the actual 0, 1 matrix encoding.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] 1. The design method disclosed by the present invention has higher design efficiency. The terahertz filter disclosed by the present invention adopts a reverse design scheme of deep learning. Only the target transmittance parameter needs to be input into the reverse prediction convolutional neural network, and then the method can perform automatic optimization design through the network model, and the required target device structure can be generated within milliseconds.

[0030] 2. The method of the present invention can design terahertz filters at different target transmittances. Therefore, it can explore the structures that can achieve corresponding functions in the design area through the neural network. The side length of the pixel points of the designed terahertz wave filter is only 20, and the overall size depends on actual needs, and it can be integrated into the terahertz system.

[0031] 3. The 1 / 4 symmetric structure of the method of the present invention can directly offset the influence brought by the electric field polarization, without the need to simulate the electromagnetic fields at each polarization angle multiple times in the program to obtain polarization stability. Description of the Drawings

[0032] Figure 1Schematic diagram of the 1 / 4 symmetric structure and spectral response of the terahertz filter in the method embodiment of the present invention.

[0033] Figure 2 Schematic diagram of the forward spectral prediction network of the terahertz filter in the method embodiment of the present invention.

[0034] Figure 3 Schematic diagram of the reverse spectral prediction network of the terahertz filter in the method embodiment of the present invention.

[0035] Figure 4 Schematic diagram of the reverse prediction structure of the terahertz filter in the method embodiment of the present invention, comparison between the normalized transmittance curve and the target transmittance. Detailed implementation manners

[0036] The technical solution of the present invention will be specifically described below with reference to the accompanying drawings.

[0037] The present invention provides a method for designing a terahertz filter based on deep learning, which trains a reverse spectral prediction network and a forward spectral prediction network in series. By using the specified terahertz frequency as an input parameter, the final terahertz filter structure is predicted through the reverse spectral prediction network. The method includes the following steps:

[0038] Set the initial structural dimensions and substrate material of the terahertz filter. Divide the terahertz filter structure into N×N regions, each region consisting of metal and air. When the corresponding region is a metal region, it is represented by 1, and when the corresponding region is an air region, it is represented by 0. Collect a dataset containing the structural parameters and spectral responses of the terahertz filter.

[0039] Build a forward spectral prediction network and train the forward spectral prediction network based on the dataset. Continuously adjust the parameters for optimization to obtain a trained forward spectral prediction network.

[0040] Build a reverse spectral prediction network and connect it in front of the forward spectral prediction network to form a complete network and train it based on the dataset. Continuously adjust the parameters for optimization to obtain a trained reverse spectral prediction network.

[0041] Input the spectrum of the required target terahertz frequency into the trained reverse spectral prediction network to generate the corresponding terahertz filter structure.

[0042] The following is the specific implementation process of the present invention.

[0043] Figure 1The 1 / 4 symmetrical structure and spectrum response diagram of the terahertz bandpass filter in the embodiment of the method of the present invention are shown in FIG. In this embodiment, the distribution of the pixel points in the frequency selective surface structure unit is set to a 1 / 4 symmetrical structure, and the device is symmetrical about the x-axis and the y-axis, which can directly offset the influence of the electric field polarization in the structure without the need to simulate the electromagnetic field of each polarization angle multiple times in the program to obtain polarization stability.

[0044] Before network training, the collected huge data set was preprocessed, and the data set contained a total of 16,985 groups of data. In order to ensure the randomness and unbiasedness of the data, the present invention adopts a random shuffle processing method and sets the random seed (seed) to 0. This step is crucial for the repeatability of the experiment. By fixing the random seed, it is easy for other researchers to reproduce the experimental results. In view of the rich amount of data, the present invention adopts the retention method to reasonably divide the data set: specifically, 80% of the samples are assigned as training sets to train the model; 10% of the samples are used as validation sets to adjust the model parameters and avoid overfitting; and the other 10% of the samples are used as test sets to evaluate the final performance of the model from an objective perspective.

[0045] Figure 2 The schematic diagram of the forward spectrum prediction network of the terahertz filter in the embodiment of the method of the present invention. The input of the forward model is the 0, 1 structure matrix of the terahertz filter, and the output is the spectrum response parameter. The network is composed of an input layer, a convolution layer, a fully connected layer, and an output layer. During the entire network construction process, a matrix of size 10×10 is input and input into the first convolution layer. In order to extract the structural features of the metasurface, 64 3×3 convolution kernels are used in the first convolution layer. Next, a pooling layer of size 2×2 is used. The core function of the pooling layer is downsampling, thereby reducing the size of the feature map while retaining key feature information to the greatest extent. 128 3×3 convolution kernels are used in the second convolution layer, and 256 3×3 convolution kernels are used in the third convolution layer. After three convolution and pooling operations, the 10×10 matrix is converted to a 256×1 format, thereby achieving effective feature extraction and compression of the original data. This operation not only retains key structural information, but also significantly reduces the amount of data, making subsequent calculations more efficient.

[0046] After the above operations are completed, the obtained one-dimensional vector data is input into the subsequent fully connected layer. By adjusting and optimizing hyperparameters, a deep neural network consisting of three fully connected layers is constructed, where the number of neurons in each layer is 256, 512, and 256 in sequence. After each fully connected layer, a batch normalization layer (Batch Normalization, BN) is introduced. Its main function is to standardize the input data and adjust the data distribution through translation and scaling operations, which helps to alleviate the overfitting problem, accelerate network convergence, and ensure gradients. Through this series of structural designs and parameter adjustments, effective learning and expression of the input data are achieved, further enhancing the model's prediction ability and training effect. The last layer is the output layer, consisting of 200 neurons, representing 200 spectral points of the output spectral response parameters. In the constructed forward prediction neural network, the rectified linear unit function (Rectified Linear Unit, ReLU) is used as the activation function, and its mathematical expression is:

[0047] f(x) = max{0, x}

[0048] In the formula, when the input x is less than 0, the function output is 0; when the input is greater than or equal to 0, the function output is the input x itself; its advantage is that its gradient is discrete, 0 or 1, and there will be no gradient vanishing problem, which makes the neural network converge more quickly.

[0049] In the training stage of the forward spectral prediction network, the mean squared error (Mean Squared Error, MSE) is used to guide the training of the model and the learning of parameters. The calculation method of MSE is the mean of the squares of the differences between the predicted value and the actual value. This function is sensitive to errors and helps to find the model with the smallest error. Generally speaking, the smaller the MSE, the better the prediction ability of the model, because the calculation of MSE incorporates the square term of the prediction error, so a smaller prediction error will result in a relatively lower MSE value. On the contrary, the increase in MSE reflects the decline in the learning accuracy of the model, meaning that the prediction error of the model is relatively large. The calculation formula of MSE is as follows:

[0050]

[0051] In the formula, n is the number of samples, T prediction is the predicted spectrum of the forward spectral prediction network, and T simulation is the actual simulation spectrum.

[0052] In the training of the forward spectral prediction network, the batch size is set to 128, which means that in each iteration, the network will process 128 data samples simultaneously. This setting helps to balance computational efficiency and memory usage, and also contributes to the stable convergence of the model. For the learning rate, a key parameter that controls the learning step of the model, it is set to 0.00001 to ensure that the model can update the weights smoothly and effectively, avoiding instability caused by overly fast updates or slow convergence caused by overly slow updates.

[0053] After 600 epochs of training, the loss value of the forward spectral prediction network on the training set gradually decreases, and finally the loss converges stably to 0.0005. At the same time, the model also performs well on the validation set, and its loss converges to 0.0022. This significant decrease in the loss value not only proves the effectiveness of the network structure but also indicates that the model has a certain generalization ability on unseen data, that is, when the training error is low, the validation error also remains at a low level.

[0054] After completing the training of the forward spectral prediction network, the construction of the inverse spectral prediction network can be started. After completion, the inverse spectral prediction network is connected in front of the forward network to form a complete network for joint training. After completing the connection operations of each part, the overall model is successfully constructed. When spectral response data is input into this model, the data will be processed by the inverse network to obtain the corresponding structure matrix. Subsequently, the obtained structure matrix is input into the forward network. After the operations and processing of the forward network, the spectral response result of the filter structure designed by the inverse network can finally be output. In addition, the forward network is mainly used for simulation during the training process, so its parameters need to be kept fixed. To achieve this, the weight parameters of the forward spectral prediction network are frozen and do not participate in the training process. The parameters of the inverse network will be continuously adjusted during the training process.

[0055] In the inverse spectral prediction network, the Adam (Adaptive Moment Estimation) optimizer is selected for parameter optimization. The key of the Adam optimizer lies in calculating the exponentially weighted moving averages of both the first moment and the second moment of the gradient simultaneously. And the first moment represents the exponentially weighted average of the gradient, usually called momentum, while the second moment is the exponentially weighted average of the square of the gradient. This process effectively combines the historical information of the gradient, optimizes the efficiency of parameter updates, and performs bias correction to ensure that the gradient estimate does not tend to 0 at the beginning of training, enabling the learning rate to be automatically adjusted, thereby improving the learning effect of the network. In addition, the Sigmoid function is used in the output layer of the network. This function can transform the input data into the numerical range from 0 to 1, and its mathematical expression is as follows:

[0056]

[0057] Where x is the input variable and f(x) is the output value, representing the probability that a sample belongs to a certain category; it is usually used in binary classification problems because it can express the probability that a sample belongs to a certain category in an intuitive and quantitative way. Specifically, when its output value approaches 1, this usually means that the input sample is judged to belong to a specific category; on the contrary, if the output value approaches 0, it indicates that the sample is judged to belong to another category.

[0058] Figure 3 It is a schematic diagram of the inverse spectral prediction network of the terahertz filter in this embodiment. The input of the inverse network is the target spectral response data, and the output is the 0, 1 structure matrix of the terahertz filter metasurface designed by the neural network. And the dataset used by the inverse spectral prediction network is the same as that of the forward spectral prediction network. This network is composed of a convolutional layer, Leaky ReLU, a pooling layer, and a fully connected layer. The input is spectral response data of 200×1. After being processed by one layer of convolution and pooling operations, it is converted into a one-dimensional vector form and connected to the fully connected layer. The number of neurons in each layer of the fully connected layer is set to 512, 256, and 128 in sequence, and a BN layer is configured after each fully connected layer. The final output layer consists of 100 neurons, which is used to represent the structure matrix with a design dimension of 10×10. Then set the random seed seed to 0. Among the 16,985 groups of datasets used in the inverse prediction network, 80% of them are used as the training set, 10% as the test set, and the remaining 10% as the validation set. In the parameter setting of the network, Epoch is set to 600, and the batch size is set to 64, and the learning rate is 0.0001. The loss function still selects MSE. In the inverse network, MSE is defined as the error metric between the predicted 0, 1 matrix encoding and the actual 0, 1 matrix encoding. During the network training stage, the model had an overfitting problem. To alleviate this phenomenon, the present invention introduces a Dropout regularization strategy in the fully connected layer, and sets the Dropout parameter to 0.5, that is, the neural network randomly ignores 50% of the neurons each time during the training process. As an effective regularization technique, this method can significantly reduce the overfitting degree of the model to the training data by randomly disconnecting neuron connections.

[0059] After 600 rounds of iterative training, a relatively small loss value of 0.062 was finally obtained on the training set; while on the validation set, the loss value of the model was 0.076. The experimental results show that the fitting effect of the model on the training set is ideal, and the generalization performance on the validation set can still maintain a high level.

[0060] After the inverse network is trained, the test data set is input into the inverse network, and the predicted structural parameters are input into the previously trained forward prediction neural network to generate a predicted spectrum. If the error between the predicted spectrum and the true spectrum is within the preset threshold range, it indicates that the training model of the inverse design neural network has met the expected design goal.

[0061] Figure 4 This is a schematic diagram of the inverse structure prediction result of the terahertz filter in this embodiment. As can be seen from the results, such as Figure 4 (b) and (d) are results with relatively large errors. Although there are still certain frequency offsets in some bands between the target transmittance curve and the transmittance spectrum obtained by simulating the structure output by the inverse design network through the forward network, the overall waveform and the center frequency position basically meet the design requirements. This indicates that the inverse design network model can accurately and efficiently design a terahertz filter metasurface structure that meets the expectations according to the given target spectral response parameters and with adjustable center frequencies. Through this method, the inverse design network demonstrates its potential and practicality in quickly generating complex electromagnetic structures, proving the advantages and application prospects of deep learning in metasurface design.

[0062] The above are the preferred embodiments of the present invention. All changes made according to the technical solution of the present invention, when the functions and effects produced do not exceed the scope of the technical solution of the present invention, fall within the protection scope of the present invention.

Claims

1. A design method of a terahertz filter based on deep learning, characterized in that, The reverse spectrum prediction network and the forward spectrum prediction network are trained in series, and the final terahertz filter structure is obtained by predicting the specified terahertz frequency as an input parameter through the reverse spectrum prediction network.

2. The method for designing a terahertz filter based on deep learning according to claim 1, wherein The method comprises the following steps: Set the initial structure size and substrate material of the terahertz filter, divide the terahertz filter structure into N×N regions, each region is composed of metal and air, when the corresponding region is a metal region, it is represented by 1, when the corresponding region is an air region, it is represented by 0; collect a data set containing the structural parameters and spectral response of the terahertz filter; Build a forward spectrum prediction network and train it based on the data set, and obtain a trained forward spectrum prediction network through continuous parameter adjustment and optimization; Build a reverse spectrum prediction network and connect it in series in front of the forward spectrum prediction network to form a complete network and train it based on the data set. Through continuous parameter adjustment and optimization, a trained reverse spectrum prediction network is obtained. The spectrum of the required target terahertz frequency is input into the trained inverse spectrum prediction network to generate the corresponding terahertz filter structure.

3. The method for designing a terahertz filter based on deep learning according to claim 2, wherein The dataset contains the 1 / 4 symmetrical structure of the terahertz filter and its corresponding spectral response.

4. The method for designing a terahertz filter based on deep learning according to claim 2, wherein The electromagnetic simulation software FDTD and MATLAB are used for joint simulation to collect data sets.

5. The method for designing a terahertz filter based on deep learning according to claim 2, wherein The forward spectrum prediction network has the 0, 1 structure matrix of the terahertz filter as input and the spectral response parameters as output.

6. The method for designing a terahertz filter based on deep learning according to claim 5, wherein The network structure of the forward spectrum prediction network consists of an input layer, a convolutional layer, a fully connected layer, and an output layer. In the process of constructing the forward spectrum prediction network, a matrix of size 10×10 is input to the input layer and is input to the convolutional layer, which has a three-layer structure. In order to extract the structural features of the terahertz filter metasurface, 64 3×3 convolution kernels are used in the first convolutional layer, followed by a pooling layer of size 2×2. 128 3×3 convolution kernels are used in the second convolutional layer, and 256 3×3 convolution kernels are used in the third convolutional layer. ×3 convolution kernel, after three convolution and pooling operations, the 10×10 matrix is converted into a 256×1 format, and the obtained one-dimensional vector data is used to realize feature extraction and compression of the original data; the obtained one-dimensional vector data is input into the fully connected layer, and the fully connected layer has three layers, in which the number of neurons in each layer is 256, 512 and 256 respectively. After each fully connected layer, a batch normalization layer BN is introduced; the last layer is the output layer, which consists of 200 neurons, representing 200 spectrum points of the output spectrum response parameters.

7. The method for designing a terahertz filter based on deep learning according to claim 6, wherein In the forward spectrum prediction network constructed, the rectified linear unit function ReLU is used as the activation function, and its mathematical expression is: f(x)=max{0,x} In the formula, when the input x is less than 0, the function output is 0; when the input is greater than or equal to 0, the function output is the input x itself; In the forward spectrum prediction network training phase, the mean square error (MSE) is used to guide the training and parameter learning of the forward spectrum prediction network. The calculation formula of MSE is as follows: where n is the number of samples, T prediction is the predicted spectrum by the forward spectral prediction network, T simulation is the actual simulated spectrum.

8. The method for designing a terahertz filter based on deep learning according to claim 2, wherein When the complete network formed by cascading the inverse spectral prediction network in front of the forward spectral prediction network is trained, the weight parameters of the forward spectral prediction network are frozen and do not participate in the training process. Only the parameters of the inverse spectral prediction network are adjusted and optimized. The input of the inverse spectral prediction network is the spectral response parameter, and the output is the structure matrix of the terahertz filter.

9. The terahertz filter design method based on deep learning according to claim 8, wherein The inverse spectral prediction network consists of a convolutional layer, Leaky ReLU, a pooling layer, a fully connected layer, and an output layer. During the construction of the inverse spectral prediction network, the input is 200×1 spectral response data. After being processed by one layer of convolution and pooling operations, it is converted into a one-dimensional vector form and connected to the fully connected layer. The fully connected layer has a three-layer structure. The number of neurons in each layer of the fully connected layer is set to 512, 256, and 128 in sequence, and a BN layer is configured after each layer of the fully connected layer. The final output layer consists of 100 neurons and is used to represent the structure matrix with a design dimension of 10×10.

10. The method for designing a terahertz filter based on deep learning according to claim 9, characterized in that, In the constructed inverse spectral prediction network, the Adam optimizer is selected for parameter optimization. The Sigmoid function is used in the output layer, which can convert the input data into the numerical range of 0 to 1. The mathematical expression is as follows: where x is the input variable and f(x) is the output value, representing the probability that the sample belongs to a certain category; During the training stage of the inverse spectral prediction network, the mean squared error MSE is used as the loss function. MSE is defined as the error metric between the 0, 1 matrix encoding of the predicted structure matrix of the terahertz filter and the actual 0, 1 matrix encoding.