A method, apparatus, and readable storage medium for classifying physiological stages of medical images.

By sorting multidimensional metadata and grouping physiological cycles, combined with spatial feature extraction and temporal coding networks, the problems of low efficiency and high subjectivity in phase classification of pelvic DCE-MRI images are solved, achieving highly accurate and robust physiological phase classification.

CN123118536APending Publication Date: 2026-11-17THE SECOND HOSPITAL OF HEBEI MEDICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611331250.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies are inefficient and highly subjective in phase classification of pelvic DCE-MRI images, have difficulty handling medical image sequences of different lengths, do not fully utilize the temporal information in the acquired metadata, and are sensitive to noise and individual differences.

Method used

By sorting multidimensional metadata and grouping by menstrual cycle, a fixed-length input sequence is formed. Feature modeling is performed using spatial feature extraction network and temporal coding network. A classification model is selected based on anatomical structural attributes to classify menstrual phases.

Benefits of technology

It effectively processes medical image sequences of different lengths, fully utilizes the long-range dependencies between sequence frames, and improves the accuracy and robustness of physiological phase classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118536A_ABST
    Figure CN123118536A_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of medical image processing technology, specifically to a method, apparatus, and readable storage medium for classifying physiological phases in medical images. The method includes: acquiring a medical image sequence; sequentially sorting and grouping slices according to their physiological cycle based on multidimensional metadata; allocating sampling quotas according to the proportion of slices in each group; extracting feature frames at equal intervals within each group to form a fixed-length input sequence; encoding each frame of the fixed-length input sequence frame-by-frame using a spatial feature extraction network to obtain a spatial feature vector sequence; modeling long-range inter-frame dependencies of the spatial feature vector sequence using a temporal coding network based on a self-attention mechanism to output sequence-level features; and classifying the sequence-level features based on the anatomical structural attributes of the samples using a classification model corresponding to those attributes to output the physiological phase classification result. This scheme comprehensively improves the accuracy and robustness of physiological phase classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of medical image processing technology, specifically to a method, apparatus, and readable storage medium for classifying physiological stages of medical images. Background Technology

[0002] The pelvic cavity has a complex structure, housing the urinary and reproductive organs and part of the intestines. Numerous lesions reside in the pelvic cavity, among which malignant tumors—such as prostate cancer in men and ovarian and cervical cancer in women—seriously threaten human health. Early detection, accurate characterization, and precise staging provide crucial information for clinical diagnosis and treatment planning and can significantly improve patient survival rates. Magnetic resonance imaging (MRI) has excellent soft tissue resolution and is currently widely used for examining diseases of the pelvic organs. Dynamic contrast-enhanced MRI (DCE-MRI) involves continuous scanning after contrast agent injection to acquire the anatomical structure, T1-weighted (T1WI) signal, and blood supply characteristics of lesions. It currently plays an important diagnostic role in bladder, uterine, and adnexal lesions, and serves as an adjunct in the diagnosis of prostate diseases.

[0003] DCE-MRI of the pelvic cavity is a continuous multi-phase scan, which can be divided into plain phase, arterial phase, venous phase, and delayed phase. The plain phase mainly acquires the T1WI signal intensity and anatomical information of the lesion before enhancement; the arterial phase, usually 20-40 seconds after contrast agent injection, can show the early blood supply of the lesion, and lesions with rich blood supply may enhance during this phase; the venous phase, 60-90 seconds after contrast agent injection, can show the extent and degree of infiltration of the lesion, playing an important role in the staging and grading of the lesion; the delayed phase, 3-5 minutes or even longer after contrast agent injection, observes contrast agent elution to determine the lesion type. Accurately identifying the physiological phase to which each frame of the DCE-MRI sequence belongs is an important prerequisite for combining phase information with the pathological features presented by the image and carrying out subsequent diagnostic analysis.

[0004] In current clinical practice, the most common technique for phase classification of pelvic DCE-MRI images remains manual classification. Doctors rely on observing the enhancement levels of blood vessels and solid organs in the images, as well as metadata about the scan time, to make judgments. This approach is not only inefficient but also highly subjective and prone to misjudgment. In recent years, deep learning methods have been attempted for temporal classification of medical images. However, existing methods typically input the entire sequence directly into a 3D convolutional network or recurrent network, which presents the following problems: First, the length of medical image sequences is not fixed, and the number of scan layers and time points varies significantly among different patients, making it difficult to process them uniformly. Second, existing methods do not fully utilize the temporal information in the acquired metadata, relying solely on image content, leading to sensitivity to noise and individual differences. Summary of the Invention

[0005] To address the problems in the related technologies, this disclosure provides a method, apparatus, and readable storage medium for classifying physiological stages of medical images.

[0006] In a first aspect, embodiments of this disclosure provide a method for classifying physiological stages in medical images, including: Medical image sequences are acquired, and the slices are sorted temporally and grouped by physiological cycle based on multidimensional metadata. When the length of the original sequence is greater than or equal to the preset target number of frames, sampling quotas are allocated according to the proportion of slices in each group, and feature frames are extracted at equal intervals within each group to form a fixed-length input sequence. Each group of slices corresponds to the same physiological enhancement state, and there is a unidirectional progressive temporal constraint between groups. Each frame of the fixed-length input sequence is encoded frame by frame by a spatial feature extraction network to obtain a spatial feature vector sequence; The spatial feature vector sequence is modeled for long-range inter-frame dependencies using a temporal coding network based on a self-attention mechanism, and the sequence-level features are output. Based on the anatomical structural attributes of the samples, the sequence-level features are classified using the classification model corresponding to the attribute, and the physiological phase classification results are output.

