A brain disease classification method based on 3D attention convolution and self-supervised learning

By using a method based on 3D attention convolution and self-supervised learning, the problem of medical image classification models relying on manually labeled data is solved. The data augmentation intensity is dynamically adjusted and a gradient blocking mechanism is introduced to achieve efficient image classification under cross-domain data, thereby improving the model's generalization ability and accuracy.

CN122156786APending Publication Date: 2026-06-05GUOCI CLOUD DIGITAL (DEQING) TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUOCI CLOUD DIGITAL (DEQING) TECHNOLOGY CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-05

Smart Images

  • Figure CN122156786A_ABST
    Figure CN122156786A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of medical image processing and artificial intelligence, and discloses a brain disease classification method based on 3D attention convolution and self-supervised learning. The method acquires a no-label three-dimensional brain image, carries out frequency domain decoupling and amplitude spectrum blending, combines a three-dimensional low-pass filter to generate an enhanced composite sample; the image is input into a three-dimensional convolutional neural network containing a channel and spatial attention branch, and a corresponding weighted mask is extracted; the channel energy dispersion degree is calculated, and the cutoff frequency radius of the filter is updated in reverse to dynamically adjust the frequency domain disturbance degree; based on the enhanced sample, the network is trained through self-supervised contrast learning combined with a stop gradient operation to obtain a pre-training model. The application can reduce the dependence on artificial labeled data, eliminate the data acquisition differences of multi-center cross-devices, avoid shortcut learning of the model, and improve the accuracy of image classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical image processing and artificial intelligence technology, specifically to a brain disease classification method based on 3D attention convolution and self-supervised learning. Background Technology

[0002] Medical magnetic resonance imaging (MRI) plays a crucial role in the clinical diagnosis of brain diseases. In recent years, deep learning techniques based on 3D convolutional neural networks have been widely applied to assist in the classification of brain images. However, existing deep learning classification models typically employ a supervised learning paradigm, and their training process heavily relies on large-scale 3D image datasets annotated by professional physicians. Due to the high cost and long cycle of medical image annotation, these models often face limitations in practical applications due to insufficient labeled data, resulting in limited generalization ability when faced with unknown data.

[0003] To reduce reliance on manually labeled data, some studies have introduced self-supervised learning methods in medical image processing. However, when generating enhanced samples for 3D medical images, existing techniques often employ geometric transformations based on the spatial dimension of the image, such as random cropping, flipping, or adding conventional noise. These conventional enhancement methods do not fully consider the frequency domain physical characteristics of MRI images, making it difficult to effectively separate the underlying anatomical structures of the image from the physical properties of the external acquisition equipment. Therefore, when faced with multi-center data from different medical institutions and acquisition devices, existing methods struggle to eliminate data distribution shifts caused by differences in equipment acquisition, leading to decreased cross-domain classification accuracy.

[0004] Furthermore, in existing self-supervised feature extraction iterations, the strength parameter of data augmentation is usually pre-set and kept fixed. This static perturbation method cannot perceive and adapt to the current feature extraction state of the model, easily leading to gradient instability in the early stages of training due to excessive data perturbation, or getting stuck in local optima in the later stages of training due to insufficient perturbation, thus resulting in shortcut learning. Simultaneously, because brain lesions often have multi-scale and complex three-dimensional spatial structures, existing networks lack effective gradient isolation mechanisms when simultaneously processing global channel features and local spatial features. This can cause computational conflicts between attention features of different dimensions during backpropagation, leading to feature degradation and ultimately affecting the reliability and accuracy of brain disease classification. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a brain disease classification method based on 3D attentional convolution and self-supervised learning. This solves the problem that existing medical brain image classification models rely on large-scale datasets with manual annotations by doctors, resulting in high data acquisition and annotation costs and limited model generalization ability. Furthermore, existing unsupervised or self-supervised image enhancement methods typically employ spatial geometric transformations or conventional noise addition, failing to address the frequency domain physical characteristics of MRI images, making it difficult to eliminate cross-domain data differences caused by acquisition equipment from different medical institutions.

[0006] To address the above problems, the present invention provides the following technical solution: The first aspect of this invention provides a brain image classification method based on 3D attentional convolution and self-supervised learning, comprising the following steps: Acquire the first and second label-free 3D brain images; Frequency domain decoupling and amplitude spectrum fusion were performed on the first and second unlabeled 3D brain images, and enhanced synthetic samples were generated by combining them with a 3D Butterworth low-pass filter. The first unlabeled 3D brain image and the enhanced synthetic sample were respectively input into a 3D convolutional neural network containing channel attention branches and spatial attention branches for feature extraction, and their respective channel weighted masks and spatial weighted masks were obtained. Extract the channel weighted mask corresponding to the enhanced synthetic sample, calculate the channel energy dispersion of the channel weighted mask, and update the cutoff frequency radius of the three-dimensional Butterworth low-pass filter in reverse according to the channel energy dispersion, so as to dynamically adjust the frequency domain perturbation degree of the enhanced synthetic sample generated in the next iteration. Based on the enhanced synthetic samples after updating the cutoff frequency radius and the first unlabeled 3D brain image, the 3D convolutional neural network is subjected to comparative learning and iterative training using a preset self-supervised loss function to obtain a pre-trained network model. Acquire clinically labeled 3D brain images, and use these images to perform supervised fine-tuning of the pre-trained network model to obtain a target image classification model. The three-dimensional brain image to be processed is input into the target image classification model, and the image classification result is output.

[0007] In one optional implementation, the process of acquiring the first and second unlabeled 3D brain images includes: constructing an unlabeled 3D image data pool; extracting two distinct random index parameters from the unlabeled 3D image data pool based on a random sampling mechanism without replacement; extracting the corresponding first and second unlabeled 3D brain images according to the distinct random index parameters, and performing modal consistency verification to ensure that both belong to the same medical magnetic resonance imaging modality. This step, by setting modal constraints, avoids cross-modal feature fusion of images with different imaging physical properties, preventing the generation of data lacking actual physical meaning.

[0008] In one optional implementation, the process of frequency domain decoupling and amplitude spectrum fusion of the first and second unlabeled 3D brain images, combined with a 3D Butterworth low-pass filter to generate enhanced synthetic samples, includes: obtaining the first amplitude spectrum and first phase spectrum of the first unlabeled 3D brain image, and the second amplitude spectrum of the second unlabeled 3D brain image, respectively, through 3D Fast Fourier Transform; generating a 3D low-pass mask and a 3D high-pass mask using a 3D Butterworth low-pass filter; extracting the low-frequency component of the first amplitude spectrum through the 3D low-pass mask, extracting the high-frequency component of the second amplitude spectrum through the 3D high-pass mask, and linearly adding the low-frequency component and the high-frequency component to obtain a mixed amplitude spectrum; recombining the mixed amplitude spectrum with the first phase spectrum, and generating enhanced synthetic samples through 3D Inverse Fast Fourier Transform. The above process is based on Fourier frequency domain theory. By separating the amplitude spectrum, which reflects the overall contrast of the image, from the phase spectrum, which reflects the topological information of the anatomical structure, it preserves the underlying anatomical structure of the original image while introducing the physical appearance features of the external image, thereby eliminating the differences in equipment acquisition caused by multi-center data acquisition in the feature space.

[0009] In one optional implementation, the process of calculating the channel energy dispersion of the channel-weighted mask and updating the cutoff frequency radius of the 3D Butterworth low-pass filter based on the channel energy dispersion includes: calculating the statistical variance of the extracted channel-weighted mask in each channel dimension, defining the statistical variance as the channel energy dispersion; calculating the error callback deviation between the preset target dispersion and the channel energy dispersion; and propagating the error callback deviation in reverse, updating the cutoff frequency radius of the 3D Butterworth low-pass filter in the next iteration based on the exponential moving average mechanism. The channel energy dispersion objectively characterizes the network's ability to focus on core channel features. Through the aforementioned closed-loop feedback mechanism, the algorithm can dynamically adjust the filter's cutoff radius according to the current feature extraction state of the model, achieving adaptive adjustment of the data augmentation intensity. This mechanism avoids gradient collapse caused by the introduction of high-frequency noise in the early stages of training, while also preventing the model from getting trapped in local optima in the later stages of training.

[0010] In one optional implementation, the process of performing contrastive learning iterative training on a 3D convolutional neural network using a preset self-supervised loss function includes a gradient blocking operation. Specifically, this involves: obtaining the frequency band perturbation type parameter for the current iteration; when the frequency band perturbation type parameter indicates that low-frequency perturbation dominates, applying a stop gradient operation to the operator generating the channel weighted mask in the channel attention branch to cut off the contrastive learning gradient backpropagation path of the channel attention branch; when the frequency band perturbation type parameter indicates that high-frequency perturbation dominates, applying a stop gradient operation to the operator generating the spatial weighted mask in the spatial attention branch to cut off the contrastive learning gradient backpropagation path of the spatial attention branch. During this process, the forward propagation of the identity mapping of the backbone features in the 3D convolutional neural network remains connected to the basic gradient backpropagation path. This gradient blocking design dynamically blocks parameter updates of non-correlated branches based on the dominant type of the current frequency domain perturbation, allowing the network to alternately rely on spatial and channel features for contrastive learning, preventing degradation in the feature extraction process. Simultaneously, the connectivity of the backbone identity mapping ensures the integrity of the underlying network computation graph.

