A method for optimizing permanent magnet parameters in magnetic resonance imaging

By combining deep learning prediction models with intelligent optimization algorithms, the problem of low optimization efficiency in traditional permanent magnet design is solved, enabling fast and accurate optimization of permanent magnet parameters, improving magnetic field prediction accuracy and design efficiency, and adapting to the needs of different application scenarios.

CN122307442APending Publication Date: 2026-06-30NANYANG NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANYANG NORMAL UNIV
Filing Date
2026-04-22
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Traditional permanent magnet design methods suffer from low optimization efficiency and long cycles. They are difficult to achieve global optimization of magnetic field strength, uniformity, and escape field under constraints of size, weight, and cost, and they rely on the designer's experience, making it difficult to make rapid adjustments.

Method used

By combining deep learning prediction models with intelligent optimization algorithms, a magnetic field prediction model with a convolution-encoder-decoder structure is constructed to capture the nonlinear coupling relationship between permanent magnet array parameters and magnetic field distribution. The magnetic field strength, uniformity, and escaping field strength are optimized using a multi-objective fitness function, thereby achieving fast and accurate optimization of permanent magnet parameters.

Benefits of technology

It significantly improves the efficiency of permanent magnet parameter optimization, shortens the design cycle, enhances the accuracy of magnetic field prediction, and enables rapid adjustment of constraint conditions in different application scenarios to output permanent magnet parameters that meet clinical imaging needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122307442A_ABST
    Figure CN122307442A_ABST
Patent Text Reader

Abstract

This invention discloses a method for optimizing permanent magnet parameters in magnetic resonance imaging (MRI), relating to the field of MRI equipment. The method includes: determining the fixed structural parameters, magnetic field design parameters, and permanent magnet array constraints of the MRI equipment; providing several permanent magnet parameter design samples and determining the magnetic field matrix of each design sample; organizing complete sample data based on the parameter design samples and corresponding magnetic field matrices, and constructing a sample dataset; training a magnetic field prediction model using the sample dataset; generating several individuals corresponding to the permanent magnet parameter design samples according to the permanent magnet array constraints, and optimizing them using an optimization algorithm, selecting several optimized individuals based on their fitness values; determining the permanent magnet parameters of the permanent magnet array corresponding to the optimized individuals, and verifying the magnetic field strength and uniformity of the imaging region, as well as the escape field strength, and selecting the optimal permanent magnet parameters. This invention has the advantages of high efficiency, accurate prediction, superior multi-objective collaboration, and strong versatility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of magnetic resonance imaging equipment technology, and more specifically to a method for optimizing the parameters of a permanent magnet in magnetic resonance imaging. Background Technology

[0002] Magnetic resonance imaging (MRI) is a core imaging tool for clinical diagnosis and life science research. Among them, permanent magnet MRI is widely used in primary healthcare, interventional diagnosis and treatment, and other scenarios due to its advantages such as no liquid helium consumption, low operating cost, and open structure.

[0003] As a core component of MRI, the magnetic field strength and uniformity of the imaging area of ​​permanent magnets directly determine the signal-to-noise ratio and spatial resolution of the image, which are key indicators for magnet design. Currently, permanent magnet MRI often adopts a combination structure of multiple permanent magnet arrays, yokes and pole shoes. The target magnetic field is achieved by adjusting parameters such as permanent magnet size, position and remanence. However, traditional permanent magnet design relies on analytical estimation, empirical trial and error and iterative simulation, which has the following defects: (1) The multi-parameter, multi-constraint and strongly nonlinear magnetic field mapping relationship of permanent magnet arrays makes the conventional finite element iteration calculation large and slow to converge, making it difficult to quickly traverse the optimal parameter combination, resulting in low optimization efficiency and long cycle. (2) There are coupling conflicts between magnetic field strength, uniformity and escaping field. Traditional methods are prone to neglecting one aspect for another, making it difficult to achieve global optimization under size, weight and cost constraints. (3) Traditional permanent magnet design relies on the designer's experience, making it difficult to make rapid design adjustments.

