A deep learning-based magnetic resonance imaging automatic classification and lesion detection method

By combining multi-sequence 3D MRI data with anatomical atlases for multi-scale feature modeling and sand cat swarm optimization algorithm, the problems of missed lesion detection and low model optimization efficiency in existing technologies are solved, achieving high-precision and robust lesion detection.

CN122135100APending Publication Date: 2026-06-02THE NAVAL MEDICAL UNIV OF PLA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
THE NAVAL MEDICAL UNIV OF PLA
Filing Date
2026-02-28
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing magnetic resonance imaging technology has problems with lesion detection, such as missed or false detections. It is difficult to make full use of three-dimensional MRI data and prior anatomical information. Furthermore, model optimization is inefficient and relies on time-consuming and labor-intensive manual parameter tuning.

Method used

By combining multi-sequence 3D MRI data with standard anatomical atlases, multi-scale anatomical prior feature maps are constructed. Multi-task joint diagnosis is performed by improving the SegFormer model, and the model parameters are automatically optimized by combining the sand cat swarm optimization algorithm to achieve efficient and automated lesion detection.

Benefits of technology

It significantly improves the accuracy and robustness of lesion classification and segmentation, reduces reliance on manual parameter tuning, enhances diagnostic efficiency and model stability, and is suitable for complex clinical scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122135100A_ABST
    Figure CN122135100A_ABST
Patent Text Reader

Abstract

This invention discloses a deep learning-based automatic classification and lesion detection method for magnetic resonance imaging (MRI), comprising: acquiring multi-sequence MRI three-dimensional volumetric data; preprocessing and dividing the data into training and validation sets; registering with standard anatomical atlases and resampling to obtain multi-scale anatomical prior feature maps; constructing an improved SegFormer model to generate preliminary multi-task joint diagnostic results; encoding the data into parameter vectors to be optimized, forming a parameter vector set; obtaining the optimal parameter vectors based on a sand cat swarm optimization algorithm; using the optimal parameter vectors to obtain the optimized improved SegFormer model; and obtaining the final multi-task joint diagnostic results using the multi-sequence MRI data of the patient to be tested. This invention achieves high-precision automatic classification and lesion detection grading of multi-sequence three-dimensional MRI images by improving the SegFormer model and combining it with sand cat swarm optimization of multi-level parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical imaging technology, and in particular to a method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning. Background Technology

[0002] Magnetic resonance imaging (MRI) is widely used in the clinical diagnosis of diseases of the brain, spine, and multiple organs. Numerous studies and products based on deep learning have been developed for the automatic classification and lesion detection of MRI images. Common methods include using two-dimensional convolutional neural networks, U-Net series networks, encoder-decoder structures, and Transformer-based segmentation models for automatic segmentation or classification of MRI images. However, many methods still process three-dimensional MRI volume data by breaking it down into two-dimensional slices or combinations of a small number of slices, failing to adequately utilize the morphological continuity of lesions in three-dimensional space. Multi-sequence MRI often simply stacks inputs along the channel dimension, lacking feature modeling for the differences between different sequences. Most methods rely solely on network autonomous learning, failing to fully utilize prior information from anatomical atlases and struggling to suppress responses from non-target regions in a timely manner. This leads to missed or false lesions in complex backgrounds and structurally similar regions, resulting in overall classification and segmentation results that are still insufficient in terms of accuracy and robustness.

[0003] Current automated MRI analysis systems generally rely on manual experience or simple grid search and random search methods for model structure design and hyperparameter setting. Key parameters such as the number of encoding layers, channels, loss function weights, learning rate, and lesion detection threshold are often manually adjusted through repeated experiments. This parameter tuning and structure optimization process is time-consuming and labor-intensive, and it is difficult to guarantee global optimum. Some studies have attempted to introduce swarm intelligence optimization methods such as particle swarm optimization and genetic algorithms, but these are mostly single-population, fixed-parameter configurations. They lack mechanisms for adaptive adjustment to changes in target task performance and do not have a dedicated division of labor and collaborative design for global exploration and local development. In high-dimensional parameter spaces, they are prone to getting trapped in local optima, and their optimization efficiency and stability cannot meet the comprehensive performance and efficiency requirements of complex medical image automatic classification and lesion detection tasks.

[0004] Therefore, how to provide a deep learning-based method for automatic classification and lesion detection in magnetic resonance imaging is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose an automatic classification and lesion detection method based on deep learning for magnetic resonance imaging (MRI). This invention revolves around the joint modeling of multi-sequence 3D MRI data and anatomical prior information, and the intelligent optimization of multi-level model parameters. It presents a complete workflow from multi-sequence 3D MRI volumetric data acquisition and preprocessing, standard anatomical atlas registration to generate multi-scale anatomical prior feature maps, multi-task joint diagnosis based on an improved SegFormer model, to automatic optimization of model structural parameters, training hyperparameters, and lesion detection thresholds using a sand cat swarm optimization algorithm, completing model training and clinical inference to output overall diagnostic results and lesion detection grading results. Compared with existing technologies, this invention can more fully utilize 3D multimodal MRI and anatomical prior information, significantly improving the accuracy and robustness of lesion classification and segmentation, while reducing reliance on manual parameter tuning. It has higher diagnostic efficiency and engineering application value in complex clinical scenarios.

[0006] According to an embodiment of the present invention, a deep learning-based automatic classification and lesion detection method for magnetic resonance imaging includes:

[0007] Multiple sequence magnetic resonance three-dimensional volume data were acquired, preprocessed to form a magnetic resonance three-dimensional volume dataset, and divided into training set and validation set;

[0008] Based on standard anatomical atlases, anatomical information is registered to the magnetic resonance three-dimensional volume data space to generate prior probability maps of anatomical regions. Resampling is then performed at different spatial scales to obtain multi-scale anatomical prior feature maps.

[0009] An improved SegFormer model was constructed, and the training set was embedded with 3D overlapping patches and encoded in multiple stages to obtain multi-scale 3D feature maps. These were then combined with multi-scale anatomical prior feature maps to obtain multi-scale gated 3D feature maps and generate preliminary multi-task joint diagnostic results.

[0010] The multi-level parameters of the improved SegFormer model are encoded into parameter vectors to be optimized, forming a set of parameter vectors to be optimized;

[0011] The set of parameter vectors to be optimized is initialized based on the sand cat swarm optimization algorithm, resulting in multiple sand cat individuals, which are then divided into scout groups and hunting groups. Under adaptive sensitive range control, the sand cat individuals are updated and migrated. Based on the fitness evaluation of the improved SegFormer model on the training and validation sets, the optimal parameter vector is output.