[0011] In one optional implementation, the preset self-supervised loss function includes adaptive temperature contrast loss and attention consistency loss. The process of calculating the adaptive temperature contrast loss includes: calculating the feature distribution variance of the current batch of data in the feature space; dynamically and positively adjusting the adaptive temperature coefficient based on the feature distribution variance, wherein the smaller the feature distribution variance, the smaller the adjusted adaptive temperature coefficient; and using the adjusted adaptive temperature coefficient to calculate the adaptive temperature contrast loss between the first unlabeled 3D brain image and the enhanced synthetic sample. The process of calculating the attention consistency loss includes: extracting the first spatially weighted mask corresponding to the first unlabeled 3D brain image and the second spatially weighted mask corresponding to the enhanced synthetic sample; calculating the mean square error between the first spatially weighted mask and the second spatially weighted mask to obtain the attention consistency loss. This loss function system can automatically adjust the learning difficulty according to the degree of sample clustering in the feature space and constrain the network to output a consistent spatial response to the same anatomical structure under different perturbations.

[0012] In one optional implementation, the process of supervised fine-tuning of a pre-trained network model using clinically labeled 3D brain images includes: replacing the nonlinear projection head at the end of the pre-trained network model with a task-level perception layer; inputting the clinically labeled 3D brain images into the replaced pre-trained network model and outputting predicted probabilities; calculating the comprehensive error using a multi-class focal loss function, and performing numerically safe truncation within the logarithmic domain of the multi-class focal loss function by maximizing the predicted probabilities against a preset minimum constant; updating the network parameters based on the comprehensive error to obtain the target image classification model. The numerically safe truncation process avoids gradient explosion caused by logarithmic underflow.

[0013] In one optional implementation, the process of inputting the three-dimensional brain image to be processed into the target image classification model and outputting the image classification result includes: inputting the three-dimensional brain image to be processed into the target image classification model and outputting a set of predicted probabilities for each image category; determining whether the maximum predicted probability in the set of predicted probabilities is greater than or equal to a preset confidence threshold; if it is greater than or equal to the confidence threshold, then the category corresponding to the maximum predicted probability is taken as the image classification result. After inputting the three-dimensional brain image to be processed into the target image classification model and outputting the image classification result, the process further includes: extracting the spatially weighted mask generated by the target image classification model for the three-dimensional brain image to be processed; and fusing the extracted spatially weighted mask with the three-dimensional brain image to be processed after interpolation and magnification to output a three-dimensional lesion heatmap. This provides a visual representation of lesion features.

[0014] A second aspect of the present invention provides an electronic device including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the brain image classification method based on 3D attention convolution and self-supervised learning as described in any optional embodiment of the first aspect of the present invention.

[0015] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the brain image classification method based on 3D attention convolution and self-supervised learning as described in any optional embodiment of the first aspect of the present invention.

[0016] This invention provides a brain disease classification method based on 3D attentional convolution and self-supervised learning. It has the following beneficial effects: 1. This invention decouples unlabeled 3D brain images in the frequency domain, extracts and reconstructs the amplitude and phase spectra, and generates enhanced synthetic samples by combining them with a 3D Butterworth low-pass filter. This feature preserves the underlying anatomical topological information of the original images while introducing physical appearance features from different data sources, effectively eliminating image data differences caused by multi-center equipment acquisition and improving the model's generalization ability when facing cross-domain data.

[0017] 2. This invention calculates the channel energy dispersion of a channel-weighted mask and updates the cutoff frequency radius of a three-dimensional Butterworth low-pass filter based on this dispersion. This feature constructs a closed-loop feedback adjustment mechanism for data augmentation intensity, enabling the algorithm to dynamically adjust the frequency domain perturbation level in the next round based on the model's current feature extraction state. This avoids the shortcut learning problem caused by using fixed augmentation parameters and prevents the model from getting trapped in local optima in the later stages of training, thus improving the stability of self-supervised training.

[0018] 3. This invention introduces a gradient blocking mechanism in contrastive learning training. Based on the current frequency band perturbation type, it dynamically applies a gradient-stopping operation to either the channel attention branch or the spatial attention branch. This feature, while maintaining the connectivity of the backbone network's basic feature flow, cuts off the gradient backpropagation path of specific branches, allowing the network to alternately rely on spatial and channel features for learning. This avoids computational conflicts that may arise during multi-scale lesion feature extraction, reduces the risk of feature degradation, and thus improves the accuracy of the final brain image classification. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the architecture of the brain disease classification system according to an embodiment of the present invention; Figure 2 This is a flowchart of a brain disease classification method based on 3D attention convolution and self-supervised learning, according to an embodiment of the present invention. Figure 3 This is a comparison chart of ROC curves for various methods in this invention embodiment; Figure 4 This is a dynamic trend diagram of closed-loop feedback parameters and loss convergence in an embodiment of the present invention; Figure 5 This is an interpretable lesion thermogram according to an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions in 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.

[0021] See attached document Figure 1 , Figure 1 This is a schematic diagram of the architecture of a brain disease classification system according to an embodiment of the present invention. The present invention provides a brain disease classification system deployed on a computer device equipped with graphics processing unit resources and a parallel computing architecture to perform brain disease diagnosis and classification tasks. The brain disease classification system includes a data acquisition module, a frequency domain processing module, a feature extraction module, a closed-loop feedback module, and a classification inference module. The data acquisition module receives and stores three-dimensional magnetic resonance imaging (MRI) data acquired by external medical scanning equipment. The three-dimensional MRI image data includes unlabeled three-dimensional MRI image data and three-dimensional MRI image datasets with clinical pathological annotation information. The data acquisition module converts the three-dimensional MRI image data and loads it into computing memory to provide data input for subsequent processes.

[0022] See attached document Figure 2 , Figure 2This is a flowchart of a brain disease classification method based on 3D attention convolution and self-supervised learning according to an embodiment of the present invention. The present invention provides a brain disease classification method based on 3D attention convolution and self-supervised learning, comprising the following steps: S10, Obtain unlabeled original and donor samples from three-dimensional magnetic resonance imaging data; S20: Perform three-dimensional fast Fourier transform on the original sample and the donor sample to extract the corresponding three-dimensional amplitude spectrum and three-dimensional phase spectrum. Call the three-dimensional Butterworth filter to perform frequency domain weighted fusion on the three-dimensional amplitude spectrum and retain the three-dimensional phase spectrum data of the original sample. Generate an enhanced synthetic sample with physical perturbation in a specific frequency band through three-dimensional inverse fast Fourier transform. S30 constructs a positive sample pair by combining the original sample and the enhanced synthetic sample and inputs it into the feature extraction module. Forward propagation is performed through a three-dimensional convolutional coding feature backbone network and a cascaded three-dimensional channel global anatomical attention mechanism and a three-dimensional spatial local pathological attention mechanism. In parallel, global channel attention calibration tensor, local spatial attention feature mask and dimensionality reduction representation vector are generated. S40: Based on the dominant frequency band perturbation type when generating enhanced synthetic samples by the frequency domain processing module, activate the corresponding backpropagation route selector to block the gradient backpropagation path of non-corresponding attention mechanism branches to calculate the contrastive learning loss and attention consistency loss respectively; at the same time, calculate the channel energy dispersion based on the energy parameters of the channel weighted mask, calculate the error callback deviation based on the channel energy dispersion and backpropagate it to the frequency domain processing module to dynamically update the cutoff frequency radius variable of the three-dimensional Butterworth filter, and iterate until the self-supervised loss function reaches the convergence condition; S50 performs a classification fine-tuning phase after the self-supervised pre-training phase converges. It stops the feedback calculation logic of frequency band physical perturbation and error callback, loads three-dimensional MRI image data with clinical pathology annotation information into the feature extraction module, and uses the cross-entropy loss function to perform supervised reverse fine-tuning operations on the parameters in the classification inference module and the feature extraction module. S60: Input the newly acquired three-dimensional MRI images of the patient to be tested into the feature extraction module and classification reasoning module after parameter fine-tuning. Through the extracted data features, the module calculates and outputs the confidence probability index and the final reasoning classification result of the three-dimensional MRI images of the patient to be tested corresponding to the labels of various medical degenerative diseases.

[0023] In this embodiment, the process of obtaining unlabeled original and donor samples from three-dimensional magnetic resonance imaging data in step S10 further includes the following sub-steps: S101: Acquire the original 3D NMR images and perform voxel space alignment and grayscale normalization to construct a label-free 3D image data pool.

[0024] In practical medical image processing scenarios, the system reads raw 3D MRI images (e.g., T1-weighted or T2-weighted structural MRI images) from external storage media or medical image archiving systems that do not contain pathological diagnostic labels. Due to differences in imaging parameters generated by underlying scanning equipment (such as hardware from different brands or with different magnetic field strengths), the system needs to resample 3D MRI images from different sources to a uniform voxel physical size (preferably isotropic resolution of 1mm × 1mm × 1mm). For brain tissue extraction, skull dissection, and bias field correction of 3D MRI images, those skilled in the art can use basic tools in the field of medical image analysis to perform corresponding operations. The basic processing mechanisms for MRI artifact elimination and brain parenchyma localization are well-known technologies in the field and will not be elaborated here.

