A three-dimensional electromagnetic field prediction method based on U-MH SwinUNet model

By combining the umbrella multi-head input structure and SwinTransformer Block in the U-MH SwinUNet model, the problem of computing resources and processing time requirements in three-dimensional electromagnetic field prediction is solved, and efficient and high-speed electromagnetic field prediction is achieved, which meets the complex electromagnetic The actual requirements of equipment and systems.

CN118886337BActive Publication Date: 2024-11-29HEBEI UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411365250.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-11-29
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

The existing numerical calculation methods of electromagnetic field have increased dramatically when dealing with complex three-dimensional electromagnetic field problems. Traditional convolutional neural networks and Transformer models are insufficient in global information processing and high-precision electromagnetic data scenarios, especially for The requirements for three-dimensional data models are not adequately addressed.

Method used

Using a three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model, combining the umbrella multi-head input structure and SwinTransformer Block, it integrates the U-Net codec advantages and SwinTransformer's multi-head attention mechanism, and optimizes feature extraction and information flow transmission. The ability to process multiple data source inputs in parallel improves the efficiency and accuracy of electromagnetic field prediction.

Benefits of technology

It realizes efficient and high-speed three-dimensional electromagnetic field prediction, which can more realistically and accurately reflect the actual operation of complex electromagnetic equipment and systems, significantly improving the performance and application prospects of the model in electromagnetic field prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886337B_ABST
    Figure CN118886337B_ABST
Patent Text Reader

Abstract

The present invention discloses a three-dimensional electromagnetic field prediction method based on the U‑MH SwinUNet model, which belongs to the field of big data electromagnetic field numerical calculation technology, and includes the following steps: establishing three-dimensional electromagnetic equipment models of different complexity in numerical simulation software; collecting data sets through script control, preprocessing, and dividing the data into training sets and test sets; using multiple magnetic field distribution results as supervision data of the model architecture, using multiple electromagnetic equipment parameters as input data of the model architecture, training the model architecture, and obtaining a three-dimensional electromagnetic field distribution prediction model; the three-dimensional electromagnetic field prediction method based on the U‑MH SwinUNet model described in the present invention, compared with other traditional prediction models, can process multiple data batches in parallel or efficiently perform operations on multiple processing units, and the advantage is that it adopts a local window self-attention mechanism and a hierarchical structure design. In this way, the present invention significantly improves the accuracy of prediction, and brings new breakthroughs to the field of big data electromagnetic field numerical calculation technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of big data electromagnetic field numerical calculation, and in particular relates to a three-dimensional electromagnetic field prediction method based on a U-MHSwinUNet model. Background Art

[0002] As a core technology in the fields of electrical engineering and biomedical engineering, computational electromagnetics has penetrated into multiple application levels such as electrical equipment design, transcranial magnetic stimulation, antenna design, optoelectronic equipment, and radar cross-section analysis. In these application scenarios, the rapid and accurate acquisition of electromagnetic field distribution information of electromagnetic equipment has irreplaceable and important value for the analysis, control, and optimization of equipment performance.

[0003] At present, the finite element numerical method is widely used to solve various physical field problems described by partial differential equations due to its mature technical system based on mesh generation, interpolation calculation and variational principle, and has become the mainstream method for numerical calculation of electromagnetic fields. However, when faced with problems involving complex factors such as composite structures, three-dimensional models, wave effects, transient responses, nonlinear behaviors, infinite domain analysis, and multi-physical field coupling, the finite element method's demand for computing resources, memory, and processing time has increased dramatically, which has severely restricted its popularization and promotion in practical applications. Although in theory, the finite element method has the ability to handle these complex problems, in actual operation, it is often difficult to implement due to the limitations of computer processing power.

[0004] With the improvement of graphics processing unit (GPU) performance and the enhancement of algorithm efficiency, deep learning technology provides a new solution for electromagnetic field prediction. However, due to its inherent local perception characteristics and spatial invariance, traditional convolutional neural networks (CNNs) are difficult to fully capture and process the global information of input data. Transformer-based models can solve the problem of global information acquisition to a certain extent, but these models usually require multi-layer network stacking, and as the network depth increases, information attenuation is prone to occur. In addition, traditional Transformer models may ignore the interaction between electromagnetic fields of different complexities when processing specific areas, resulting in an incomplete and in-depth grasp of the global information of the electromagnetic field.

[0005] Among the existing technical solutions, the model using the combination of the Transformer model and the style transfer technology disclosed in patent number CN115983140A, and the method combining the convolutional neural network and the Transformer disclosed in patent number CN116911150A, although each has certain advantages, such as high parallelism, large-scale problem handling capabilities, and long-distance feature capture, are still insufficient when processing high-precision and complex electromagnetic data scenarios. More importantly, both patents only discuss two-dimensional data models, while in actual applications, three-dimensional magnetic field prediction has a wider range of needs and application scenarios because it can more realistically and comprehensively reflect the geometric shape, structure, and magnetic field distribution characteristics of electromagnetic equipment.

