Methods, devices, electronic equipment, and storage media for establishing hysteresis loop prediction models
By improving the convolutional neural network and combining it with the K-nearest neighbor algorithm, the problems of parameter identification accuracy and computational resource consumption in the hysteresis loop prediction model were solved, and fast and accurate hysteresis loop prediction was achieved.
Patent Information
- Application Number
- CN202411677212.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing hysteresis loop prediction models are insufficient in terms of parameter identification accuracy and efficiency. Traditional neural network models are prone to overfitting and consume high computational resources, making it difficult to iterate and adjust quickly in practical applications.
An improved convolutional neural network combined with the K-nearest neighbor algorithm was used. The model structure was optimized through data standardization, dropout layer and backpropagation algorithm, and adjusted with the K-nearest neighbor algorithm to construct a hysteresis loop prediction model.
It effectively prevents overfitting, improves model generalization ability, reduces computational complexity and resource consumption, and enables rapid iteration and improved accuracy.
Smart Images

Figure CN119670538B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of magnetic materials technology, specifically to a method, apparatus, electronic device, and storage medium for establishing a hysteresis loop prediction model. Background Technology
[0002] Electrical steel sheets are widely used in various electrical equipment such as transformers and motors, playing a vital role in electrical engineering and equipment. However, as an easily magnetized ferromagnetic material, electrical steel sheets possess unique hysteresis characteristics, which are particularly important when modeling electrical equipment containing a large amount of ferromagnetic material. Hysteresis loop prediction models can effectively characterize the actual magnetization characteristics and losses of ferromagnetic materials. Accurate construction of hysteresis loop prediction models for ferromagnetic materials is of great significance for the design precision and operational safety of electrical equipment.
[0003] Currently, the main models for simulating the hysteresis characteristics of soft magnetic materials are the Preisach model and the Jiles-Atherton (JA) model. The Preisach model, based on macroscopic magnetization theory, is a purely mathematical model. However, the classical Preisach model has some limitations in practical applications. It only considers the irreversible component of hysteresis, neglecting the actual reversible component and its interaction with the applied magnetic field. This results in limited accuracy of the classical Preisach model for most magnetic materials and application conditions. Since its introduction in 1984, the JA model has become the most commonly used hysteresis loop prediction model due to its high computational efficiency and clear physical meaning. However, the accuracy of hysteresis modeling in the JA model is determined by five parameters. Therefore, it is crucial to accurately and efficiently identify these parameters. However, current parameter fitting methods often rely on experimentally obtained hysteresis loops and determine parameters by analyzing special points (such as coercivity and remanent magnetization). This often results in low accuracy and efficiency in parameter identification. Alternatively, optimization algorithms, such as particle swarm optimization and genetic algorithms, are used for parameter identification. Although these algorithms improve the efficiency of parameter extraction to some extent, they often have slow convergence speeds and are prone to getting trapped in local optima, thus affecting the accurate and rapid identification of JA model parameters.
[0004] The magnetization mechanism of ferromagnetic materials is highly complex, involving the movement of magnetic domains and incorporating various energy forms, including exchange energy, external field energy, and anisotropic properties. Traditional hysteresis loop prediction models rely primarily on mathematical tools, making it difficult to accurately describe the magnetization process. In contrast, neural network algorithms excel at modeling black-box systems with unclear physical mechanisms. Therefore, many researchers have begun to utilize neural network techniques to construct hysteresis loop prediction models.
[0005] In hysteresis modeling research, many scholars have successfully applied neural networks. Some researchers have used Long Short-Term Memory (LSTM) networks to establish hysteresis loop prediction models for materials. By learning magnetization characteristics from time-series data, they have effectively captured the dynamic hysteresis properties of materials. However, the training time for these models can be several hours, which is quite long. Therefore, although neural networks have shown potential in hysteresis property modeling, they still face the following challenges in practical applications:
[0006] Overfitting is a common problem in neural network model building, leading to poor performance on test data. Overfitting can stem from the complexity of the network structure and noise in the training data, requiring researchers to employ effective regularization strategies during model design and training.
[0007] Complexity of structural design: Neural network structure design is complex. Choosing a suitable network structure is the key to neural network modeling. The selection of hyperparameters such as the number of network layers, number of nodes, and activation functions directly affects the model performance.
[0008] Training time and resources: Training a neural network can require significant computational resources and time, especially when dealing with large-scale datasets, where computational efficiency becomes a critical issue. This may limit its application in resource-constrained environments. Summary of the Invention
[0009] To address the shortcomings of existing technologies, the present invention aims to provide a method, apparatus, electronic device, and storage medium for establishing a hysteresis loop prediction model. The method, based on an improved convolutional neural network combined with the K-nearest neighbor algorithm, prevents overfitting, offers faster training speeds and lower resource consumption, and facilitates rapid iteration and adjustment in practical applications. By incorporating the K-nearest neighbor algorithm, the model not only achieves excellent performance in the feature extraction stage but can also be adjusted using a simple and effective K-nearest neighbor method during the final model establishment. Therefore, the model can better adapt to data distributions, further improving its accuracy.
[0010] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0011] A method for establishing a hysteresis loop prediction model includes the following steps:
[0012] Hysteresis characteristic experiments were conducted on ferromagnetic materials. Hysteresis loop correlation characteristics were set under preset sinusoidal excitation at different magnetic induction intensity peak values. The hysteresis loop correlation characteristics include magnetic induction intensity waveform data and magnetic field waveform data.
[0013] A hysteresis loop prediction model was established, comprising an improved convolutional neural network model and a K-nearest neighbor algorithm model. The improved convolutional neural network model was used for data training, with the input being the peak value and waveform data of magnetic induction intensity, and the output being the magnetic field waveform data, resulting in a trained improved convolutional neural network model. Feature data obtained from the trained improved convolutional neural network model was acquired, and the target value was set as the magnetic field waveform data. The improved convolutional neural network model was then used to adjust the magnetic field waveform data based on the feature data to obtain the final magnetic field waveform result.
[0014] Furthermore, the peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data were all standardized, and the standardized peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data were used for training in the improved convolutional neural network.
[0015] Furthermore, the method for standardizing the data of magnetic induction intensity peak, magnetic field intensity waveform, and magnetic field waveform is as follows:
[0016] The peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data obtained from the hysteresis characteristic experiment are arranged in columns. Each column of data is converted to the same scale using the Standard Scaler normalization method. Each data point is designated as a feature value, and the formula for standardizing each feature value is as follows:
[0017]
[0018] Where X is the eigenvalue, μ is the mean of each column of eigenvalues, and σ is the standard deviation of each column of eigenvalues. scaled This refers to standardized magnetic field strength waveforms or magnetic field waveform data.
[0019] Furthermore, the improved convolutional neural network model includes convolutional layers, pooling layers, flattening layers, a first fully connected layer, a Dropout layer, a second fully connected layer, and an output layer, wherein...
[0020] The convolutional layer uses 32 convolutional kernels to generate 32 feature maps. Each kernel is 1 row and 2 columns in size. The linear unit is modified as the activation function using formula (2) to introduce non-linear characteristics. Formula (2) is as follows:
[0021] f(x) = max(0, x) (2)
[0022] Where x represents the activation value received by the neuron. When the input x > 0, the output is x, and when the input x ≤ 0, the output is 0.
[0023] The pooling layer is used for downsampling, and the pooling layer window size is 1 row and 1 column.
[0024] The flattening layer is used to convert multidimensional input data into one-dimensional data for input into the first fully connected layer;
[0025] The first fully connected layer has 64 neurons and uses ReLU as the activation function;
[0026] The dropout rate for the Dropout layer is 40%–60%;
[0027] The second fully connected layer contains one neuron.
[0028] Furthermore, in the training process of the improved convolutional neural network model, the parameters are adaptively adjusted according to the current prediction error in each iteration through the backpropagation algorithm, and the loss function adopts the mean squared error.
[0029] Furthermore, the K-nearest neighbor algorithm model is used to adjust the magnetic field strength waveform results, and the method for outputting the final magnetic field strength waveform results is as follows:
[0030] The sample to be predicted is set as the magnetic field strength waveform result. For each sample to be predicted, the K-nearest neighbor algorithm uses Euclidean distance to calculate the distance between the sample to be predicted and all samples in the training set.
[0031] Based on the calculated distance, find the K nearest neighbor samples to the sample to be predicted;
[0032] The K nearest neighbor algorithm model is used to extract K target values corresponding to K nearest neighbor samples. The mean of the K target values is calculated to generate the final predicted value, which is then used as the final magnetic field waveform result.
[0033] Furthermore, a 5-fold cross-validation is added to the K-nearest neighbor algorithm. The dataset of magnetic field strength waveform results is divided into 5 subsets. Each time, 1 subset is selected as the validation set and the other 4 subsets are used as the training set. The training set is used for training and the results are evaluated on the test set.
[0034] In cross-validation, the mean square error for each fold is calculated as shown in formula (6);
[0035]
[0036] Where, m i y is the number of samples in the i-th fold. ij It is the true value of the i-th fold. It is the predicted value for the i-th fold.
[0037] A device for establishing a hysteresis loop prediction model, comprising:
[0038] The data acquisition module is used to conduct hysteresis characteristic experiments on ferromagnetic materials, and to set the hysteresis loop correlation characteristics under a preset sinusoidal excitation at different magnetic induction intensity peaks. The hysteresis loop correlation characteristics include magnetic induction intensity waveform data and magnetic field waveform data.
[0039] The model building module is used to establish a hysteresis loop prediction model, which includes an improved convolutional neural network model and a K-nearest neighbor algorithm model. The improved convolutional neural network model is used for data training, with the input being the peak value of magnetic induction intensity and the waveform data of magnetic induction intensity, and the output being the magnetic field waveform data, resulting in a trained improved convolutional neural network model. The feature data obtained from the trained improved convolutional neural network model is then acquired, and the target value is set as the magnetic field waveform data. The K-nearest neighbor algorithm model is used to adjust the magnetic field waveform data based on the feature data to obtain the final magnetic field waveform result.
[0040] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method for establishing a hysteresis loop prediction model.
[0041] A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described method for establishing a hysteresis loop prediction model.
[0042] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0043] To prevent overfitting, the hysteresis loop prediction model establishment method in this invention adds a Dropout layer to the traditional convolutional neural network. By randomly discarding a portion of neurons, the dependence of the improved convolutional neural network model on specific training data is reduced, improving the model's generalization ability and making it more robust when handling new and unseen data. The improved convolutional neural network model adopts a six-layer structure, which maintains the model's flexibility while significantly reducing computational complexity. This design allows for faster training, lower resource consumption, and facilitates rapid iteration and adjustment in practical applications. Combined with the K-nearest neighbor algorithm, the improved convolutional neural network model not only achieves excellent performance in the feature extraction stage but can also be adjusted using the simple and effective K-nearest neighbor method in the final hysteresis loop prediction model establishment. Therefore, the hysteresis loop prediction model can better adapt to data distribution, further improving its accuracy. Attached Figure Description
[0044] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments of the invention and, together with the specification, further serve to explain the principles of the invention and to enable those skilled in the art to make and use this disclosure.
[0045] Figure 1 This is a flowchart of the method for establishing the hysteresis loop prediction model of the present invention;
[0046] Figure 2 This is a flowchart of the method for establishing a hysteresis loop prediction model according to a specific embodiment of the present invention;
[0047] Figure 3 This is a schematic diagram of the structure of the improved convolutional neural network model provided in an embodiment of the present invention;
[0048] Figure 4 A comparison of the hysteresis loop prediction model establishment method provided in this embodiment of the invention with the simulation of hysteresis characteristics by a traditional convolutional neural network at Bm = 1.7T;
[0049] Figure 5 This is a schematic diagram of the device for establishing the hysteresis loop prediction model of the present invention. Detailed Implementation
[0050] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0051] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0052] Example 1
[0053] Example 1 provides a method for establishing a hysteresis loop prediction model, such as... Figure 1 and Figure 2 As shown, it includes the following steps:
[0054] Step S1: Conduct hysteresis characteristic experiments on ferromagnetic materials, and set the hysteresis loop correlation characteristics under preset sinusoidal excitation at different magnetic induction intensity peak values. The hysteresis loop correlation characteristics include magnetic induction intensity waveform data and magnetic field waveform data.
[0055] Step S2: Establish a hysteresis loop prediction model, which includes an improved convolutional neural network model and a K-nearest neighbor algorithm model. The improved convolutional neural network model is used for data training. The input is the peak value of magnetic induction intensity and the waveform data of magnetic induction intensity, and the output is the magnetic field waveform data, resulting in a trained improved convolutional neural network model. The feature data obtained from the trained improved convolutional neural network model is acquired, and the target value is set as the magnetic field waveform data. The K-nearest neighbor algorithm model is used to adjust the magnetic field waveform data based on the feature data to obtain the final magnetic field waveform result.
[0056] This embodiment provides a method for establishing a hysteresis loop prediction model. Based on an improved convolutional neural network model combined with the K-nearest neighbor algorithm, this method prevents overfitting, offers faster training speeds and lower resource consumption, and facilitates rapid iteration and adjustment in practical applications. By incorporating the K-nearest neighbor algorithm, the model not only achieves excellent performance in the feature extraction stage but can also be adjusted using a simple and effective K-nearest neighbor method during the final model establishment. Therefore, the model can better adapt to data distributions, further improving its accuracy.
[0057] In this embodiment, the peak magnetic induction intensity, the waveform data of magnetic induction intensity, and the waveform data of magnetic field are all standardized. The standardized peak magnetic induction intensity, the waveform data of magnetic field, and the waveform data of magnetic field are used for training in the improved convolutional neural network.
[0058] In this embodiment, the method for standardizing the data of magnetic induction intensity peak, magnetic field intensity waveform, and magnetic field waveform is as follows:
[0059] The peak magnetic flux density, waveform data, and magnetic field waveform data obtained from the hysteresis characteristic experiment are arranged in columns. Each column of data is converted to the same scale using the Standard Scaler normalization method. Each data point is designated as a feature value, and the formula for standardizing each feature value is as follows:
[0060]
[0061] Where X is the eigenvalue, μ is the mean of each column of eigenvalues, and σ is the standard deviation of each column of eigenvalues. scaled Standardized magnetic induction intensity waveform data or magnetic field waveform data.
[0062] In step S2 of this embodiment, as follows Figure 3As shown, the improved convolutional neural network model includes a convolutional layer, a pooling layer, a flattening layer, a first fully connected layer, a dropout layer, a second fully connected layer, and an output layer. This embodiment designs an improved convolutional neural network model by adding a dropout layer to the traditional convolutional neural network, constructing an improved convolutional neural network with a six-layer structure including one convolutional layer, one pooling layer, one flattening layer, two fully connected layers, and one dropout layer. The improved convolutional neural network model has a simple structure, containing one convolutional layer and one pooling layer, specifically used to extract effective features from the input data. In the establishment of the hysteresis loop prediction model, the convolutional layer can automatically identify local patterns and structures in the data through the sliding window technique, while the pooling layer reduces the feature dimension through downsampling, retaining the most significant information. This feature extraction capability helps the hysteresis loop prediction model capture the complex relationship between the peak value of magnetic induction intensity and the waveform data of magnetic induction intensity. Adding a dropout layer to the network structure randomly "drops" a certain proportion of neurons, effectively reducing the complexity of the hysteresis loop prediction model and the risk of overfitting. This allows the hysteresis loop prediction model to learn more robust feature representations during training, rather than relying on a specific neuron, thereby improving the generalization ability of the hysteresis loop prediction model and ensuring its stability.
[0063] In this embodiment, the convolutional layer uses 32 convolutional kernels to perform convolution operations on the input magnetic flux density peak and magnetic flux density waveform data to capture different feature patterns and generate 32 feature maps. The size of each convolutional kernel is 1 row and 2 columns. Formula (2) is used to modify the linear unit as the activation function to introduce nonlinear characteristics and enhance the expressive power of the model. Formula (2) is:
[0064] f(x) = max(0, x) (2)
[0065] Where x represents the activation value received by the neuron. When the input x > 0, the output is x, and when the input x ≤ 0, the output is 0.
[0066] Pooling layers are used for downsampling to reduce the dimensionality of data and computational complexity. The pooling layer window size is 1 row and 1 column.
[0067] The flattening layer is used to convert multidimensional input data into one-dimensional data for input into the first fully connected layer;
[0068] The first fully connected layer has 64 neurons and uses ReLU as the activation function to improve the non-linear expressive power of the model.
[0069] The dropout rate of the Dropout layer is 40%–60%. In this specific implementation, the dropout rate is 50%. The Dropout layer is used to reduce the risk of overfitting. During training, 50% of neurons are randomly ignored to enhance the model's generalization ability.
[0070] The second fully connected layer contains one neuron that outputs a value, which serves as the model's prediction of the magnetic field waveform data.
[0071] In this embodiment, during the training of the improved convolutional neural network model, the backpropagation algorithm is used to adaptively adjust the parameters based on the current prediction error in each iteration, and the mean squared error is used as the loss function. During training, the backpropagation algorithm accelerates the learning of important features in the data by the hysteresis loop prediction model, thereby continuously optimizing performance and gradually bringing the prediction results closer to the true values. The process of minimizing the loss function will enable the model to learn important patterns in the data.
[0072] The loss function used in this invention is the mean square error shown in formula (3).
[0073]
[0074] Among them, y i This is the actual value. is the predicted value, n is the number of samples, and i is the index of the i-th sample.
[0075] In this embodiment, to improve the accuracy of the hysteresis loop prediction model, an improved convolutional neural network model and a K-nearest neighbor algorithm model are combined to precisely adjust the hysteresis loop prediction model.
[0076] The training dataset for the K-Nearest Neighbors algorithm uses features extracted from an improved convolutional neural network model, with the target value being magnetic field waveform data. After training, new magnetic flux density peak values and magnetic flux density waveform data are input into the hysteresis loop prediction model to predict the magnetic field waveform data, thus obtaining the final magnetic field waveform result.
[0077] In this embodiment, the K-nearest neighbor algorithm model is used to adjust the magnetic field strength waveform results, and the method for outputting the final magnetic field strength waveform results is as follows:
[0078] The sample to be predicted is set as the magnetic field strength waveform result. For each sample to be predicted, the K-nearest neighbor algorithm uses Euclidean distance to calculate the distance between the sample to be predicted and all samples in the training set.
[0079] Based on the calculated distance, find the K nearest neighbor samples to the sample to be predicted;
[0080] The K nearest neighbor algorithm model is used to extract K target values corresponding to K nearest neighbor samples. The mean of the K target values is calculated to generate the final predicted value, which is then used as the final magnetic field waveform result.
[0081] In this embodiment, for each sample to be predicted, the K-nearest neighbor algorithm uses Euclidean distance (4) to calculate the distance between the sample to be predicted and all samples in the training set.
[0082]
[0083] d(x, x) i ) is the input sample to be predicted, x and x'. i The Euclidean distance between training samples, where n is the number of features in the samples, and x j and x ij These are the values of the input sample to be predicted and the training sample on the j-th feature, respectively.
[0084] The K nearest neighbor algorithm model is used to extract the K target values corresponding to the K nearest neighbor samples. The final predicted value is generated by calculating the mean of the K target values. The calculation formula is shown in formula (5).
[0085]
[0086] in, This is the final predicted value, y i It is the actual target value of the K nearest neighbor samples.
[0087] In this embodiment, three nearest neighbor samples and K target values corresponding to the three nearest neighbor samples are extracted.
[0088] In this embodiment, a 5-fold cross-validation is added to the K-nearest neighbor algorithm. The dataset is divided into 5 subsets. Each time, one subset is selected as the validation set, and the remaining 4 subsets are used as the training set. The model is trained and evaluated on the test set.
[0089] In cross-validation, the mean squared error for each fold is calculated as shown in formula (6).
[0090]
[0091] Where, m i y is the number of samples in the i-th fold. ij It is the true value of the i-th fold. is the predicted value of the i-th fold, and j is the index of the j-th sample in the validation set.
[0092] The following detailed explanation of the method for establishing a hysteresis loop prediction model is provided through a specific embodiment.
[0093] Data preprocessing: In this stage, data collection is carried out first. Hysteresis characteristic experiments are conducted on 23RK85 silicon steel sheets to obtain experimental data. The data includes the relevant characteristics of the hysteresis loop under 50Hz sinusoidal excitation with different magnetic induction intensity peak values Bm, including magnetic induction intensity waveform data B and magnetic field waveform data H.
[0094] The data is normalized by using the StandardScaler normalization method to convert the peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data to the same scale.
[0095] After data preprocessing, the data dimensions of the magnetic induction intensity peak, magnetic field intensity waveform, and magnetic field waveform data are converted into a four-dimensional feature matrix that can be input into a convolutional neural network.
[0096] The peak magnetic flux density Bm and the magnetic flux density waveform data B are used as inputs to the improved convolutional neural network model, and the magnetic field waveform data H is used as the output of the improved convolutional neural network model.
[0097] In the improved convolutional neural network model, a dataset of magnetic induction intensity peak, magnetic field intensity waveform, and magnetic field waveform data was established. 80% of the data in the dataset was used as the training set, and 20% of the data was used as the test set. The matrix of the training set was (0.8n, 1, 2, 1), and the matrix of the test set was (0.2n, 1, 2, 1), where n is the total number of samples. Each sample contains 1 channel, 2 features, and the depth of each feature map is 1.
[0098] During training, the model parameters are continuously adjusted using the backpropagation algorithm, with the mean squared error used as the loss function.
[0099] The K-nearest neighbor algorithm model is used to adjust the magnetic field strength waveform results, and the final magnetic field strength waveform results are output.
[0100] Add 5-fold cross-validation to the K-nearest neighbor algorithm model.
[0101] After multiple verifications, the hysteresis loop prediction model can better generalize to unseen data, reducing the risk of overfitting.
[0102] The hysteresis loop prediction model constructed by this invention based on an improved convolutional neural network model combined with the K-nearest neighbor algorithm model is compared with the hysteresis loop prediction model constructed by a traditional convolutional neural network. The traditional convolutional neural network used in the comparison includes a six-layer structure: two convolutional layers, two pooling layers, one flattening layer, and one fully connected layer.
[0103] The comparison results are shown in Table 1;
[0104] Table 1. Comparison of traditional convolutional neural network models and hysteresis loop prediction models constructed based on improved convolutional neural network models combined with the K-nearest neighbor algorithm.
[0105] algorithm Training set mean square error Test set mean square error Total time Traditional convolutional neural networks 0.0068614 0.0291109 3.54 seconds Improved Convolutional Neural Network - K Nearest Neighbors Algorithm 0.0003609 0.0011165 2.62 seconds
[0106] As shown in Table 1, the hysteresis loop prediction model constructed by this invention based on an improved convolutional neural network model combined with the K-nearest neighbor algorithm has a mean squared error of 0.0003609 on the training set and 0.0011165 on the test set, with a total processing time of 2.62 seconds. The mean squared error of the traditional convolutional neural network is 0.0068614 on the training set and 0.0291109 on the test set, with a total processing time of 3.54 seconds.
[0107] The hysteresis characteristics at a peak magnetic flux density Bm = 1.7 were simulated. Figure 4 It is evident that the hysteresis loop prediction model constructed by this invention, based on an improved convolutional neural network model combined with the K-nearest neighbor algorithm, is more closely aligned with actual test data compared to the hysteresis loop prediction model constructed using traditional convolutional neural networks. The hysteresis loop prediction model constructed based on the improved convolutional neural network model combined with the K-nearest neighbor algorithm shows significant improvements in both accuracy and construction time.
[0108] Example 2
[0109] Example 2 provides a device for establishing a hysteresis loop prediction model, such as Figure 5 As shown, it includes:
[0110] The data acquisition module is used to conduct hysteresis characteristic experiments on ferromagnetic materials, and to set the hysteresis loop correlation characteristics under a preset sinusoidal excitation at different magnetic induction intensity peaks. The hysteresis loop correlation characteristics include magnetic induction intensity waveform data and magnetic field waveform data.
[0111] The model building module is used to establish a hysteresis loop prediction model, which includes an improved convolutional neural network model and a K-nearest neighbor algorithm model. The improved convolutional neural network model is used for data training, with the input being the peak value of magnetic induction intensity and the waveform data of magnetic induction intensity, and the output being the magnetic field waveform data, resulting in a trained improved convolutional neural network model. The feature data obtained from the trained improved convolutional neural network model is then acquired, and the target value is set as the magnetic field waveform data. The K-nearest neighbor algorithm model is used to adjust the magnetic field waveform data based on the feature data to obtain the final magnetic field waveform result.
[0112] Example 3
[0113] Example 3 provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described method for establishing a hysteresis loop prediction model.
[0114] Example 4
[0115] Example 4 provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method for establishing a hysteresis loop prediction model.
[0116] The memory in this embodiment of the invention is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.
[0117] The hysteresis loop prediction model establishment method disclosed in this invention can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the hysteresis loop prediction model establishment method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in this invention's embodiments. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention's embodiments can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium, specifically a memory. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the hysteresis loop prediction model establishment method provided in this invention's embodiments.
[0118] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned methods.
[0119] It is understood that memory can be volatile or non-volatile, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0120] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for establishing a hysteresis loop prediction model, characterized in that, Includes the following steps: Hysteresis characteristic experiments were conducted on ferromagnetic materials. Hysteresis loop correlation characteristics were set under preset sinusoidal excitation at different magnetic induction intensity peak values. The hysteresis loop correlation characteristics include magnetic induction intensity waveform data and magnetic field waveform data. A hysteresis loop prediction model was established, comprising an improved convolutional neural network (CNN) model and a K-nearest neighbor (KNN) algorithm model. The improved CNN model was used for data training, with the input being the peak value and waveform data of the magnetic flux density, and the output being the magnetic field waveform data, resulting in a trained improved CNN model. Feature data obtained from the trained improved CNN model was acquired, and the target value was set as the magnetic field waveform data. The KNN algorithm model was then used to adjust the magnetic field waveform data based on the feature data to obtain the final magnetic field waveform result. The improved convolutional neural network model includes convolutional layers, pooling layers, flattening layers, a first fully connected layer, a Dropout layer, a second fully connected layer, and an output layer. The convolutional layer uses 32 convolutional kernels to generate 32 feature maps. Each kernel is 1 row and 2 columns in size. The linear unit is modified as the activation function using formula (2) to introduce non-linear characteristics. Formula (2) is as follows: (2) Where x represents the activation value received by the neuron. When the input x > 0, the output is x, and when the input x ≤ 0, the output is 0. The pooling layer is used for downsampling, and the pooling layer window size is 1 row and 1 column. The flattening layer is used to convert multidimensional input data into one-dimensional data for input into the first fully connected layer; The first fully connected layer has 64 neurons and uses ReLU as the activation function; The dropout rate is 40%–60%; The second fully connected layer contains one neuron.
2. The method for establishing a hysteresis loop prediction model according to claim 1, characterized in that: The peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data were all standardized. The standardized peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data were then used for training in the improved convolutional neural network.
3. The method for establishing a hysteresis loop prediction model according to claim 2, characterized in that, The method for standardizing the peak magnetic flux density, magnetic field strength waveform, and magnetic field waveform data is as follows: The peak magnetic induction intensity, magnetic field intensity waveform, and magnetic field waveform data obtained from the hysteresis characteristic experiment are arranged in columns. Each column of data is converted to the same scale using the Standard Scaler normalization method. Each data point is designated as a feature value, and the formula for standardizing each feature value is as follows: (1) Where X is the eigenvalue, μ is the mean of each column of features, and σ is the standard deviation of each column of features. This refers to standardized magnetic field strength waveforms or magnetic field waveform data.
4. The method for establishing a hysteresis loop prediction model according to claim 1, characterized in that: In the training process of the improved convolutional neural network model, the parameters are adaptively adjusted according to the current prediction error in each iteration through the backpropagation algorithm, and the loss function is the mean squared error.
5. The method for establishing a hysteresis loop prediction model according to claim 1, characterized in that, The method for adjusting the magnetic field strength waveform using the K-nearest neighbor algorithm model and outputting the final magnetic field strength waveform is as follows: The sample to be predicted is set as the magnetic field strength waveform result. For each sample to be predicted, the K-nearest neighbor algorithm uses Euclidean distance to calculate the distance between the sample to be predicted and all samples in the training set. Based on the calculated distance, find the K nearest neighbor samples to the sample to be predicted; The K nearest neighbor algorithm model is used to extract K target values corresponding to K nearest neighbor samples. The mean of the K target values is calculated to generate the final predicted value, which is then used as the final magnetic field waveform result.
6. The method for establishing a hysteresis loop prediction model according to claim 1, characterized in that: Add 5-fold cross-validation to the K-nearest neighbor algorithm. Divide the dataset of magnetic field strength waveform results into 5 subsets. Each time, select 1 subset as the validation set and the other 4 subsets as the training set. Train on the training set and evaluate on the test set. In cross-validation, the mean square error for each fold is calculated as shown in formula (6); (6) in, It is the number of samples in the i-th fold. It is the true value of the i-th fold. It is the predicted value for the i-th fold.
7. A device for establishing a hysteresis loop prediction model, characterized in that, include: The data acquisition module is used to conduct hysteresis characteristic experiments on ferromagnetic materials, and to set the hysteresis loop correlation characteristics under a preset sinusoidal excitation at different magnetic induction intensity peaks. The hysteresis loop correlation characteristics include magnetic induction intensity waveform data and magnetic field waveform data. The model building module is used to establish a hysteresis loop prediction model. The hysteresis loop prediction model includes an improved convolutional neural network model and a K-nearest neighbor algorithm model. The improved convolutional neural network model is used for data training. The input is the peak value of magnetic induction intensity and the magnetic induction intensity waveform data. The output is the magnetic field waveform data, resulting in a trained improved convolutional neural network model. The feature data obtained from the trained improved convolutional neural network model is acquired. The target value is set as the magnetic field waveform data. The K-nearest neighbor algorithm model is used to adjust the magnetic field waveform data based on the feature data to obtain the final magnetic field waveform result. The improved convolutional neural network model includes convolutional layers, pooling layers, flattening layers, a first fully connected layer, a Dropout layer, a second fully connected layer, and an output layer. The convolutional layer uses 32 convolutional kernels to generate 32 feature maps. Each kernel is 1 row and 2 columns in size. The linear unit is modified as the activation function using formula (2) to introduce non-linear characteristics. Formula (2) is as follows: (2) Where x represents the activation value received by the neuron. When the input x > 0, the output is x, and when the input x ≤ 0, the output is 0. The pooling layer is used for downsampling, and the pooling layer window size is 1 row and 1 column. The flattening layer is used to convert multidimensional input data into one-dimensional data for input into the first fully connected layer; The first fully connected layer has 64 neurons and uses ReLU as the activation function; The dropout rate is 40%–60%; The second fully connected layer contains one neuron.
8. An electronic device, characterized in that: The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the hysteresis loop prediction model establishment method according to any one of claims 1-6.
9. A non-transitory computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the hysteresis loop prediction model establishment method according to any one of claims 1-6.
Citation Information
Patent Citations
Dynamic hysteresis model for predicting hysteresis characteristics under high-frequency sine excitation
CN115050433A
Compensation control method for torsion angle of motor-driven joint based on hysteresis model
CN118848961A