[0007] Optionally, the multidimensional metadata includes acquisition time, image instance number, time location identifier, and total number of time locations; the temporal sorting is nested in the order of acquisition time, image instance number, time location identifier, and total number of time locations; when there are missing values ​​in the multidimensional metadata, a default value is assigned to the missing value.

[0008] Optionally, assigning default values ​​includes: assigning a value of 1 if the image instance number is missing, assigning a value of 0 if the time location identifier is missing, assigning a value of 0 if the total number of time locations is missing, assigning a value of 0 if the acquisition time is missing; and assigning a value of 0 if both the acquisition time and the image instance number are missing, then the sequence is discarded.

[0009] Optionally, the physiological cycle grouping includes: logically grouping the sorted slices according to the same number of seconds of the acquisition time, the time position identifier, and the total number of time positions, wherein the slices in the same group have the same phase category label, and there is a unidirectional progressive temporal constraint between the groups.

[0010] Optionally, the step of allocating sampling quotas according to the proportion of slices in each group and extracting feature frames at equal intervals within each group includes: The number of samples allocated to the kth group is

[0011] Among them, L kL is the number of slices in the k-th group, L is the total number of slices in the original sequence, N is the number of frames in the fixed-length input sequence, and round indicates rounding to the nearest integer. If the N calculated for a certain group k =0, then force N to k =1; When the sum of the sample sizes of each group is not equal to N, adjust N according to the size of the decimal remainder of each group. k Make adjustments by adding or subtracting to ultimately satisfy the requirements. Where K is the total number of groups; The original intra-group index corresponding to the i-th sampling point within the k-th group is:

[0012] Where i∈{0,1,…,N} k -1}, This indicates rounding down to the nearest integer.

[0013] Optionally, it also includes: When the length of the original sequence is less than the target number of frames, zero vector padding is performed at the end of the sequence to the target number of frames, and an effective bitmask is generated simultaneously; the effective bitmask is used to identify the effective feature positions and padding positions in the self-attention calculation of the temporal coding network.

[0014] Optionally, before encoding each frame of the fixed-length input sequence frame by frame through the spatial feature extraction network, a spatial structure-preserving normalization preprocessing is also included for each frame image: Based on the shortest side of the image, it is scaled isotropically and proportionally according to a preset standardized reference size to maintain the aspect ratio of the image. Based on the image center, perform center cropping according to a preset center retention ratio; The cropped image region is scaled to a preset standard input size using bilinear interpolation. The image is converted to a three-channel format and each channel is standardized according to the preset mean and standard deviation.

[0015] Optionally, the spatial feature extraction network is a pre-trained ConvNeXt-Base network, which outputs a high-dimensional feature map after removing the final classification head, and then compresses it into a fixed-dimensional spatial feature vector through global adaptive average pooling.

[0016] Optionally, the timing coding network includes: A linear projection layer is used to linearly project the spatial feature vector sequence onto the hidden layer space, the hidden layer space having a dimension of 256; A learnable global temporal tag is inserted at the beginning of the spatial feature vector sequence; A learnable positional encoding matrix is ​​incorporated into the spatial feature vector sequence through element-wise addition; The encoder consists of 4 stacked layers, each layer comprising a multi-head self-attention mechanism and a feedforward network, with the multi-head self-attention mechanism having 8 heads.

[0017] Optionally, the anatomical structure attribute is gender; the classification model includes a male-specific model and a female-specific model, wherein the male-specific model is independently trained based on a male training sample set under the same network architecture of the spatial feature extraction network and the temporal coding network, and the female-specific model is independently trained based on a female training sample set under the same network architecture; during inference, the corresponding classification model is automatically selected based on the gender label in the image metadata.

[0018] Optionally, during model training, the loss weight of each training sample can be dynamically adjusted based on the number of effective slices for that sample. Let ni be the number of valid slices contained in the i-th training sample, and n be the average number of valid slices in all samples in the current batch. Then the weight of this sample is:

[0019] Among them, W max This is the preset weight limit; The overall loss of the current batch is the weighted average of the cross-entropy loss of each sample and its corresponding weight.

[0020] Secondly, embodiments of this disclosure provide a medical image physiological stage classification device, comprising: The physiological time series standardization module is configured to acquire medical image sequences and sort the slices temporally and group them according to physiological cycles based on multidimensional metadata. When the length of the original sequence is greater than or equal to the preset target number of frames, the sampling quota is allocated according to the proportion of slices in each group, and feature frames are extracted at equal intervals within each group to form a fixed-length input sequence. Each group of slices corresponds to the same physiological enhancement state, and there is a unidirectional progressive temporal constraint between groups. The spatial feature extraction module is configured to encode each frame of a fixed-length input sequence frame by frame to obtain a spatial feature vector sequence; The temporal coding module is configured to model the long-range inter-frame dependencies of the spatial feature vector sequence based on a self-attention mechanism and output sequence-level features; The classification routing module is configured to classify sequence-level features based on the anatomical structural attributes of the samples, using the classification model corresponding to the attribute, and outputting the physiological phase classification results.

[0021] Thirdly, embodiments of this disclosure provide an electronic device including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method as described in any one of the first, second, or third aspects.

[0022] Fourthly, embodiments of this disclosure provide a readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed by a processor, implement the method as described in any one of the first, second, or third aspects.

[0023] The technical solutions provided in this disclosure may have the following beneficial effects: According to the technical solution provided in this disclosure, medical image sequences are standardized to extract fixed-length input sequences. Feature modeling is then performed using a spatial feature extraction network and a temporal coding network. Finally, based on the anatomical structural attributes of the samples, a corresponding classification model is selected to output the physiological phase classification result. This technical solution can effectively process medical image sequences of different lengths, fully utilize the long-range dependencies between sequence frames, and improve the accuracy and robustness of physiological phase classification.

[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0025] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings.