[0006] Therefore, the present invention proposes a three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model, which not only inherits the global information processing capability of the Transformer model, but also realizes parallel processing of multiple data source inputs through a unique umbrella-shaped multi-head input structure, thereby greatly improving the efficiency and accuracy of electromagnetic field prediction. At the same time, the method designs and optimizes the three-dimensional data model, so that it can more realistically and accurately reflect the actual operation of complex electromagnetic equipment and systems, providing strong technical support for the research and development and application of related fields. Summary of the invention

[0007] The present invention aims to avoid the defects of the above-mentioned related technologies and proposes a three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model. The method can combine the umbrella-shaped multi-head input structure with the SwinUnet model, solve the three-dimensional electromagnetic field prediction, and achieve high efficiency and high speed of prediction. By adopting the SwinUnet architecture, the present invention effectively integrates the umbrella-shaped multi-head input structure, the codec advantages of U-Net and the multi-head attention mechanism of SwinTransformer, and optimizes feature extraction and information flow transmission in the network. Specifically, the umbrella-shaped multi-head input structure allows the model to receive and process inputs from different data sources in parallel, improving the efficiency of data processing and the response speed of the model.

[0008] This solution discloses a three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model, including:

[0009] S1, establish three-dimensional electromagnetic device models with different complexities, including coil electromagnetic device model, one-dimensional Helmholtz coil electromagnetic device model, and wireless energy transmission electromagnetic device model in electromagnetic field numerical simulation software; use electromagnetic field numerical simulation software to analyze the three-dimensional electromagnetic device model and obtain the magnetic field distribution result of solving the electromagnetic device model;

[0010] S2, using scripts to control the electromagnetic field numerical simulation software to export the csv file containing the electromagnetic device model data distribution information, forming a large data set of electromagnetic device parameters and magnetic field distribution;

[0011] S3, based on the characteristics of electromagnetic field data, construct the U-MH SwinUNet model;

[0012] The U-MH SwinUNet model includes an umbrella-shaped multi-head input structure, an encoder composed of a SwinTransformer Block and a block merging layer, a decoder composed of a SwinTransformer Block and a block expansion layer, a block segmentation layer, a linear embedding layer, a global pooling layer, a linear projection layer, a skip connection, and a loss function containing physical constraints. The umbrella-shaped multi-head input structure includes adding more input heads during the data input process, and adding a feature extraction module during the processing of the input head;

[0013] S4, train the U-MH SwinUNet model using the processed dataset;

[0014] S5, using the trained model to predict the three-dimensional electromagnetic field.

[0015] Furthermore, step S2 also includes data processing of the large data set, wherein the data processing process includes gridding the space where the simulated three-dimensional electromagnetic device model is located to obtain material parameters, excitation parameters and magnetic field distribution of each grid point;

[0016] The required data distribution information is extracted, and the data distribution information includes the distribution information of the material parameters and excitation parameters of the electromagnetic device model, and the magnetic field distribution information. The distribution information of the material parameters and excitation parameters of the electromagnetic device model constitutes a feature matrix. Different types of electromagnetic device models have different types of feature matrices. The distribution information of the material parameters and excitation parameters is used as the input feature matrix based on the U-MH SwinUNet model, and the corresponding magnetic field distribution information is used as the training label. The magnetic field distribution is used as the actual value to compare with the predicted value. A part of each feature matrix is ​​randomly extracted from the large data set after data processing as a test set, and the other part is used as a training set.

[0017] Furthermore, the loss function containing physical constraints is a loss function designed based on Gauss's law, Ampere's law and the law of conservation of charge:

[0018] Gaussian Law Loss

[0019]

[0020] Where E is the electric field, is the charge density, is the dielectric constant of vacuum;

[0021] Ampere's law losses

[0022]

[0023] in, is the magnetic field, is the current density, is the vacuum permeability, is the rate of change of the electric field with time;

[0024] Charge conservation loss

[0025]

[0026] in, is the rate of change of charge density with time;

[0027] Boundary condition loss

[0028]

[0029] in, is the predicted value of E at the jth boundary point, is the theoretical value of E at the jth boundary point;

[0030] Total loss:

[0031]

[0032] in, is the weight coefficient used to balance the impact of each part of the loss.

[0033] Furthermore, the training of S4 includes the following steps:

[0034] First, the data is divided into blocks of uniform size through a block processing module, each of which contains xyz coordinates, current density, dielectric constant, and magnetic field strength features; then, these features are mapped to a high-dimensional space through a linear projection operation and combined with content-aware position encoding.

[0035] Furthermore, the materials included in the toroidal coil electromagnetic device model, the one-dimensional Helmholtz electromagnetic device model and the wireless energy transmission electromagnetic device model in S1 are air and copper.

[0036] Furthermore, the U-MH SwinUNet model includes an umbrella-shaped multi-head input structure, a block segmentation layer, a linear embedding layer, an encoder module, an intermediate SwinTransformer Block, a decoder module, a global pooling layer, a linear projection layer, a skip connection, and a loss function containing physical constraints, which are connected in sequence;

[0037] Among them, the umbrella-shaped multi-head input structure includes adding more input heads during the data input process and adding a feature extraction module during the processing of the input heads;

[0038] The encoder is composed of three SwinTransformer Blocks and block merging layers stacked alternately three times, and the decoder is composed of three SwinTransformer Blocks and block expansion layers stacked alternately three times.