[0012] The optimal parameter vector is configured into the multi-level parameters of the improved SegFormer model, and the model is fully trained on the training and validation sets to obtain the optimized improved SegFormer model.

[0013] The multi-sequence magnetic resonance three-dimensional volume data of the patient to be tested are input into the optimized and improved SegFormer model to obtain the final multi-task joint diagnostic results.

[0014] Optionally, the acquisition of multi-sequence magnetic resonance three-dimensional volume data is preprocessed, including spatial registration, removal of irrelevant tissues, resampling, grayscale normalization, size unification, and noise suppression.

[0015] Optionally, the division into training and validation sets includes:

[0016] Acquire multi-sequence magnetic resonance three-dimensional volume data of the target anatomical site. Archive the multi-sequence magnetic resonance three-dimensional volume data of the same subject according to the subject identification to form the original multi-sequence magnetic resonance three-dimensional volume dataset. The multi-sequence magnetic resonance three-dimensional volume data includes liquid attenuation inversion recovery weighted imaging, diffusion weighted imaging, magnetic susceptibility weighted imaging and contrast enhancement weighted imaging.

[0017] The original multi-sequence magnetic resonance three-dimensional volume dataset is preprocessed and randomly divided into training and validation sets at the sample level according to a preset ratio, with the examined objects as the dividing unit.

[0018] Optionally, obtaining the multi-scale anatomical prior feature map includes:

[0019] A standard anatomical atlas corresponding to the target anatomical site is selected, and the preprocessed magnetic resonance three-dimensional volume data is image registered. The magnetic resonance three-dimensional volume data is aligned to the standard anatomical atlas through spatial transformation. Then, the anatomical structure labels in the standard anatomical atlas are mapped to the magnetic resonance three-dimensional volume data space through the inverse transformation of spatial transformation, generating an anatomical structure label map corresponding to the magnetic resonance three-dimensional volume data.

[0020] Based on the anatomical structure label map, a prior probability value is assigned to each voxel of the anatomical region to form an anatomical region prior probability map. The anatomical region prior probability map is then downsampled according to multiple preset spatial scales to obtain a multi-scale anatomical prior feature map.

[0021] Optionally, generating preliminary multi-task joint diagnostic results includes:

[0022] An improved SegFormer model was constructed, including a 3D volume data encoding module, an anatomical prior gated feature fusion module, and a multi-task joint diagnostic output module;

[0023] The three-dimensional volume data encoding module inputs the preprocessed multi-sequence magnetic resonance three-dimensional volume data in the training set in the form of a three-dimensional voxel matrix, adds parameters for the number of channels and the number of feature transformation units for three-dimensional overlapping patch embedding, performs three-dimensional overlapping patch embedding and three-dimensional downsampling feature encoding on the input data, and performs feature transformation through multiple encoding stages in sequence, outputting multiple multi-scale three-dimensional feature maps with different spatial resolutions and number of channels.

[0024] The anatomical prior gating feature fusion module aligns the multi-scale anatomical prior feature map with the multi-scale three-dimensional feature map according to spatial dimensions. At each scale, it combines the corresponding anatomical prior feature map with the current scale three-dimensional feature map, calculates the weight coefficient map of enhancing the target anatomical region and suppressing irrelevant regions, adds a mapping weight parameter, and performs voxel-by-voxel weighting on the scale three-dimensional feature map to obtain the multi-scale gating three-dimensional feature map.

[0025] The multi-task joint diagnosis output module aligns the multi-scale gated 3D feature maps in terms of spatial resolution after channel unification and 3D upsampling. The aligned multi-scale gated 3D feature maps are then stitched together and feature transformed in the channel dimension to obtain a fused 3D feature map. A new fusion weight parameter is added, and image-level diagnostic classification branch, voxel-level lesion segmentation branch, and lesion-level severity grading branch are set on the fused 3D feature map. The image-level diagnostic classification branch outputs the overall diagnostic results, the voxel-level lesion segmentation branch outputs the lesion segmentation results, and the lesion-level severity grading branch outputs the preliminary results of lesion detection grading.

[0026] During the training phase, the losses corresponding to the image-level diagnostic classification branch, the voxel-level lesion segmentation branch, and the lesion-level severity grading branch are weighted and summed according to preset weights, and used as updated model parameters to improve the multi-task joint training loss of the SegFormer model.

[0027] Optionally, the set of parameter vectors to be optimized includes:

[0028] The multi-level parameters to be optimized are determined, including the number of channels and the number of feature transformation units in the 3D volume data encoding module for embedding 3D overlapping patches, the mapping weight parameters in the anatomical prior gating feature fusion module, and the fusion weight parameters in the multi-task joint diagnostic output module.

[0029] The multi-level parameters are arranged one by one in a preset order, and each parameter corresponds to a component in the parameter vector to be optimized. The minimum value, maximum value and value step size are preset for each component to form a parameter vector to be optimized in several dimensions. All the parameter vectors to be optimized are then combined into a set of parameter vectors to be optimized.

[0030] Optionally, the output optimal parameter vector includes:

[0031] Based on the set of parameter vectors to be optimized, multiple initial parameter vectors to be optimized are generated by random sampling within the value range of each parameter dimension. Each parameter vector to be optimized is associated with a sand cat individual, forming an initial sand cat population. The parameter vectors to be optimized corresponding to each sand cat individual are then configured into the improved SegFormer model, and the initial fitness value is calculated by short training rounds on the training set and validation set.

[0032] The initial sand cat population is divided into scout groups and hunting groups according to a preset ratio. In each iteration generation, the global sensitivity range is calculated using an adaptive function based on the current iteration generation, the maximum iteration generation, and the change in the average fitness of the current generation and the previous generation. The global sensitivity range is then multiplied by a random number between zero and one to obtain the individual sensitivity range of each sand cat.

[0033] For each individual sand cat in the reconnaissance group, a global search perturbation is generated based on the individual sensitivity range of the current sand cat and the difference between the current position of the sand cat and the position of the sand cat with the best fitness. The global search perturbation is superimposed on the current position of the sand cat to update the parameter vector to be optimized. Boundary constraints are applied to the updated parameter vector to be optimized and reconfigured into the improved SegFormer model. The updated fitness value is calculated on the training set and the validation set.

[0034] For each individual sand cat in the hunting group, a local development perturbation is generated based on the individual sensitivity range of the sand cat, the distance between the current position of the sand cat and the position of the sand cat with the best fitness, and a random angle between zero and two times pi. The local development perturbation is subtracted from the position of the sand cat with the best fitness to update the parameter vector to be optimized. Boundary constraints are applied to the updated parameter vector to be optimized and reconfigured into the improved SegFormer model. The updated fitness value is calculated on the training set and the validation set.