[0026] Figure 1 A flowchart illustrating a method for classifying physiological stages of medical images according to an embodiment of this disclosure is shown.

[0027] Figure 2 A schematic diagram illustrating the temporal sequencing, physiological cycle grouping, and sampling according to an embodiment of the present disclosure is shown.

[0028] Figure 3 This diagram illustrates the architecture of a spatial-temporal hybrid feature extraction model according to an embodiment of the present disclosure.

[0029] Figure 4 A structural block diagram of a medical image physiological stage classification device according to an embodiment of the present disclosure is shown.

[0030] Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0031] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the method according to embodiments of the present disclosure is shown. Detailed Implementation

[0032] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of exemplary embodiments have been omitted from the drawings.

[0033] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.

[0034] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] Figure 1 A flowchart illustrating a method for classifying physiological stages of medical images according to an embodiment of this disclosure is shown.

[0036] like Figure 1 As shown, the medical image physiological stage classification method includes the following steps S110-S140.

[0037] Step S110: Obtain medical image sequences, sort the slices by time sequence and group them by physiological cycle based on multidimensional metadata; when the length of the original sequence is greater than or equal to the preset target number of frames, allocate sampling quotas according to the proportion of slices in each group, extract feature frames at equal intervals in each group, and form a fixed-length input sequence.

[0038] In the context of this disclosure, a "medical imaging sequence" refers to a series of two-dimensional tomographic images produced by the same examination protocol, such as a sequential scan sequence of pelvic DCE-MRI. Each frame may be referred to as a "slice" or "frame." The length of the original sequence (i.e., the total number of slices) is also considered. The number of frames may vary depending on the patient, equipment, and scanning protocol, ranging from tens to thousands of frames. To accommodate the fixed input requirements of subsequent deep learning networks, it needs to be normalized to a preset target number of frames. A fixed frame sequence, wherein, These are hyperparameters pre-defined based on computing resources and task requirements. It should be noted that a complete scan should include four phases: plain scan, arterial phase, venous phase, and delayed phase. However, in actual clinical practice, only a few of these phases may be scanned. This disclosure uses a complete scan image including all four phases as an example for illustrative purposes.

[0039] First, the multidimensional metadata associated with each slice is obtained. According to a preferred embodiment of this disclosure, the multidimensional metadata includes at least: acquisition time, instance number, temporal position identifier, and number of temporal positions. This metadata is typically stored in the DICOM header file of the medical image. The acquisition time is usually accurate to seconds or milliseconds and is used to represent the actual scan time of the frame; the instance number is the original sequence number of the frame in the sequence; the temporal position identifier and the number of temporal positions are specifically used to describe the temporal position information of the dynamic scan.

[0040] refer to Figure 2 , Figure 2 This diagram illustrates the temporal sequencing, physiological cycle grouping, and sampling according to embodiments of the present disclosure. Figure 2 As shown, to ensure the robustness of the sorting algorithm and its compatibility with heterogeneous clinical data, this scheme introduces a non-destructive data fault tolerance mechanism. If a key label is missing, a preset default value is assigned to the missing value to ensure the continuity of the sorting and grouping algorithms. Specifically, if the image instance number is missing, it is assigned a value of 1; if the time location identifier is missing, it is assigned a value of 0; if the total number of time locations is missing, it is assigned a value of 0; if the acquisition time is missing, it is assigned a value of 0; if both the acquisition time and the image instance number are missing, the sequence is discarded.

[0041] To ensure the correct temporal sequence between frames, all slices need to be sorted. The sorting employs a multi-level nested rule: slices are sequentially sorted using acquisition time, image instance number, time position identifier, and total number of time positions. Specifically, they are first sorted in ascending order by acquisition time; if acquisition times are the same, they are sorted in ascending order by image instance number; if still the same, they are sorted in ascending order by time position identifier; finally, they are sorted in ascending order by total number of time positions. This strict nested sorting ensures that even with minor deviations in some metadata, the correct scan timing can be restored to the greatest extent possible.

[0042] Continue to refer to Figure 2After sorting, the sorted slices are logically grouped according to the acquisition time (accurate to the second), time position identifier, and total number of time positions. Specifically, slices acquired within the same number of seconds and with the same time position identifier are grouped into the same group. Each group represents a "physiological enhancement state," because images acquired at the same time or phase should have consistent tissue enhancement. There is a unidirectional progressive temporal constraint between groups, meaning that groups increase in chronological order, and the time position of a later group is necessarily later than that of the previous group, ensuring the irreversibility of the temporal logic. Based on the physiological prior knowledge that "contrast agent metabolism is irreversible," the grouped sequences exhibit a strict phase progression relationship (plain scan phase → arterial phase → venous phase → delayed phase). Assuming a total of... Group 1, the 1st group Each group contains A slice, satisfying .

[0043] After grouping, different processing strategies are adopted according to different input length scenarios. The following two specific examples illustrate this. and Complete processing flow for both scenarios.