[0039] And the normalization layer and activation function layer are connected after the SwinTransformer Block;

[0040] The normalization layer and the activation function layer are connected in sequence;

[0041] At the same time, the SwinTransformer Block of the encoder and decoder establish symmetrical skip connections, and the third skip connection introduces the convolutional layer with strong local information extraction capability into the skip connection structure of the model.

[0042] Furthermore, the SwinTransformer Block is built based on a shifted window, which includes a LayerNorm (LN) layer, a multi-head self-attention module, a residual connection, and a 2-layer MLP with GELU nonlinearity; in consecutive transformer blocks, the window-based multi-head self-attention (W-MSA) module and the shifted window-based multi-head self-attention (SW-MSA) module are applied sequentially; this window partitioning allows the following consecutive SwinTransformer Blocks: The calculation formula in the SwinTransformer network is:

[0043]

[0044]

[0045]

[0046]

[0047] In the above formula, Represents the input features of the l-th layer SwinTransformer network module; represents the output of the l-th layer MSA; Indicates that the output features of the SwinTransformer network module at layer l are also the input features of layer l+1; represents the output of the l+1th layer SW-MSA; Represents the output features of the l+1th layer SwinTransformer network module; W-MSA is the MSA layer with divided windows, SW-MSA is the MSA layer with moving windows, and MSA uses the global attention mechanism to calculate the attention calculation formula:

[0048]

[0049] In the formula, Q, K, and V are obtained by multiplying the input features by three matrices respectively, Q represents the information to be queried, K represents the queried information, V represents the value obtained by the query, d represents the number of feature division areas and the channel dimension, and the value in B comes from the bias matrix. Compared with the prior art, the electromagnetic field numerical prediction method based on deep learning described in the present invention has the following advantages:

[0050] 1. The present invention proposes a three-dimensional electromagnetic field prediction method based on deep learning. The method combines an umbrella-shaped multi-head input structure with a SwinUnet model to significantly improve the performance of the model in electromagnetic field prediction. The advantage of the present invention is that it can effectively handle the magnetic field distribution problem generated by electromagnetic devices of different complexity regardless of how the size, shape or internal structure of these devices change, which shows that the model involved in the present invention has a wide range of application scenarios and broad application prospects.

[0051] 2. The present invention adopts a method of randomly generating a large data set within an effective range. This method avoids the bias of artificially selecting data, ensures the extensiveness and randomness of the data set, and thus improves the generalization ability of the model.

[0052] 3. The large data set used in the model training process of the present invention does not require the electromagnetic field distribution diagram obtained by the electromagnetic field numerical simulation software, but only the characteristic matrix that reflects the data distribution characteristics. Therefore, there is no need to pre-process the image, which reduces the complexity of data processing. Moreover, the magnetic field distribution data is output in the form of a grid, and the value of each point can be accurately expressed, which improves the accuracy of the training results. The prediction object involved in the present invention includes not only variable structural parameters, but also variable excitation parameters, involving a wider range of parameters and a higher diversity of problems.

[0053] 4. The core of the present invention is to apply the U-MH SwinUNet model to the prediction of three-dimensional electromagnetic field data. This model uses SwinTransformer Block for deep feature extraction and restores lost spatial information through jump connections. Studies have shown that compared with traditional CNN models, U-MH SwinUNet can more effectively prevent information loss and provide more accurate prediction results when processing complex electromagnetic field distributions. This is due to its ability to maintain local and global information of the data during feature extraction, thereby solving the problem of local receptive field limitation that is common in electromagnetic field prediction. In addition, the model's parallel processing capabilities and adaptability to large-scale data sets give it excellent application prospects in the field of electromagnetic field prediction.

[0054] 5. The umbrella-shaped multi-head input structure of the present invention allows the model to process inputs from multiple data sources in parallel, effectively converting three-dimensional electromagnetic field data into serialized data to meet the input requirements of the Transformer model. This design not only speeds up data processing, but also enhances the model's ability to process complex data structures.

[0055] 6. In summary, compared with other electromagnetic field prediction models, the present invention can achieve efficient scalability, uses a local window self-attention mechanism and a hierarchical structure, and can process multiple data batches at the same time or perform operations on multiple processing units. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings constituting part of the present invention are used to provide a further understanding of the present invention and to prove the advantages and authenticity of the present invention, wherein:

[0057] Figure 1 A schematic diagram of a flow chart of an electromagnetic field numerical prediction method based on deep learning according to an embodiment of the present invention;

[0058] Figure 2 It is an overall schematic diagram of the U-MH SwinUNet model structure in the present invention;

[0059] Figure 3 It is a structural diagram of the SwinTransformer Block in the present invention;

[0060] Figure 4 A schematic diagram of the structure of a toroidal coil electromagnetic device model according to an embodiment of the present invention;

[0061] Figure 5 This is a schematic diagram of the structure of a one-dimensional Helmholtz coil electromagnetic device model according to an embodiment of the present invention;

[0062] Figure 6 This is a schematic diagram of the structure of the wireless energy transmission coil electromagnetic device model according to an embodiment of the present invention;