[0035] Based on the fitness of individual sand cats in the current reconnaissance group and hunting group, some sand cats with better fitness in the reconnaissance group are transferred to the hunting group, and some sand cats with poor fitness in the hunting group are transferred to the reconnaissance group. Iterative optimization is performed until the number of iterations reaches the preset maximum number of iterations or the fitness change of the best-fit sand cat individual in several consecutive generations is lower than the preset threshold. The parameter vector to be optimized corresponding to the best-fit sand cat individual is then output as the optimal parameter vector.

[0036] Optionally, the optimized improved SegFormer model includes:

[0037] Each component in the optimal parameter vector is mapped to the corresponding multi-level parameters of the improved SegFormer model, and the structural parameters of the three-dimensional volume data encoding module, the anatomical prior gated feature fusion module, and the multi-task joint diagnosis output module are set.

[0038] The multi-sequence magnetic resonance three-dimensional volume data and annotations in the training set are used as input. In each training round, the parameters are updated according to the training set, and the multi-task joint diagnostic loss and corresponding performance indicators are calculated on the validation set. The trainable parameters of the improved SegFormer model are iteratively updated based on the backpropagation results of the multi-task joint diagnostic loss until the training rounds reach the preset upper limit or the validation set performance converges, thus obtaining the optimized improved SegFormer model.

[0039] Optionally, obtaining the final multi-task joint diagnostic result includes:

[0040] Multi-sequence magnetic resonance three-dimensional volume data of the target anatomical site of the patient to be tested are acquired, preprocessed to obtain preprocessed magnetic resonance three-dimensional volume data of the patient to be tested, and the standard anatomical atlas is registered to the preprocessed magnetic resonance three-dimensional volume data space to generate multi-scale anatomical prior feature maps.

[0041] Preprocessed 3D MRI data and multi-scale anatomical prior feature maps are input into the MRI automatic classification and lesion detection model for forward reasoning to obtain image-level diagnostic classification results, voxel-level lesion segmentation results, and lesion-level severity grading results.

[0042] The beneficial effects of this invention are:

[0043] This invention utilizes three-dimensional multi-sequence magnetic resonance imaging (MRI) data and standard anatomical atlases to construct multi-scale anatomical prior features. In the improved SegFormer model, deep integration is achieved through three-dimensional volumetric data encoding, anatomical prior gating feature fusion, and multi-task joint diagnostic output. This enables the network to simultaneously perform overall diagnosis, fine lesion segmentation, and lesion severity grading within the same model. Compared to existing methods based solely on two-dimensional slices or simple channel stacking, this invention continuously models lesion morphology in three-dimensional space and uses anatomical priors for selective enhancement and background suppression of target regions, effectively reducing false positives and missed detections. This improves the accuracy and robustness of lesion classification and segmentation results under complex anatomical structures and multi-sequence conditions, providing clinicians with more comprehensive and structured diagnostic information.

[0044] This invention encodes the structural parameters, training hyperparameters, and lesion detection threshold of the improved SegFormer model into a parameter vector to be optimized. It introduces a sandcat swarm optimization algorithm with adaptive sensitivity range decay and a dual-swarm collaborative search structure of scout and hunting groups, achieving automatic global optimization in the high-dimensional parameter space. Compared to empirically-based parameter tuning or traditional single-swarm, fixed-control-parameter optimization strategies, this invention adaptively adjusts the search step size and search strategy based on the model's fitness changes on the training and validation sets. While maintaining global exploration capabilities, it enhances local refinement, reduces manual trial-and-error costs, and lowers the risk of getting trapped in local optima. This results in a higher-performance and more stable automatic magnetic resonance imaging classification and lesion detection model while ensuring controllable computational overhead, facilitating its deployment and widespread application in real-world clinical settings. Attached Figure Description

[0045] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0046] Figure 1 This is a flowchart of a deep learning-based automatic classification and lesion detection method for magnetic resonance imaging proposed in this invention.

[0047] Figure 2 This is a block diagram of the improved SegFormer model, which is a deep learning-based method for automatic classification and lesion detection in magnetic resonance imaging, as proposed in this invention.

[0048] Figure 3 This is a functional diagram of the sand cat swarm optimization algorithm for an automatic classification and lesion detection method for magnetic resonance imaging based on deep learning proposed in this invention. Detailed Implementation

[0049] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0050] refer to Figure 1 , Figure 2 and Figure 3 A deep learning-based automatic classification and lesion detection method for magnetic resonance imaging includes:

[0051] Multiple sequence magnetic resonance three-dimensional volume data were acquired, preprocessed to form a magnetic resonance three-dimensional volume dataset, and divided into training set and validation set;

[0052] Based on standard anatomical atlases, anatomical information is registered to the magnetic resonance three-dimensional volume data space to generate prior probability maps of anatomical regions. Resampling is then performed at different spatial scales to obtain multi-scale anatomical prior feature maps.

[0053] An improved SegFormer model was constructed, and the training set was embedded with 3D overlapping patches and encoded in multiple stages to obtain multi-scale 3D feature maps. These were then combined with multi-scale anatomical prior feature maps to obtain multi-scale gated 3D feature maps and generate preliminary multi-task joint diagnostic results.

[0054] The multi-level parameters of the improved SegFormer model are encoded into parameter vectors to be optimized, forming a set of parameter vectors to be optimized;

[0055] The set of parameter vectors to be optimized is initialized based on the sand cat swarm optimization algorithm, resulting in multiple sand cat individuals, which are then divided into scout groups and hunting groups. Under adaptive sensitive range control, the sand cat individuals are updated and migrated. Based on the fitness evaluation of the improved SegFormer model on the training and validation sets, the optimal parameter vector is output.

[0056] The optimal parameter vector is configured into the multi-level parameters of the improved SegFormer model, and the model is fully trained on the training and validation sets to obtain the optimized improved SegFormer model.

[0057] The multi-sequence magnetic resonance three-dimensional volume data of the patient to be tested are input into the optimized and improved SegFormer model to obtain the final multi-task joint diagnostic results.

[0058] In this embodiment, the acquisition of multi-sequence magnetic resonance three-dimensional volume data and the preprocessing include spatial registration, removal of irrelevant tissues, resampling, grayscale normalization, size unification and noise suppression.

[0059] In this embodiment, the division into training set and validation set includes:

[0060] Acquire multi-sequence magnetic resonance three-dimensional volume data of the target anatomical site. Archive the multi-sequence magnetic resonance three-dimensional volume data of the same subject according to the subject identification to form the original multi-sequence magnetic resonance three-dimensional volume dataset. The multi-sequence magnetic resonance three-dimensional volume data includes liquid attenuation inversion recovery weighted imaging, diffusion weighted imaging, magnetic susceptibility weighted imaging and contrast enhancement weighted imaging.