[0044] First scenario: (Long sequence scenario - group ratio sampling path) Suppose a pelvic DCE-MRI examination contains 100 real slices ( After being sorted chronologically, the slices were divided into four physiological phase groups, and the distribution of each group is as follows:

[0045] First, multidimensional metadata sorting is performed to ensure that the 100 frames are arranged strictly according to the acquisition time. Then, the sorted slices are logically grouped according to the acquisition time (accurate to the second), time position identifier, and total number of time positions, forming the above 4 groups, with unidirectional progressive timing constraints between groups (plain scan → artery → vein → delay).

[0046] Next, several representative frames need to be extracted from each group, such that the sum of the number of frames sampled from each group equals the preset target number of frames. In this embodiment, it is set To ensure that the contribution of each group to the final sequence is proportional to its original length, a proportional allocation of sampling quotas is adopted. Number of samples allocated to each group Calculate according to the following formula:

[0047] Calculate the quota for each group:

[0048] .

[0049] In this example This is exactly equal to the target number of frames, requiring no correction. If the quota for a certain group is calculated to be 0, it is forcibly set to 1 and deducted from other groups to ensure that each phase has representative frames selected.

[0050] Within each group, feature frames are extracted using equal-interval sampling. For the first... Group 1, the 1st group sampling points ( The corresponding original within-group index is:

[0051] For example, group 1 ( The sampling index is:

[0052] That is, extract frame 0, frame 9, and frame 19 from the 20 frames of group 1. Similarly, each group is sampled in the same way.

[0053] Finally, the sampling frames are spliced ​​together in the original order of group 1 → group 2 → group 3 → group 4 to form a sample frame of length [length missing]. A fixed-length input sequence was used. This sequence fully covered the entire physiological trajectory of contrast agent "inflow-peak-clearance" through proportional sampling, and representative information of each phase was preserved.

[0054] The second scenario: (Short sequence scenario - zero-padding mask path) For the original sequence length Less than the target number of frames In cases where zeros are padded at the end in conjunction with an effective bit mask, this disclosure employs a method of padding the tail with zeros and using an effective bit mask. Assume a pelvic DCE-MRI examination contains only 12 real slices ( After sorting, it still contains four complete physiological phases (3 frames of plain scan, 3 frames of arterial scan, 3 frames of venous scan, and 3 frames of delayed scan), but the total number of slices is relatively small.

[0055] First, multidimensional metadata sorting is performed to ensure the 12 frames are arranged strictly according to their acquisition time, thus preserving the complete physiological trajectory (plain scan → artery → vein → delayed scan). At this point, the total number of actual slices... Less than the target number of frames This does not meet the applicable conditions for grouped sampling. Therefore, four zero vector frames are appended to the end of the sorted 12-frame real sequence to pad the sequence, making the sequence length 16. At the same time, a valid bitmask with a length of 16 is generated, where the first 12 bits are 1 (valid) and the last 4 bits are 0 (padding / invalid).

[0056] The mask is fed into the Transformer encoder along with the sequence. During self-attention calculation, positions where the mask is 0 are masked and do not participate in the attention score calculation, ensuring that the model only focuses on the complete physiological trajectories contained in the first 12 frames of the real slice, and the padding zero vectors do not cause interference. At this point, although the input sequence length has reached 16, the effective physiological trajectories are only in the first 12 frames; the masking mechanism ensures that the padding positions do not affect the accuracy of temporal modeling.

[0057] The two examples above correspond to two typical input scenarios that may occur in clinical practice. When At that time, long sequences are compressed to the target number of frames by grouped proportional sampling, preserving representative information of each phase; when At this time, by padding with trailing zeros and using a masking mechanism, short sequences are padded to the target frame number, preserving all real slice information while ensuring a uniform model input format. These two methods together constitute a complete temporal normalization scheme, covering all possible input sequence lengths.

[0058] In one embodiment of this disclosure, before performing step S120, in order to ensure that the input image has a uniform spatial scale and maintains the geometric proportions of the original anatomical structure to the greatest extent, the present invention further employs a spatial structure preservation standardization preprocessing strategy. The core of this strategy lies in the combination of "uniform scaling" and "anatomical prior cropping".

[0059] Specifically, considering the differences in image size and aspect ratio generated by different medical centers and equipment, the shortest side of the image is first used as the standardization benchmark, and spatial standardization is performed on the image using a proportional isotropic scaling method. The scaling factor is calculated using the following formula:

[0060] in, and These represent the height and width of the original image, respectively. This is a preset standardized reference size. This method ensures that the aspect ratio of the image remains unchanged, avoiding the distortion of organ morphology and deformation of blood vessel structure caused by traditional non-proportional stretching.

[0061] After spatial standardization, a fixed-ratio center crop is performed based on the image center. The preset center retention ratio can be set according to the anatomical distribution range of the target organ to effectively reduce irrelevant background information while ensuring complete coverage of the main anatomical structures and vascular pathways.

[0062] After completing the center clipping, the clipping area is processed using bilinear interpolation to unify the dimensions, ultimately obtaining the preset standard input dimensions.

[0063] Specifically, since the backbone network used in this scheme is pre-trained on natural images, it accepts three-channel RGB input. Therefore, before inputting single-channel or pseudo-color MRI images into the network, they need to be constructed into a three-channel format. To match the data distribution of the pre-trained weights, the three channels need to be standardized separately, using the following standardization formula: ,in, For input values, For the output value, The mean, The standard deviation is the mean, and the standard deviation is set based on the statistics of the pre-trained dataset.

[0064] Step S120: Encode each frame of the fixed-length input sequence frame by frame through a spatial feature extraction network to obtain a spatial feature vector sequence.

[0065] This disclosure employs a pre-trained model based on a convolutional neural network as the backbone for spatial feature extraction, utilizing the general visual representations learned from massive amounts of natural images. Figure 3 A diagram illustrating the architectural composition of a spatial-temporal hybrid feature extraction model according to an embodiment of this disclosure is shown. Figure 3 As shown on the left, the spatial feature extraction network adopts the ConvNeXt-Base architecture, and its internal structure is detailed below.

[0066] The ConvNeXt-Base backbone network consists of four symmetrical Stages, each connected by downsampling layers to progressively reduce the spatial size of the feature maps and increase the number of channels. Each Stage contains multiple ConvNeXtBlocks, such as... Figure 3 As shown in the dashed box on the left, the core components of each ConvNeXtBlock include: Depthwise Separable Convolution (DW Conv): Located at the very top (top layer) of the entire module, it is used to extract local spatial features by separating spatial convolution from channel convolution, thereby significantly reducing the number of parameters while maintaining strong representation capabilities.

[0067] Layer Normalization (LayerNorm): Immediately following depthwise separable convolutions. Instead of traditional batch normalization, it normalizes each sample independently, helping to improve training stability, especially suitable for training scenarios with small batch sizes.

[0068] 1×1 point convolution with GELU activation (Conv→GELU→Conv): After layer normalization, this consists of two 1×1 convolution operations, with a nested GELU as a non-linear activation function. In the diagram, these two 1×1 convolutions respectively serve to increase and decrease dimensionality (enhancing non-linear representation).

[0069] Layer scaling: Immediately following the second 1×1 convolution (dimensionality reduction operation). A learnable scaling factor is multiplied by the output of each module, performing element-wise scaling of the channel dimensions, which helps stabilize the training of deep networks.

[0070] Random depth / drop path: Located at the end of the entire branch (i.e., the last element). During training, the entire residual branch is randomly dropped with a certain probability, which is an effective regularization method to prevent overfitting.

[0071] Residual connection (⊕): The original input of the module (i.e., the leftmost vertical line) skips directly over the above five steps and is added element-wise to the output after random depth / discard path processing, thereby ensuring that the gradient can be smoothly backpropagated and avoiding degradation due to network deepening.

[0072] Through the progressive processing of the above four stages, the spatial resolution of the input image gradually decreases while the number of channels gradually increases, ultimately outputting a high-dimensional feature map.

[0073] This approach removes the final classification head of the original ConvNeXt-Base network, retaining all the aforementioned convolutional stages as spatial feature extractors. For a single input frame image (normalized to a preset input size), ConvNeXt-Base outputs a high-dimensional feature map (e.g., ...). Figure 3 The middle part is shown as (structure).

[0074] To obtain spatial feature vectors of fixed dimensions, a global adaptive average pooling layer is added at the end of the backbone network to compress the spatial dimension of each feature map into a single value. This pooling operation is adaptive; regardless of the spatial size of the input feature map, the output dimension is always the preset spatial feature dimension (e.g., ...). Figure 3 (as shown in the 1024-dimensional diagram). Thus, for a length of... The frame sequence is processed frame by frame through a spatial feature extraction network to obtain a spatial feature vector sequence. , of which each The dimension is the preset spatial feature dimension.

[0075] During model training, the backbone network weights can be frozen or fine-tuned depending on the data size. When the training data size is limited, freezing the pre-trained weights is preferable to prevent overfitting, while significantly reducing memory consumption and training time, allowing model training to focus more on optimizing the parameters of the temporal coding network.

[0076] Step S130: The spatial feature vector sequence is modeled for long-range inter-frame dependencies using a time-series coding network based on a self-attention mechanism, and the sequence-level features are output.

[0077] Since physiological phase classification depends not only on the spatial content of a single frame image, but also on the enhancement trends between frames (e.g., the complete hemodynamic process of contrast agent "inflow-peak-clearance"), effective temporal modeling is required. This disclosure employs a Transformer-based temporal coding network, the core of which is a multi-head self-attention mechanism. This network can directly model the dependencies between any two frames, is not limited by distance, and overcomes the shortcomings of recurrent neural networks, such as difficulty in parallelization and long-term forgetting.

[0078] Continue to refer to Figure 3 ,like Figure 3 As shown on the right, the specific structure of the time-series coding network is as follows: Linear Projection Layer: This layer transforms the feature vector (of dimension 1) output from the ConvNeXt backbone network after global average pooling. The feature dimension is reduced from 1024 to 256 through a linear projection layer. This operation effectively reduces the feature dimension, reduces the computational cost of subsequent multi-head self-attention mechanisms, and makes the feature distribution more suitable for the input requirements of the Transformer encoder.

[0079] Learnable global temporal token (ClassToken): Corresponding to the category token in the diagram. During sequence processing, a learnable category vector is concatenated with the projected feature sequence. In the subsequent encoder, this token interacts with all input features through a self-attention mechanism, and its corresponding output vector is ultimately used as the aggregate representation of the entire sequence. Compared to simply pooling features, the class token allows the network to adaptively determine which feature dimensions are most important for classification, enhancing the flexibility of feature extraction.

[0080] Learnable Position Embedding: Since self-attention mechanisms are inherently insensitive to order, positional information needs to be explicitly injected. This disclosure employs learnable position embedding, which initializes a positional encoding matrix and incorporates it into each vector of the input sequence through element-wise addition. Compared to fixed positional encoding (sine and cosine), learnable encoding can adaptively adjust the positional representation based on training data, making it more suitable for the irregular time intervals of medical image sequences.

[0081] Stacked encoder layers (EncoderLayer×L): Labeled as "Encoder Layer × 4" in the diagram (i.e., 4 layers stacked repeatedly). Each encoder layer, from bottom to top, contains: a multi-head self-attention mechanism, a first addition and normalization, a feedforward neural network, and a second addition and normalization. The feedforward network typically contains two linear layers activated using GELU. After extracting global dependencies through the 4 stacked encoder layers, the output vector corresponding to the class token is extracted as the sequence-level feature of the entire sequence. This feature is then fed into the top multilayer perceptron (MLP) and softmax layers to output the final classification result.

[0082] In addition, In short sequence scenarios, since sequence padding and effective bit mask are introduced in step S110, the model automatically ignores the padding position during attention calculation, ensuring the accuracy of time series modeling.

[0083] Step S140: Based on the anatomical structural attributes of the sample, classify the sequence-level features using the classification model corresponding to the attribute, and output the physiological phase classification result.

[0084] Populations with different anatomical structural attributes may exhibit significant differences in physiological reinforcement dynamics. Taking sex as an example, the pelvic anatomy (prostate in men, uterus and adnexa in women) and blood supply dynamics are fundamentally different between men and women. If a uniform classification model is used, the model may be forced to learn a certain compromise pattern, reducing its ability to fit a specific population. Therefore, this disclosure proposes to construct multiple dedicated classification models based on anatomical structural attributes (preferably sex), with each model trained independently on its corresponding training subset.

[0085] Specifically, during the training phase, all training samples are first divided into male and female training sample sets based on the gender labels in the image metadata. Then, two classification models are trained independently on these two subsets, each using the exact same network architecture (i.e., the aforementioned spatial feature extraction network + temporal coding network), but parameter initialization and training processes are completely independent and do not interfere with each other. Each dedicated model has its own classification head (usually a linear classification layer that maps sequence-level features to the number of categories). , Optimize the number of phase categories.

[0086] During the inference phase, when a new medical image sequence is input, its gender label is first read from its metadata. If it is male, it is automatically routed to the male-specific model for forward inference; if it is female, it is routed to the female-specific model. If the gender label is missing, a general model can be used by default, or a hint can be output. This routing strategy ensures high accuracy for each model in its area of ​​expertise while achieving automatic adaptation during inference, eliminating the need for manual selection by the user.

[0087] Training and optimization To make the model performance more consistent with clinical diagnostic logic, this disclosure implements specific optimization strategies during the training process.

[0088] Sample weight balancing strategy: Since the number of effective slices contained in the T1 sequences of different studies varies, the amount of anatomical structural information and dynamic enhancement information carried by different samples also differs. To increase the contribution of samples containing more effective image information to model parameter updates, this disclosure dynamically adjusts their loss weights based on the number of effective slices corresponding to the training samples. Specifically, let the... The number of valid slices contained in each training sample is The average number of valid slices for all samples in the current batch is The weight of the sample is defined as follows: ,in, The weight cap is a preset upper limit; the overall loss of the current batch is the weighted average of the cross-entropy loss of each sample and its corresponding weight. Through this design, the model pays more attention to samples containing rich anatomical structures and dynamic reinforcement information, while the upper limit of weights prevents a few very long sequences from generating excessively large gradients, which could lead to training instability.

[0089] Optimizer and Learning Rate Scheduling: An adaptive moment estimation optimizer is used, along with a preset initial learning rate and weight decay coefficient. The learning rate scheduling employs a cosine annealing strategy with preheating. After the preheating phase, the learning rate decays according to a cosine curve, ensuring stable convergence of the model in the early stages of training and fine-tuning in the later stages.

[0090] Regularization and stability strategies: To prevent overfitting, a dropout mechanism is introduced into the temporal coding network. Furthermore, an early stopping strategy is employed, terminating training when the validation set loss no longer decreases within a preset number of epochs; a gradient pruning strategy is used to prevent gradient explosion; and label smoothing techniques are introduced to enhance the model's generalization ability and prevent overconfidence in the training labels. Specific Implementation This section uses a complete pelvic contrast-enhanced MRI phase classification task as an example to fully describe the implementation process of the above technical solution with specific numerical values. All the specific numerical values ​​described below are preferred configurations for this embodiment and are not intended to limit the scope of protection of this disclosure.

[0092] (a) Data acquisition and time series standardization This embodiment retrieved 1000 pelvic DCE-MRI examination data from a medical institution's PACS system, including 500 males and 500 females. Each examination included a complete T1-weighted enhancement sequence, with the original sequence length... Distributed between 80 and 600 frames, all with the original image size being [missing information]. Pixel.

[0093] Metadata parsing and fault tolerance: The AcquisitionTime, InstanceNumber, TemporalPositionIdentifier, and NumberOfTemporalPositions are read from the DICOM header file of each frame. For missing values, the following default value strategy is adopted: InstanceNumber is assigned a value of 1, TemporalPositionIdentifier is assigned a value of 0, NumberOfTemporalPositions is assigned a value of 0, and AcquisitionTime is assigned a value of 0. If both AcquisitionTime and InstanceNumber are missing, the sequence is discarded; in this embodiment, 12 data entries were therefore discarded.

[0094] Four-dimensional cascade sort: nested ascending sort in the order of AcquisitionTime (floating-point number, accurate to milliseconds), InstanceNumber, TemporalPositionIdentifier, and NumberOfTemporalPositions.

[0095] Menstrual cycle grouping: The sorted slices are logically grouped according to AcquisitionTime (accurate to the second), TemporalPositionIdentifier, and NumberOfTemporalPositions. In this embodiment, each of the 1000 data points contains... to The number of groups varies, and each group corresponds to a physiological enhancement state (plain scan phase, early arterial phase, late arterial phase, venous phase, delayed phase, etc.).

[0096] Target frame rate setting: In this embodiment, the model is set to a fixed input length. For the first Grouped according to the formula Calculate the quotas, then adjust for decimal remainders to make the sum 128. Within each group, apply the formula... Equal-interval sampling. When the original sequence length... At this time, zero padding is performed at the end of the sequence and a valid bitmask is generated.

[0097] (ii) Standardized pretreatment for maintaining spatial structure Proportional scaling: Sets a standardized baseline size Scaling factor .for The original image, after scaling, is still [image size]. ;for The original image, scaled to approximately .

[0098] Center cropping: An 87.5% center retention ratio is used, meaning 87.5% of the central area of ​​the scaled image is retained. For Image, cropped area is ;for Image, cropped area is .

[0099] Size uniformity and standardization: Bilinear interpolation is used to uniformly scale all cropping areas to the desired size. Pixels. Then channel normalization was performed: the single-channel MRI image was copied into a three-channel RGB format, with the mean of the three channels set to [0.485, 0.456, 0.406] and the standard deviation set to [0.229, 0.224, 0.225].

[0100] (III) Spatial Feature Extraction (ConvNeXt-Base) This embodiment uses a ConvNeXt-Base model pre-trained on ImageNet-22K as the spatial feature extraction backbone, removing the final classification head. For each frame... The input image, ConvNeXt-Base, is processed step-by-step through four stages to output a shape of... The feature map is then compressed into a 1024-dimensional global spatial feature vector through global adaptive average pooling. For a frame sequence of length 128, the following is obtained: spatial feature vector sequence .

[0101] Training strategy: This embodiment adopts a freezing strategy, keeping all weight parameters of the ConvNeXt-Base backbone network unchanged, and only training the subsequent temporal coding network and classification head.

[0102] (iv) Sequence coding (SequenceTransformer) The timing coding network parameters in this embodiment are as follows: The linear projection layer maps 1024 dimensions to... Dimension; Insert a learnable class token (dimensional 256) at the beginning of the sequence; Employ a learnable positional encoding matrix (shape 256). ); Stack 4 layers of Transformer encoders, each layer with multiple self-attention heads. The intermediate dimension of the feedforward network dropout ratio After the encoder, the 256-dimensional vector corresponding to the class token is extracted as the sequence-level feature. .

[0103] (V) Gender-based governance and classification In this embodiment, based on the PatientSex label, 988 valid data points were divided into a male subset (495 cases) and a female subset (493 cases), and two classification models were trained independently for each subset. Each model's classification head is a linear layer that maps 512-dimensional sequence-level features to... The system classifies phases into four categories: plain phase, arterial phase, venous phase, and delayed phase. During inference, the system automatically routes the data to the corresponding model based on the gender label of the sample, outputs the probability distribution of the four phases, and takes the category with the highest probability as the final classification result.

[0104] (vi) Training hyperparameters The training hyperparameters in this embodiment are as follows: Batch size = 32; Optimizer: AdamW; Initial learning rate... Weight decay The learning rate scheduling uses Warmup (5 epochs) + Cosine Annealing, with a total training epochs of 80; Early Stopping Patience = 15; Gradient Clipping max_norm = 1.0; Label Smoothing Coefficient = 0.05; The upper limit of the weights in the weighted loss function is set to 5.0.

[0105] (vii) Training Results With the above configuration, this embodiment achieved an overall classification accuracy of 97.71% on an independent test set (76 cases), with a recall of 98.68% in the plain scan phase, 86.15% in the arterial phase, 87.16% in the venous phase, and 100% in the delayed phase. Compared to the unified model without gender segregation (accuracy 93.85%), this represents an improvement of 4 percentage points, verifying the effectiveness of the disclosed technical solution. The test results for different genders using the model of this application are shown in Table 1. The overall classification accuracy using the existing ResNet34 and Swin-tiny models is shown in Table 2.

[0106] Table 1

[0107] Table 2

[0108] The specific values ​​above are only preferred configurations for this embodiment. Those skilled in the art can adjust the above parameters according to actual task requirements and computing resources, and all such adjustments fall within the protection scope of this disclosure.

[0109] The technical solutions provided in this disclosure have at least the following beneficial effects: (1) By using multidimensional metadata-driven temporal sorting and physiological cycle grouping, and by using proportional quota and equal interval sampling, medical image sequences of arbitrary length are normalized into fixed-length inputs. This not only preserves the consistency of the enhancement state of each physiological stage, but also ensures the temporal continuity and representativeness of the frame sequence, providing high-quality input for subsequent deep learning models.

[0110] (2) In the spatial preprocessing stage, the geometric distortion of organs caused by traditional forced deformation scaling is effectively avoided by isotropic scaling with equal proportion and anatomical prior-guided center clipping, and the spatial proportional relationship of anatomical structure and vascular pathway is completely preserved, providing accurate spatial context information for spatial feature extraction.

[0111] (3) Spatial features are extracted using a pre-trained ConvNeXt-Base network. With the help of large-scale natural image pre-training knowledge, the problem of insufficient medical image annotation data is effectively alleviated. At the same time, fixed-dimensional feature vectors are obtained through global pooling, which facilitates temporal network processing.

[0112] (4) The time-series coding network based on the self-attention mechanism can capture long-range dependencies between frames. Compared with RNN, it is better at modeling the overall trend of the reinforcement curve, and has stronger robustness to noise and individual differences, which significantly improves the classification accuracy.

[0113] (5) Based on anatomical structural attributes such as gender, a dedicated classification model is constructed to fully explore the differences in physiological reinforcement dynamics among different groups, avoid the average effect of the unified model, and achieve better classification performance in both male and female subsets. Furthermore, automatic routing is achieved during inference without the need for additional user operation, which has good clinical applicability.

[0114] Figure 4 A structural block diagram of a medical image physiological stage classification device according to an embodiment of the present disclosure is shown. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both.

[0115] like Figure 4 As shown, the medical image physiological stage classification device 400 includes: The physiological time series standardization module 410 is configured to acquire medical image sequences, sort the slices temporally and group them according to physiological cycles based on multidimensional metadata, allocate sampling quotas according to the proportion of slices in each group, extract feature frames at equal intervals within each group, and form a fixed-length input sequence; wherein, each group of slices corresponds to the same physiological enhancement state, and there is a unidirectional progressive temporal constraint between groups; The spatial feature extraction module 420 is configured to encode each frame of a fixed-length input sequence frame by frame to obtain a spatial feature vector sequence; The temporal coding module 430 is configured to model the long-range inter-frame dependency of the spatial feature vector sequence based on a self-attention mechanism and output sequence-level features. The phase result output module 440 is configured to classify the sequence-level features based on the anatomical structural attributes of the sample, and output the physiological phase classification results using the classification model corresponding to the attribute.

[0116] For specific technical details of the embodiments disclosed herein, please refer to the above embodiments, which will not be repeated here.

[0117] This disclosure also discloses an electronic device, Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0118] like Figure 5 As shown, the electronic device includes a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method according to embodiments of the present disclosure.

[0119] Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the method according to embodiments of the present disclosure is shown.

[0120] like Figure 6 As shown, the computer system includes a processing unit that can execute various methods described above based on a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM). The RAM also stores various programs and data required for the operation of the computer system. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0121] The following components are connected to the I / O interface: input sections including keyboards, mice, etc.; output sections including cathode ray tubes (CRTs), liquid crystal displays (LCDs), and speakers; storage sections including hard disks; and communication sections including network interface cards such as LAN cards and modems. The communication section performs communication processes via a network such as the Internet. Drives are also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that computer programs read from them can be installed into the storage section as required. The processing unit can be implemented as a CPU, GPU, TPU, FPGA, NPU, etc.