[0025] After completing the above operations, non-critical background areas and artifact interference are eliminated. To ensure that the input data distribution meets the requirements for robust feature extraction by the self-supervised model and to avoid gradient explosion caused by extreme contrast, the spatially registered 3D NMR images need to undergo grayscale normalization calculation. The computing device extracts the voxel grayscale values ​​of non-background regions from each individual image and performs numerical mapping through feature normalization. Specifically, this involves converting the absolute grayscale value of each voxel into a standardized feature reflecting the relative offset. The mapping formula is as follows: ; in, This indicates the coordinates in three-dimensional space after standardization. The voxel gray value at that location; This represents the original voxel gray value at the corresponding coordinates after resampling; This represents the average gray value of all foreground brain tissue voxels within a single 3D brain image. This represents the standard deviation of the gray levels of all foreground brain tissue voxels in the image of this single unit; To prevent the calculation of non-zero constants from overflowing, as a preferred method, The value is configured to be 10. -5 The maximum value function is used here. The denominator is constrained to strictly avoid division-to-zero anomalies in extremely smooth background slices. The three-dimensional spatial coordinates are strictly constrained by the subsequently defined spatial dimension boundaries, i.e., satisfying... , and All images that have undergone the above calculations and completed grayscale mapping are loaded into memory, collectively forming a large-scale unlabeled 3D image data pool required for self-supervised learning.

[0026] S102, in each iteration of the system's self-supervised pre-training, extracts disjoint image volume data from the unlabeled 3D image data pool according to a random discrete probability distribution, and defines and maps them as original samples and donor samples.

[0027] The aforementioned unlabeled 3D image data pool is defined as a set. ,in This refers to the total number of 3D NMR individual images covered by the data pool. Possessing unique characterization of the first Three-dimensional tensors of the brain of each independently acquired individual. At the start of each independent training batch of the self-supervised computation pipeline, the computing device consists of integer ranges... Internally retrieve two unequal random index parameters. and To ensure the rigor of the algorithm logic and prevent index collision dead zones, the extraction program incorporates a random sampling decision mechanism without replacement. That is, if the initial state intercepted by the system's internal pseudo-random generator is... If the result is not found, the incremental parameter will be forcibly discarded and regenerated. Until the two are different. At the same time, the system has built-in modal consistency verification rules to ensure that the original sample and the donor sample that are extracted and paired belong to the same medical magnetic resonance imaging modality (e.g., both are T1-weighted structural images or both are T2-weighted images), so as to prevent uncontrollable physical structural distortion caused by cross-modal frequency domain fusion.

[0028] The computing device will retrieve the corresponding index from the data pool. Image feature data It is assigned as the original sample. From the perspective of principle analysis, this original sample is used to provide the basic data of the medical topology and spatial anatomical morphology of the core examined individual for subsequent network operations, which constitutes the structural benchmark in self-supervised contrastive learning.

[0029] In parallel, the computing device will correspond to the index Image feature data Assigned as donor samples. Donor samples are decoupled from their actual anatomical representation task in the system and are only used to provide physical contrast difference intervention parameters of heterogeneous individuals in the frequency domain processing stage. This assists the algorithm in synthesizing an enhanced view with anatomical invariance but altered grayscale contrast without manual annotation.

[0030] The original sample and donor sample, after mapping and extraction, are transferred to the graphics processor's memory. Physically, the original sample and donor sample maintain a strictly consistent three-dimensional tensor shape. in The number of height voxels representing the coronal space. The number of voxels representing the width of the sagittal plane. This represents the number of depth slices in the cross-sectional space. As a practical operational dimension reference in this embodiment, The data can be cropped or zero-padding and set to 160×192×160 to fit the receptive field of a 3D convolutional network. The original samples and donor samples with the above data attributes and format together construct the basic paired input pool for this round of self-supervised forward propagation computation, serving as normalized input nodes for inter-layer computation of the network.

[0031] In this embodiment, regarding step S20 above, the process of performing a three-dimensional fast Fourier transform on the original sample and the donor sample to extract the corresponding three-dimensional amplitude spectrum and three-dimensional phase spectrum, calling a three-dimensional Butterworth filter to perform frequency domain weighted fusion on the three-dimensional amplitude spectrum and retaining the three-dimensional phase spectrum data of the original sample, and generating an enhanced synthetic sample with physical perturbations in a specific frequency band through a three-dimensional inverse fast Fourier transform, further includes the following sub-steps: S201 After acquiring the original sample and the donor sample, the computing device performs a three-dimensional fast Fourier transform on them through the discrete computing engine to perform a forward frequency domain mapping, converting the voxel matrix in the spatial domain into a three-dimensional complex domain tensor that covers the frequency distribution, thereby realizing the mathematical decoupling of the image's physical contrast information and geometric anatomical structure.

[0032] In the field of medical image analysis, low-frequency signals from MRI images typically characterize smooth contrast and large areas of grayscale appearance between tissues, while high-frequency signals and phase components highly encapsulate intricate anatomical topological structures such as brain sulci and gyri contours and lesion edges. To enable the model to learn anatomical structural features unaffected by differences in scanning equipment hardware without manual annotation, this embodiment separates the amplitude representing appearance from the phase representing structure in the frequency domain.

[0033] Computing devices are designed for spatial dimensions that are all The original sample tensor With donor sample tensor Through three-dimensional fast Fourier transform This transformation is derived from a spatial domain image into a three-dimensional complex tensor composed of real and imaginary parts. Taking the original sample as an example, the transformation is defined and the complex domain analytical process is expressed as follows: ; in, Represents the original sample's coordinates in the frequency domain. Complex frequency values ​​at; and These represent the real and imaginary parameters corresponding to that frequency point, respectively. The imaginary unit represents the complex number field. Based on this, the system extracts the corresponding three-dimensional amplitude spectrum through polar coordinate transformation. With three-dimensional phase spectrum Its mapping formula is: ; atan ; To avoid the real part being used when calculating the phase angle The algorithm dead zone that triggers a division-by-zero exception when the result is zero is preferably addressed by calling the full-quadrant arctangent function atan in this embodiment. It can robustly output the values ​​directly based on the signs and values ​​of the real and imaginary parts. Phase angle within the interval. Parallel computation pipelines utilize equivalent logic to synchronously acquire donor samples. Three-dimensional amplitude spectrum With three-dimensional phase spectrum The parameter space for each dimension of this process is strictly limited to... , and Within the integer coordinate domain.

[0034] S202 generates a three-dimensional Butterworth mask matrix based on the centroid coordinates of the three-dimensional frequency band, and establishes a cutoff frequency filter channel with continuous differentiability and spatial smoothness properties to eliminate potential Gibbs ringing artifacts during time-domain reconstruction.

[0035] When truncating and blending different sample frequency components, directly using a rectangular window with an ideal mask can cause abrupt truncation of frequency components at the high-low frequency boundary. This discontinuous mapping will induce concentric water ripple interference patterns in the inversely reconstructed spatial image. To overcome this physical distortion defect, this embodiment constructs a three-dimensional Butterworth filter and introduces a transition band design that gradually decays with the frequency radius.

[0036] The computing device first shifts the zero-frequency component to the geometric center of the spectrum matrix and defines the position of the zero-frequency point at that center as... Based on this, the system calculates arbitrary discrete frequency points. The three-dimensional Euclidean spatial distance between the zero frequency point and this point Its calculation method can be expanded as follows: ; Subsequently, the system generates three-dimensional Butterworth low-pass mask matrices for the low-frequency and high-frequency bands, respectively. With the high-pass mask matrix The values ​​of each element in the matrix are calculated as follows: ; ; in, To control the cutoff steepness of first-order or multi-order filters, a preferred approach is to balance smoothness and cutoff strength. The value is set to 2; The cutoff frequency radius variable represents the three-dimensional Butterworth filter and is also defined as the half-power frequency threshold. In the first iteration of the self-supervised procedure, the computing device uses its internal pseudo-random number generator to draw from a boundary-constrained uniform distribution. The initial startup value, the range of which is preferably defined within 1000. Within the interval, in subsequent training iterations, this variable... Random sampling is stopped, and instead, the system receives error callback parameters calculated based on spatial discreteness from the closed-loop feedback module, performing dynamic iterative updates to ensure the reasonableness of the basic frequency passband range. For the adjustment of frequency domain coordinates and low-frequency centering shift operations in three-dimensional space, those skilled in the art can use the Discrete Fourier Translation Operator for adaptation; this is well-known technology in the field and will not be elaborated upon here.

[0037] S203, under the computational forced safety constraint of locking the original sample's three-dimensional phase spectrum to maintain its numerical value, obtains and executes a random Boolean decision selection instruction, and calls a three-dimensional Butterworth low-pass or high-pass mask matrix to perform frequency domain weighted fusion on the three-dimensional amplitude spectrum according to the instruction, and outputs the target mixed amplitude spectrum whose physical properties of a single frequency band are affected by the donor intervention.

[0038] To achieve effective data augmentation under different contrast and noise levels, the system controls the frequency domain blending range using random parameters. Specifically, at the start of each independent self-supervised training batch, the system introduces batch-level frequency band perturbation controller parameters that follow a Bernoulli probability distribution. This ensures that all positive and negative sample sequences within the same batch adopt a unified frequency band fusion strategy, and that the probability of occurrence of both states is equally assigned as 0.5. When When activated, the system determines that the dominant frequency band perturbation type is a low-frequency physical perturbation, and performs the following cross-Hadamard product operation to combine the donor sample... The low-frequency appearance attributes are forcibly injected into the amplitude spectrum of the original sample: ; Conversely, when When activated, the system determines that the dominant frequency band perturbation type is high-frequency detail perturbation, and completes cross-sample fusion of the donor high-frequency components into the original sample through the inverted mask channel: ; In the formula, The matrix dot product logic corresponds to the scalar elements at their respective positions in the matrix space. This represents the target mixed amplitude spectrum after cross-sample aliasing suppression. This step only performs data replacement calculations on the amplitude matrix, thereby strictly ensuring at the program level that the structural topological features represented by the original sample phase are free from interference from the donor data.

