Resonator inverse design method and device based on residual error automatic encoder method
Through the resonator inverse design method based on the residual automatic encoder method, the training data is generated using electroacoustic lumped analogy and the residual connection is introduced, the problems of low computational efficiency and overfitting of the model in the prior art are solved, and high efficiency is achieved , flexible model deployment and performance improvement.
Patent Information
- Application Number
- CN202411456196.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the model has low computational efficiency, is prone to falling into local optimality, and has problems of gradient disappearance and explosion, resulting in insufficient overfitting and generalization capabilities of the model.
A resonator inverse design method based on the residual automatic encoder method is adopted, and the training data set is generated through electroacoustic lumped analogy, the residual autoencoder model is trained, and residual connections are introduced into the model to alleviate the gradient vanishing and explosion problems. At the same time, model pruning and quantization are performed to reduce model volume and improve computational efficiency.
It significantly improves the computing efficiency and generalization capabilities of the model, reduces the model size, and flexibly deploys it in multiple ends with different performances, with the same performance as the server side, solving the problems of local optimization and overfitting.
Smart Images

Figure CN119446105A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of acoustic device design, and in particular relates to a resonator inverse design method and device based on a residual autoencoder method. Background Art
[0002] Arbitrary control of acoustic waves has long been a great challenge and research hotspot, but in the analysis and design of acoustic structures or materials, a series of theoretical methods are combined with numerical simulations to calculate certain acoustic properties. Although accurate results can be obtained through this method, it is very time-consuming and strongly depends on the model used.
[0003] In recent years, a series of artificial intelligence methods based on machine learning have introduced new ideas for the research of structure and material design. This is a paradigm shift in the field of material design, which can reduce the dependence on researchers' experience and theoretical knowledge. Common optimization strategies include genetic algorithms, particle swarm optimization, and topology optimization. However, these traditional machine learning algorithms are often computationally inefficient and tend to converge to local optimality prematurely in the early stages of the search, leading to overfitting problems. Summary of the invention
[0004] In order to solve the problems of low model calculation efficiency and easy falling into local optimal points in existing models, alleviate gradient vanishing and gradient explosion, reduce model overfitting, and enhance the generalization ability of the model, the present invention provides a resonator inverse design method and device based on the residual autoencoder method to solve the above-mentioned technical defects.
[0005] In a first aspect, the present invention proposes a resonator inverse design method based on a residual autoencoder method, comprising:
[0006] S1. Based on the electroacoustic lumped analogy method, the Helmholtz resonator is used as the absorber to generate a training data set, which consists of different sets of geometric parameters and their corresponding absorption coefficients;
[0007] S2. Use the generated training data set to train a residual autoencoder model. The model includes an encoder and a decoder. The encoder compresses the input data into a low-dimensional representation, and the decoder reconstructs the low-dimensional representation into the original data. A residual connection is introduced into the model.
[0008] S3, pruning and quantizing the trained residual autoencoder model;
[0009] S4. Input the target absorption coefficient curve into the optimized residual autoencoder model to generate the corresponding geometric parameter combination.
[0010] Through the above technical means, the lumped electroacoustic analogy is used to generate data, which can generate accurate training data sets without a large amount of experimental data. In addition, the model adopts an autoencoder architecture, which can learn the low-dimensional representation of data in an unsupervised learning manner. By compressing the input data into a low-dimensional implicit representation and then reconstructing it, the main features of the data can be effectively extracted. At the same time, the model also introduces residual connections based on the autoencoder, ensuring that in the back-propagation process, the gradient not only depends on the chain rule, but can also be directly transmitted through jump connections, more effectively transmitting the gradient to the early layers of the network, thereby alleviating the gradient disappearance and explosion problems. Compared with traditional deep neural networks, the index performance and reasoning speed of the model have been greatly improved. The model is fused with operators and quantized perceptual training, the size of the model is compressed, and the decoder part is cut off. The model is compressed from 200M to 79M and successfully deployed to the Android side for reasoning, and the performance is on par with the server side. It solves the problem that the previous model is prone to falling into local optimality and overfitting, and at the same time greatly improves the computing efficiency, compresses the model volume, and can be flexibly deployed on multiple terminals with different performance to give full play to the hardware performance.
[0011] Preferably, step S1 comprises:
[0012] S11. Obtain the physical model of the Helmholtz resonator and define the geometric parameters of the Helmholtz resonator, including the neck radius r. N , cavity radius r C 、Neck length l N and cavity length l C ;
[0013] S12. Convert the physical model into an equivalent electroacoustic representation. The total impedance Z of the equivalent electroacoustic representation HR Obtained through geometric parameter calculation and constructing the total impedance Z HR The characteristic relationship with the absorption coefficient α is expressed as Where z0 is the air impedance;
[0014] S13, adjusting the geometric parameters, generating corresponding absorption coefficients according to the characteristic relationship, and forming a training data set with different geometric parameter sets and their corresponding absorption coefficients.
[0015] Preferably, the total impedance in step S12 is calculated and obtained by the normalized ratio of acoustic resistance and the normalized ratio of resonator acoustic reactance, which is expressed as:
[0016] Z HR = z0(R HR +jX HR )
[0017] Among them, R HR is the normalized ratio of acoustic impedance, X HRis the normalized ratio of the acoustic reactance of the resonator, z0 is the air impedance, and j is the imaginary part;
[0018] Normalized ratio of acoustic impedance R HR , expressed as
[0019]
[0020] Where η is the kinematic viscosity coefficient of air, ρ is the air density, ω is the angular frequency, ∈ T =S n / A0,S n is the cross-sectional area of the neck of the Helmholtz resonator, A0 is the cross-sectional area of the cavity of the Helmholtz resonator;
[0021] Normalized ratio of resonator acoustic reactance X HR , expressed as:
[0022]
[0023] Where k is the sound wave number, δ = 0.85 dh, l RC is the height of the modified cavity, l RC = l N +l C +∈ T (l N +1.7r N ).
[0024] Through the above technical means, the lumped electroacoustic analogy is used to generate data, which can generate accurate training data sets without a large amount of experimental data.
[0025] Preferably, the training data in step S1 is verified by COMSOL finite element method simulation.
[0026] Preferably, the COMSOL finite element method simulation verification includes: the complex density and bulk modulus determined by the JCA model, the domain inside the neck of the Helmholtz resonator is represented as an equivalent fluid, and the absorption coefficient within the selected frequency range is generated based on the Helmholtz equation, and the absorption coefficient corresponds to any set of four geometric parameters; the absorption coefficient generated by the Helmholtz equation is compared and verified with the absorption coefficient in the training data set; wherein the Helmholtz equation is expressed as:
[0027]
[0028] Among them, ρ is the air density, p is the sound pressure, and k is the sound wave number.
[0029] Through the above technical means, the accuracy of the training data set generated by the lumped electroacoustic analogy is guaranteed by COMSOL finite element method simulation verification.
[0030] Preferably, in step S2, the encoder maps the original input subsequence x to a latent space representation z, and the decoder reconstructs the output according to the latent space representation z To match the measured response y, the encoder’s mapping f θ and the decoder mapping g θ Respectively expressed as:
[0031] z=f θ (x) = s f (W x +b w )
[0032]
[0033] Where θ={Wx,b w},θ′={Vz,b v},s f represents the activation function, Wx and b W Denote the weight matrix and bias vector of the encoder, Vz and b respectively V Denotes the weight matrix and bias vector of the decoder; Wx, Vz, b W and b V Adjustment is based on the loss function, which is expressed as:
[0034]
[0035] Where N is the total number of data samples, α n,k and is the actual and predicted absorption coefficient, α n,k is the output of the decoder, n,j are the actual geometric parameters, is the predicted geometric parameters and the output of the encoder, m is the number of geometric parameters, p is the number of absorption coefficients, and β is a hyperparameter.
[0036] Through the above technical means, the loss function is used to optimize the model performance and make the training process more stable.
[0037] Preferably, step S3 includes:
[0038] S31, performing operator fusion on the trained residual autoencoder model;
[0039] S32, quantizing the residual autoencoder model after the operator fusion;
[0040] S32, the decoder part of the residual autoencoder model after clipping and quantization.
[0041] Through the above technical means, pruning techniques are used to further compress the model size. The decoder module is not needed in the subsequent forward reasoning process, so a class containing only the encoder module is redefined, which can be directly extracted in the autoencoder model. The size of the pruned model is compressed from 200M to 70M, reducing unnecessary neurons and weights, reducing the model calculation amount, and shortening the reasoning time.
[0042] Preferably, step S31 includes a fusion operator based on the PyTorch framework to merge the multi-layer operations of the trained residual autoencoder model into one computing kernel.
[0043] Through the above technical means, through operator fusion, multiple operations can be combined into one and directly performed in the same calculation process, without the need for repeated memory writing and reading, thereby reducing the pressure on memory bandwidth and speeding up the calculation. And reducing the number of nodes in the calculation graph, making the calculation graph more concise, which not only speeds up the execution process, but also makes it easier to debug and optimize the calculation graph.
[0044] Preferably, step S32 includes quantizing the residual autoencoder model after operator fusion based on quantization perception, including preparing the residual autoencoder model and loading pre-trained model parameters; configuring the quantization engine using the API provided by PyTorch; converting the residual autoencoder model to a quantization perception mode and retraining to obtain a quantized residual autoencoder model.
[0045] Through the above technical means, quantization-aware training inserts a pseudo-quantization module into the model to simulate the rounding and clamping operations performed by the quantization model during the inference process, thereby improving the model's adaptability to quantization effects during the training process and obtaining higher quantization model accuracy. The quantized model significantly reduces the model's storage space, and the computational complexity is also greatly reduced.
[0046] In a second aspect, an embodiment of the present invention proposes a resonator inverse design device based on a residual autoencoder method, comprising:
[0047] A data generation module is configured to generate a training data set based on an electroacoustic lumped analogy method with a Helmholtz resonator as an absorber, the training data set consisting of different sets of geometric parameters and their corresponding absorption coefficients;
[0048] A model training module is configured to train a residual autoencoder model using the generated training data set, wherein the model includes an encoder and a decoder, wherein the encoder compresses the input data into a low-dimensional representation, and the decoder reconstructs the low-dimensional representation into the original data, and a residual connection is introduced into the model;
[0049] A model optimization module is configured to prune and quantize the trained residual autoencoder model;
[0050] The model inference module is configured to input the target absorption coefficient curve into the optimized residual autoencoder model to generate a corresponding geometric parameter combination.
[0051] Compared with the prior art, the beneficial results of the present invention are:
[0052] The use of lumped electroacoustic analogy to generate data can generate accurate training data sets without a large amount of experimental data. In addition, the model adopts an autoencoder architecture, which can learn low-dimensional representations of data in an unsupervised learning manner. By compressing the input data into a low-dimensional implicit representation and then reconstructing it, the main features of the data can be effectively extracted. At the same time, the model also introduces residual connections based on the autoencoder, ensuring that in the back-propagation process, the gradient not only depends on the chain rule, but can also be directly transmitted through jump connections, more effectively transmitting gradients to the early layers of the network, thereby alleviating the gradient disappearance and explosion problems. Compared with traditional deep neural networks, the model's index performance and reasoning speed have been greatly improved. The model is operator-fused and quantized perceptual training is performed, the model size is compressed, and the decoder part is cut off. The model is compressed from 200M to 79M and successfully deployed to the Android side for reasoning, and the performance is on par with the server side. It solves the problem that the previous model is prone to falling into local optimality and overfitting, while greatly improving the computing efficiency and compressing the model size. It can be flexibly deployed on multiple terminals with different performances to give full play to the hardware performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0054] Figure 1 It is a flowchart of the resonator inverse design method based on the residual autoencoder method;
[0055] Figure 2 are the top view and side view of the Helmholtz resonator;
[0056] Figure 3 is the equivalent electroacoustic circuit of the Helmholtz resonator;
[0057] Figure 4 Comparison of training data generated for electroacoustic lumped analogy with FEM calculation results;
[0058] Figure 5Workflow designed for Helmholtz resonator prediction;
[0059] Figure 6 is the residual autoencoder model architecture;
[0060] Figure 7 Training and validation losses for the residual autoencoder model for 1000 epochs;
[0061] Figure 8 is the neck radius r N , cavity radius r C 、Neck length l N and cavity length l C Comparison of predicted and true values of four geometric parameters;
[0062] Fig. 9 Comparison of prediction results of three models: DNN, AE, and residual autoencoder model;
[0063] Fig.10 This is a schematic diagram of the inference effect of the residual autoencoder model deployed on an Android phone;
[0064] Fig.11 Schematic diagram of the resonator inverse design device based on the residual autoencoder method. DETAILED DESCRIPTION
[0065] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0066] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0067] This embodiment discloses a resonator inverse design method based on a residual autoencoder method. Figure 1 For a flowchart of the resonator inverse design method based on the residual autoencoder method, refer to Figure 1 , methods include:
[0068] S1. Based on the electroacoustic lumped analogy method, the Helmholtz resonator (HRIN) is used as the absorber to generate a training data set consisting of different sets of geometric parameters and their corresponding absorption coefficients.
[0069] Specifically, step S1 includes:
[0070] S11. Obtain the physical model of the Helmholtz resonator and define the geometric parameters of the Helmholtz resonator, including the neck radius r. N , cavity radius r C 、Neck length l N and cavity length l C ;
[0071] Furthermore, Figure 2 The top view and side view of the Helmholtz resonator are shown in Figure 1. The physical model of the Helmholtz resonator (HRIN) is shown in Figure 2. Figure 2 As shown. The arrow represents the incident wave P i and the reflected wave P r , r N and r C Represent the neck radius and cavity radius respectively. N represents the length of the neck, and l C It is the difference between the cavity length and the neck length.
[0072] S12. Convert the physical model into an equivalent electroacoustic representation. The total impedance Z of the equivalent electroacoustic representation HR Obtained through geometric parameter calculation and constructing the total impedance Z HR The characteristic relationship with the absorption coefficient α is expressed as Where z0 is the air impedance;
[0073] Furthermore, the equivalent electroacoustic representation of HRIN is as follows: Figure 3 As shown, the impedance is expressed as:
[0074] Z HR =Z RN +Z RC #(1)
[0075] The impedance of HRIN consists of two parts, Z RN represents the acoustic impedance of the HRIN neck, Z RC represents the acoustic impedance of the HRIN cavity. In addition, Z HR It can be expressed as the normalized impedance ratio plus the normalized reactance ratio as shown below:
[0076] Z HR = z0(R HR +jX HR )#(2)
[0077] In formula (2), R HR is the normalized ratio of acoustic impedance, X HR is the normalized ratio of the acoustic impedance of the resonator, z0 is the air impedance, and j is the imaginary part. The expression of the normalized acoustic impedance ratio is as follows:
[0078]
[0079] Where η is the kinematic viscosity coefficient of air, ω is the angular frequency, ∈ T =S n / A0,S n is the cross-sectional area of the neck, A0 is the cross-sectional area of the cavity, and ρ is the air density. The expression for the normalized ratio of the acoustic reactance of the resonator is as follows:
[0080]
[0081] Where k is the sound wave number, where δ = 0.85 dh, l RC is the modified cavity height:
[0082] l RC = l N +l C +∈ T (l N +1.7r N )#(5)
[0083] Finally, the absorption coefficient α is determined by the following formula, that is, the total impedance Z HR Characteristic relationship with absorption coefficient α:
[0084]
[0085] The absorption coefficient ranges between 0 and 1.
[0086] S13, adjusting the geometric parameters, generating corresponding absorption coefficients according to the characteristic relationship, and forming a training data set with different geometric parameter sets and their corresponding absorption coefficients.
[0087] In order to verify the effectiveness of the proposed electroacoustic simulation model, the acoustic absorption characteristics of the Helmholtz resonator with a neck (HRIN) were simulated by the finite element method (FEM) using the acoustic module in COMSOL Multiphysics software. The complex density and bulk modulus determined by the Johnson-Champoux-Allard (JCA) model are used to represent the domain inside the neck of the Helmholtz resonator as an equivalent fluid. The parameters of the JCA model are listed in Table 1. The propagation of sound in an impedance tube follows the acoustic wave equation, which is simplified to the Helmholtz equation in the frequency domain, which is in the following form:
[0088]
[0089] Among them, ρ is the air density, p is the sound pressure, and k is the sound wave number.
[0090] Figure 4 Comparison of training data generated for the electroacoustic lumped analogy with FEM calculation results, see Figure 4, the calculation results of the two methods are highly consistent. The proposed physical model exhibits a sharp absorption peak. Considering that this study is mainly aimed at low-frequency absorbers, the selected frequency range is 0-700Hz. A Python script is used to generate the absorption coefficient in the frequency range of 0-700Hz according to the above equation, corresponding to any set of four geometric parameters. During the preparation of the dataset, all physical and material parameters except the four geometric parameters remain unchanged. The range of variation of these four geometric parameters is listed in Table 2. The prepared dataset has undergone multiple rounds of verification to ensure its robustness, and no errors or defects have been detected.
[0091] Table 1 Five acoustic parameters of the JCA model
[0092] parameter <![CDATA[α ∞ ]]> φ Λ′[mm] Λ[mm] σ[Pa*s] value 0.99 0.97 1 1 136.8
[0093] Table 2 Geometric parameters r N 、r C , l N and l C Range of variation
[0094] parameter Random value range [mm] <![CDATA[r N ]]> 1-10 <![CDATA[r C ]]> 10-50 <![CDATA[l N ]]> 10-100 <![CDATA[l C ]]> 5-50
[0095] S2. Use the generated training data set to train a residual autoencoder model. The model includes an encoder and a decoder. The encoder compresses the input data into a low-dimensional representation, and the decoder reconstructs the low-dimensional representation into the original data. A residual connection is introduced into the model.
[0096] Specifically, the autoencoder consists of two parts: the encoder and the decoder. The encoder compresses the input data into a low-dimensional representation, while the decoder reconstructs the low-dimensional representation back to the original data. These two parts are learned simultaneously during the training process to establish the forward and backward mapping between the latent space and the input. The collaborative learning function of the autoencoder alleviates the non-uniqueness problem in the inverse design. In this study, the encoder processes the input sound absorption characteristic curve to extract the latent features from the data. Its function f θ As shown in Formula 8, the original input subsequence x is mapped to the latent space representation z. At the same time, the decoder uses the compressed features derived by the encoder to reconstruct the structural response. It acts as another mapping g θ , which reconstructs the output based on the compressed features z to match the measured response y.
[0097] z=f θ (x) = s f (Wx+b w )#(8)
[0098]
[0099] where θ={W,b w},θ′={V,b v},s f represents the activation function, and the rectified linear unit (Relu) is used in this architecture. W and b W denote the weight matrix and bias vector of the encoder, respectively, while V and b V represents the weight matrix and bias vector of the decoder. The best performance of the autoencoder is obtained by adjusting W, V, b according to the loss function given in the following equation W and b V To achieve:
[0100]
[0101] N is the total number of data samples, where α n,k and represents the actual and predicted absorption coefficient, α n,k is also the output of the decoder. In addition, y n,j represents the actual geometric parameters, and is the predicted geometric parameters and the output of the encoder. Here, m represents the number of geometric parameters and p represents the number of absorption coefficients. In this study, m = 4 and p = 700. In addition, β is a hyperparameter and is selected as 0.01. The loss function can optimize the model performance and make the training process more stable. Figure 5 Workflow designed for Helmholtz resonator prediction, reference Figure 5 The training and prediction process of the residual autoencoder model in this application is as follows Figure 5 shown.
[0102] Secondly, residual connections are added to the autoencoder structure. The introduction of residual connections allows the gradient to be directly transferred to the previous layer, thus avoiding the gradual reduction of the gradient during the transmission process. The specific steps are as follows:
[0103] For autoencoders, increasing the network depth can enhance the representation ability of the model, thereby achieving better performance in the inverse design task. However, as the network depth increases, various problems arise. During backpropagation, the network parameters are updated using the chain rule for gradient calculation. When the network becomes very deep, the gradient may decrease layer by layer during the backpropagation process. Due to repeated convolutions with small weights, the gradients of the early layers become very small, which eventually leads to the gradient vanishing problem, making the network parameter update unstable. Similarly, multi-layer networks may also encounter the problem of gradient explosion. In this case, the gradient value is repeatedly multiplied by the weight of each layer; if the weight or gradient value is large, the product increases rapidly. This causes drastic changes in the weight parameters during training, resulting in large fluctuations in the loss function value, making the model training unstable. Due to extreme gradient values, the model may fall into a local minimum, which seriously affects the performance of the autoencoder.
[0104] The residual connection introduces a skip connection, which allows the gradient to be passed directly to the previous layer, thus avoiding the gradual reduction of the gradient during transmission. This structure ensures that during the back-propagation process, the gradient not only relies on the chain rule, but can also be transmitted directly through the skip connection. This direct gradient path can more effectively transmit gradients to the early layers of the network, thereby alleviating the gradient vanishing and exploding problems. The residual connection in this architecture is different from the original residual connection. The original residual connection takes the input x and generates the output x+F(x) because x and F(x) have the same dimension. However, in the architecture proposed in this article, the data length of the output F(x) is reduced and the feature depth is increased compared to the input x. In order to solve the problem of size mismatch, the convolutional layer and the pooling layer are merged into the residual skip connection in the architecture. Similarly, in the residual decoding block, the convolutional layer and the upsampling layer are merged into the residual skip connection to match the output dimension that needs to be summed, thereby allowing the output dimension to be restored from the cascaded input. The overall structural diagram of the model is shown in Figure 6 shown.
[0105] The proposed residual autoencoder model was trained using the generated dataset and subsequently used to reversely predict the geometric parameters of HRIN. Based on the electroacoustic method mentioned above, a dataset containing 427,500 samples was created. The dataset was divided into training (70%), validation (20%), and test (10%) subsets. The training set was used to train the residual autoencoder model to minimize the prediction error, the validation set was used to determine the optimal weights, and the test set was used to evaluate the performance of the model. The ideal trained model should be able to accurately reverse predict the geometric parameters and exhibit excellent generalization performance. A total of 1000 epochs were performed for training and validation, during which the loss of the residual autoencoder model was estimated, as shown in Figure 7 As shown. After up to 300 epochs, the validation and training losses drop significantly. Then, between 300 and 700 epochs, the loss gradually slows down and finally converges to the minimum at the 1000th epoch. After successful training, the residual autoencoder model is evaluated on a test set containing 42,000 mutually exclusive samples. The evaluation metric used here is the coefficient of determination R 2 and mean absolute percentage error (MAPE), R 2 A measure used to analyze the similarity between two signals, ranging from 0 to 1. The MAPE value represents the average relative percentage error of the prediction. A good model should show a low MAPE value and a high R 2 Value. 2 The calculation method of MAPE is as follows:
[0106]
[0107] Where N represents the number of data points in the data set, yn is the value of the actual geometric parameter, are the values of the predicted geometric parameters, is the average value of the actual geometric parameters. The research results show that l N The MAPE is the highest, which is 7.92%, and the R2 is 0.911, while the r C The MAPE is the lowest at 3.29%, R 2 is 0.958. In addition, r N and l C The MAPEs were 4.56% and 5.82% respectively, and R 2 The values are 0.923 and 0.944. Next, 100 samples are randomly selected from the test set, and the actual values and predicted values are plotted on the odd-even plot, as shown in Figure 8 As shown in Figure 1, points that fall on the diagonal line represent a perfect match between the predicted and actual values. The closer the point is to the diagonal line, the higher the correlation between the predicted and actual values, indicating a more accurate prediction. The residual autoencoder model accurately predicted all four parameters in most cases, achieving an R of 0.949. 2 value and a MAPE of 2.81%. The model shows good performance on unseen datasets, indicating that it has high generalization ability.
[0108] In order to confirm the effectiveness of the proposed residual autoencoder method over existing optimization techniques, two additional network models are built to analyze the performance advantages of residual autoencoders.
[0109] Table 3 Comparison of performance indicators of three different models
[0110]
[0111] is a deep neural network (DNN) and an autoencoder (AE) without residual connections. The same dataset is used for training and testing. The comparison results of the three models are shown in Table 3. MAPE and R of geometric parameters predicted by the deep neural network (DNN) model and the autoencoder (AE) model 2The values are still relatively high compared to the residual autoencoder. It is worth noting that the AE model has shown some improvement in the prediction accuracy of geometric parameters compared to the traditional DNN model. This is the advantage of unsupervised learning, as AE can be trained without labeled data and can discover hidden patterns and structures in the data. By incorporating residual connections into AE, the residual autoencoder model further significantly improves the prediction accuracy. As shown in Table 3, in the reverse prediction, the residual autoencoder outperforms the other two models on all four parameters. To further verify this, the DNN, AE, and residual autoencoder models were compared for the HRIN geometry. Given a set of target absorption characteristics, three machine learning models are used to predict the four geometric parameters. The predicted geometric parameters are then used to calculate the corresponding absorption characteristics using the electroacoustic analogy method described above. Subsequently, the errors between these predicted absorption characteristics and the target absorption characteristics are analyzed, as shown in Fig. 9 As shown, the absorption characteristics of the Helmholtz resonator designed using the geometric parameters predicted by the residual autoencoder model closely match the target absorption characteristics. In contrast, the sound absorption curves predicted by the DNN and AE models have large errors, mainly reflected in the deviations and differences in the absorption peak frequency and amplitude. The results show that the proposed residual autoencoder model can accurately predict the acoustic geometric parameters of the inner and outer sets. This demonstrates the ability of the model to effectively perform inverse design of Helmholtz resonators.
[0112] S3, pruning and quantizing the trained residual autoencoder model;
[0113] Specifically, step S3 includes:
[0114] S31, performing operator fusion on the trained residual autoencoder model;
[0115] Furthermore, we first use the torch.quantization.fuse_modules fusion operator of the PyTorch framework. In this model, multiple operations (such as convolution, normalization, and activation functions) are usually performed sequentially. After each operation, the result is written to the memory and then read for the next operation. Through operator fusion, multiple operations can be combined into one and performed directly in the same calculation process. There is no need for repeated memory writing and reading, thereby reducing the pressure on memory bandwidth and speeding up the calculation. At the same time, the fusion operator can merge multiple layers of operations into one computing core to improve the efficiency of parallel computing. The most important thing is that operator fusion can reduce the number of nodes in the calculation graph, making the calculation graph more concise, which not only speeds up the execution process, but also makes it easier to debug and optimize the calculation graph.
[0116] S32, quantizing the residual autoencoder model after the operator fusion;
[0117] Furthermore, the model is quantized using QAT (quantization awareness). Quantization awareness training is to insert a pseudo-quantization module into the model to simulate the rounding and clamping operations performed by the quantization model during the inference process, thereby improving the model's adaptability to quantization effects during the training process and obtaining higher quantization model accuracy. In this process, all calculations (including model forward and backward propagation calculations and pseudo-quantization node calculations) are implemented in floating-point calculations, and are quantized to a true int8 model after training is completed. Before performing quantization-aware training, prepare the model and load the parameters of the pre-trained model, then use the API provided by PyTorch to configure QAT. Here, quant.get_default_qat_qconfig() is used to configure the quantization engine, and qnnpack is used as the backend. This is a quantization library optimized for mobile devices (such as mobile phones), which also supports low-precision operations and is optimized for different hardware platforms. Then use quant.prepare_qat() to convert the original model to quantization-aware mode and train the model again. After training is completed, convert the model to a quantized model. This step converts the weights and activation values of the floating-point model to low-precision int8. The quantized model significantly reduces the storage space of the model, and the computational complexity is also greatly reduced. It has been verified that the effect of the quantized model has not decreased compared to the pre-quantized model, and both evaluation indicators have reached the expected standards.
[0118] S32, the decoder part of the residual autoencoder model after clipping and quantization.
[0119] Furthermore, pruning techniques are used to further compress the model size. The decoder module is not needed in the subsequent forward reasoning process, so a class containing only the encoder module is redefined, which can be directly extracted in the residual autoencoder model. The size of the pruned model is compressed from 200M to 70M, reducing unnecessary neurons and weights, reducing the amount of model calculations, and shortening the reasoning time. The average prediction accuracy of the model deployed to the Android end is 98.9%, and the average reasoning time for each set of data is 0.125s, which is basically the same as the server-side performance. The effect is as follows Fig.10 shown.
[0120] S4. Input the target absorption coefficient curve into the optimized residual autoencoder model to generate the corresponding geometric parameter combination.
[0121] In a second aspect, an embodiment of the present invention proposes a resonator inverse design device based on a residual autoencoder method. Fig.11 Schematic diagram of the resonator inverse design device based on the residual autoencoder method, reference Fig.11 , the device comprises:
[0122] The data generation module 1101 is configured to generate a training data set based on an electroacoustic lumped analogy method and using a Helmholtz resonator as an absorber, wherein the training data set consists of different sets of geometric parameters and their corresponding absorption coefficients;
[0123] A model training module 1102 is configured to train a residual autoencoder model using the generated training data set, wherein the model includes an encoder and a decoder, wherein the encoder compresses the input data into a low-dimensional representation, and the decoder reconstructs the low-dimensional representation into the original data, and a residual connection is introduced into the model;
[0124] The model optimization module 1103 is configured to prune and quantize the trained residual autoencoder model;
[0125] The model inference module 1104 is configured to input the target absorption coefficient curve into the optimized residual autoencoder model to generate a corresponding geometric parameter combination.
[0126] This application uses lumped electroacoustic analogy to generate data, which can generate accurate training data sets without a large amount of experimental data. In addition, the model adopts an autoencoder architecture, which can learn the low-dimensional representation of data in an unsupervised learning manner. By compressing the input data into a low-dimensional implicit representation and then reconstructing it, the main features of the data can be effectively extracted. At the same time, the model also introduces residual connections based on the autoencoder, ensuring that in the back propagation process, the gradient not only depends on the chain rule, but can also be directly transmitted through jump connections, and more effectively transmits gradients to the early layers of the network, thereby alleviating the problem of gradient disappearance and explosion. Compared with traditional deep neural networks, the index performance and reasoning speed of the model have been greatly improved. The model is fused with operators and quantized perceptual training, the size of the model is compressed, and the decoder part is cut off. The model is compressed from 200M to 79M, and successfully deployed to the Android side for reasoning, and the performance is on par with the server side. It solves the problem that the previous model is prone to local optimality and overfitting, and at the same time greatly improves the computing efficiency, compresses the model volume, and can be flexibly deployed on multiple terminals with different performance to give full play to the hardware performance.
[0127] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.
Claims
1. A resonator inverse design method based on a residual autoencoder method, characterized in that: include: S1. Based on the electroacoustic lumped analogy method, a training data set is generated using a Helmholtz resonator as an absorber, wherein the training data set consists of different geometric parameter sets and their corresponding absorption coefficients; S2. Train a residual autoencoder model using the generated training data set, wherein the model includes an encoder and a decoder, wherein the encoder compresses the input data into a low-dimensional representation, and the decoder reconstructs the low-dimensional representation into the original data, and a residual connection is introduced into the model; S3, pruning and quantizing the trained residual autoencoder model; S4. Input the target absorption coefficient curve into the optimized residual autoencoder model to generate the corresponding geometric parameter combination.
2. The method according to claim 1, characterized in that Step S1 includes: S11, obtaining a physical model of the Helmholtz resonator, defining geometric parameters of the Helmholtz resonator, the geometric parameters including the neck radius r N , cavity radius r C 、Neck length l N and cavity length l C ; S12, converting the physical model into an equivalent electroacoustic representation, the total impedance Z of the equivalent electroacoustic representation HR Obtained by calculating the geometric parameters, and constructing the total impedance Z HR The characteristic relationship with the absorption coefficient α is expressed as Where z0 is the air impedance; S13, adjusting the geometric parameters, generating corresponding absorption coefficients according to the characteristic relationship, and forming a training data set with different geometric parameter sets and their corresponding absorption coefficients.
3. The method according to claim 2, characterized in that The total impedance in step S12 is calculated by the normalized ratio of acoustic resistance and the normalized ratio of resonator acoustic reactance, which is expressed as: Z HR =z0(R HR +jX HR ) Among them, R HR is the normalized ratio of acoustic impedance, X HR is the normalized ratio of the acoustic reactance of the resonator, z0 is the air impedance, and j is the imaginary part; The acoustic impedance normalized ratio R HR , expressed as Where η is the kinematic viscosity coefficient of air, ρ is the air density, ω is the angular frequency, ∈ T =S n / A0,S n is the cross-sectional area of the neck of the Helmholtz resonator, and A0 is the cross-sectional area of the cavity of the Helmholtz resonator; The normalized ratio of the resonator acoustic reactance to X HR , expressed as: Where k is the sound wave number, δ = 0.85 dh, l RC is the height of the modified cavity, l RC = l N +l C +∈ T (l N +1.7r N ).
4. The method according to claim 1, characterized in that: The training data in step S1 is verified by COMSOL finite element method simulation.
5. The method according to claim 4, characterized in that The COMSOL finite element method simulation verification includes: complex density and bulk modulus determined by the JCA model, representing the domain inside the neck of the Helmholtz resonator as an equivalent fluid, generating an absorption coefficient within a selected frequency range based on the Helmholtz equation, and the absorption coefficient corresponds to a set of any four geometric parameters; comparing and verifying the absorption coefficient generated by the Helmholtz equation with the absorption coefficient in the training data set; wherein the Helmholtz equation is expressed as: Among them, ρ is the air density, p is the sound pressure, and k is the sound wave number.
6. The method according to claim 1, characterized in that Step S2: The encoder maps the original input subsequence x to a latent space representation z, and the decoder reconstructs the output according to the latent space representation z. To match the measured response y, the encoder’s mapping f θ and the decoder mapping g θ Respectively expressed as: z=f θ (x)=s f (Wx+b w ) Where θ={Wx,b w },θ′={Vz,b v },s f represents the activation function, Wx and b W Denote the weight matrix and bias vector of the encoder, Vz and b respectively. V Represents the weight matrix and bias vector of the decoder; Wx, Vz, b W and b V The adjustment is performed based on a loss function, which is expressed as: Where N is the total number of data samples, α n,k and is the actual and predicted absorption coefficient, α n,k is the output of the decoder, n,j are the actual geometric parameters, is the predicted geometric parameters and the output of the encoder, m is the number of geometric parameters, p is the number of absorption coefficients, and β is a hyperparameter.
7. The method according to claim 1, characterized in that Step S3 includes: S31, performing operator fusion on the trained residual autoencoder model; S32, quantizing the residual autoencoder model after the operator fusion; S32, the decoder part of the residual autoencoder model after clipping and quantization.
8. The method according to claim 7, characterized in that Step S31 includes a fusion operator based on the PyTorch framework, which merges the multi-layer operations of the trained residual autoencoder model into one computing kernel.
9. The method according to claim 7, characterized in that: Step S32 includes quantizing the residual autoencoder model after operator fusion based on quantization perception, including preparing the residual autoencoder model and loading pre-trained model parameters; configuring the quantization engine using the API provided by PyTorch; converting the residual autoencoder model to a quantization perception mode and retraining it to obtain a quantized residual autoencoder model.
10. A resonator inverse design device based on a residual autoencoder method, characterized in that: include: A data generation module is configured to generate a training data set based on an electroacoustic lumped analogy method with a Helmholtz resonator as an absorber, wherein the training data set consists of different sets of geometric parameters and their corresponding absorption coefficients; A model training module is configured to train a residual autoencoder model using the generated training data set, wherein the model includes an encoder and a decoder, wherein the encoder compresses input data into a low-dimensional representation, and the decoder reconstructs the low-dimensional representation into original data, and a residual connection is introduced into the model; A model optimization module is configured to prune and quantize the trained residual autoencoder model; The model inference module is configured to input the target absorption coefficient curve into the optimized residual autoencoder model to generate a corresponding geometric parameter combination.