[0004] Therefore, how to provide an efficient, accurate, and multi-objective collaborative method for optimizing permanent magnet parameters is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a method for optimizing permanent magnet parameters in magnetic resonance imaging, which can quickly obtain the permanent magnet parameters with optimal magnetic field performance under the premise of satisfying structural constraints, thereby improving magnet design efficiency and product performance.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: This invention discloses a method for optimizing the parameters of a permanent magnet in magnetic resonance imaging, comprising: Step 1: Determine the fixed structure parameters, magnetic field design parameters, and permanent magnet array constraints of the magnetic resonance imaging equipment; Step 2: Based on conventional permanent magnet parameter design methods, several permanent magnet array permanent magnet parameter design samples are given, and the magnetic field matrix of each design sample is determined through simulation calculation; Step 3: Based on the permanent magnet parameters, design samples and corresponding magnetic field matrices to obtain complete sample data and construct a sample dataset; use the sample dataset to train a magnetic field prediction model; Step 4: Based on the constraints of the permanent magnet array, generate several individuals corresponding to the permanent magnet parameter design samples, and perform optimization through an optimization algorithm. Select several optimized individuals based on their fitness values. During the optimization process, use the magnetic field prediction model trained in Step 3 to obtain the magnetic field matrix of the design sample corresponding to each individual. Calculate the magnetic field strength, magnetic field uniformity, and exhaust field strength based on the magnetic field matrix, and then determine the fitness value of each individual. Step 5: Determine the permanent magnet parameters of the permanent magnet array corresponding to the optimized individual, and verify the magnetic field strength and uniformity of the imaging area, as well as the scattering field strength, and select the optimal permanent magnet parameters.

[0007] Furthermore, the fixed structural parameters include: the three-dimensional dimensions of the magnetic yoke and the three-dimensional dimensions of the pole shoes; The magnetic field design parameters include: magnetic field strength, magnetic field uniformity, and escaping field strength; The constraints on the permanent magnet array include: three-dimensional size constraints of a single permanent magnet and remanence constraints.

[0008] Furthermore, the permanent magnet parameter design sample of the permanent magnet array is represented as a matrix. : ; in, In the permanent magnet array, the first... Line number The parameter vector of the permanent magnet. and These represent the total number of rows and columns, respectively. , They represent the first Line number The length, width, and height of the permanent magnets Indicates the first Line number The magnetization direction vector of the permanent magnet. Indicates the first Line number The magnitude of remanence of a permanent magnet; The magnetic field matrix Represented as: ; It is a three-dimensional matrix. The total number of grid divisions for the magnetic field region along the three axes of a three-dimensional Cartesian coordinate system; Represents the third in three-dimensional space Magnetic field vector at the grid node , The magnitude of the magnetic field at that point in space. Let be the direction vector of the magnetic field at this point in space.

[0009] Furthermore, the magnetic field prediction model includes a convolutional part, an encoder part, and a decoder part; The convolution part takes the matrix of permanent magnet parameter design samples as input, extracts local correlation features of parameters through two-dimensional convolution operation and outputs feature map; The encoder part, based on the feature map output by the convolution part, performs global feature modeling and fusion by capturing the global dependencies between features, and obtains high-dimensional encoded features that fuse global correlation information. The decoder section, based on the high-dimensional encoded features, converts the encoded features into a three-dimensional magnetic field matrix through global feature alignment and nonlinear mapping reconstruction.

[0010] Furthermore, the convolutional portion includes 1 sequentially connected... 1 convolutional layer, 3 3 convolutional layers and pooling layers; the 1 The first convolutional layer performs preliminary feature extraction on the matrix of permanent magnet parameter design samples; the third... The three convolutional layers perform local feature extraction; the pooling layer performs local feature extraction on the three convolutional layers. The output of the third convolutional layer is subjected to average pooling.

