Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 14, No. 2, 2025 174 Deep Learning‐Based Magnetic Core Loss Prediction Using a Fully Connected Neural Network Wenqi Wang1, Donghao Yang1, Binkai Sun2, Zhenzhen Huang1, Xin Huang1, Jiayi Li2, Xiuqin Huang3 and Xinjian Wang1, * 1School of Physics and Electronic Engineering, Harbin Normal University, Harbin, China 2School of Chemistry and Chemical Engineering, Harbin Normal University, Harbin, China 3School of Business, Minnan Normal University, Zhangzhou, China *Corresponding author: Abstract: This paper proposes a core loss prediction model based on a fully connected neural network (FCNN). After pre- processing the data, seven key features are extracted, and feature importance is sorted. The excitation waveform features are converted into five variables and combined with four additional features to form the final input feature set. Based on this, the FCNN prediction model is constructed, the early stop method is used in the training process to prevent overfitting, and the generalization ability is evaluated using cross-validation[1]. The R2 of the model training set and the test set are 0.9889 and 0.9843, respectively, and the prediction error of 94.55% of the test samples is less than ±10%. FCNN shows higher accuracy and stability in core loss prediction tasks than traditional machine learning methods. Keywords: Core loss prediction, fully connected neural network, Random Forest, Model evaluation. 1. Introduction The Core loss is a key parameter of power electronic equipment, and its accurate prediction is very important for equipment design, optimization, and operation efficiency improvement[2]. The traditional core loss prediction methods are mainly based on empirical formulas and experimental data, but because the core loss is affected by many factors, these methods make it difficult to capture its complex nonlinear relationship, resulting in limited prediction accuracy. In recent years, with the development of machine learning technology, the data-driven magnetic core loss prediction method has been widely used. Deep learning methods, especially fully connected neural networks (FCNNS), have demonstrated remarkable capabilities in modeling complex nonlinear systems. In this paper, a magnetic core loss prediction model based on FCNN is proposed, and the feature selection is combined with random forest to improve the prediction accuracy and generalization ability. By comparing with traditional machine learning models (Random forest, XGBoost), we verify the effectiveness of this method and provide an efficient and scalable solution for core loss prediction. 2. Data Cleaning After data collection, data cleaning is usually required, including dealing with missing values, duplicate values, and outliers. For data that does not meet the quality requirements, delete or fill the policy to improve the accuracy and reliability of the data. Through data analysis, it is found that there are discrete and continuous data in the data set, and the data amplitude changes greatly. Based on this characteristic, we first cleaned the data. First of all, the data is distributed and processed. Here, the distribution diagram of the magnetic core loss data is used for preliminary observation: Figure 1. Core loss distribution diagram 175 The data presents a skewed distribution and contains more extreme values. In order to further identify outliers and abnormal data, this paper uses the boxplot method to divide the data set into four quartiles to evaluate the variability. As a commonly used statistical graph, boxplot is used to describe the distribution characteristics of data, especially the central position, the degree of dispersion, and the outlier of the data[3]. First, sort the entire data in ascending order, then divide it into four equal quartiles, called Q1, Q2, Q3, and Q4, where Q1 and Q3 are the first and third quartiles of the dataset, and IQR is the interquartile. At the same time, it is specified that points other than Q1 and Q3 are distribution outliers, and the results of the boxplot are shown in Figure 2: Figure 2. Core loss box diagram It can be found that there are a lot of outliers in the data, and combined with the skewed distribution, these outliers have certain experimental significance. To prevent the data features of magnetic core loss from being damaged, this paper chooses the value with the largest outlier degree at the top as the outlier value, while the data near the box type is retained. 3. Feature Importance Sorting and Screening Based on Random Forest 3.1. Feature selection and data processing Before establishing the core loss prediction model, the feature selection is needed first. To improve the prediction ability of the model, we extracted seven waveform features, including standard deviation, skewness, amplitude, kurtosis, turning point, mean value, and spectral center[4]. Due to the large number of data features, to reduce redundancy, we use random forest to sort and screen the importance of features. Random Forest improves model accuracy and robustness by building multiple decision trees trained on different subsamples and randomly selected features. It calculates feature importance scores for dimensionality reduction and feature selection. Among the seven features—mean, standard deviation, skewness, amplitude, spectral center, kurtosis, and number of turning points—the top three most important features can be selected using Random Forest. Importance rating and ranking are shown in Figure 3 below: Figure 3. Feature importance ranking 176 As seen from the figure, the feature importance ranking is: number of turning points > kurtosis > skewness > standard deviation > amplitude > mean = spectrum center. To simplify the model, improve interpretability, and prevent overfitting, we eliminated the mean value and spectrum center and replaced waveform features with residual features. For a universal prediction model across different material types and temperatures, we included material type, excitation wave frequency, peak value, and temperature, finally selecting nine features as inputs. For material characteristics, we used one- hot encoding to convert categorical variables into numerical representations, avoiding issues with integer encoding. 4. Establishment of Core Loss Prediction Model Based on FCNN In order to construct a fully connected neural network (FCNN) core loss prediction model, we use data with nine features to model. FCNN is a classical neural network architecture, which consists of an input layer (nine neurons corresponding to independent variables such as frequency, peak value, and temperature), one or more hidden layers, and an output layer (one neuron corresponding to the predicted value of core loss). Its basic principles include linear transformation, nonlinear activation function, and backpropagation training algorithm. Given the large amount of data, numerous influencing variables, and complex nonlinear relationships in this study, we adopted the FCNN structure containing three hidden layers, with the number of neurons being 64, 32, and 64 [5], respectively, as shown in Figure 4. This configuration avoids overfitting while maintaining the complexity of the model, helping to capture important features in the data. Figure 4. Network structure The specific training process is: 1. Enter layer to hide layer 1 1.1 Linear transformation 1 1 (1)bz W x  () () Among them, (1)W for the weight matrix, each weight representation input feature jx to what extent it affects the I- hidden neuron, The shape is (n1,9), which is the input vector of 9 influence features such as frequency, peak value and temperature, and the shape is (9,1), (1)b is a bias vector of shape (n1,1). 1.2 Nonlinear activation: For this task, we chose the ReLU activation function to introduce nonlinearities: 1 (1)max(0, )a z() Make sure only when linear combinations are available when it is positive neurons will be activated. This task reflects the influence of certain feature combinations on loss under specific conditions. 2. Hide layers 1 to 2 3. Hide layers 2 to Hide layers 3 The principle is the same as above; both are linear transformation and nonlinear activation processes. The second layer of neurons combines the output of the first layer, and the third layer of neurons combines the output of the second layer to extract higher-level features, which is the key to capturing complex nonlinear relationships. 4. Hide layer 3 to the output layer 4.1 Linear Transformation (3) (3) (2) (3)z W a b   Among them (3)W is a weight matrix of shape (1,n2) that maps the output of hidden layer 3 to the output layer. 4.2 Output (3)ŷ z The output is a predicted value of the core loss directly related to the previous feature combination. 5. Calculate the loss function and backpropagation 5.1 Calculate losses using mean square error (MSE) : 2 1 1 n i i L y n    The loss function quantifies the gap between the loss predicted by the model and the actual loss to improve the prediction accuracy by minimizing it. 5.2 Back Propagation Backpropagation calculates the gradient of each layer by the chain rule: (3) (3) L L y w y w         177 Update weights and bias: ( ) ( ) ( ) l l l L w w w     This process adjusts the weights according to the sensitivity of the losses to each weight, ensuring that the model can predict more accurately. After repeated backpropagation and weight updating, the model can learn the complex nonlinear relationship between the independent variable and the dependent variable. 5. Acknowledgements Because the numerical scale of magnetic core loss varies greatly, direct training may cause the model to be difficult to converge. Therefore, we input the model training after normalizing the independent variables and dependent variables and reverse normalize the model output results in the prediction stage to restore the original value range for comparison with real data or practical application. Because the numerical scale of magnetic core loss varies greatly, direct training may cause the model to be difficult to converge. Therefore, we input the model training after normalizing the independent variables and dependent variables and reverse normalize the model output results in the prediction stage to restore the original value range for comparison with real data or practical application[6]. After 300 rounds of training, the loss of the model on the normalized data tends to stabilize and converges to 0.0113, where the training sets and the test set are . The results show that the model has high prediction accuracy, and the results of the test set further verify its good generalization ability[7]. The experimental results show that the training loss gradually decreases with the increase in the number of iterations and finally stabilizes at around 0.0113 (Figure 5. (A)). In the test set, we drew a comparison graph between the real value and the predicted value and marked the error interval of ±10% (Figure 5. (B)). The results show that 94.55% of the predicted values fall within the error range, which indicates that FCNN can accurately predict the core loss and has good generalization ability. A. Training loss changes with the number of iterations B. Graph comparing the true value with the predicted value Figure 5. Iterative loss versus prediction graph Due to the large range and fluctuation of core loss, MSE, RMSE, and MAPE as evaluation indexes may not be enough to fully reflect the model performance. Therefore, we further calculated the symmetric mean absolute percentage error (SMAPE), which measures the relative error between the predicted value and the true value. SMAPE is more robust when processing data with large fluctuations or extreme values, and it has symmetry, which can balance the impact of predicted value and actual value on the error to avoid the traditional error index being too sensitive to extreme value data. The calculation formula is: Where is the actual value, is the predicted value, and is the total number of samples. In this model training, test set. The results show that both the training set and the test set have excellent prediction accuracy and generalization ability. To analyze the model's losses, we visualized the residuals using scatter plots, histograms, and boxplots (Figure 6). The scatter plot shows that residuals are mostly concentrated around low predicted values, with no obvious systematic bias or nonlinear trends, indicating stable model fitting without significant underfitting or overfitting. The histogram reveals a roughly normal distribution of residuals centered around zero, suggesting small overall prediction errors and good model performance. The boxplot further confirms this, with a median close to zero and a small interquartile range, indicating accurate predictions for most samples and no significant bias. In summary, our model has a good residual distribution, small prediction errors, and meets the normality assumption, demonstrating strong fitting ability. A few outliers do not significantly impact the overall model performance. 2 0.9889R  2 0.9843R  1 ˆ| |100% SMAPE ˆ| | | | 2 n i i i ii y y y yn     i ˆiy n 178 Figure 6. Residual diagram To further test the excellence of the core loss prediction model we built, we selected the traditional machine learning algorithm to build the model as a comparison. Fig. 7 shows the visual results of the real value and predicted value of random Forest and XGBoost, 79.26% and 80.87% of the data fall within the ±10% error line, respectively. The prediction effect and generalization ability are worse than the FCNN loss prediction model. A. Random forest prediction map B. XGboost prediction graph Figure 7. Neural network prediction graph The detailed evaluation index comparison is shown in Figure 8. Through the comparison of multiple machine learning models, it can be found that the general core loss prediction model built by us based on FCNN is higher than the traditional machine learning model in terms of prediction accuracy and generalization ability. Figure 8. Comparison diagram of model indicators 6. Conclusion In this study, a magnetic core loss prediction model based on a fully connected neural network (FCNN) was constructed, and the prediction accuracy and generalization ability of the model were improved through data preprocessing, feature extraction, and optimization training process. The experimental results show that FCNN has better prediction performance than the traditional random forest and XGBoost models. In the test set, 94.55% of the sample prediction error is less than ±10%, indicating that the model can effectively capture the complex nonlinear characteristics of the core loss. The results show that this method can provide reliable support for the design and optimization of power electronic equipment and has a wide range of engineering applications. References [1] H. Sun, L. Yu and J. Katto, "Fully Neural Network Mode Based Intra Prediction of Variable Block Size," 2020 IEEE International Conference on Visual Communications and Image Processing (VCIP), Macau, China, 2020, pp. 21-24 179 [2] Z. Li, W. Han, Z. Xin, Q. Liu, J. Chen and P. C. Loh, "A Review of Magnetic Core Materials, Core Loss Modeling and Measurements in High-Power High-Frequency Transformers," in CPSS Transactions on Power Electronics and Applications, vol. 7, no. 4, pp. 359-373, December 2022 [3] L. A. Demidova and A. A. Misailidi, "Algorithm for Detecting Anomalous Student Activities in the Online Learning Process Based on Box Plots," 2023 5th International Conference on Control Systems, Mathematical Modeling, Automation and Energy Efficiency (SUMMA), Lipetsk, Russian Federation, 2023, pp. 309-314, [4] S. Khalid, T. Khalil, and S. Nasreen, "A survey of feature selection and feature extraction techniques in machine learning," 2014 Science and Information Conference, London, UK, 2014, pp. 372-378 [5] K. Z. Mao and Guang-Bin Huang, "Neuron selection for RBF neural network classifier based on data structure preserving criterion," in IEEE Transactions on Neural Networks, vol. 16, no. 6, pp. 1531-1540, Nov. 2005 [6] M. Kolarik, R. Burget, and K. Riha, "Comparing Normalization Methods for Limited Batch Size Segmentation Neural Networks," 2020 43rd International Conference on Telecommunications and Signal Processing (TSP), Milan, Italy, 2020, pp. 677-680 [7] Z. Zhang and X. Zhang, "A Review of Research on Generalization Error Analysis of Deep Learning Models," 2023 International Conference on Image Processing, Computer Vision and Machine Learning (ICICML), Chengdu, China, 2023, pp. 906-912.