[0039] S204, the system reloads the target mixed amplitude spectrum obtained by frequency domain weighted fusion and the reserved original sample three-dimensional phase spectrum, performs extreme component recombination and merging in the form of complex exponential, and finally inversely transforms it to the real voxel topological space through three-dimensional inverse fast Fourier transform to complete the generation operation of enhanced synthetic sample.

[0040] To map the frequency-domain composite matrix back to an intuitive medical image format, the computing device reconstructs a complex array with novel frequency-domain properties: ; The complex array generated by the recoupling operation is then fed into the three-dimensional inverse fast Fourier transform engine. Restore and generate an enhanced synthetic sample tensor with the same spatial dimensions as the original sample but with variations in physical tone: ; in, This describes the process of extracting and outputting the real part of the complex result matrix from the inverse transform, used to filter out high-order, small imaginary noise remaining due to the limitations of floating-point calculation precision. The enhanced synthetic samples are obtained based on the above complete mapping loop. Its corresponding original sample While exhibiting strict consistency in anatomical structures and disease-related biomarkers, the data reveals specific differences in MRI tissue irradiance and local high-frequency random textures. This specific physical perturbation data forms the key comparative basis for driving subsequent attention models to automatically capture representations in the absence of clinical annotations.

[0041] In this embodiment, the implementation process of constructing a weight-sharing dual-branch network to perform forward propagation on the original sample and the enhanced synthetic sample in step S30, and sequentially performing channel and spatial feature weighting through a dual-path cascaded three-dimensional attention module to finally extract and generate a high-level semantic feature vector that can be used for self-supervised measurement, further includes the following sub-steps: S301, the system establishes a feature encoder based on a three-dimensional deep convolutional neural network architecture, taking the previously generated original samples and enhanced synthetic samples as input data columns, and extracting basic three-dimensional feature tensors by performing three-dimensional convolution and pooling operations.

[0042] In the self-supervised pre-training framework, the feature encoder is responsible for extracting hierarchical representations covering low-level texture and high-level semantics from the original voxel matrix. To ensure the consistency of feature mappings for data from the same source, the system instantiates two encoding network branches with weight parameters that are always synchronously copied in real time, each receiving the original samples independently. Enhanced synthetic samples with physical perturbation At this point, the physical state of the input data is configured with spatial dimensions as follows: The three-dimensional single-path grayscale nuclear magnetic resonance image tensor.

[0043] As a preferred approach, the encoder backbone network employs a 3D residual network architecture (such as 3D-ResNet) that incorporates residual bypass connections. The network body consists of ordinary 3D convolutional layers for initial feature extraction, and multiple cascaded stacked 3D residual blocks. (Original sample) Within the network, continuous 3D convolution operations and multi-step sliding downsampling processes are performed, resulting in a layer-by-layer contraction of the spatial dimension accompanied by a multiple expansion of the channel depth. Ultimately, this process maps and generates a multi-channel basic 3D feature tensor. Assuming the global dimensionality reduction ratio is... (As a preferred method, take) If the value is 8 or 16, then the dimension of the tensor is defined as... ,in The total number of depth channels representing the feature map (e.g., 256 or 512). , and represent the spatial boundary dimensions of the reduced feature tensor in the coronal, sagittal, and transverse planes, respectively, and satisfy . Regarding the specific matching algorithms for group normalization and nonlinear activation units within the 3D residual network module, those skilled in the art can make conventional configuration adjustments according to the application scenario. The specific stacking principles and forward computation mechanisms are well-known technologies in the field and will not be elaborated upon here. Similarly, enhancing the synthetic samples... Parallel computation produces a basic three-dimensional feature tensor with consistent dimensions. .

[0044] S302 intercepts the basic three-dimensional feature tensor output by the backbone network, directs it to the first-level link of the dual-path cascaded attention mechanism, performs cross-level three-dimensional channel attention calculation and mask modulation, and extracts key channel components that are meaningful for the current anatomical representation.

[0045] After medical 3D images are extracted through hundreds of layers of deep convolution, the resulting independent feature channels do not contribute equal weight to downstream tissue boundary recognition and lesion clustering. To suppress redundant filtering background generated in multi-layer convolution and amplify the data dimension with specific representations, the computing system calls the channel attention operator to redistribute the weights of the features to be processed.

[0046] System along Spatial dimension (i.e., through) Three-dimensional global average pooling and three-dimensional max pooling operations are performed on the three-dimensional regions to capture the smooth background mean distribution properties and obvious local tissue mutation peak information of each channel throughout the brain space. These two pooling methods compress and aggregate the three-dimensional spatial information into a pair of pooling methods, each with a size of 1. The independent feature column vectors are then processed in parallel through a shared multilayer perceptron (MLP) network constructed from dimensionality-reduced and dimensionality-increasing fully connected layers. The results of the superposition of the computation nodes are then calculated using the logistic activation function, and the output channel weighted mask is generated. : ReLU AvgPool3D ReLU MaxPool3D ; Within this formula configuration Represents the Sigmoid activation function used to normalize values ​​to the (0,1) interval; ReLU represents the rectified linear unit that introduces a nonlinear expression. The weight matrix of the first fully connected layer, which performs feature dimensionality reduction mapping, has an output dimension of... ,in The preferred value for the attenuation scaling factor is 16; To recover the second fully connected layer weight matrix to its original channel feature size, its mapped-back dimension is... AvgPool3D and MaxPool3D define the three-dimensional averaging and maximum physical pooling paradigms, respectively. Based on the acquired weighted mask, the system drives the feature mapping along the channel axis to generate the channel calibration tensor. : ; In the formula, This represents the execution of an element-wise multiplication operation based on a broadcast mechanism along the channel axis. After this modulation operation, The importance of each feature channel dimension was quantitatively allocated at the physical constraint level.

[0047] S303, the system inputs the channel calibration tensor as streaming data to the second-level link of the dual-path cascaded attention mechanism, initiates a spatial dimension-based local attention focusing mechanism, and calculates and generates a three-dimensional spatial mask region designed to suppress hardware physical background noise.

[0048] After performing feature weighting along the channel dimension, the feature weights of each voxel region within the spatial dimension are further calculated. In brain MRI images, the sulci and gyri of the hippocampus and ventricular margins often carry richer disease-associated information, while the discriminative significance of large areas of homogeneous white matter is relatively lower. The system performs voxel-by-voxel calibration of the spatial weights, guiding the forward inference process to focus the computation on these core tissue nodes.

[0049] System along tensor The channel dimension (i.e., along) Solve for the global maximum and global average matrices separately (using axes spanning all channels), resulting in two scales that are both shrunk to... Spatial depiction slices. By performing a cascaded stitching operation on the two along the channel axis, the system constructs a composite topological index. This composite index is scanned using a single-layer 3D convolution mechanism with a fixed parameter kernel to fuse dual-modal parameters and spatial feature masks. Thus, it takes shape: ; here, Defined as a convolution kernel with the kernel size parameter set to... The 3D convolution operation object, as a preferred method, ensures sufficient receptive field for local feature fusion while avoiding parameter overload. The value of is 7; This is denoted as the logical scalar for data concatenation operations across channel directions; and This indicates that a squeeze pooling constraint is applied to the feature channel axis. The system performs composite computations based on this mask to output the final two-way refined tensor. : ; At this time, the formula This represents a voxel-by-voxel multiplication computation based on a broadcast mechanism along the spatial dimension. The output is... In terms of physical meaning, it not only eliminates the generalization interference of non-critical slice channels, but also accurately locates highly specific brain anatomical contour segments within three-dimensional structural coordinates.

[0050] S304 reads the dual-path refined tensor sequence, uses the multi-layer projection topology component to perform feature domain flattening and high-dimensional parameter remapping processing, and completes the conversion of voxel morphological matrix into abstract multi-dimensional semantic vector.

[0051] Residual elements filtered by spatial convolution and dual attention It retains its four-dimensional spatial array property, which includes geometric coordinates. This data structure is not directly applicable to performing similarity and spatial distance metrics calculations within a self-supervised framework. Therefore, the computation system triggers a final round of three-dimensional global average pooling to... The matrix in the format is summed and averaged across the entire geometrically defined space, shrinking to a dimension of 1. A single-column full array.

[0052] This purified abstract array is then imported into the input node of a specially designed nonlinear projector module. The projector contains two consecutive multidimensional weighted linear fully connected layers and a rectified linear unit activation layer in between. After performing linear scaling and activation, the network releases dimensionality-reduced feature vectors from its ends, decoupled from the specific anatomical voxel coordinate anchor points and mapped to the contrastive learning dimensionality space. : ; In this definition of arithmetic, To reduce the feature dimension from The first projection layer weight matrix mapped to the target dimension (e.g., 2048 dimensions) of the hidden layer; To reduce the dimensionality of hidden features to the self-supervised metric dimension (e.g., a 128-dimensional) second-layer weight matrix; This refers to weighted pooling that removes spatial attribute constraints. Applying this equivalent operational rule to the parallel-flowing enhanced synthetic feature branch, the system synchronously obtains the corresponding representation feature vectors. The output of the computing unit up to this point and It carries high-level biological semantic data with viewpoint invariance and pose robustness, which will ultimately be used as key variables for direct extraction of distance measurement and pushed into the model's pre-set comparative evaluation loss function such as InfoNCE, providing the basis for error sources for the inverse innovation of the network's weight gradient.