[0063] Figure 7 This is a comparison diagram of the predicted magnetic field distribution and the actual magnetic field distribution of the toroidal coil electromagnetic device model test set after training in an embodiment of the present invention; wherein (a) is a diagram of the predicted magnetic field distribution result, and (b) is a diagram of the actual magnetic field distribution result;

[0064] Figure 8 This is a comparison diagram of the predicted magnetic field distribution and the actual magnetic field distribution of the one-dimensional Helmholtz coil electromagnetic device model test set after training in an embodiment of the present invention, wherein (a) is a predicted magnetic field distribution result diagram, and (b) is a actual magnetic field distribution result diagram;

[0065] Fig. 9 This is a comparison diagram of the predicted magnetic field distribution and the actual magnetic field distribution of the wireless energy transmission coil electromagnetic device model test set after training in an embodiment of the present invention, wherein (a) is a diagram of the predicted magnetic field distribution result, and (b) is a diagram of the actual magnetic field distribution result; DETAILED DESCRIPTION

[0066] The present invention is described in detail below with reference to the accompanying drawings and embodiments. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be understood as limiting the present invention.

[0067] A three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model according to an embodiment of the present invention, the specific process of the prediction method (see Figure 1 )yes:

[0068] S1, establish three 3D electromagnetic device models with different complexity in electromagnetic field numerical simulation software;

[0069] The three-dimensional electromagnetic device model is analyzed using electromagnetic field numerical simulation software to obtain the magnetic field distribution results of the electromagnetic device model.

[0070] S2, using scripts to control the electromagnetic field numerical simulation software to export the csv file containing the electromagnetic device model data distribution information, forming a large data set of electromagnetic device parameters and magnetic field distribution;

[0071] Use the data export function of the electromagnetic field numerical simulation software to export the csv file containing the data distribution information of the electromagnetic device model to form a large data set of the electromagnetic device's own parameters and magnetic field distribution;

[0072] The large data set is processed, and the data processing process is: grid-dividing the space where the simulated three-dimensional electromagnetic device model is located to obtain material parameters, excitation parameters and magnetic field distribution of each grid point;

[0073] The required data distribution information is extracted, and the required data distribution information includes the distribution information of material parameters and excitation parameters of the electromagnetic device model and the magnetic field distribution information. The distribution information of material parameters and excitation parameters of the electromagnetic device model constitutes a feature matrix. Different types of electromagnetic device models have different types of feature matrices. The distribution information of material parameters and excitation parameters is used as the input feature matrix based on the U-MH SwinUNet model, and the corresponding magnetic field distribution information is used as the training label. The magnetic field distribution is used as the actual value to compare with the predicted value.

[0074] A small part of each feature matrix is ​​randomly extracted from the large data set after data processing as the test set, and the remaining majority is used as the training set.

[0075] S3, based on the characteristics of electromagnetic field data, construct the U-MH based SwinUNet model.

[0076] U-MH SwinUNet (Umbrella Multi-Head SwinUNet) emphasizes the combination of umbrella multi-head input structure and SwinUNet. U-MH SwinUNet mainly combines umbrella multi-head input structure to process different types of features, uses SwinTransformer Block to extract features of local window self-attention mechanism and sliding window mechanism, and multi-layer convolution, pooling, jump connection and global average pooling layer together form encoder and decoder structure to achieve feature fusion and multi-scale information capture, and finally restores spatial resolution through upsampling and deconvolution layer, and outputs prediction results.

[0077] The U-MH SwinUNet model includes an umbrella-shaped multi-head input structure, an encoder composed of a SwinTransformer Block and a block merging layer, a decoder composed of a SwinTransformer Block and a block expansion layer, a block segmentation layer, a linear embedding layer, a global pooling layer, a linear projection layer, a skip connection, and a specific loss function containing physical constraints.

[0078] The umbrella-shaped multi-head input structure refers to adding more input heads during the data input process, and adding specific feature extraction modules during the processing of the input heads. In order to solve the complex characteristics of electromagnetic field data, more electromagnetic field features are introduced, such as spatial position, material properties, electromagnetic parameters, etc., and jump connections are established between specific levels of multi-head input to ensure the diversity and interoperability of features.

[0079] The encoder composed of SwinTransformer Block and block merging layer module effectively captures local features through local window self-attention mechanism and realizes global perception through moving window strategy, while the block merging layer module gradually reduces the resolution of feature map by merging adjacent patches to maintain important contextual information.

[0080] The decoder, which is composed of the SwinTransformer Block and the block merging layer module, uses the local window self-attention mechanism to refine the feature map layer by layer, and uses the moving window strategy to achieve global information exchange. The block expansion layer module gradually restores the low-resolution feature map to a high-resolution image through feature expansion and reorganization.

[0081] Transformer has strong global information extraction capabilities, but weak local information extraction capabilities. Regarding the ability to extract local information of electromagnetic fields, the Transformer model performs well in global information extraction, but its local information extraction capabilities are relatively weak. Therefore, the convolutional layer with strong local information extraction capabilities is introduced into the jump connection structure of the model. Specifically, the convolutional layer can capture local features and perform information interaction and fusion in the local range. In this way, the U-MH SwinUNet model can not only capture global information, but also better process local information, thereby improving its performance in various tasks.