[0061] The original multi-sequence magnetic resonance three-dimensional volume dataset is preprocessed and then randomly divided into training and validation sets at the sample level according to a preset ratio, using the examined subjects as the dividing unit. Specifically, this random division at the sample level, using the examined subjects as the dividing unit, involves:

[0062] The sample data is organized by dividing the subject into units. All magnetic resonance three-dimensional volume data and corresponding annotation information of the same subject under different sequences are uniformly classified into one sample record. An index table of the subject is established to ensure that the data of the same subject will not be split into different subsets during the division process.

[0063] In the entire index of tested objects, 80% of the tested objects are divided into the training object set and 20% of the tested objects are divided into the validation object set. A fixed random seed is set during random partitioning to ensure the reproducibility of the partitioning process. During the partitioning process, the proportion of different disease categories or diagnostic labels in the training object set and the validation object set is kept to be basically the same, so that the training set and the validation set maintain a relative balance in the category distribution.

[0064] In this embodiment, obtaining the multi-scale anatomical prior feature map includes:

[0065] A standard anatomical atlas corresponding to the target anatomical region is selected. Image registration is performed on the preprocessed MRI 3D volume data. Spatial transformation is used to align the MRI 3D volume data to the standard anatomical atlas. Then, the inverse spatial transformation is used to map the anatomical structure labels from the standard anatomical atlas to the MRI 3D volume data space, generating an anatomical structure label map corresponding to the MRI 3D volume data. Wherein:

[0066] The standard anatomical atlas uses three-dimensional anatomical template data corresponding to the target anatomical site. The three-dimensional anatomical template data is obtained by spatial registration and averaging fusion of magnetic resonance three-dimensional volume data of multiple healthy subjects. Anatomical structure labels are pre-labeled for each anatomical structure in the template space to form a standard anatomical atlas containing anatomical structure label information. The standard anatomical atlas is stored in a fixed spatial coordinate system and voxel resolution and is used as a reference space for registration.

[0067] The step of aligning the magnetic resonance three-dimensional volume data to the standard anatomical atlas through spatial transformation specifically involves: performing image registration between the preprocessed magnetic resonance three-dimensional volume data and the standard anatomical atlas; solving for the spatial transformation function that maps the magnetic resonance three-dimensional volume data to the standard anatomical atlas space; the spatial transformation function is an affine transformation that includes translation, rotation, scaling, and shearing components; and aligning the magnetic resonance three-dimensional volume data to the template space of the standard anatomical atlas in terms of coordinates and scale through the spatial transformation function.

[0068] The inverse transformation of the spatial transformation is to use the inverse spatial transformation function to reverse map the anatomical structure label of each voxel in the standard anatomical atlas from the template space to the original spatial coordinate system of the magnetic resonance three-dimensional volume data. On the voxel grid of the magnetic resonance three-dimensional volume data, the corresponding anatomical structure label value is assigned to each voxel, generating an anatomical structure label map corresponding to the magnetic resonance three-dimensional volume data.

[0069] Based on the anatomical structure label map, a prior probability value is assigned to each voxel of the anatomical region to form an anatomical region prior probability map. The anatomical region prior probability map is then downsampled according to multiple preset spatial scales to obtain a multi-scale anatomical prior feature map.

[0070] In this embodiment, generating preliminary multi-task joint diagnostic results includes:

[0071] An improved SegFormer model was constructed, comprising a 3D volumetric data encoding module, an anatomical prior gated feature fusion module, and a multi-task joint diagnostic output module, wherein:

[0072] The three-dimensional volume data encoding module receives and encodes the preprocessed multi-sequence magnetic resonance three-dimensional volume data, and outputs multi-scale three-dimensional feature maps. The anatomical prior gating feature fusion module introduces multi-scale anatomical prior information at each scale to gating and weight the multi-scale three-dimensional feature maps to generate multi-scale gated three-dimensional feature maps. The multi-task joint diagnosis output module takes the multi-scale gated three-dimensional feature maps as input and generates image-level diagnostic classification results, voxel-level lesion segmentation results, and lesion-level severity grading results, respectively, forming an integrated improved SegFormer model structure.

[0073] The 3D volume data encoding module inputs the preprocessed multi-sequence magnetic resonance 3D volume data from the training set in the form of a 3D voxel matrix. It adds parameters for the number of channels and feature transformation units for 3D overlap patch embedding. The module performs 3D overlap patch embedding and 3D downsampling feature encoding on the input data, sequentially performing feature transformation through multiple encoding stages, outputting multiple multi-scale 3D feature maps with different spatial resolutions and channel numbers.

[0074] The parameters of the number of channels and the number of feature transformation units in the newly added 3D overlapping patch embedding are used to control the number of channels in the output feature map after the 3D overlapping patch is embedded. By adjusting the number of channels, the representation dimension of local voxel blocks in multi-sequence magnetic resonance images by the encoding module is changed, and the feature expression capability is enhanced or compressed under the premise of controllable parameter quantity, providing an adjustable adaptation space for data distribution of different task scales and different anatomical sites.

[0075] The output of multiple multi-scale 3D feature maps with different spatial resolutions and number of channels is specifically as follows:

[0076] The three-dimensional volume data encoding module inputs the preprocessed multi-sequence magnetic resonance three-dimensional volume data in the training set in the form of a three-dimensional voxel matrix. The multi-sequence magnetic resonance three-dimensional volume data is composed of a four-dimensional data tensor with three spatial dimensions of depth, height and width and the sequence channel dimension. The magnetic resonance three-dimensional volume data of the same subject under each sequence are stacked in the channel dimension to form a multi-channel three-dimensional voxel matrix of uniform size as the input of the encoding module.

[0077] The 3D volume data encoding module first performs 3D overlapping patch embedding processing on the input multi-channel 3D voxel matrix. It uses 3D convolution operation with preset convolution kernel size and stride to extract local voxel block features in the depth, height and width directions. The stride of the convolution kernel is smaller than the size of the convolution kernel to form the overlapping area of ​​adjacent patches in space. The convolution output is used as the first layer of 3D feature map to realize the initial mapping from the original voxel space to the feature space.

[0078] After completing the 3D overlapping patch embedding, the 3D volume data encoding module sequentially performs downsampling and feature transformation on the features through multiple encoding stages. Each encoding stage includes a set of 3D downsampling operation units and several 3D feature transformation units. The 3D downsampling operation units reduce the feature map resolution and increase the number of channels in the spatial dimension through 3D convolution or 3D pooling with stride. The 3D feature transformation units perform nonlinear mapping and inter-channel recombination on the downsampled feature map to obtain a new 3D feature representation.