[0122] In particular, according to embodiments of this disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing the methods described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium.

[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0124] The units or modules described in the embodiments of this disclosure can be implemented in software or programmable hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.

[0125] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system described above; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in this disclosure.

[0126] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

Claims

1. A medical image physiologic phase classification method characterized by, include: Acquire medical image sequences and perform temporal sorting and physiological cycle grouping of slices based on multidimensional metadata; When the length of the original sequence is greater than or equal to the preset target number of frames, sampling quotas are allocated according to the proportion of slices in each group, and feature frames are extracted at equal intervals within each group to form a fixed-length input sequence; wherein, each slice in each group corresponds to the same physiological enhancement state, and there is a unidirectional progressive temporal constraint between groups; Each frame of the fixed-length input sequence is encoded frame by frame by a spatial feature extraction network to obtain a spatial feature vector sequence; The spatial feature vector sequence is modeled for long-range inter-frame dependencies using a temporal coding network based on a self-attention mechanism, and the sequence-level features are output. Based on the anatomical structural attributes of the samples, the sequence-level features are classified using the classification model corresponding to the attribute, and the physiological phase classification results are output.

2. The method of claim 1, wherein, The multidimensional metadata includes acquisition time, image instance number, time location identifier, and total number of time locations; the temporal sorting is nested in the order of acquisition time, image instance number, time location identifier, and total number of time locations; when there are missing values ​​in the multidimensional metadata, a default value is assigned to the missing value.