[0011] Furthermore, the encoder portion is composed of several identical coding layers stacked together, each coding layer including a multi-head self-attention module, a feedforward network module, and a residual connection module; The multi-head self-attention module maps the input features into three sets of features: query, key, and value. It calculates multiple sets of self-attention weights in parallel with multiple heads and then concatenates the multi-head results to obtain the global dependency features. The forward feedback network module performs high-dimensional nonlinear transformation on the globally dependent features through two linear transformation layers and one nonlinear activation layer. The residual connection module performs a residual connection between the input and output of the forward feedback network module and outputs the result.

[0012] Furthermore, the decoder part is composed of several decoding layers with the same structure stacked together. Each decoding layer includes an encoder-decoder attention module, a dynamic normalization module, a feedforward network module, and a residual connection module. The encoder-decoder attention module uses the high-dimensional encoded features output by the encoder as key and value features, and the output features of the previous layer of the decoder as query features. It calculates attention weights in parallel with multiple heads, globally aligns the encoded features and decoded features, and establishes a mapping relationship between permanent magnet parameter features and magnetic field spatial distribution features. The dynamic normalization module performs dynamic normalization processing on the output of the encoder-decoder attention module; The feedforward network module performs high-dimensional nonlinear transformation on the normalized features through two linear transformation layers and one nonlinear activation layer. The residual connection module performs a residual connection between the input and output of the forward feedback network module and outputs the result.

[0013] Furthermore, step 4 specifically includes: Step 4.1: Based on the constraints of the permanent magnet array, randomly generate several sets of permanent magnet parameter combinations as the initial population, with each set of parameter combinations corresponding to one individual; Step 4.2: Input each individual in the population into the trained magnetic field prediction model, output the corresponding magnetic field matrix, and calculate the individual fitness value; Step 4.3: Sort the individuals in the population according to their fitness values, and select a preset number of high-quality individuals as the parent population; Step 4.4: Determine whether the maximum number of iterations or the fitness value has converged. If yes, terminate the iteration and output the optimal individual; otherwise, proceed to step 4.5. Step 4.5: Perform crossover operation on individuals in the parent population, exchange some permanent magnet parameters among individuals according to the crossover probability, and generate offspring individuals; Step 4.6: Perform mutation operations on individuals in the parent population and offspring individuals, randomly adjust some permanent magnet parameters according to the preset mutation probability, and generate mutated individuals; Step 4.7: Merge the parent population, offspring individuals, and mutated individuals into a new generation population, and return to step 4.2.

[0014] Furthermore, the formula for calculating the fitness value is as follows: ; in, This is the fitness value; , and These are the magnetic field strength weight, magnetic field uniformity weight, and escape field strength weight, respectively. For the target magnetic field strength, This represents the actual magnetic field strength. Magnetic field uniformity in the imaging region The intensity is the dissipation field strength.

[0015] Furthermore, step 5 specifically includes: based on the permanent magnet parameters of the permanent magnet array corresponding to the optimized individual, using the Biot-Savart law and the magnetic dipole model, calculating the magnetic field generated by each magnet in the permanent magnet array; linearly superimposing the magnetic fields generated by each magnet to obtain the magnetic field generated by the permanent magnet array in the imaging region and the escaping region; determining the magnetic field strength and uniformity of the imaging region based on the magnetic field of the permanent magnet array in the imaging region, and determining the escaping field strength based on the magnetic field of the permanent magnet array in the escaping region; finally calculating and sorting the fitness values ​​of each optimized individual, and using the permanent magnet parameters corresponding to the optimal individual as the optimal permanent magnet parameters.