[0079] By executing multiple encoding stages in sequence, the 3D volume data encoding module outputs multi-scale 3D feature maps with gradually decreasing spatial resolution and gradually increasing number of channels from shallow to deep layers. The 3D feature maps at each scale are different in terms of spatial size and number of channels.

[0080] The anatomical prior gating feature fusion module aligns multi-scale anatomical prior feature maps with multi-scale 3D feature maps according to spatial dimensions. At each scale, it combines the corresponding anatomical prior feature map with the current-scale 3D feature map, calculates weight coefficient maps for enhancing the target anatomical region and suppressing irrelevant regions, adds mapping weight parameters, and performs voxel-by-voxel weighting on the scale 3D feature maps to obtain multi-scale gating 3D feature maps, where:

[0081] The newly added mapping weight parameter is used to control the mapping strength and influence ratio of anatomical prior features and multi-scale three-dimensional features in the gating process. By adjusting the weight mapping function of different scales and different anatomical regions, the model can allocate higher gating weights at important anatomical structures and lower gating weights in irrelevant or low-confidence regions.

[0082] The calculation of the weighted coefficient map of the enhanced target anatomical region and the suppressed irrelevant region is specifically as follows:

[0083] The current-scale 3D feature map is spliced ​​or superimposed with the corresponding-scale anatomical prior feature map in the channel dimension to form a joint feature input. The joint feature input is then fed into several 3D convolution operation units and nonlinear activation units for feature transformation, and the output is a single-channel or few-channel response map that is consistent with the current-scale 3D feature map in spatial size.

[0084] Normalization or compression mapping is applied to the response map at each voxel location, mapping the response value to a weight coefficient range between zero and one. This results in voxel locations with high anatomical prior probability and consistent with the 3D feature response receiving larger weight coefficients, while voxel locations with low anatomical prior probability or inconsistent with the 3D feature response receiving smaller weight coefficients, thus forming a weight coefficient map at the current scale.

[0085] The multi-task joint diagnostic output module aligns the multi-scale gated 3D feature maps in terms of spatial resolution after channel unification and 3D upsampling. It then stitches and transforms the aligned multi-scale gated 3D feature maps along the channel dimension to obtain a fused 3D feature map. A fusion weight parameter is added, and image-level diagnostic classification, voxel-level lesion segmentation, and lesion severity grading branches are set on the fused 3D feature map. The image-level diagnostic classification branch outputs the overall diagnostic result, the voxel-level lesion segmentation branch outputs the lesion segmentation result, and the lesion severity grading branch outputs the preliminary lesion detection grading result. Among these:

[0086] The newly added fusion weight parameter is used to adjust the contribution ratio of gated 3D features at each scale in the fused 3D feature map. By assigning learnable or optimizable weights to feature channels at different scales, the model can automatically highlight the scale information most useful for discrimination when jointly outputting overall diagnosis, lesion segmentation and severity grading, suppressing redundant or interfering features, and improving the consistency and accuracy of multi-task prediction results.

[0087] The image-level diagnostic classification branch will perform global pooling on the three spatial dimensions of depth, height and width of the fused three-dimensional feature map to obtain a global feature vector representing the entire magnetic resonance examination. The global feature vector will then be input into a multi-layer fully connected operation unit to output the probability value of the corresponding examination category. The category with the highest probability value will be selected as the overall diagnostic result to characterize the image-level diagnostic conclusion of the current magnetic resonance examination.

[0088] The voxel-level lesion segmentation branch inputs the fused 3D feature map into several 3D convolutional operation units, performs local refinement and channel transformation on the fused features, and then generates a voxel-level prediction map through a 3D convolutional operation unit with the number of output channels equal to the number of target categories. Each voxel position in the voxel-level prediction map corresponds to a set of category probability values. The category with the highest probability is selected as the segmentation label of the current voxel to obtain the lesion segmentation result in the original 3D space.

[0089] The lesion severity grading branch first uses the lesion segmentation results to extract lesion regions from the fused 3D feature map. Through connected component analysis, multiple independent lesion regions are separated in 3D space. For each lesion region, region pooling is performed on the fused 3D feature map to obtain the corresponding lesion feature vector. Then, each lesion feature vector is input into a multi-layer fully connected operation unit to output the severity level or risk score of the current lesion, forming the lesion detection grading result.

[0090] During the training phase, the losses corresponding to the image-level diagnostic classification branch, the voxel-level lesion segmentation branch, and the lesion-level severity grading branch are weighted and summed according to preset weights, and used as updated model parameters to improve the multi-task joint training loss of the SegFormer model.

[0091] In this embodiment, the process of constructing the set of parameter vectors to be optimized includes:

[0092] The multi-level parameters to be optimized are determined, including the number of channels and the number of feature transformation units in the 3D volume data encoding module for embedding 3D overlapping patches, the mapping weight parameters in the anatomical prior gating feature fusion module, and the fusion weight parameters in the multi-task joint diagnostic output module.

[0093] The multi-level parameters are arranged one by one in a preset order, and each parameter corresponds to a component in the parameter vector to be optimized. The minimum value, maximum value and value step size are preset for each component to form a parameter vector to be optimized in several dimensions. All the parameter vectors to be optimized are then combined into a set of parameter vectors to be optimized.

[0094] In this embodiment, the output optimal parameter vector includes:

[0095] Based on the set of parameter vectors to be optimized, multiple initial parameter vectors to be optimized are randomly sampled within the value range of each parameter dimension. Each parameter vector to be optimized is associated with a sand cat individual, forming an initial sand cat population. The parameter vectors to be optimized corresponding to each sand cat individual are then configured into the improved SegFormer model. Short-round training is performed on the training and validation sets to calculate the initial fitness value. Specifically, the short-round training on the training and validation sets to calculate the initial fitness value involves:

[0096] Based on the minimum, maximum, and step size of each parameter in the set of parameter vectors to be optimized, the value range and discrete sampling points of each parameter dimension are determined. Uniform random sampling is performed on all parameter dimensions to generate several complete parameter value combinations in the parameter space. Each parameter value combination forms an initial parameter vector to be optimized.

[0097] Each initial parameter vector to be optimized is mapped to a sand cat individual. All sand cat individuals are combined into an initial sand cat population. The position of each sand cat individual in the parameter space is marked as the parameter vector to be optimized corresponding to the sand cat individual. The structural parameters, training hyperparameters and lesion detection threshold of the improved SegFormer model are configured using the parameter vector to be optimized corresponding to each sand cat individual, resulting in a set of improved SegFormer model instances corresponding to sand cat individuals.