[0082] The global pooling layer is introduced into the model. First, global average pooling is performed to calculate the average value of all pixels in each channel of the feature map to generate a global feature vector. Then, global maximum pooling is performed to calculate the maximum value of all pixels in each channel of the feature map to generate a global feature vector. Finally, global fusion is performed to fuse the output of the global pooling layer with the local features in the decoder.

[0083] In combination with the physical laws of electromagnetic fields, a specific loss function with physical constraints is designed for electromagnetic field prediction problems. The advantage of this loss function is that it can ensure that the prediction results of the model are consistent with actual physical phenomena. The following is a loss function designed based on Gauss's law, Ampere's law, and the law of conservation of charge:

[0084] Gaussian Law Loss

[0085]

[0086] Where E is the electric field, is the charge density, is the dielectric constant of vacuum;

[0087] Ampere's law losses

[0088]

[0089] in, is the magnetic field, is the current density, is the vacuum permeability, is the rate of change of the electric field with time;

[0090] Charge conservation loss

[0091]

[0092] in, is the rate of change of charge density with time.

[0093] Boundary condition loss

[0094]

[0095] in, is the predicted value of E at the jth boundary point, is the theoretical value of E at the jth boundary point; the total loss:

[0096]

[0097] in, is the weight coefficient used to balance the impact of each part of the loss.

[0098] At this point, the design of each part of the U-MH SwinUNet model is completed, and the U-MH SwinUNet model is obtained;

[0099] S4, train the U-MH SwinUNet model using the processed dataset.

[0100] The three-dimensional coil feature matrix in the training set is input into the U-MH SwinUNet model for training; this process involves the adaptation of input data, the tuning of model parameters, and the implementation of training strategies.

[0101] First, the data is divided into blocks of uniform size through the block processing module, each of which contains features such as xyz coordinates, current density, dielectric constant and magnetic field strength. Subsequently, these features are mapped to a high-dimensional space through a linear projection operation, which is combined with content-aware position encoding to enhance the model's understanding of the spatial structure of electromagnetic field data.

[0102] After completing the data preprocessing, we input the data into the U-MH SwinUNet model. The encoder extracts features level by level through the hierarchical structure, while the jump connection retains rich local information. At the bottleneck layer, the model learns the global dependency of the data, and then gradually restores the spatial resolution of the feature map through the decoder.

[0103] During the training process, the classifier works based on the output of the encoder, providing guidance for each Transformer decoder. These decoders work in parallel and ultimately output the predicted distribution of the electromagnetic field at different spatial locations. We gradually adjust the learning rate, batch size, and other hyperparameters to optimize the performance of the model. At the same time, techniques such as cross-validation are used to evaluate the generalization ability and accuracy of the model on different datasets. After training is completed, we will obtain a model that can accurately predict the distribution of three-dimensional electromagnetic fields.

[0104] The trained U-MH SwinUNet model is tested using the test set and compared with the actual magnetic field results obtained by the electromagnetic field numerical simulation software. If the error of the test result is close to the expected effect of the error of the training result, and the total physical loss function of the magnetic field distribution is less than 1%, it proves that the model training is successful and can be used for actual magnetic field prediction. Otherwise, the number of training sets should be appropriately increased to continue training or the structure of the U-MH SwinUNet model should be optimized to continue training until the test is successful.

[0105] S5, using the trained model to predict the three-dimensional electromagnetic field.

[0106] When making predictions, the input data of the test set is input into the trained U-MH SwinUNet model to obtain the corresponding magnetic field distribution of the electromagnetic device to be tested.

[0107] The electromagnetic device models of different complexity described in S1 include: a toroidal coil electromagnetic device model, a one-dimensional Helmholtz electromagnetic device model, and a wireless energy transmission electromagnetic device model, wherein the materials included in the electromagnetic device model are air and copper. The single-turn coil electromagnetic device model has the simplest structure and a small excitation variation range; the wireless energy transmission electromagnetic device model has the most complex structure and a wide excitation variation range; and the Helmholtz electromagnetic device model has a complexity between the two.

[0108] Different levels of complexity mean that: the ranges of structural parameters, material parameters and excitation parameters of each electromagnetic device model are different; the structural parameters include the structure and position of the electromagnetic device model, the material parameters include the material, relative dielectric constant, relative magnetic permeability, conductivity, etc. of the electromagnetic device model, the excitation parameters include current density, etc., the current density is obtained according to the current value / area, the current value includes size and direction, and the current density is determined by the current value.

[0109] The complexity of the single-turn coil electromagnetic device model is affected by the geometry and position of the coil and the magnitude of the current passing through the coil. The electromagnetic field distribution characteristics of a single-turn coil will change with changes in its diameter, coil line width and current intensity. The change in current directly affects the magnetic field intensity, while the spatial position and shape of the coil determine the distribution of the magnetic field lines, thereby affecting the electromagnetic environment in the area where the coil is located. The complexity of the Helmholtz coil electromagnetic device model lies in the distance and current distribution between two or more parallel circular coils. Helmholtz coils are usually used to generate a nearly uniform magnetic field area. The radius of the coil, the distance between the centers of the circles, and the current passing through the coils are all key factors affecting the uniformity and intensity of the magnetic field. When designing the model, these parameters need to be accurately calculated and adjusted to achieve the desired magnetic field characteristics. The complexity of the wireless energy transmission electromagnetic device model is mainly affected by the coil arrangement, electromagnetic coupling efficiency, and energy transmission distance. Wireless energy transmission devices usually involve at least one pair of transmitting and receiving coils, and the relative position and geometric configuration between them determine the efficiency of energy transmission. Factors affecting the complexity of the model include the diameter of the coil, the winding density of the coil, the distance between the coils, and the frequency and amplitude of the current. Optimizing these parameters can improve the performance and distance of wireless energy transmission while reducing energy loss.