[0016] As can be seen from the above technical solution, compared with the prior art, the present invention provides a method for optimizing the parameters of a permanent magnet in magnetic resonance imaging, which has the following beneficial effects: This invention combines a deep learning prediction model with an intelligent optimization algorithm, replacing the traditional design method that relies on trial and error, analytical estimation, and repeated finite element simulations. This significantly reduces the computational load and iteration time of the magnetic field, greatly improves the efficiency of permanent magnet parameter optimization, and shortens the overall design cycle of the magnet. Through a magnetic field prediction model with a convolution-encoder-decoder structure, it can accurately capture the strong nonlinear and strongly coupled mapping relationship between permanent magnet array parameters and magnetic field distribution, taking into account both local feature correlation and global dependency modeling. The output magnetic field matrix is ​​more closely aligned with physical constraints, and the prediction accuracy of magnetic field strength and uniformity is higher. A multi-objective fitness function is used to collaboratively optimize magnetic field strength, uniformity, and escape field strength, effectively balancing the coupling conflicts among the three. Under constraints such as permanent magnet size, remanence, and structure, it achieves globally optimal parameter combinations, avoiding the shortcomings of traditional methods that focus on one aspect while neglecting another. The constraints and target weights can be quickly adjusted according to different application scenarios, exhibiting strong versatility and adaptability, and can stably output permanent magnet parameters that meet clinical imaging needs. In summary, the permanent magnet parameter optimization method of this invention has the advantages of high efficiency, accurate prediction, multi-objective collaborative optimization, and strong versatility. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0018] Figure 1 This is a schematic diagram of the overall process of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] This invention discloses a method for optimizing the parameters of a permanent magnet in magnetic resonance imaging, such as... Figure 1 As shown, it includes: Step 1: Determine the fixed structure parameters, magnetic field design parameters, and permanent magnet array constraints of the magnetic resonance imaging equipment; Step 2: Based on conventional permanent magnet parameter design methods (e.g., firstly using engineering trial and error, manually adjusting size, position, and remanence based on experience, and then using analytical methods to equate the magnet, yoke, and air gap to a circuit based on the magnetic circuit theorem, quickly estimating the magnetic field and thus designing the permanent magnet parameters; or using parametric scanning method, designing the permanent magnet parameters by step-by-step traversal and comparison of single / multi-parameter parameters), several permanent magnet array permanent magnet parameter design samples are given, and the magnetic field matrix of each design sample (imaging area and escaping area) is determined by simulation calculation (e.g., using the finite element method for iterative simulation calculation). Step 3: Based on the permanent magnet parameters, design samples and corresponding magnetic field matrices to obtain complete sample data and construct a sample dataset; use the sample dataset to train a magnetic field prediction model and learn the relationship between the permanent magnet parameters and the magnetic field matrix of the permanent magnet array. Step 4: Based on the constraints of the permanent magnet array, generate several individuals corresponding to the permanent magnet parameter design samples, and perform optimization through an optimization algorithm. Select several optimized individuals based on their fitness values. During the optimization process, use the magnetic field prediction model trained in Step 3 to obtain the magnetic field matrix of the design sample corresponding to each individual. Calculate the magnetic field strength, magnetic field uniformity, and exhaust field strength based on the magnetic field matrix, and then determine the fitness value of each individual. Step 5: Determine the permanent magnet parameters of the permanent magnet array corresponding to the optimized individual, and verify the magnetic field strength and uniformity of the imaging area, as well as the escaping field strength, and select the optimal permanent magnet parameters.

[0021] In one specific embodiment, the fixed structural parameters include: the three-dimensional dimensions of the yoke and the three-dimensional dimensions of the pole shoes; Magnetic field design parameters include: magnetic field strength, magnetic field uniformity, and escaping field strength; The constraints on permanent magnet arrays include: the three-dimensional size constraints of individual permanent magnets and the remanence constraints.