[0098] For each configured improved SegFormer model, a preset number of short training rounds are performed on the training set, and a multi-task joint diagnostic performance index is calculated on the validation set. The comprehensive performance index, including image-level classification performance, voxel-level segmentation performance, and lesion-level grading performance, is combined into a single fitness value according to a preset method. The current fitness value is used as the initial fitness of the corresponding sand cat individual, where:

[0099] The image-level classification performance metric is the image-level diagnostic classification accuracy, which represents the ratio of the number of MRI examinations correctly classified by the model in the validation set to the total number of MRI examinations in the validation set. The voxel-level segmentation performance metric is the average Dice coefficient, which represents the ratio of twice the number of voxels in the intersection of the predicted segmented region and the actual segmented region to the sum of the number of voxels in the predicted segmented region and the actual segmented region for each lesion category, and then the arithmetic mean of the ratios for all lesion categories. The lesion-level grading performance metric is the lesion grading accuracy, which represents the ratio of the number of lesions in the validation set whose predicted severity level is completely consistent with the manually labeled severity level to the total number of lesions.

[0100] The initial sand cat population is divided into scout and hunting groups according to a preset ratio. In each iteration generation, based on the current iteration generation, the maximum iteration generation, and the change in the average fitness of the current generation and the previous generation, an adaptive function is used to calculate the global sensitivity range. The global sensitivity range is then multiplied by a random number between zero and one to obtain the individual sensitivity range of each sand cat. Specifically, the calculation of the global sensitivity range using the adaptive function involves:

[0101] First, the basic sensitivity range is obtained based on the iteration progress. The basic sensitivity range is equal to the preset maximum sensitivity range coefficient multiplied by one minus the ratio obtained by dividing the current iteration number by the maximum iteration number. Then, the fitness improvement rate is calculated based on the fitness change. The fitness improvement rate is equal to the difference between the average fitness of the previous generation and the average fitness of the current generation, divided by the sum of the absolute value of the average fitness of the previous generation and a preset minimum positive number.

[0102] The basic sensitivity range is multiplied by an amplification factor consisting of one plus the product of the adaptive adjustment coefficient and the fitness improvement rate to obtain the adaptively adjusted global sensitivity range, and the global sensitivity range is limited to the preset minimum sensitivity range and maximum sensitivity range.

[0103] For each individual sand cat, a value between zero and one is randomly sampled. The value is then multiplied by the global sensitivity range to obtain the individual sensitivity range of the corresponding sand cat.

[0104] For each individual sand cat in the reconnaissance group, a global search perturbation is generated based on the individual sensitivity range of the current sand cat and the difference between the current position of the sand cat and the position of the sand cat with the best fitness. The global search perturbation is superimposed on the current position of the sand cat to update the parameter vector to be optimized. Boundary constraints are applied to the updated parameter vector to be optimized and reconfigured into the improved SegFormer model. The updated fitness value is calculated on the training set and the validation set.

[0105] For each individual sand cat in the hunting group, a local development perturbation is generated based on the individual sensitivity range of the sand cat, the distance between the current position of the sand cat and the position of the sand cat with the best fitness, and a random angle between zero and two times pi. The local development perturbation is subtracted from the position of the sand cat with the best fitness to update the parameter vector to be optimized. Boundary constraints are applied to the updated parameter vector to be optimized and reconfigured into the improved SegFormer model. The updated fitness value is calculated on the training set and the validation set.

[0106] Based on the fitness of individual sand cats in the current reconnaissance group and hunting group, some sand cats with better fitness in the reconnaissance group are transferred to the hunting group, and some sand cats with poor fitness in the hunting group are transferred to the reconnaissance group. Iterative optimization is performed until the number of iterations reaches the preset maximum number of iterations or the fitness change of the best-fit sand cat individual in several consecutive generations is lower than the preset threshold. The parameter vector to be optimized corresponding to the best-fit sand cat individual is then output as the optimal parameter vector.

[0107] In this embodiment, the optimized and improved SegFormer model includes:

[0108] Each component in the optimal parameter vector is mapped to the corresponding multi-level parameters of the improved SegFormer model, and the structural parameters of the three-dimensional volume data encoding module, the anatomical prior gated feature fusion module, and the multi-task joint diagnosis output module are set.

[0109] The multi-sequence magnetic resonance three-dimensional volume data and annotations in the training set are used as input. In each training round, the parameters are updated according to the training set, and the multi-task joint diagnostic loss and corresponding performance indicators are calculated on the validation set. The trainable parameters of the improved SegFormer model are iteratively updated based on the backpropagation results of the multi-task joint diagnostic loss until the training rounds reach the preset upper limit or the validation set performance converges, thus obtaining the optimized improved SegFormer model.

[0110] In this embodiment, obtaining the final multi-task joint diagnostic result includes:

[0111] Multi-sequence magnetic resonance three-dimensional volume data of the target anatomical site of the patient to be tested are acquired, preprocessed to obtain preprocessed magnetic resonance three-dimensional volume data of the patient to be tested, and the standard anatomical atlas is registered to the preprocessed magnetic resonance three-dimensional volume data space to generate multi-scale anatomical prior feature maps.

[0112] Preprocessed 3D MRI data and multi-scale anatomical prior feature maps are input into the MRI automatic classification and lesion detection model for forward reasoning to obtain image-level diagnostic classification results, voxel-level lesion segmentation results, and lesion-level severity grading results.

[0113] Example 1:

[0114] To verify the feasibility of this invention in practice, it was applied to brain MRI examinations in the radiology department of a tertiary hospital. Patients who underwent cranial MRI examinations between January 2023 and June 2024 were included in the study. The included cases encompassed various diagnostic types, including cerebral infarction, cerebral hemorrhage, brain tumors, demyelinating lesions, and normal controls. Multi-sequence three-dimensional MRI data were collected from all patients, and image-level diagnostic conclusions, fine segmentation and annotation of lesions, and severity grading were provided by senior radiologists. After data anonymization, all cases were grouped and preprocessed according to the subjects to construct a multi-sequence MRI three-dimensional volume dataset for training and validation of the method of this invention.

[0115] This invention first performs spatial registration, removes irrelevant tissues such as the skull, resamples, normalizes grayscale, and unifies dimensions for each multi-sequence 3D MRI. Combined with publicly available standard brain anatomical atlases, multi-scale anatomical prior features spatially aligned with each case are generated through registration. The preprocessed multi-sequence 3D volumetric data and corresponding multi-scale anatomical prior features are input into an improved SegFormer model. The 3D volumetric data encoding module extracts multi-scale 3D features, and the anatomical prior gating feature fusion module emphasizes important anatomical regions and suppresses irrelevant regions. Finally, the multi-task joint diagnostic output module simultaneously provides the overall diagnostic conclusion, lesion segmentation results, and lesion severity classification. Regarding model parameter settings, the 3D encoding structural parameters, anatomical gating parameters, joint loss weights, and lesion detection thresholds are uniformly encoded into a multi-level parameter vector. A sandcat swarm optimization algorithm with adaptive sensitivity range and a dual-group collaborative search structure of reconnaissance and hunting groups is used to automatically optimize the multi-level parameters globally.