[0053] In this embodiment, regarding step S40 above, based on the feature vector output by the preceding dual-path cascaded attention network, a directional contrastive loss function based on the self-supervised paradigm is constructed. An adaptive adjustment mechanism for the loss evaluation parameters is established by combining the variance of the feature distribution within the batch. The closed-loop optimization of the network weights is completed through error backpropagation. This further includes the following sub-steps: S401, the computing device configures the input batch of parallel training data and establishes a positive and negative sample pair matching mapping. Based on the cosine distance metric strategy, it calculates the spatial distribution similarity between high-dimensional abstract feature vectors, thus establishing a numerical basis for feature aggregation without clinical manual annotation.

[0054] In the self-supervised representation learning algorithm system for medical images, the core driving force for model optimization comes from the structural correspondence of the data itself, rather than externally provided artificial pathological labels. Since the original sample and the enhanced synthetic sample generated through specific physical frequency perturbation originate from the same initial brain MRI scan, they are strictly aligned in geometric anatomy. The computational system reads data from the same batch... Each original sample is aggregated with its corresponding enhanced synthetic sample to form a total of [number]. Batch training sequences. As a preferred method, the number of batch samples is limited by GPU memory capacity and the stability requirements of gradient updates. The value is set to an even number between 32 and 128. In this sequence, feature vectors originating from the same image... and The system marks positive sample pairs as bearing the same anatomical topology; while the rest of the batch Each feature vector, belonging to different patients or different scanning fields, is logically defined as a negative sample group with a mutually exclusive anatomical relationship to the current original sample. This pairing relationship established through source image tracing directly constitutes the pseudo-label system for self-supervised training.

[0055] To quantify the convergence of the distribution of the aforementioned high-dimensional features in the mapping space, the system compares the dimensional span between any two feature vectors along the extracted hidden layer. and Calculate cosine similarity Its scalar operation logic is as follows: ; In the formula, Representing vectors Transpose of; Representation vector Euclidean norm. It is particularly important to note that, to avoid runtime algorithm crashes due to "division by zero" caused by outputting all-zero vectors during the initial training phase or the severe gradient decay stage of the feature network, this embodiment introduces a very small numerical constant in the denominator calculation. Boundary security cut-off protection, as a preferred setting, The value is 1×10 -8 The closer the similarity metric is to 1, the more the representation model tends to believe that the two feature vectors depict the same anatomical state of brain tissue structure.

[0056] S402, the system extracts the feature similarity between positive sample pairs and negative sample groups, constructs a temperature-scaled directional contrast loss function, and drives the model to eliminate the physical differences in NMR contrast and lock in invariant features across modes by calculating the error of the network output distribution.

[0057] After obtaining the similarity matrix covering the entire batch, the network needs to constrain its forward inference behavior through a loss metric, guiding the encoder to bring positive sample pairs closer together and push their corresponding negative samples further apart within the feature space. In this business scenario, the computing device calculates the unit sample vector based on the Information Noise Contrast Estimation (InfoNCE) paradigm. Primary orientation loss value : ; In the formula, It is an exponential function with a natural base; This represents the index within the current batch sequence. Any eigenvector; Defined as a Boolean truth indicator operator, only if the sequence index... Not equal to the index of the currently focused sample Output 1 if the condition is met, and 0 otherwise, to ensure that the denominator fully covers all negative and cross-correlation terms, including augmented samples. The hyperparameter representing the smoothness of the similarity distribution and the strength of the gradient penalty is usually called the temperature coefficient.

[0058] S403 addresses the degradation in the ability to mine difficult negative samples caused by the fixed temperature coefficient in traditional contrastive learning systems. The system establishes a parameter adaptive feedback flow that synchronously tracks the dispersion of features within a batch and sends dynamically updated compensation temperature values ​​to the model calculation nodes in real time.

[0059] As backpropagation progresses through multiple rounds, the distances of most negative samples calculated by the conventional model in the latent space will increase, resulting in a fixed numerical value. This will cause the overall loss to tend towards numerical saturation. This state will cause the model to lose its ability to distinguish difficult negative samples with high similarity (such as independent slices with similar anatomical structures but different small lesions), weakening the effectiveness of gradient updates.

[0060] To maintain the network structure and overcome the vanishing gradient effect, the computational system performs a step-by-step update during the current training iteration. In the process, focus samples are extracted and calculated. Statistical variance of the set of similarities with the feature vectors of all corresponding negative samples This is used to measure the aggregation and dispersion level of misjudgment features within this batch. Furthermore, the system invokes a feedback control mechanism to calculate and output the dynamic adjustment temperature coefficient for the current time series. : ; in, It is a constant lower bound that maintains the convergence benchmark of the loss function, and is set to 0.07 as a preferred approach; To control the gain factor of the upper limit of temperature regulation, it is preferably set in the range of [0.05, 0.2]. This is a variance sensitivity control factor used to adjust the rate of exponential decay response, with a preferred range of 5.05 to 15.0.

[0061] From a theoretical perspective, when a model gets stuck in a situation where negative samples are difficult to distinguish and the distribution variance is high... When the training bottleneck shrinks dramatically, the exponential term approaches 1 and the (1-exp) term approaches 0. The system will automatically reduce the temperature coefficient τ and bring it closer to the lower bound of the constant. Lower temperatures can make the probability distribution of the Softmax activation function output more acute, thereby increasing the loss weight of negative samples with high similarity to positive samples in the feature space during gradient backpropagation, driving the network to discover subtle topological differences; while when feature separation is clear and variance increases, the temperature coefficient gradually increases to a higher level. By appropriately smoothing the probability distribution, system-wide gradient oscillations can be avoided. S404: Based on the dominant frequency band perturbation type when the frequency domain processing module generates enhanced synthetic samples, activate the corresponding backpropagation route selector, block the gradient backpropagation path of non-corresponding attention mechanism branches, and jointly calculate the attention consistency loss.

[0062] In the same pair of data feature extraction process, the original sample With enhanced synthetic samples Despite variations in physical contrast, the three-dimensional pathological topology should remain constant. To this end, the system extracts the corresponding local spatial feature mask from the original sample. Corresponding to augmented samples Calculate attention consistency loss The mean squared error metric forces the network to focus on the same anatomical region even with structural variations. ; Meanwhile, to prevent network degradation or shortcut learning, the system extracts parameters from the frequency band disturbance controller. ( ) as a routing switch. When When (low-frequency physical disturbances dominate, altering global contrast), the system disconnects the global channel attention mechanism (responding to macroscopic contrast), forcing the network to rely solely on local spatial attention mechanisms to discover topology; conversely, when When high-frequency detail perturbations dominate, increasing local noise, the system cuts off gradient backpropagation of local spatial attention, forcing the network to rely more on channel paths to purify macroscopic semantics.

[0063] It is important to emphasize that the dual-path cascaded attention mechanism incorporates a residual bypass design. This blocking mechanism only applies to the parameter updates of the corresponding attention mask (channel mask or spatial mask) generator itself, stopping gradient operations. The forward propagation of the identity mapping of the backbone features and the backpropagation path of the basic gradients remain connected, thus completely avoiding the global computation graph breakage and network training collapse caused by local blocking in the cascaded structure. Furthermore, this blocking mechanism only applies to the loss calculation branch of contrastive learning; the local spatial attention mechanism does not affect the attention consistency loss (…). The gradient backpropagation path remains connected to ensure effective optimization with consistent anatomical structure. At the underlying framework implementation level, the system avoids computational graph conflicts that can easily arise from directly modifying parameter properties. Instead, it achieves flexible dynamic routing control by applying a stop gradient operator to the tensors of specific feature branches before calculating the contrastive loss.

[0064] S405 calculates the channel energy dispersion based on the energy parameters of the channel weighted mask, generates an error callback deviation, and propagates it back to the frequency domain processing module to iteratively update the cutoff frequency radius variable of the three-dimensional Butterworth filter in a closed loop. .

[0065] To achieve dynamic adversarial enhancement through self-supervised data generation, the computational system needs to be aware of the current feature extraction state of the network. The system extracts channel-weighted masks from the channel attention mechanism. This is used as an energy distribution vector, and its statistical variance in each channel dimension is calculated, defined as the channel energy dispersion. This dispersion reflects the current model's ability to focus on different feature channels (the higher the dispersion, the more accurately the model can capture the core channels).

[0066] The computing device sets the target discrete value. And calculate the error callback deviation. : ; in, To control the hyperparameter coefficients of the feedback update step size, the system propagates the callback deviation in reverse to the frequency domain processing module. To avoid drastic parameter oscillations caused by differences in data distribution between batches, an exponential moving average (EMA) smoothing mechanism based on the momentum factor is introduced, and the following difference formula is used in the next round... Update the cutoff frequency radius variable of the Butterworth filter: ; In the formula, These are upper and lower cutoff functions used to ensure that the filter radius is strictly constrained within a legal physical frequency threshold. between, The smoothing coefficient is set to a range of [0.9, 0.99] as a preferred approach. This closed-loop smoothing feedback logic is used to achieve the following: When the model's feature extraction capability is weak (low dispersion), the system automatically reduces the low-pass filter radius to generate simpler samples with smaller contrast perturbations; when the model's extraction capability improves, the system gradually increases the perturbation range to provide more challenging positive sample pairs.

[0067] S406, the system summarizes and integrates the local orientation loss of each sample in the current batch, outputs the global average error vector and submits it to the optimizer module, and deduces the solution in reverse along the cascaded network, driving the weights of each layer, including the attention parameter, to complete the closed-loop evolution repeatedly.