[0022] In one specific embodiment, the permanent magnet parameter design sample of the permanent magnet array is represented as a matrix. : ; in, In the permanent magnet array, the first... Line number The parameter vector of the permanent magnet. and These represent the total number of rows and columns, respectively. , They represent the first Line number The length, width, and height of the permanent magnets Indicates the first Line number The magnetization direction vector of the permanent magnet. Indicates the first Line number The magnitude of the remanence of a permanent magnet.

[0023] about and First, using the effective mounting plane dimensions of the yoke and pole shoes as the maximum arrangement boundary, and combining this with the length and width constraints of individual permanent magnets, the upper limit of the number of permanent magnets that the array can accommodate is calculated. Along the lateral arrangement direction of the pole shoe plane, the effective width of the pole shoe is divided by the width of a single permanent magnet and rounded down to obtain the total number of columns in the permanent magnet array. Along the longitudinal arrangement direction of the pole shoe plane, divide the effective length of the pole shoe by the length of a single permanent magnet and round down to obtain the total number of rows of the permanent magnet array. During the arrangement process, reasonable assembly gaps must be reserved to ensure that there is no interference between permanent magnets or between permanent magnets and yokes / pole shoes.

[0024] Magnetic field matrix Represented as: ; It is a three-dimensional matrix. The total number of grid divisions for the magnetic field region along the three axes of a three-dimensional Cartesian coordinate system; Represents the third in three-dimensional space Magnetic field vector at the grid node , The magnitude of the magnetic field at that point in space. Let be the direction vector of the magnetic field at this point in space.

[0025] In one specific embodiment, the magnetic field prediction model includes a convolutional part, an encoder part, and a decoder part; The convolution part takes the matrix of permanent magnet parameter design samples as input, extracts local correlation features of parameters through two-dimensional convolution operation and outputs feature maps to enhance the local correlation of parameter features, while also smoothing and regularizing the feature distribution, and can simulate the shaping effect of magnetic yoke and pole shoes on magnetic field. In the encoder part, based on the feature map output by the convolution part, global feature modeling and fusion are performed by capturing the global dependencies between features to obtain high-dimensional encoded features that integrate global correlation information. In the decoder section, based on high-dimensional encoded features, the encoded features are converted into a three-dimensional magnetic field matrix through global feature alignment and nonlinear mapping reconstruction. This matrix is ​​used to establish a precise mapping relationship between permanent magnet parameters and magnetic field distribution, and outputs the magnetic field matrix of the imaging area and the escaping area.

[0026] In one specific embodiment, the convolutional portion includes sequentially connected 1 1 convolutional layer, 3 3 convolutional layers and pooling layers; 1 1. The convolutional layer performs preliminary feature extraction on the matrix of permanent magnet parameter design samples, extracting the magnetic field strength and direction features of individual magnets; 3. The three convolutional layers extract local features, adaptively capturing the local correlation features of the permanent magnet's position, magnetic field strength, and orientation through learnable convolutional kernels; the pooling layers further refine the local features. The output of the three convolutional layers is subjected to average pooling to reduce the dimension of the feature map and reduce the amount of computation.

[0027] In one specific embodiment, the encoder part is composed of several identical coding layers stacked together, each coding layer including a multi-head self-attention module, a feedforward network module, and a residual connection module; The multi-head self-attention module maps the input features into three sets of features: query, key, and value. It computes multiple sets of self-attention weights in parallel by multiple heads, and then concatenates the multi-head results to obtain global dependency features. This allows it to capture the long-range global dependency between any two permanent magnet parameters in the permanent magnet array, breaking through the limitations of the local receptive field and accurately modeling the strong coupling relationship of multiple parameters.

[0028] The feedforward network module performs high-dimensional nonlinear transformations on globally dependent features through two linear transformation layers and one nonlinear activation layer, thereby improving the model's ability to fit complex magnetic field mapping relationships.

[0029] The residual connection module performs residual connections between the input and output of the feedforward network module and outputs the result; thereby alleviating gradient vanishing in deep networks and improving feature reuse rate and training stability.

