## 4 Results and Discussion  
### Training of the Proposed ANN  
We processed the simulation data from the filters, yielding a total of 118,698 pairs of design-frequency-S parameter data. These pairs were randomly assorted, with 80% (94,958 pairs) designated as the training dataset and the remaining 20% (23,740 pairs) as the testing dataset. The artificial neural network (ANN) was trained over 200 epochs using a learning rate of \(1\times 10^{-3}\). Furthermore, we implemented a decay of the learning rate by a factor of 0.9 every five epochs. The ANN's training outcomes are depicted in Figure 5a. To more effectively demonstrate the fluctuations in the loss function and accuracy during the later stages of training, we selected the range of 0 to 5 for the loss function and 96.5% to 100% for the accuracy. Observing the variations in the loss function and accuracy curves throughout the training process, it is evident that the neural network model converged to a low error level in a relatively brief period, and the trend progressively stabilized. The error converged to 0.4507, with an accuracy of 99.76% on the training set. On the testing set, the accuracy ultimately stabilized at 99.4%, with no significant overfitting detected.  
We selected a test group to compare the prediction results of the ANN model with the simulation results of the EM. As shown in Figure 5b, it was found that the predictions of the ANN model highly conformed to the actual EM simulation results, accurately predicting the changing trends of S11 and S21. This suggests that the ANN model can replace the EM simulation software in predicting the electrical performance of the card filter in our experiments.  
Figure 5: (**a**) The training process of the neural network model in terms of loss and accuracy. (**b**) The predictions of the neural network model for the design of the hairpin filter and the validation results through the HFSS simulation. (**c**) The absolute error of the neural network model in predicting S11. (**d**) The absolute error of the neural network model in predicting S21.  
We further scrutinized the absolute error distribution of the ANN model. The absolute error distributions for S11 and S21 are depicted in Figure 5c,d, respectively. In both distributions (with the vertical axis employing a logarithmic scale), there are 19,186 data points for S11 with errors predominantly under 0.2, representing approximately 80.82% of the entire testing dataset. Within these, 95.0% of the data exhibit absolute errors less than 1, and the fraction of data pairs with absolute errors less than 3 reaches as high as 97.96%. For S21, around 75.88% of the data display errors less than 0.5, while 91.27% of the data possess prediction errors within 1. This suggests that the ANN model has effectively assimilated the nonlinear relationship between geometric dimensions and electrical behavior. As depicted in Figure 5b, the ANN model demonstrates excellent consistency with the actual simulation results, mirroring the frequency response characteristics of the designed filter. Consequently, we can infer that the established ANN model is aptly suited for predicting the behavior of the hairpin filter and can supersede the electromagnetic simulation kernel in predicting the electrical behavior of the hairpin filter.