[0116] Based on actual hospital data, the automatic classification and lesion detection model for magnetic resonance imaging trained using the method of this invention was used to infer from independently validated brain MRI cases. This achieved an integrated workflow from raw multi-sequence 3D MRI to automatically providing overall diagnosis, lesion extent, and lesion grading results. Compared with existing two-dimensional network plus empirical thresholding methods and the unmodified SegFormer model in radiology, the method of this invention shows a stable improvement in image-level diagnostic accuracy, consistency between lesion segmentation contours and manual annotations, and accuracy in lesion severity grading. While maintaining an acceptable inference time, it significantly reduces the workload of manual tuning and repeated trials, making the model easier to run and update in daily workflows for a long time, and alleviating the workload of doctors in the initial screening and follow-up comparison of large numbers of cases.

[0117] Table 1. Performance comparison of different models on automatic classification and lesion detection tasks in brain MRI.

[0118] Model Image-level accuracy (%) Average Dice of lesions Classification accuracy rate (%) Inference time (seconds / example) Training convergence rounds U-Net 87.9 0.78 79.5 2.10 120 DeepLabV3+ 89.2 0.80 81.3 2.25 130 PSPNet 89.6 0.81 81.8 2.32 132 nnU-Net 91.0 0.83 83.0 2.40 140 SegFormer 91.8 0.83 83.6 2.55 138 Swin-UNet 92.1 0.84 84.2 2.60 142 TransUNet 92.5 0.84 85.0 2.68 145 Method of the present invention 94.6 0.88 88.9 2.81 115

[0119] As can be seen from the data in Table 1, the image-level accuracy of traditional U-Net, DeepLabV3+, and PSPNet in brain MRI tasks is approximately 87.9%–89.6%, the average Dice of lesions is concentrated in the range of 0.78–0.81, and the grading accuracy is approximately 79.5%–81.8%. Overall, they are at a basic usable level, but their ability to characterize small lesions and complex lesion morphologies is limited, making it difficult to meet the requirements of accurate diagnosis.

[0120] The performance of models such as nnU-Net, SegFormer, Swin-UNet, and TransUNet has been improved, with image-level accuracy increasing to 91.0%–92.5%, average lesion Dice increasing to 0.83–0.84, and grading accuracy increasing to 83.0%–85.0%. This indicates that stronger coding structures and attention mechanisms have improved the utilization of 3D information and feature representation to some extent. However, there are still problems such as insufficient anatomical constraints, inadequate fitting of lesion boundaries, and insufficient multi-task collaboration.

[0121] The method of this invention achieves an image-level accuracy of 94.6% and an average lesion Dice of 0.88 under the same dataset and evaluation system, as well as a grading accuracy of 88.9%. These results are significant improvements over representative models such as SegFormer and TransUNet. At the same time, the inference time remains at 2.81 seconds per case and the number of training convergence rounds is reduced to 115, demonstrating a better balance between accuracy, stability and efficiency. This effectively solves the problems of insufficient utilization of three-dimensional multiple sequences and anatomical priors in existing methods and the reliance on manual parameter tuning for model parameters.

[0122] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A deep learning-based automatic classification and lesion detection method for magnetic resonance imaging, characterized in that, include: Multiple sequence magnetic resonance three-dimensional volume data were acquired, preprocessed to form a magnetic resonance three-dimensional volume dataset, and divided into training set and validation set; Based on standard anatomical atlases, anatomical information is registered to the magnetic resonance three-dimensional volume data space to generate prior probability maps of anatomical regions. Resampling is then performed at different spatial scales to obtain multi-scale anatomical prior feature maps. An improved SegFormer model was constructed, and the training set was embedded with 3D overlapping patches and encoded in multiple stages to obtain multi-scale 3D feature maps. These were then combined with multi-scale anatomical prior feature maps to obtain multi-scale gated 3D feature maps and generate preliminary multi-task joint diagnostic results. The multi-level parameters of the improved SegFormer model are encoded into parameter vectors to be optimized, forming a set of parameter vectors to be optimized; The set of parameter vectors to be optimized is initialized based on the sand cat swarm optimization algorithm, resulting in multiple sand cat individuals, which are then divided into scout groups and hunting groups. Under adaptive sensitive range control, the sand cat individuals are updated and migrated. Based on the fitness evaluation of the improved SegFormer model on the training and validation sets, the optimal parameter vector is output. The optimal parameter vector is configured into the multi-level parameters of the improved SegFormer model, and the model is fully trained on the training and validation sets to obtain the optimized improved SegFormer model. The multi-sequence magnetic resonance three-dimensional volume data of the patient to be tested are input into the optimized and improved SegFormer model to obtain the final multi-task joint diagnostic results.

2. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The process involves acquiring multi-sequence magnetic resonance three-dimensional volume data and performing preprocessing, including spatial registration, removal of irrelevant tissues, resampling, grayscale normalization, size unification, and noise suppression.

3. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The division into training and validation sets includes: Acquire multi-sequence magnetic resonance three-dimensional volume data of the target anatomical site. Archive the multi-sequence magnetic resonance three-dimensional volume data of the same subject according to the subject identification to form the original multi-sequence magnetic resonance three-dimensional volume dataset. The multi-sequence magnetic resonance three-dimensional volume data includes liquid attenuation inversion recovery weighted imaging, diffusion weighted imaging, magnetic susceptibility weighted imaging and contrast enhancement weighted imaging. The original multi-sequence magnetic resonance three-dimensional volume dataset is preprocessed and randomly divided into training and validation sets at the sample level according to a preset ratio, with the examined objects as the dividing unit.

4. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The obtained multi-scale anatomical prior feature map includes: A standard anatomical atlas corresponding to the target anatomical site is selected, and the preprocessed magnetic resonance three-dimensional volume data is image registered. The magnetic resonance three-dimensional volume data is aligned to the standard anatomical atlas through spatial transformation. Then, the anatomical structure labels in the standard anatomical atlas are mapped to the magnetic resonance three-dimensional volume data space through the inverse transformation of spatial transformation, generating an anatomical structure label map corresponding to the magnetic resonance three-dimensional volume data. Based on the anatomical structure label map, a prior probability value is assigned to each voxel of the anatomical region to form an anatomical region prior probability map. The anatomical region prior probability map is then downsampled according to multiple preset spatial scales to obtain a multi-scale anatomical prior feature map.

5. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The generation of preliminary multi-task joint diagnostic results includes: An improved SegFormer model was constructed, including a 3D volume data encoding module, an anatomical prior gated feature fusion module, and a multi-task joint diagnostic output module; The three-dimensional volume data encoding module inputs the preprocessed multi-sequence magnetic resonance three-dimensional volume data in the training set in the form of a three-dimensional voxel matrix, adds parameters for the number of channels and the number of feature transformation units for three-dimensional overlapping patch embedding, performs three-dimensional overlapping patch embedding and three-dimensional downsampling feature encoding on the input data, and performs feature transformation through multiple encoding stages in sequence, outputting multiple multi-scale three-dimensional feature maps with different spatial resolutions and number of channels. The anatomical prior gating feature fusion module aligns the multi-scale anatomical prior feature map with the multi-scale three-dimensional feature map according to spatial dimensions. At each scale, it combines the corresponding anatomical prior feature map with the current scale three-dimensional feature map, calculates the weight coefficient map of enhancing the target anatomical region and suppressing irrelevant regions, adds a mapping weight parameter, and performs voxel-by-voxel weighting on the scale three-dimensional feature map to obtain the multi-scale gating three-dimensional feature map. The multi-task joint diagnosis output module aligns the multi-scale gated 3D feature maps in terms of spatial resolution after channel unification and 3D upsampling. The aligned multi-scale gated 3D feature maps are then stitched together and feature transformed in the channel dimension to obtain a fused 3D feature map. A new fusion weight parameter is added, and image-level diagnostic classification branch, voxel-level lesion segmentation branch, and lesion-level severity grading branch are set on the fused 3D feature map. The image-level diagnostic classification branch outputs the overall diagnostic results, the voxel-level lesion segmentation branch outputs the lesion segmentation results, and the lesion-level severity grading branch outputs the preliminary results of lesion detection grading. During the training phase, the losses corresponding to the image-level diagnostic classification branch, the voxel-level lesion segmentation branch, and the lesion-level severity grading branch are weighted and summed according to preset weights, and used as updated model parameters to improve the multi-task joint training loss of the SegFormer model.

6. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The set of parameter vectors to be optimized includes: The multi-level parameters to be optimized are determined, including the number of channels and the number of feature transformation units in the 3D volume data encoding module for embedding 3D overlapping patches, the mapping weight parameters in the anatomical prior gating feature fusion module, and the fusion weight parameters in the multi-task joint diagnostic output module. The multi-level parameters are arranged one by one in a preset order, and each parameter corresponds to a component in the parameter vector to be optimized. The minimum value, maximum value and value step size are preset for each component to form a parameter vector to be optimized in several dimensions. All the parameter vectors to be optimized are then combined into a set of parameter vectors to be optimized.

7. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The output optimal parameter vector includes: Based on the set of parameter vectors to be optimized, multiple initial parameter vectors to be optimized are generated by random sampling within the value range of each parameter dimension. Each parameter vector to be optimized is associated with a sand cat individual, forming an initial sand cat population. The parameter vectors to be optimized corresponding to each sand cat individual are then configured into the improved SegFormer model, and the initial fitness value is calculated by short training rounds on the training set and validation set. The initial sand cat population is divided into scout groups and hunting groups according to a preset ratio. In each iteration generation, the global sensitivity range is calculated using an adaptive function based on the current iteration generation, the maximum iteration generation, and the change in the average fitness of the current generation and the previous generation. The global sensitivity range is then multiplied by a random number between zero and one to obtain the individual sensitivity range of each sand cat. For each individual sand cat in the reconnaissance group, a global search perturbation is generated based on the individual sensitivity range of the current sand cat and the difference between the current position of the sand cat and the position of the sand cat with the best fitness. The global search perturbation is superimposed on the current position of the sand cat to update the parameter vector to be optimized. Boundary constraints are applied to the updated parameter vector to be optimized and reconfigured into the improved SegFormer model. The updated fitness value is calculated on the training set and the validation set. For each individual sand cat in the hunting group, a local development perturbation is generated based on the individual sensitivity range of the sand cat, the distance between the current position of the sand cat and the position of the sand cat with the best fitness, and a random angle between zero and two times pi. The local development perturbation is subtracted from the position of the sand cat with the best fitness to update the parameter vector to be optimized. Boundary constraints are applied to the updated parameter vector to be optimized and reconfigured into the improved SegFormer model. The updated fitness value is calculated on the training set and the validation set. Based on the fitness of individual sand cats in the current reconnaissance group and hunting group, some sand cats with better fitness in the reconnaissance group are transferred to the hunting group, and some sand cats with poor fitness in the hunting group are transferred to the reconnaissance group. Iterative optimization is performed until the number of iterations reaches the preset maximum number of iterations or the fitness change of the best-fit sand cat individual in several consecutive generations is lower than the preset threshold. The parameter vector to be optimized corresponding to the best-fit sand cat individual is then output as the optimal parameter vector.

8. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The optimized and improved SegFormer model includes: Each component in the optimal parameter vector is mapped to the corresponding multi-level parameters of the improved SegFormer model, and the structural parameters of the three-dimensional volume data encoding module, the anatomical prior gated feature fusion module, and the multi-task joint diagnosis output module are set. The multi-sequence magnetic resonance three-dimensional volume data and annotations in the training set are used as input. In each training round, the parameters are updated according to the training set, and the multi-task joint diagnostic loss and corresponding performance indicators are calculated on the validation set. The trainable parameters of the improved SegFormer model are iteratively updated based on the backpropagation results of the multi-task joint diagnostic loss until the training rounds reach the preset upper limit or the validation set performance converges, thus obtaining the optimized improved SegFormer model.

9. The method for automatic classification and lesion detection in magnetic resonance imaging based on deep learning according to claim 1, characterized in that, The final multi-task joint diagnostic result obtained includes: Multi-sequence magnetic resonance three-dimensional volume data of the target anatomical site of the patient to be tested are acquired, preprocessed to obtain preprocessed magnetic resonance three-dimensional volume data of the patient to be tested, and the standard anatomical atlas is registered to the preprocessed magnetic resonance three-dimensional volume data space to generate multi-scale anatomical prior feature maps. Preprocessed 3D MRI data and multi-scale anatomical prior feature maps are input into the MRI automatic classification and lesion detection model for forward reasoning to obtain image-level diagnostic classification results, voxel-level lesion segmentation results, and lesion-level severity grading results.