3. The method of claim 2, wherein, The physiological cycle grouping includes: logically grouping the sorted slices according to the same number of seconds of the acquisition time, the time position identifier, and the total number of time positions. Slices within the same group have the same phase category label, and there is a unidirectional progressive temporal constraint between groups.

4. The method of claim 1, wherein, The process of allocating sampling quotas according to the proportion of slices in each group and extracting feature frames at equal intervals within each group includes: The number of samples allocated to the kth group is ; wherein L k is the number of slices within the kth group, L is the total number of slices of the original sequence, N is the number of frames of the fixed-length input sequence, and round denotes rounding to the nearest integer. If the group calculation of N k = 0, then force N k = 1; When the sum of the sampling numbers of the groups is not equal to N, the N is corrected up or down according to the size of the decimal remainder of each group k to finally satisfy where K is the total number of groups. The original intra-group index corresponding to the i-th sampling point within the k-th group is: ; where i e 0, 1,..., N k -1, denotes the floor function.

5. The method of claim 1, wherein, The spatial feature extraction network is a pre-trained ConvNeXt-Base network. After removing the final classification head, it outputs a high-dimensional feature map, which is then compressed into a fixed-dimensional spatial feature vector through global adaptive average pooling.

6. The method of claim 1, wherein, The time-series coding network includes: A linear projection layer is used to linearly project the spatial feature vector sequence onto the hidden layer space, the hidden layer space having a dimension of 256; A learnable global temporal tag is inserted at the beginning of the spatial feature vector sequence; A learnable positional encoding matrix is ​​incorporated into the spatial feature vector sequence through element-wise addition; The encoder consists of 4 stacked layers, each layer comprising a multi-head self-attention mechanism and a feedforward network, with the multi-head self-attention mechanism having 8 heads.