[0030] The encoder consists of several identical coding layers stacked together. Each layer performs global dependency capture, nonlinear transformation and residual fusion on the features, which are progressively strengthened and eventually output high-dimensional coded features that fuse global correlation information.

[0031] In one specific embodiment, the decoder part is composed of several identical decoding layers stacked together. Each decoding layer includes an encoder-decoder attention module, a dynamic normalization module, a feedforward network module, and a residual connection module. The encoder-decoder attention module uses the high-dimensional encoded features output by the encoder as key and value features, and the output features of the previous layer of the decoder as query features. It calculates attention weights in parallel with multiple heads, globally aligns the encoded features and decoded features, establishes a mapping relationship between permanent magnet parameter features and magnetic field spatial distribution features, and ensures the physical rationality of magnetic field matrix reconstruction. The dynamic normalization module performs dynamic normalization on the output of the encoder-decoder attention module. Its operation function is as follows: ;in, For input features, and The corresponding mean and standard deviation, respectively It is a very small constant. and To learnable offset parameters, the feature distribution is adaptively adjusted to adapt to the nonlinear characteristics of the magnetic field distribution, thereby improving mapping accuracy and training stability. The feedforward network module performs high-dimensional nonlinear transformation on the normalized features through two linear transformation layers and one nonlinear activation layer, enhancing the model's ability to fit complex magnetic field mapping relationships. The residual connection module performs residual connections between the input and output of the feedforward network module and outputs the result, which alleviates the gradient vanishing problem in deep networks and improves feature reuse rate and training stability. The decoder consists of several identical decoding layers stacked together. Each layer sequentially performs global feature alignment, dynamic normalization, nonlinear transformation and residual fusion, reconstructing the magnetic field distribution layer by layer, and finally converting the high-dimensional encoded features into a three-dimensional magnetic field matrix that conforms to physical constraints.

[0032] In one specific embodiment, step 4 specifically includes: Step 4.1 Initialize the population: Based on the constraints of the permanent magnet array, several sets of permanent magnet parameter combinations are randomly generated as the initial population, with each set of parameter combinations corresponding to one individual; Step 4.2 Fitness Calculation: Input each individual in the population into the trained magnetic field prediction model, output the corresponding magnetic field matrix, and calculate the individual fitness value; Step 4.3 Selection operation: Sort the individuals in the population according to their fitness values, and select a preset number of high-quality individuals as the parent population; Step 4.4 Iteration Termination Judgment: Determine whether the maximum number of iterations or fitness value convergence has been reached. If yes, terminate the iteration and output the optimal individual; otherwise, proceed to step 4.5. Step 4.5 Crossover operation: Perform crossover operation on individuals in the parent population, exchange some permanent magnet parameters among individuals according to the crossover probability, and generate offspring individuals; Step 4.6 Mutation Operation: Perform mutation operation on individuals in the parent population and offspring individuals, randomly adjust some permanent magnet parameters according to the preset mutation probability to generate mutated individuals and maintain population diversity; Step 4.7 Population Update: Merge the parent population, offspring individuals, and mutated individuals into a new generation population, and return to Step 4.2.

[0033] In a specific embodiment, the fitness value is calculated using the following formula: ; in, This is the fitness value; , and These are the magnetic field strength weight, magnetic field uniformity weight, and escape field strength weight, respectively. For the target magnetic field strength, This represents the actual magnetic field strength. Magnetic field uniformity in the imaging region Let represent the escaping field strength. The actual magnetic field strength is predicted and calculated using a magnetic field prediction model, or verified and calculated using the permanent magnet parameters of the permanent magnet array. The uniformity and escaping field strength are calculated similarly.