[0068] After completing batch-level adaptive constraints, the system... Obtain the final scalar total loss value used to guide optimization (where To balance the weighting coefficients of the two loss magnitudes. At this point, the network computing framework automatically switches to backpropagation computing mode, using the chain rule to penetrate the preceding multilayer perceptual projector, spatial and channel attention modules, and 3D convolutional backbone network, and performs continuous product calculations on the partial derivative matrix to obtain the parameter update direction vector.

[0069] For the specific operations of the computing system receiving gradient results and calling the adaptive moment estimation (such as AdamW) optimization engine to implement weight shift correction, as well as the setting and implementation of the linear decay learning rate warm-up stepping strategy of the supporting application, those skilled in the art can configure the corresponding mature framework according to the specific computing hardware resources. The internal mathematical update steps are well-known technologies in this field and will not be elaborated here. After hundreds to thousands of rounds of data iteration and closed-loop learning, the weight parameters of the backbone network finally achieve autonomous convergence without external pathological marker intervention. Thus, when inputting unknown brain medical images, it can robustly filter tissue physical contrast noise and achieve robust feature extraction of its three-dimensional anatomical structure.

[0070] In this embodiment, regarding step S50 above, after completing the closed-loop pre-training of unsupervised features, the system transfers the extracted high-dimensional representation capabilities of medical images to specific downstream clinical diagnostic tasks (such as tumor grading, lesion segmentation, or prediction of brain anatomy lesions). By stripping away the pre-training auxiliary structure and introducing labeled clinical data, a subject-supervised fine-tuning framework based on differential learning rate is constructed. Its specific implementation process further includes the following sub-steps: S501 extracts parameter snapshots of the 3D feature encoder and dual-channel cascaded attention module that have reached convergence during pre-training, reconstructs the topology based on the model, discards the nonlinear projection head used for self-supervised auxiliary tasks, and splices and attaches a task-level perception layer adapted to clinical classification or segmentation targets.

[0071] During the self-supervised pre-training phase, the core task of the neural network is to capture the internal anatomical consistency of MRI images by comparing perturbed samples. Since the unsupervised contrastive feature space differs semantically from the direct pathological classification probability distribution, the computational system must reassemble the model structure to accurately map this generalized feature extraction capability to specific medical diagnostic workflows. The system retains the fully iteratively optimized backbone convolutional network and cascaded attention mechanism as the feature extraction base, while simultaneously freezing or deconstructing the end-peripheral perceptual layers originally used for contrast dimension mapping.

[0072] To target downstream clinical applications, the system introduces a new fully connected neuron mapping matrix at the end of the feature extraction base as a task-level perception layer. Assuming the business requirement is a classification task to determine the disease category of the current input image, the system receives the dimension generated by the pre-pooling process as follows: The global abstract vector. The task-level perception layer performs a linear weighted calculation, and then... Dimensionality reduction directly from 12 features to the number of target categories The system then calls the normalized exponential function (Softmax) to convert the output into a probability distribution vector corresponding to each category. The output probability value of its unit neuron. The calculation is as follows: ; Here, Represents the task-level perception layer for the first The original logical values ​​of the linear output nodes for each clinical category; Represents all The corresponding logical values ​​for each category; The total number of categories for downstream annotation tasks was defined. Based on this topology splicing mechanism, the model completed the network architecture transformation from a feature purification structure to a medical diagnostic operator.

[0073] S502, the computing device loads a supervised dataset with expert clinical pathology annotations, establishes feature mapping pairs covering the original data tensors and real physical labels, and initializes a differential learning rate adjustment mechanism to mitigate catastrophic forgetting.

[0074] Unlike the previous model driven by massive amounts of unlabeled data, the batch input data read by the computing system in this stage has specific medical gold standard constraints. The input data consists of tuples. The format is used as an independent batch input to the computation framework in the supervised phase, where For the same specifications The patient's original three-dimensional MRI scan tensor; This is the true clinical diagnostic label vector mapped using one-hot encoding.

[0075] During the fine-tuning phase based on pre-trained weights, to avoid strong error gradients disrupting the spatial anatomical texture mapping weights already learned by the backbone network during backpropagation of a small amount of labeled data, the system abandons the globally unified parameter optimization strategy and instead activates a hierarchical differential learning rate constraint. As a preferred approach, the system assigns initial learning rate parameters with high search stride characteristics to the newly attached task-level perception layer. Its value range is set in

[10] . -3 10 -2 The interval; however, for the 3D convolutional backbone and attention components belonging to the pre-trained module, the base learning rate distributed by the system is significantly reduced. The preferred attenuation threshold range is

[10] . -5 10 -4 This parameter unfreezing and cross-level step gradient constraint mechanism ensures that while the underlying features are smoothly fine-tuned, the top-level business logic can converge quickly.

[0076] S503, the network executes supervised forward propagation logic, uses the difference in probability distribution between the predicted distribution vector and the true diagnostic label to establish a focal loss function, and quantifies the fitting error of the network from the low-level pixel features to the high-level pathological definition.

[0077] As the labeled data array traverses the activation components layer by layer, the network extracts the batch prediction probability in real time at the output and establishes a comparison with the gold standard. Because medical imaging data often faces a significant imbalance between healthy and rare pathological samples during actual acquisition, using conventional cross-entropy loss can easily lead to parameter shift towards the majority class. Therefore, the system calls a multi-class focus loss function that integrates class weighting and difficulty penalty factors to obtain the comprehensive error of the current batch of data. : ; In the above constraint expression, This represents the batch size of data configured during the supervised fine-tuning phase; Identify the matrix element when the first element is... The category to which the true clinical label of an individual belongs Take 1 if the condition is met, otherwise take 0; The corresponding positive prediction probability is derived. A modified weighting parameter is introduced. Used to balance the differences in sample frequency across different pathological categories, its value is determined by the formula. Calculated, of which The total number of training samples, Categories to be pre-statistically counted within a data set The total number of samples; As a parameter for mining difficult samples, it is used to reduce the dominance of easily classified samples in the gradient, and as a preferred method, it is used in organ lesion classification tasks. The value is 2.0. Furthermore, for the sake of algorithm stability, the logarithm field is determined by... (The sentence is incomplete and requires more context to translate accurately. It likely refers to a function or parameter, but without further information, a direct translation is not possible.) (e.g., 1×10) -8 Execute the maximum value function Numerical safe truncation is performed in a way that eliminates the gradient explosion dead zone caused by numerical underflow of logarithmic operations when the predicted probability approaches 0.

[0078] S504: The system extracts and summarizes the target pathological error gradients, driving the hybrid optimization engine to perform backpropagation calculations. Based on a decay adjustment strategy, iterative parameter updates are implemented across all network nodes until the evaluation metrics on the validation set reach convergence, ultimately outputting the locked application-level medical image evaluation model.

[0079] The calculated loss error is backpropagated along the nodes of the computation graph, and its partial derivatives are solved. Then, each derivative is multiplied by the predetermined learning rate step size of the previous layer. and The parameters are updated. For steps such as automatically triggering the loss convergence stagnation detection mechanism based on changes in validation set evaluation metrics and model parameter retention logic, those skilled in the art can configure the operational logic according to conventional supervised learning execution specifications. The operational rules for weight implementation based on the adaptive optimizer system are well-known technologies in this field and will not be elaborated here. After dozens to hundreds of iterations of fine-tuning and smoothing, the algorithm framework seamlessly transitions from a self-supervised feature mining state to a pathological detection decision state, ultimately capable of calculating and outputting reliable lesion probabilities and anatomical judgment conclusions for independent patient images with unknown input.

[0080] In this embodiment, regarding step S60 above, after the fine-tuned network reaches the expected convergence accuracy, the system is removed from the gradient update environment during training and deployed as an independent diagnostic service engine for actual medical scenarios. The computing device receives raw patient images collected at the end of the clinical facility, and through deterministic forward inference and a confidence-based safety decision-making mechanism, directly outputs pathological prediction results with clinical reference value and interpretable lesion heatmaps. Its specific implementation process further includes the following sub-steps: S601, the system mounts the underlying convolutional kernels and perceptual layer network weights that are solidified through the supervised fine-tuning stage, while explicitly switching the entire computational framework and all internal normalization and regularization components to the evaluation inference mode, and performing deterministic physical space and grayscale standardization adjustments on independently input patient MRI images.

[0081] In actual clinical inference, the physical distribution of the data to be inferred must be strictly consistent with that during model training. Since the prediction phase does not involve loss function calculations or gradient backpropagation, the system uses low-level control commands from the deep learning framework to forcibly freeze the optimizer state and all learnable parameters of the neurons within the network. In this state, the batch normalization layer abandons the use of the statistical variance of the current input data and instead uses the global moving average accumulated during training. With moving average variance Meanwhile, the random masking mechanism of the discarding method module is completely bypassed, ensuring that the same input image can obtain a unique and definite combination of output features in multiple forward calculations.

[0082] Raw 3D MRI scan data acquired by clinical medical terminals It is read into the computing bus. The system calls the medical image processing operator to resample it, aligning its spatial geometry to the network's preset scale. Specifications, among which , , These correspond to the standard pixel dimensions of 3D medical images in the coronal, sagittal, and transverse planes, respectively. To eliminate grayscale contrast shifts caused by differences in the main magnetic field strength of different batches of clinical hardware, the system calculates the global mean of voxel intensity within the current image. with standard deviation Perform Z-score voxel normalization mapping to generate the standard test tensor. : ; In the formula, To prevent extremely small safety cutoff values ​​where the denominator is zero due to completely black or extremely smooth images, a preferred approach is to use a value of 1×10. -5 Standardized generation In terms of data structure, it constitutes a dimension of A single-batch, single-channel forward propagation input array. From an algorithmic perspective, the aforementioned standardized operations provide a low-level information benchmark for subsequent deep models that possesses scale invariance and device compatibility.

[0083] S602, the computing device inputs the standard test tensor into the frozen three-dimensional residual backbone network and the dual-path cascaded attention module, and uses the high-order representation mapping matrix obtained during training to directly extract the global abstract feature vector for the current patient's brain anatomy and abnormal tissue lesion morphology.

[0084] The standardized tensor sequentially traverses the computation graph through layers of fixed 3D convolutional kernels and downsampling operators. Upon reaching the dual-path cascaded attention component, the network utilizes spatial and channel attention mechanisms to automatically filter out background redundancy outside the brain cavity along the depth and 3D coordinate system spatial axes of the feature tensor, focusing on abnormal tissue regions with potential pathological features. The final 3D global average pooling layer compresses the spatial structure tensor, calibrated through multiple levels of attention, into a dimension limited to [missing information]. discrete eigenvectors This vector has completely broken away from the three-dimensional spatial coordinate system of the initial brain scan in a physical sense, and instead quantifies the degree of organ and tissue lesions in the input patient's local area in the form of numerical coordinates in a high-dimensional latent space.

[0085] S603 relies on the terminal task-level perception layer to perform linear classification and probability normalization mapping on the global abstract feature vector, introduces a diagnostic confidence error prevention mechanism with threshold constraints, and calculates and outputs the specific disease category scalar corresponding to the current independent image.

[0086] High-dimensional vectors carrying pathological offset information A fully connected task-level perceptual network, assembled and mounted during the fine-tuning stage, is directly imported. Through matrix multiplication and linear operations with bias terms, the system outputs the raw logical values ​​for each preset clinical category. Subsequently, a normalized exponential function transforms the numerical array into a predicted probability vector spanning all candidate categories and summing to 1. ,in This indicates the total number of categories of downstream tasks.

[0087] To ensure the system security and business reliability of the output results of automated diagnostic models in medical scenarios, the system not only extracts the prediction of the most probable term by peak finding, but also adds a diagnostic confidence threshold. The system calculates the final output category scalar. The logic for judging the processing instructions is as follows: ; In the above formula, This represents the physical classification index corresponding to the largest element in the extraction probability vector. As a preferred approach, this method is suitable for classification tasks involving brain tumors or neurodegenerative diseases. The value range is set between [0.75, 0.85]. When the highest classification confidence score of the model output is lower than... When this occurs, it indicates that the image may contain rare complications outside the training domain distribution or severe motion artifact occlusion. In this case, the system triggers an out-of-bounds interruption, and the system state is marked as [out-of-bounds]. The system will force the import of data into the clinical manual review queue; when the value is greater than or equal to the threshold, the system will accept the pathology category corresponding to the current maximum predicted probability as the model decision support output.

[0088] S604 combines the predicted probability with the spatial attention activation mask generated in the intermediate level, and uses a three-dimensional interpolation reconstruction algorithm to project an interpretable lesion heat map with the classification conclusion to the operating terminal, thus completing the overall intelligent diagnosis closed-loop process.

[0089] In practical medical practice, a single predictive label is often insufficient to provide adequate medical diagnostic evidence. To impart transparency to the neural network's decision-making process, the computational system simultaneously extracts and caches the low-resolution spatial feature mask tensor generated in the dual-path cascaded attention chain during the forward propagation process. (Its spatial dimensions are) After the classification output is deemed valid, the system calls the three-dimensional trilinear interpolation operator. Manipulate this tensor to inversely expand its spatial dimensions, restoring it to the geometric resolution aligned with the original test image. .

[0090] The system uses a predefined pseudo-color mapping function to convert the single-channel high-resolution mask floating-point values ​​into an RGB color-coded array, and then compares them with the original scan data. Perform Alpha fusion and overlay to generate a high-brightness heatmap that is pushed to the medical display terminal. : ; in, This indicates a pseudo-color mapping module based on a conventional visual color palette; To control the fusion coefficient of the heatmap color overlay transparency on the underlying grayscale anatomical image, a preferred approach is to set this fusion coefficient between 0.4 and 0.6. The 3D heatmap output after transparency overlay rendering can visually identify the spatial distribution of highly significant anomalies extracted by the network at the underlying anatomical structure level (i.e., a category-independent global aggregated heatmap) using bright colors. This assists physicians in quickly and globally locating the full picture of potential anatomical abnormalities. Combined with the disease prediction probability finally output by the classification and inference module, it essentially provides physicians with precise image references for final diagnosis.

[0091] To enable those skilled in the art to more clearly understand the practical application scenarios and engineering implementation process of the present invention, this embodiment takes the three-dimensional magnetic resonance imaging classification task of Alzheimer's disease (AD), a common clinical neurodegenerative disease, as an example to specifically describe the above system and method.

[0092] Pre-training phase (unsupervised data pool construction and frequency domain closed-loop learning): During system initialization, the data acquisition module reads and filters a total of 15,000 unlabeled T1-weighted 3D brain MRI images from public medical imaging databases (such as the ADNI dataset) and the archive systems of partner hospitals. After skull dissection and resampling, these images are uniformly constructed into a... A resolution-based unlabeled data pool.

[0093] In the self-supervised feature extraction stage, the computing device randomly selects source and donor samples within a batch (BatchSize=64). The system extracts the three-dimensional amplitude and phase spectra of both samples and initiates a three-dimensional Butterworth filter. During the initial iteration, the filter's cutoff frequency radius variable... It was randomly set to 12.

[0094] As iterations proceed, the calculated channel energy dispersion decreases due to the model's initially weak feature extraction capability. The deviation is only 0.05 (lower than the target dispersion of 0.15). The closed-loop feedback module calculates the positive error callback deviation. By using the exponential moving average (EMA) smoothing mechanism, the next round of... The model is automatically scaled down to 10.5. At this point, the physical contrast perturbation introduced by frequency-domain weighted fusion is relatively mild, preventing the model from crashing in the early stages of training. By the 500th training iteration, the model's ability to extract high-level semantics is significantly enhanced. The value climbed to 0.25, and the system automatically... The value is gradually increased to 25, thus inputting challenging augmented synthetic samples with high-frequency noise and drastic contrast differences into the model. This is combined with a variance-adaptive temperature coefficient. (Automatically down to 0.075 to mine difficult negative samples when variance is reduced), After 2000 rounds of unsupervised contrastive learning, the backbone network of the model has fully converged, successfully locking the topological representation ability of key anatomical structures such as the hippocampus and the ventricular margin.

[0095] Fine-tuning Phase (Supervised Task Adaptation): After completing self-supervised pre-training, the system truncates and discards the nonlinear projector used for contrastive learning, and attaches a task-level perceptual layer with an output dimension of 3 (corresponding to normal control (NC), mild cognitive impairment (MCI), and Alzheimer's disease (AD)). The system loads 2000 T1 MRI images with expert clinical diagnostic labels for fine-tuning. In this phase, the backbone convolutional network uses 5×102 -5 The minimum differential learning rate is used, while the final task-aware layer uses 2×10. -3 A higher learning rate. Use a multi-class focus loss function (setting parameters for hard sample mining). After 100 rounds of fine-tuning, the system achieves precise mapping of medical business logic.

[0096] Clinical reasoning phase (mistake prevention decision-making and heatmap output): Computer equipment deployed in the radiology department receives the raw T1 MRI image of a 72-year-old patient awaiting diagnosis. A standardized module converts this image into a real-time... The normalized tensor is fed into the model. The model's forward propagation takes approximately 0.8 seconds. The task perception layer outputs the classification probability: The maximum probability of 0.83 exceeded the system's set diagnostic confidence threshold for error prevention. The system directly accepts this result and outputs the disease diagnosis scalar as Alzheimer's disease (AD). Simultaneously, the system extracts the spatial feature mask generated by the dual-path cascaded attention link. After being amplified by trilinear interpolation and fused with the original image, a three-dimensional thermal map of the lesion was projected onto the imaging terminal. The thermal map showed a deep red highlight in the bilateral hippocampal regions and the enlarged edges of the lateral ventricles (indicating extremely high online attention), providing highly interpretable objective imaging evidence for clinical pharmacists to issue final diagnostic reports.

[0097] To verify the effectiveness and superiority of the brain disease classification system proposed in this invention, this embodiment conducted a quantitative comparative experiment on a unified hardware platform (a parallel computing workstation configured with four NVIDIA RTX 4090 24GB GPUs).

[0098] Experimental dataset and evaluation metrics: The experiment used industry-recognized medical imaging datasets (containing three categories: NC, MCI, and AD). Evaluation metrics selected included accuracy, sensitivity (reflecting the rate of missed diagnoses, the higher the better), specificity (reflecting the rate of misdiagnoses), and the area under the receiver operating characteristic curve (AUC), all commonly used in clinical diagnosis.

[0099] Comparison method setting To demonstrate the technological advancement of this invention, the following three sets of comparative baseline models are established: Baseline Method 1: Without using unsupervised pre-training, directly use labeled data for traditional supervised training (representing the traditional deep learning path).

[0100] Baseline Method 2: It adopts the mainstream self-supervised contrastive learning framework, but the data augmentation only uses conventional spatial pruning and Gaussian noise, without introducing the frequency domain phase / amplitude decoupling perturbation of this invention.

[0101] Baseline Method 3 (Invention Model Without Closed-Loop Feedback): Employs the frequency domain self-supervised architecture of this invention, but removes the channel energy dispersion error callback in step S405 and uses a three-dimensional Butterworth filter with a fixed radius.

[0102] The method of this invention (Ours): includes a complete solution of this invention, which includes frequency domain decoupling, closed-loop adaptive feedback, variance adjustment temperature coefficient, and dual-path cascaded route blocking.

[0103] Quantitative Experimental Results Analysis Based on the model's inference performance on the independently retained test set (600 cases in total), the quantitative comparison results are shown in Table 1: Table 1: Performance comparison of different brain disease classification methods on the test set: Compared to baseline 1, the ACC of this invention is improved by 12.1%. This confirms that the strategy of this invention, which relies on step S20 to extract the "phase spectrum" to preserve anatomical structures and shorten the feature distance in the latent space, can effectively overcome the bottleneck of lack of manual annotation in medical images.

[0104] Overcoming cross-device scanning differences: Compared to conventional enhanced baseline 2, this invention relies on the fusion injection of donor amplitude spectrum in the frequency domain to force the model to learn the essential physical characteristics that are not affected by device magnetic fields and contrast, which significantly reduces the misdiagnosis rate when multi-center data are mixed (SPE improvement of 6.7%).

[0105] Closed-loop feedback avoids gradient collapse: Compared to baseline 3, the AUC of the complete scheme of this invention is improved by 0.038. This strongly demonstrates the effectiveness of dynamically adjusting the filter cutoff frequency radius based on channel energy dispersion in step S405. The mechanism achieves a dynamic balance between the generation of easy and difficult samples, avoiding shortcut learning or gradient vanishing caused by a single difficulty perturbation, thereby uncovering more robust high-dimensional medical semantics.

[0106] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A brain disease classification method based on 3D attentional convolution and self-supervised learning, comprising the following steps: Acquire the first and second label-free 3D brain images; Frequency domain decoupling and amplitude spectrum fusion are performed on the first unlabeled 3D brain image and the second unlabeled 3D brain image, and enhanced synthetic samples are generated by combining a 3D Butterworth low-pass filter. The first unlabeled 3D brain image and the enhanced synthetic sample are respectively input into a 3D convolutional neural network containing channel attention branches and spatial attention branches for feature extraction, and their respective corresponding channel weighted masks and spatial weighted masks are obtained. Extract the channel weighted mask corresponding to the enhanced synthetic sample, calculate the channel energy dispersion of the channel weighted mask, and update the cutoff frequency radius of the three-dimensional Butterworth low-pass filter in reverse according to the channel energy dispersion, so as to dynamically adjust the frequency domain perturbation degree of the enhanced synthetic sample generated in the next iteration round. Based on the enhanced synthetic sample after updating the cutoff frequency radius and the first unlabeled 3D brain image, the 3D convolutional neural network is subjected to comparative learning and iterative training using a preset self-supervised loss function to obtain a pre-trained network model. Acquire three-dimensional brain images with clinical labels, and use the three-dimensional brain images with clinical labels to perform supervised fine-tuning of the pre-trained network model to obtain a target image classification model. The three-dimensional brain image to be processed is input into the target image classification model, and the image classification result is output.

2. The brain image classification method based on 3D attention convolution and self-supervised learning according to claim 1, characterized in that, The acquisition of the first unlabeled three-dimensional brain image and the second unlabeled three-dimensional brain image includes: Construct a label-free 3D image data pool; Two random index parameters are extracted from the unlabeled 3D image data pool based on a random sampling mechanism without replacement; if the two random index parameters are the same, the current extraction result is discarded and a new extraction is performed until the two random index parameters are different. The first unlabeled 3D brain image and the second unlabeled 3D brain image are extracted based on two different random index parameters, and modality consistency verification is performed to ensure that the first unlabeled 3D brain image and the second unlabeled 3D brain image belong to the same medical magnetic resonance imaging modality.

3. The brain image classification method based on 3D attention convolution and self-supervised learning according to claim 1, characterized in that, The step of performing frequency domain decoupling and amplitude spectrum fusion on the first unlabeled 3D brain image and the second unlabeled 3D brain image, and generating enhanced synthetic samples by combining a 3D Butterworth low-pass filter, includes: The first amplitude spectrum and the first phase spectrum of the first unlabeled three-dimensional brain image, and the second amplitude spectrum of the second unlabeled three-dimensional brain image were obtained by three-dimensional fast Fourier transform. The three-dimensional Butterworth low-pass filter is used to generate a three-dimensional low-pass mask and a three-dimensional high-pass mask; The low-frequency component of the first amplitude spectrum is extracted using the three-dimensional low-pass mask, and the high-frequency component of the second amplitude spectrum is extracted using the three-dimensional high-pass mask. The low-frequency component and the high-frequency component are then linearly added to obtain a mixed amplitude spectrum. The mixed amplitude spectrum is recombined with the first phase spectrum, and the enhanced synthetic sample is generated by three-dimensional inverse fast Fourier transform.

4. The brain image classification method based on 3D attentional convolution and self-supervised learning according to claim 1, characterized in that, The calculation of the channel energy dispersion of the channel-weighted mask, and the inverse update of the cutoff frequency radius of the three-dimensional Butterworth low-pass filter based on the channel energy dispersion, includes: Calculate the statistical variance of the extracted channel weighted mask in each channel dimension, and define the statistical variance as the channel energy dispersion; Calculate the error callback deviation between the preset target dispersion and the channel energy dispersion; The error callback deviation is propagated in reverse, and the cutoff frequency radius of the three-dimensional Butterworth low-pass filter in the next iteration is updated based on the exponential moving average mechanism.

5. The brain image classification method based on 3D attention convolution and self-supervised learning according to claim 1, characterized in that, The step of performing comparative learning and iterative training on the three-dimensional convolutional neural network using a preset self-supervised loss function includes a gradient blocking operation, specifically: Obtain the frequency band disturbance type parameter for the current iteration round; When the frequency band perturbation type parameter indicates that low-frequency perturbation dominates, a stop gradient operation is applied to the operator that generates the channel weighted mask in the channel attention branch to cut off the contrastive learning gradient backpropagation path of the channel attention branch. When the frequency band perturbation type parameter indicates that high-frequency perturbation dominates, the gradient stop operation is applied to the operator that generates the spatial weighted mask in the spatial attention branch to cut off the contrastive learning gradient backpropagation path of the spatial attention branch. During the application of the stopping gradient operation, the forward propagation of the identity mapping of the backbone features in the three-dimensional convolutional neural network remains connected to the backpropagation path of the basic gradient.

6. The brain image classification method based on 3D attention convolution and self-supervised learning according to claim 1, characterized in that, The preset self-supervised loss function includes adaptive temperature contrast loss; The process of calculating the adaptive temperature contrast loss includes: Calculate the variance of the feature distribution of the current batch of data in the feature space; The adaptive temperature coefficient is dynamically and positively adjusted according to the variance of the characteristic distribution, wherein the smaller the variance of the characteristic distribution, the smaller the adjusted adaptive temperature coefficient. The adaptive temperature contrast loss between the first unlabeled three-dimensional brain image and the enhanced synthetic sample is calculated using the adjusted adaptive temperature coefficient.

7. The brain image classification method based on 3D attentional convolution and self-supervised learning according to claim 1, characterized in that, The preset self-supervised loss function also includes attention consistency loss; The process of calculating the attention consistency loss includes: Extract the first spatial weighted mask corresponding to the first unlabeled 3D brain image and the second spatial weighted mask corresponding to the enhanced synthetic sample; The mean square error between the first spatial weighted mask and the second spatial weighted mask is calculated to obtain the attention consistency loss.

8. The brain image classification method based on 3D attentional convolution and self-supervised learning according to claim 1, characterized in that, The step of using the clinically labeled 3D brain images to perform supervised fine-tuning of the pre-trained network model to obtain a target image classification model includes: Replace the nonlinear projection head at the end of the pre-trained network model with a task-level perception layer; The clinically labeled 3D brain image is input into the replaced pre-trained network model, which outputs a predicted probability. The comprehensive error is calculated using a multi-class focus loss function, and numerical safety truncation is performed within the logarithmic domain of the multi-class focus loss function by taking the maximum value of the predicted probability and a preset minimum constant. The target image classification model is obtained by updating the network parameters based on the comprehensive error.

9. The brain image classification method based on 3D attentional convolution and self-supervised learning according to claim 1, characterized in that, The process of inputting the three-dimensional brain image to be processed into the target image classification model and outputting the image classification result includes: The three-dimensional brain image to be processed is input into the target image classification model, and the predicted probability set of each image category is output. Determine whether the maximum predicted probability in the predicted probability set is greater than or equal to a preset confidence threshold; If the confidence level is greater than or equal to the confidence threshold, then the category corresponding to the maximum predicted probability is taken as the image classification result.

10. The brain image classification method based on 3D attention convolution and self-supervised learning according to claim 1, characterized in that, After inputting the three-dimensional brain image to be processed into the target image classification model and outputting the image classification result, the process further includes: Extract the spatial weighted mask generated by the target image classification model for the three-dimensional brain image to be processed; The extracted spatial weighted mask is then interpolated and amplified before being fused with the three-dimensional brain image to be processed, resulting in a three-dimensional lesion heat map.