[0110] The large data set described in S2 is generated by the electromagnetic field numerical analysis software COMSOL controlled by MATLAB.

[0111] Figure 2 The figure shows the overall schematic diagram of the U-MH SwinUNet model structure of the present invention. The U-MH SwinUNet model includes an umbrella-shaped multi-head input structure, a block segmentation layer, a linear embedding layer, an encoder module, an intermediate SwinTransformer Block, a decoder module, a Global Pooling Layer, and a Linear Projection connected in sequence. And a normalization layer and an activation function layer are connected after the SwinTransformer Block. The normalization layer and the activation function layer are connected in sequence. At the same time, the SwinTransformer Blocks of the encoder and the decoder establish symmetrical jump connections, and the third jump connection introduces a convolutional layer with strong local information extraction capabilities into the jump connection structure of the model.

[0112] In the encoder, in order to convert the input into a sequence embedding, the 3D EM data is partitioned into non-overlapping blocks of size 4×4×4. This partitioning transforms the feature dimension of each patch to 4×4×4=64. In addition, a linear embedding layer is used to project the feature dimension to an arbitrary dimension (denoted as C). These transformed blocks generate hierarchical feature representations through several SwinTransformer Blocks and patch merging layers. Specifically, the block merging layer is responsible for downsampling and increasing the dimension, while the SwinTransformer Block is responsible for feature representation learning. Inspired by the U-Net architecture, a symmetric transformer-based decoder is designed. The decoder consists of a SwinTransformer Block and a block expansion layer. The extracted contextual features are combined with multi-scale features in the encoder through skip connections to compensate for the loss of spatial information due to downsampling. Different from the patch merging layer, a patch expansion layer is specially designed for upsampling. The patch expansion layer reshapes the feature maps of adjacent dimensions into larger feature maps with 2x resolution upsampling. Finally, a final patch expansion layer is used to upsample by 4 times to restore the resolution of the feature maps to the input resolution (W×H), and then a linear projection layer is applied on these upsampled features to output pixel-level segmentation predictions.

[0113] Figure 3 Shown is a schematic diagram of the structure of the SwinTransformer Block in the present invention.

[0114] Unlike the traditional multi-head self-attention (MSA) module, the SwinTransformer Block is built based on a shifted window. The block includes a LayerNorm (LN) layer, a multi-head self-attention module, a residual connection, and a 2-layer MLP with GELU nonlinearity. In consecutive transformer blocks, the window-based multi-head self-attention (W-MSA) module and the shifted window-based multi-head self-attention (SW-MSA) module are applied sequentially. This window partitioning allows the following consecutive SwinTransformer Blocks: The calculation formula in the SwinTransformer network is:

[0115]

[0116]

[0117]

[0118]

[0119] In the above formula, Represents the input features of the l-th layer SwinTransformer network module; represents the output of the l-th layer MSA; Indicates that the output features of the SwinTransformer network module at layer l are also the input features of layer l+1; represents the output of the l+1th layer SW-MSA; Represents the output features of the l+1th layer SwinTransformer network module; W-MSA is the MSA layer with divided windows, SW-MSA is the MSA layer with moving windows, and MSA uses the global attention mechanism to calculate the attention calculation formula:

[0120]

[0121] In the formula, Q, K, and V are obtained by multiplying the input features by three matrices respectively. Q represents the information to be queried, K represents the queried information, V represents the value obtained by the query, d represents the number of feature division areas and the channel dimension, and the value in B comes from the bias matrix.

[0122] Taking the coil electromagnetic device model, the Helmholtz coil electromagnetic device model, and the wireless energy transmission electromagnetic device model as examples, the technical solution of the present application is further explained.

[0123] 1. First, understand the factors that affect the magnetic field distribution of the three electromagnetic equipment models. Figure 4 As shown, for the toroidal coil electromagnetic device model, the coil is located in a 180mm×180mm three-dimensional air box, the radius of the toroidal circle is 3~15mm, the distance from the center of the toroidal circle to the center is 43~55mm (that is, the radius of the toroidal circle plus 40mm), the current passing through the coil is 5~15A, and its material is copper. The factors affecting the magnetic field distribution in the air box include the structure, excitation, and material parameters of the coil, where the structure of the coil refers to the radius and position of the coil cross section, excitation refers to the current passing through the coil, and material parameters refer to the relative dielectric constant, relative magnetic permeability, and electrical conductivity of the material.