[0034] In a specific embodiment, step 5 specifically includes: based on the permanent magnet parameters of the permanent magnet array corresponding to the optimized individual, using the Biot-Savart law and the magnetic dipole model, calculating the magnetic field generated by each magnet in the permanent magnet array; linearly superimposing the magnetic fields generated by each magnet to obtain the magnetic field generated by the permanent magnet array in the imaging region and the escaping region; determining the magnetic field strength and uniformity of the imaging region based on the magnetic field of the permanent magnet array in the imaging region, and determining the escaping field strength based on the magnetic field of the permanent magnet array in the escaping region; finally calculating and sorting the fitness values ​​of each optimized individual, and using the permanent magnet parameters corresponding to the optimal individual as the optimal permanent magnet parameters.

[0035] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0036] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for optimizing the parameters of a permanent magnet in magnetic resonance imaging, characterized in that, include: Step 1: Determine the fixed structure parameters, magnetic field design parameters, and permanent magnet array constraints of the magnetic resonance imaging equipment; Step 2: Based on conventional permanent magnet parameter design methods, several permanent magnet array permanent magnet parameter design samples are given, and the magnetic field matrix of each design sample is determined through simulation calculation; Step 3: Based on the permanent magnet parameters, design samples and corresponding magnetic field matrices to obtain complete sample data and construct a sample dataset; The magnetic field prediction model was trained using the sample dataset. Step 4: Based on the constraints of the permanent magnet array, generate several individuals corresponding to the permanent magnet parameter design samples, and perform optimization through an optimization algorithm. Select several optimized individuals based on their fitness values. During the optimization process, use the magnetic field prediction model trained in Step 3 to obtain the magnetic field matrix of the design sample corresponding to each individual. Calculate the magnetic field strength, magnetic field uniformity, and exhaust field strength based on the magnetic field matrix, and then determine the fitness value of each individual. Step 5: Determine the permanent magnet parameters of the permanent magnet array corresponding to the optimized individual, and verify the magnetic field strength and uniformity of the imaging area, as well as the scattering field strength, and select the optimal permanent magnet parameters.

2. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 1, characterized in that, The fixed structural parameters include: the three-dimensional dimensions of the magnetic yoke and the three-dimensional dimensions of the pole shoes; The magnetic field design parameters include: magnetic field strength, magnetic field uniformity, and escaping field strength; The constraints on the permanent magnet array include: three-dimensional size constraints of a single permanent magnet and remanence constraints.

3. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 1, characterized in that, The permanent magnet parameter design sample of the permanent magnet array is represented as a matrix. : ; in, In the permanent magnet array, the first... Line 1 The parameter vector of the permanent magnet. and These represent the total number of rows and columns, respectively. , They represent the first Line 1 The length, width, and height of the permanent magnets Indicates the first Line 1 The magnetization direction vector of the permanent magnet. Indicates the first Line 1 The magnitude of remanence of the permanent magnets; The magnetic field matrix Represented as: ; It is a three-dimensional matrix. The total number of grid divisions for the magnetic field region along the three axes of a three-dimensional Cartesian coordinate system; Represents the third in three-dimensional space Magnetic field vector at the grid node , The magnitude of the magnetic field at that point in space. Let be the direction vector of the magnetic field at this point in space.

4. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 1, characterized in that, The magnetic field prediction model includes a convolutional part, an encoder part, and a decoder part; The convolution part takes the matrix of permanent magnet parameter design samples as input, extracts local correlation features of parameters through two-dimensional convolution operation and outputs feature map; The encoder part, based on the feature map output by the convolution part, performs global feature modeling and fusion by capturing the global dependencies between features, and obtains high-dimensional encoded features that fuse global correlation information. The decoder section, based on the high-dimensional encoded features, converts the encoded features into a three-dimensional magnetic field matrix through global feature alignment and nonlinear mapping reconstruction.

5. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 4, characterized in that, The convolutional part includes sequentially connected 1 1 convolutional layer, 3 3 convolutional layers and pooling layers; the 1 The first convolutional layer performs preliminary feature extraction on the matrix of permanent magnet parameter design samples; the third... The three convolutional layers perform local feature extraction; the pooling layer performs local feature extraction on the three convolutional layers. The output of the third convolutional layer is subjected to average pooling.

6. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 4, characterized in that, The encoder part is composed of several identical coding layers stacked together. Each coding layer includes a multi-head self-attention module, a feedforward network module, and a residual connection module. The multi-head self-attention module maps the input features into three sets of features: query, key, and value. It calculates multiple sets of self-attention weights in parallel with multiple heads and then concatenates the multi-head results to obtain the global dependency features. The forward feedback network module performs high-dimensional nonlinear transformation on the globally dependent features through two linear transformation layers and one nonlinear activation layer. The residual connection module performs a residual connection between the input and output of the forward feedback network module and outputs the result.

7. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 4, characterized in that, The decoder part is composed of several identical decoding layers stacked together. Each decoding layer includes an encoder-decoder attention module, a dynamic normalization module, a feedforward network module, and a residual connection module. The encoder-decoder attention module uses the high-dimensional encoded features output by the encoder as key and value features, and the output features of the previous layer of the decoder as query features. It calculates attention weights in parallel with multiple heads, globally aligns the encoded features and decoded features, and establishes a mapping relationship between permanent magnet parameter features and magnetic field spatial distribution features. The dynamic normalization module performs dynamic normalization processing on the output of the encoder-decoder attention module; The feedforward network module performs high-dimensional nonlinear transformation on the normalized features through two linear transformation layers and one nonlinear activation layer. The residual connection module performs a residual connection between the input and output of the forward feedback network module and outputs the result.

8. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 1, characterized in that, Step 4 specifically includes: Step 4.1: Based on the constraints of the permanent magnet array, randomly generate several sets of permanent magnet parameter combinations as the initial population, with each set of parameter combinations corresponding to one individual; Step 4.2: Input each individual in the population into the trained magnetic field prediction model, output the corresponding magnetic field matrix, and calculate the individual fitness value; Step 4.3: Sort the individuals in the population according to their fitness values, and select a preset number of high-quality individuals as the parent population; Step 4.4: Determine whether the maximum number of iterations or the fitness value has converged. If yes, terminate the iteration and output the optimal individual; otherwise, proceed to step 4.

5. Step 4.5: Perform crossover operation on individuals in the parent population, exchange some permanent magnet parameters among individuals according to the crossover probability, and generate offspring individuals; Step 4.6: Perform mutation operations on individuals in the parent population and offspring individuals, randomly adjust some permanent magnet parameters according to the preset mutation probability, and generate mutated individuals; Step 4.7: Merge the parent population, offspring individuals, and mutated individuals into a new generation population, and return to step 4.

2.

9. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 1, characterized in that, The formula for calculating the fitness value is: ; in, This is the fitness value; , and These are the magnetic field strength weight, magnetic field uniformity weight, and escape field strength weight, respectively. For the target magnetic field strength, This represents the actual magnetic field strength. Magnetic field uniformity in the imaging region The intensity is the dissipation field strength.

10. The method for optimizing permanent magnet parameters in magnetic resonance imaging according to claim 1, characterized in that, Step 5 specifically includes: based on the permanent magnet parameters of the permanent magnet array corresponding to the optimized individual, using the Biot-Savart law and the magnetic dipole model, calculating the magnetic field generated by each magnet in the permanent magnet array; linearly superimposing the magnetic fields generated by each magnet to obtain the magnetic field generated by the permanent magnet array in the imaging region and the escaping region; determining the magnetic field strength and uniformity of the imaging region based on the magnetic field of the permanent magnet array in the imaging region, and determining the escaping field strength based on the magnetic field of the permanent magnet array in the escaping region; finally calculating and sorting the fitness values ​​of each optimized individual, and using the permanent magnet parameters corresponding to the optimal individual as the optimal permanent magnet parameters.