7. The method of claim 1, wherein, The anatomical structural attribute is gender; the classification model includes a male-specific model and a female-specific model. The male-specific model is independently trained based on a male training sample set under the same network architecture of the spatial feature extraction network and the temporal coding network. The female-specific model is independently trained based on a female training sample set under the same network architecture. During inference, the corresponding classification model is automatically selected based on the gender label in the image metadata.

8. A medical image physiological phase classification apparatus characterized by comprising: include: The physiological time series standardization module is configured to acquire medical image sequences, sort the slices temporally and group them according to physiological cycles based on multidimensional metadata, allocate sampling quotas according to the proportion of slices in each group, extract feature frames at equal intervals within each group, and form a fixed-length input sequence; wherein, each group of slices corresponds to the same physiological enhancement state, and there is a unidirectional progressive temporal constraint between groups; The spatial feature extraction module is configured to encode each frame of a fixed-length input sequence frame by frame to obtain a spatial feature vector sequence; The temporal coding module is configured to model long-range inter-frame dependencies of spatial feature vector sequences based on a self-attention mechanism and output sequence-level features. The phase result output module is configured to classify the sequence-level features based on the anatomical structural attributes of the samples, using the classification model corresponding to the attribute, and output the physiological phase classification results.

9. An electronic device, comprising: It includes a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the method as described in any one of claims 1-7.

10. A computer readable storage medium having stored thereon computer instructions, wherein, When executed by a processor, the computer instructions implement the method of any one of claims 1-7.