[0124] like Figure 5 As shown in the figure, for the Helmholtz coil electromagnetic device model, the radius of the annular circle is 3~15mm, and the distance between the center of the annular circle and the center is 43~55mm (i.e., the radius of the annular circle plus 40mm), and the distance between the two is equal to the distance between the center of the annular circle and the center. The Helmholtz coil generates a uniform magnetic field through two precisely placed circular coils of the same size, where the coil spacing and radius are equal, which is a key factor. This configuration can produce the most uniform magnetic field in the central area. The uniformity and strength of the magnetic field are affected by the diameter of the coil, the number of turns, the magnitude and direction of the current passing through the coil, where an increase in current and an increase in the number of turns can increase the magnetic field strength, and the resistance characteristics of the wire also affect the stability and thermal efficiency of the current.

[0125] like Figure 6 As shown in the figure, for the wireless energy transmission electromagnetic device model, the wireless energy transmission coil relies on the principle of electromagnetic induction, in which the relative position and alignment accuracy of the transmitting and receiving coils are crucial to the energy transmission efficiency. The size and shape of the coil determine its energy coverage range, while the number of turns and the conductive material used affect its impedance, thereby affecting the frequency response and energy transmission efficiency. The choice of operating frequency not only affects the energy transmission distance, but also determines the overall performance of the system. Therefore, optimizing these parameters is crucial to improving the effectiveness and economy of wireless energy transmission.

[0126] 2. Use electromagnetic field numerical simulation software to create different electromagnetic device models respectively. During the process, it is necessary to set structural parameters and excitation parameters that can vary within an effective range for different electromagnetic device models, and export the information distribution file of the corresponding electromagnetic device model in the electromagnetic numerical simulation software after the calculation is completed. The data file type exported in this embodiment is a csv file. It is worth noting that the data distribution information is evenly output in a grid form, which can accurately reflect the data distribution of each point in the electromagnetic device model. In addition, since the data file containing the material parameters and excitation parameter information of the electromagnetic device model can reflect the structural characteristics of the electromagnetic device model, the characteristic matrix reflecting the data distribution characteristics can be directly processed. Therefore, compared with other inventions that require preprocessing of electromagnetic device images, the present invention is simpler to operate and greatly reduces the calculation cost.

[0127] 3. Since training the U-MH SwinUNet model requires a certain number of large data sets, the present invention uses a script file to control the electromagnetic field numerical simulation software to randomly generate a large data set within the effective parameter range in order to save manpower and speed up the output rate of the large data set. Compared with other inventions, it avoids the artificial selection of the data set, expands the scope and randomness of the large data set, and makes the U-MH SwinUNet model after training more generalized and the prediction results more accurate.

[0128] 4. Part of the generated large data set is used as a training set, and the other part is used as a test set. After data processing, it is convenient to better extract features of the data based on the U-MH SwinUNet model.

[0129] Figure 7 This is a comparison chart of the predicted magnetic field distribution and the actual magnetic field distribution of the toroidal coil electromagnetic device model after training. (a) is the predicted magnetic field distribution result chart, and (b) is the actual magnetic field distribution result chart. The figure shows that the magnetic field distribution of the predicted result and the actual result are almost the same, proving that the prediction effect of the magnetic field of the toroidal coil electromagnetic device model based on the U-MH SwinUNet model is good.

[0130] Figure 8 This is a comparison chart of the predicted magnetic field distribution and the actual magnetic field distribution of the Helmholtz coil electromagnetic device model after training. (a) is the predicted magnetic field distribution result, and (b) is the actual magnetic field distribution result. The figure shows that the magnetic field distribution of the predicted result and the actual result are almost the same, proving that the prediction effect of the magnetic field of the Helmholtz coil electromagnetic device model based on the U-MH SwinUNet model is good.

[0131] Fig. 9 This is a comparison chart of the predicted magnetic field distribution and the actual magnetic field distribution of the electromagnetic equipment model of the built-in wireless energy transmission device after training. (a) is the predicted magnetic field distribution result chart, and (b) is the actual magnetic field distribution result chart. The figure shows that the magnetic field distribution of the predicted result and the actual result are almost the same, proving that the U-MH SwinUNet model has a good prediction effect on the magnetic field of the electromagnetic equipment model of the wireless energy transmission device.

[0132] Since it is difficult and not intuitive to display a three-dimensional structure in two dimensions, the present invention selects a three-dimensional diagram composed of central cross-sectional diagrams of XOY, XOZ, and YOZ planes to better display the internal structure and prediction results.

[0133] The test results of the above three electromagnetic equipment models with different complexities prove that the U-MHSwinUNet model based on the present invention can better complete the electromagnetic field numerical prediction task of different types of electromagnetic equipment.

[0134] In summary, the above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0135] Any matters not described in the present invention are applicable to the prior art.

Claims

1. A three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model, characterized by: S1. Establish three-dimensional electromagnetic device models with different levels of complexity, including coil electromagnetic device models, one-dimensional Helmholtz coil electromagnetic device models, and wireless energy transmission electromagnetic device models in electromagnetic field numerical simulation software; use electromagnetic field numerical simulation software to analyze the three-dimensional electromagnetic device model and obtain the magnetic field distribution results of the electromagnetic device model; S2. Use scripts to control the electromagnetic field numerical simulation software to export the csv file containing the electromagnetic device model data distribution information to form a large data set of electromagnetic device parameters and magnetic field distribution; S3. According to the characteristics of electromagnetic field data, a U-MH SwinUNet model is constructed; The U-MH SwinUNet model includes an umbrella-shaped multi-head input structure, an encoder composed of SwinTransformer Block and PatchMerging, a decoder composed of SwinTransformer Block and Patch Expanding, a block segmentation layer, a linear embedding layer, a global pooling layer, a linear projection layer, a skip connection, and a loss function containing physical constraints. The umbrella-shaped multi-head input structure includes adding more input heads in the process of data input, and adding a feature extraction module in the process of processing the input head; S4, using the processed data set to train the U-MH SwinUNet model; S5. Use the trained model to predict the three-dimensional electromagnetic field; Among them, the loss function that contains physical constraints in S3 is a loss function designed based on Gauss's law, Ampere's law and the law of conservation of charge: Gaussian Law Loss: ; Where E is the electric field, is the charge density, is the dielectric constant of vacuum; Ampere's law losses: ; in, is the magnetic field, is the current density, is the vacuum permeability, is the rate of change of the electric field with time; Charge conservation loss: ; in, is the rate of change of charge density with time; Boundary condition loss: ; in, is the predicted value of E at the jth boundary point, is the theoretical value of E at the jth boundary point; Total loss: ; in, is the weight coefficient used to balance the impact of each part of the loss.

2. A three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model as claimed in claim 1, characterized in that: Step S2 also includes data processing of the large data set, wherein the data processing process includes gridding the space where the simulated three-dimensional electromagnetic device model is located to obtain material parameters, excitation parameters and magnetic field distribution of each grid point; The required data distribution information is extracted, and the data distribution information includes the distribution information of material parameters and excitation parameters of the electromagnetic device model and the magnetic field distribution information. The distribution information of material parameters and excitation parameters of the electromagnetic device model constitutes a feature matrix. Different types of electromagnetic device models have different types of feature matrices. The distribution information of material parameters and excitation parameters is used as the input feature matrix based on the U-MH SwinUNet model, and the corresponding magnetic field distribution information is used as the training label. The magnetic field distribution is used as the actual value to compare with the predicted value. A part of each feature matrix is ​​randomly extracted from the large data set after data processing as a test set, and the other part is used as a training set.

3. The three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model according to claim 1, characterized in that: The training of S4 comprises the following steps: First, the data is divided into blocks of uniform size through a block processing module, each of which contains xyz coordinates, current density, dielectric constant, and magnetic field strength features; then, these features are mapped to a high-dimensional space through a linear projection operation and combined with content-aware position encoding.

4. The three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model according to claim 1, characterized in that: The materials included in the coil electromagnetic device model, the one-dimensional Helmholtz coil electromagnetic device model, and the wireless energy transmission electromagnetic device model in S1 are air and copper.

5. The three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model according to claim 1, characterized in that: The U-MH SwinUNet model includes an umbrella-shaped multi-head input structure, Patch Partition, Linear Embedding, encoder, intermediate SwinTransformer Block, decoder, Global PoolingLayer, and Linear Projection connected in sequence; Among them, both the encoder and decoder are composed of three SwinTransformer Blocks and Patch Expanding stacked three times alternately; And the normalization layer and activation function layer are connected after the SwinTransformer Block; The normalization layer and the activation function layer are connected in sequence; At the same time, the SwinTransformer Block of the encoder and decoder establish symmetrical skip connections, and the third skip connection introduces the convolutional layer with strong local information extraction capability into the skip connection structure of the model.

6. The three-dimensional electromagnetic field prediction method based on the U-MH SwinUNet model according to claim 1, characterized in that: The SwinTransformer block is built based on a shift window. The block includes an LN layer, a multi-head self-attention module, a residual connection, and a 2-layer MLP with GELU nonlinearity, where the LN layer is a LayerNorm layer; In the consecutive transformer blocks, W-MSA modules and SW-MSA modules are applied in sequence, where the W-MSA module is a window-based multi-head self-attention module and the SW-MSA module is a shifted window-based multi-head self-attention module; this window partitioning allows the following consecutive SwinTransformer Blocks: The calculation formula in the SwinTransformer network is: ; ; ; ; In the above formula, Represents the input features of the l-th layer SwinTransformer network module; represents the output of the l-th layer MSA; Indicates that the output features of the SwinTransformer network module at layer l are also the input features of layer l+1; represents the output of the l+1th layer SW-MSA; Represents the output features of the l+1th layer SwinTransformer network module; Among them, W-MSA is the MSA layer with divided windows, SW-MSA is the MSA layer with moving windows, and MSA uses the global to calculate the attention mechanism. The attention calculation formula is: ; In the formula, Q, K, and V are obtained by multiplying the input features by three matrices respectively. Q represents the information to be queried, K represents the queried information, V represents the value obtained by the query, d represents the number of feature division areas and the channel dimension, and the value in B comes from the bias matrix.

Citation Information

Patent Citations

  • Electromagnetic energy equipment field cloud picture prediction method

    CN116911150A

  • Electromagnetic field numerical prediction method based on big data deep learning

    CN115983140A

  • Electrical equipment temperature field numerical prediction method based on big data style transfer learning

    CN116341386A