Deep learning-based automatic segmentation method and device for chest and abdominal cavity hemorrhage
By using hierarchical perceptual frequency domain enhancement and multi-scale deformable convolution in deep learning, a U-shaped Transformer network is constructed, which solves the problems of time-consuming and laborious manual segmentation and inaccurate automatic segmentation, and achieves high-precision automatic segmentation of thoracic and abdominal hemorrhage, supporting rapid clinical decision-making.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF SHANGHAI FOR SCI & TECH
- Filing Date
- 2026-04-24
- Publication Date
- 2026-05-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In treating thoracic and abdominal hemorrhage, existing technologies require manual segmentation, which is time-consuming, labor-intensive, and susceptible to subjective factors. Automated segmentation models struggle to accurately capture low-density diffuse hemorrhage areas, and the segmentation boundaries are unstable, making it difficult to meet clinical needs.
We employ a deep learning-based approach, constructing a U-shaped Transformer network through hierarchical perceptual frequency domain enhancement, frequency domain-guided deformable hybrid window attention, and frequency domain-constrained multi-scale deformable convolution. This enables multi-stage encoding and decoding, adaptively capturing the features of the bleeding region, and generating accurate bleeding region segmentation results.
It significantly improves the segmentation accuracy and stability of low-density diffuse hemorrhage, provides objective and quantitative analysis of the bleeding area, assists doctors in quickly locating the bleeding area, and supports clinical decision-making.
Smart Images

Figure CN122115871A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method and apparatus for automatic segmentation of thoracic and abdominal hemorrhage based on deep learning. Background Technology
[0002] Thoracic and abdominal hemorrhage is a common critical condition in trauma patients, and rapid and accurate identification and quantitative analysis of the bleeding area are crucial for clinical emergency decision-making. Currently, clinical practice mainly relies on physicians to manually interpret thoracic or abdominal computed tomography (CT) images, visually identifying the bleeding area and estimating the amount of blood loss.
[0003] However, manual segmentation has obvious limitations. On the one hand, CT images contain a massive amount of voxel information, and manual interpretation is time-consuming and laborious, making it difficult to meet the rapid assessment needs in emergency scenarios. On the other hand, bleeding areas, especially low-density and diffuse bleeding, have low contrast with surrounding tissues and blurred boundaries. Manual segmentation results are easily affected by subjective factors such as doctors' experience and fatigue, making it difficult to guarantee consistency and accuracy.
[0004] While existing deep learning-based automatic segmentation techniques have been applied in medical image processing, they still have shortcomings in segmenting thoracic and abdominal hemorrhage. When dealing with diffuse hemorrhage, traditional segmentation models are prone to having weak contrast information overwhelmed by deep semantic features, making it difficult to effectively capture the continuous diffusion characteristics of the bleeding area. At the same time, fixed-shape feature extraction structures cannot adapt to the irregular geometry of the bleeding area, resulting in jittery segmentation boundaries and inaccurate volume estimation, which makes it difficult to meet the stringent clinical requirements for segmentation accuracy. Summary of the Invention
[0005] To address this, the present invention provides a method and apparatus for automatic segmentation of thoracic and abdominal hemorrhage based on deep learning, so as to at least partially solve the above-mentioned technical problems.
[0006] This invention provides a deep learning-based automatic segmentation method for pleural and abdominal hemorrhage, comprising the following steps: S1. Acquire and standardize CT volume data of the thoracic or abdominal cavity; S2. Linearly embed the standardized CT volume data to generate initial features; S3. Input the initial features into the encoder for multi-stage encoding to obtain encoded features at different levels; during the encoding process, according to the different semantic levels of the encoding stage, frequency domain enhancement processing corresponding to the semantic level of the encoding features at different levels is performed to generate hierarchical-aware frequency domain enhancement features; S4. In at least one stage of the encoder, a deformable hybrid window multi-head self-attention mechanism is used to model the input features; the deformable hybrid window multi-head self-attention mechanism generates frequency domain guiding weights for modulating the attention weights of different window types based on the frequency domain enhancement processing results corresponding to the current level, and uses the frequency domain guiding weights to perform weighted fusion of the attention calculation results of the divided different types of windows; S5. Input the encoded features at different levels into the decoder for multi-stage decoding, and fuse them with the features of the corresponding level from the encoder to gradually restore the spatial resolution of the features; S6. Generate the hemorrhage region segmentation result corresponding to the CT volume data based on the features finally output by the decoder.
[0007] In one possible embodiment, the step of performing frequency domain enhancement processing on the encoded features of different levels according to the semantic level of the encoding stage, corresponding to the semantic level of that level, includes: Perform a first frequency domain enhancement process on the shallow coding features. The first frequency domain enhancement process includes: performing a frequency domain transformation on the shallow coding features, extracting their low-frequency components, and converting the low-frequency components back to the spatial domain and then fusing them with the original shallow coding features. A second frequency domain enhancement process is performed on the mid-layer coding features. The second frequency domain enhancement process includes: performing a frequency domain transformation on the mid-layer coding features to extract their low-frequency components and frequency gradient information; using the frequency gradient information to modulate the spatial domain features obtained from the low-frequency components; and fusing the modulated spatial domain features with the original mid-layer coding features. A third frequency domain enhancement process is performed on the deep coding features. The third frequency domain enhancement process includes: performing a frequency domain transformation on the deep coding features and calculating their frequency domain statistical features; and mapping the frequency domain statistical features to generate attention guidance parameters and / or offset constraint parameters.
[0008] In one possible embodiment, the deformable hybrid window multi-head self-attention mechanism generates frequency-domain guided weights for modulating attention weights of different window types based on the frequency-domain enhancement processing results corresponding to the current level, including: When processing shallow or medium-layer encoded features, the frequency domain guiding weights are generated based on the spatial domain features output by the corresponding first or second frequency domain enhancement processing to modulate attention weights for different window types. When processing deep coding features, the frequency domain guiding weights are generated based on the attention guiding parameters generated by the third frequency domain enhancement processing to modulate the attention weights of different window types.
[0009] In one possible embodiment, the step of inputting the encoded features from different levels into the decoder for multi-stage decoding and fusing them with features from the corresponding level of the encoder includes: Multi-scale deformable convolutional modules are set up on the skip connection path between the decoder and the encoder; The multi-scale deformable convolutional module receives encoded features from at least two different levels, fuses the aligned multi-scale features, and predicts the three-dimensional spatial offset field based on the fused features. Using the frequency domain enhancement processing result corresponding to the multi-scale deformable convolution module, the three-dimensional spatial offset field is constrained to obtain the constrained offset field. The constrained offset field is used to perform deformable convolution operations on the fused features, and the result is passed to the decoder for fusion.
[0010] In one possible embodiment, constraining the three-dimensional spatial offset field using the frequency domain enhancement processing result corresponding to the multi-scale deformable convolution module includes: When the features processed by the multi-scale deformable convolution module correspond to the mid-layer encoded features, the frequency gradient information obtained by the second frequency domain enhancement process is used to generate a spatial constraint map. The spatial constraint map is used to modulate the predicted three-dimensional spatial offset field on a spatially position-by-spatial basis.
[0011] In one possible embodiment, the different types of windows distinguished in the deformable hybrid window multi-head self-attention mechanism include: local cube window, axial strip window, coronal strip window, and sagittal strip window.
[0012] In one possible embodiment, the deformable hybrid window multi-head self-attention mechanism further includes a lightweight convolutional path parallel to the window attention path, wherein the output of the window attention path and the output of the lightweight convolutional path are weighted and summed using a learnable weight parameter.
[0013] In another aspect, this application also provides an automatic segmentation device for pleural and abdominal hemorrhage based on deep learning, comprising: The data acquisition and standardization module is used to acquire and standardize CT scan data of the thoracic or abdominal cavity; The feature embedding module is used to linearly embed the normalized CT volume data to generate initial features; The hierarchical-aware encoding module is used to input the initial features into the encoder for multi-stage encoding to obtain encoded features at different levels. During the encoding process, according to the different semantic levels of the encoding stage, the encoded features at different levels are subjected to frequency domain enhancement processing corresponding to the semantic level of that level to generate hierarchical-aware frequency domain enhanced features. A deformable attention modeling module is used to model input features using a deformable hybrid window multi-head self-attention mechanism in at least one stage of the encoder; the deformable hybrid window multi-head self-attention mechanism generates frequency domain guiding weights for modulating attention weights of different window types based on the frequency domain enhancement processing results corresponding to the current level, and uses the frequency domain guiding weights to perform weighted fusion of the attention calculation results of the divided different types of windows; The feature decoding and fusion module is used to input the encoded features of different levels into the decoder for multi-stage decoding, and fuse them with the features of the corresponding level from the encoder to gradually restore the spatial resolution of the features. The segmentation result generation module is used to generate the hemorrhage region segmentation result corresponding to the CT body data based on the features finally output by the decoder.
[0014] This application also provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the deep learning-based automatic segmentation method for thoracic and abdominal hemorrhage as described above.
[0015] In another aspect, this application provides a storage medium having stored computer program instructions thereon, which can be executed by a processor to implement the deep learning-based automatic segmentation method for thoracic and abdominal hemorrhage as described above.
[0016] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the deep learning-based automatic segmentation method for thoracic and abdominal hemorrhage as described above.
[0017] This application constructs an efficient and accurate automatic segmentation model for thoracic and abdominal hemorrhage through hierarchical perceptual frequency domain enhancement, frequency domain-guided deformable hybrid window attention, and frequency domain-constrained multi-scale deformable convolution. Hierarchical perceptual frequency domain enhancement injects and modulates frequency domain information specifically according to the semantic hierarchical characteristics of different encoding stages, effectively strengthening the weak signals of low-density diffuse hemorrhage and suppressing interference from noise and non-target regions. Frequency domain-guided deformable hybrid window attention dynamically modulates the weights of different window groups, achieving adaptive capture of local details and global long-range dependencies, improving the feature modeling ability for hemorrhage regions with blurred boundaries and diffuse distribution. Frequency domain-constrained multi-scale deformable convolution ensures the stability and rationality of the deformation process through frequency domain information-constrained offset field learning, accurately adapting to the irregular geometric shape of the hemorrhage region. Meanwhile, the model adopts a U-shaped Transformer network architecture. Through the symmetrical design of the encoder and decoder and skip connections, it achieves effective integration of multi-scale features and accurate restoration of resolution, which significantly improves the segmentation accuracy and stability of low-density diffuse hemorrhage. The segmentation results are objective and quantitative, which can help doctors quickly locate the bleeding area and provide strong support for clinical decision-making. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of an automatic segmentation method for thoracic and abdominal hemorrhage based on deep learning, provided as an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the segmentation model structure provided in an embodiment of this application.
[0021] Figure 3 This is a schematic diagram of the first frequency domain enhancement processing flow provided in the embodiments of this application.
[0022] Figure 4 This is a schematic diagram of the second frequency domain enhancement processing flow provided in an embodiment of this application.
[0023] Figure 5 This is a schematic diagram of the third frequency domain enhancement processing flow provided in the embodiments of this application.
[0024] Figure 6This is a schematic diagram of the deformable hybrid window multi-head self-attention modeling process provided in an embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the morphological constraint and offset learning process provided in the embodiments of this application.
[0026] Figure 8 This is a schematic diagram of an automatic segmentation device for thoracic and abdominal bleeding based on deep learning, provided in an embodiment of the present invention.
[0027] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] It should be noted that all user information (including but not limited to user device information, user personal information, object information corresponding to device usage data, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, device usage data, etc.) involved in all embodiments of this disclosure are information and data authorized by the user or fully authorized by all parties.
[0030] This method is applicable to clinical scenarios such as hospital radiology and emergency departments. It enables automated identification, precise segmentation, and quantitative analysis of bleeding areas in thoracic or abdominal CT scans of trauma patients. Implementing this method typically requires the following prerequisites: acquiring standard-format 3D thoracic or abdominal CT data; computing devices capable of executing deep learning model inference, such as servers or workstations equipped with graphics processors; and deploying a pre-trained bleeding segmentation model. Routinely acquired clinical CT images, after necessary standardized preprocessing, are suitable for this method. It can assist physicians in quickly locating bleeding areas, providing objective and quantitative analysis results, and supporting clinical decision-making.
[0031] The following detailed description, in conjunction with specific embodiments, illustrates the implementation process of the deep learning-based automatic segmentation method for thoracic and abdominal hemorrhage described in this invention. It should be noted that these embodiments are merely illustrative of the invention and not intended to limit its scope. Any conventional adjustments or substitutions made by those skilled in the art to the steps without departing from the inventive concept should be included within the scope of protection of this invention.
[0032] like Figure 1 As shown in the diagram, this invention discloses an automatic segmentation method for pleural and abdominal hemorrhage based on deep learning, comprising the following steps: S1, acquire and standardize CT body data of the thoracic or abdominal cavity; S2, linearly embeds the normalized CT volume data to generate initial features; S3, the initial features are input into the encoder for multi-stage encoding to obtain encoded features at different levels; during the encoding process, according to the different semantic levels of the encoding stage, the encoded features at different levels are subjected to frequency domain enhancement processing corresponding to the semantic level of that level to generate hierarchical-aware frequency domain enhanced features. S4, in at least one stage of the encoder, the input features are modeled using a deformable hybrid window multi-head self-attention mechanism; the deformable hybrid window multi-head self-attention mechanism generates frequency domain guiding weights for modulating attention weights of different window types based on the frequency domain enhancement processing results corresponding to the current level, and uses the frequency domain guiding weights to perform weighted fusion of the attention calculation results of the divided different types of windows; S5, input the encoded features of different levels into the decoder for multi-stage decoding, and fuse them with the features of the corresponding level from the encoder to gradually restore the spatial resolution of the features; S6. Based on the features finally output by the decoder, generate the hemorrhage region segmentation result corresponding to the CT body data.
[0033] This method is implemented using a pre-trained segmentation model, such as... Figure 2 As shown, Figure 2This is a schematic diagram of the segmentation model structure provided in an embodiment of this application. The segmentation model adopts a U-shaped Transformer network architecture including an encoder and a decoder. Its structure, from top to bottom, includes: an input layer, which receives normalized 3D CT volume data; and a patch layer. The Embedding layer, or embedding module, divides the volumetric data into blocks and maps them to initial features using 3D convolutions. The encoder consists of multiple stacked encoding stages, such as four encoding stages. Each stage contains one or more deformable hybrid Transformer blocks, which include a frequency-domain guided deformable hybrid window multi-head self-attention and a multilayer perceptron, a downsampling layer (usually at the end of the stage, implemented by a convolution with a stride of 2), and a corresponding frequency domain enhancement module. The first stage is followed by the first frequency domain enhancement module, the middle stages by the second frequency domain enhancement module, and the deepest layer by the third frequency domain enhancement module. The decoder consists of multiple stacked decoding stages, such as four decoding stages, symmetrical to the encoder. Each stage contains an upsampling layer, a feature fusion of the encoder's corresponding stage output processed by multi-scale deformable convolutions, and one or more deformable hybrid Transformer blocks. Skip connections connect the encoder and decoder corresponding stages, interspersed with multi-scale deformable convolution modules for multi-scale feature alignment, morphological constraints, and frequency domain offset constraints. The output layer consists of 1×1×1 convolutions and activation functions, generating a voxel-level segmentation probability map. Data flow between modules is achieved through feature map transmission, forming a complete end-to-end segmentation model.
[0034] In some embodiments, the segmentation model can be trained on a dataset containing a large number of labeled thoracic and abdominal CT images, with a binary mask of the hemorrhage area provided as the ground truth for each CT volume data. The training process is as follows: All learnable parameters of the model include convolutional kernel weights, the projection matrix in attention, and learnable parameters. The parameters in each guiding network are randomly initialized using methods such as Xavier or Kaiming. Xavier initialization is suitable for scenarios with linear or sigmoid activation functions, accelerating convergence by making the variances of input and output consistent; Kaiming initialization is suitable for ReLU activation functions and can effectively alleviate the gradient vanishing problem.
[0035] The batch size of a training data set can be configured to, for example, 8 or 16, input into the model. The forward computation is performed according to the steps described above, from data normalization, initial feature embedding, multi-stage encoding and frequency domain enhancement, deformable hybrid window attention modeling, multi-scale deformable convolution constraints, to decoder fusion and resolution restoration, finally obtaining the predicted segmentation probability map.
[0036] The difference between the predicted results and the ground truth labels is calculated and used as the loss function to measure the accuracy of the model's predictions. Commonly used combinations of loss functions include Dice loss and cross-entropy loss to simultaneously optimize region overlap and pixel-level classification accuracy. The formula for the total loss function is as follows: ,in The Dice loss measures the degree of overlap between the predicted and ground truth regions. The formula is: ,in To predict the probability map, As a truth mask; The weighted cross-entropy loss is used to optimize pixel-level classification accuracy, and the formula is as follows: ,in These are the class weights, used to balance the proportion of positive and negative samples; and To balance the weighting coefficients of the two losses, they can be configured as follows: , ; Three-dimensional spatial coordinates are used to locate the specific spatial position of any voxel in CT volume data or feature map.
[0037] The gradient of the loss function with respect to all model parameters is calculated using stochastic gradient descent or its variants, such as the AdamW optimizer. The AdamW optimizer combines Adam's adaptive learning rate with weight decay regularization, effectively improving training stability and model generalization ability. The model parameters are updated according to the gradient direction to minimize the loss function; the parameter update formula is as follows: ,in For model parameters, For learning rate, For the loss function with respect to The gradient. During training, a learning rate warm-up strategy is usually adopted, which is to gradually increase the learning rate in the first few training cycles, and a cosine annealing strategy is to gradually decrease the learning rate according to the cosine function in the later stages of training, in order to balance the model's convergence speed and convergence accuracy.
[0038] Model performance is monitored on an independent validation set, using the Dice coefficient as the primary evaluation metric. The Dice coefficient formula is complementary to the Dice loss; a higher value indicates better segmentation performance. Training is terminated when the validation set Dice coefficient no longer improves over multiple consecutive training epochs (e.g., 10 consecutive epochs) or reaches a preset maximum training epoch (e.g., 100 epochs). The model parameters with the best performance on the validation set are saved as the final trained model for subsequent inference stages.
[0039] Through the above training process, the model can learn to robustly segment hemorrhagic areas of different densities, shapes, and scales from complex thoracic and abdominal CT images, especially improving the segmentation accuracy and stability of low-density diffuse hemorrhage.
[0040] In some embodiments, for step S1, the executing entity first acquires three-dimensional thoracic or abdominal CT volume data of the target patient to be analyzed from a medical image archiving and communication system or other medical image storage medium. This CT volume data typically consists of a series of continuously acquired two-dimensional slice images along the human body axis, logically forming three-dimensional volume data, the dimensions of which can be represented as... ,in Indicates the image height. Indicates the image width. Indicates the number of slices.
[0041] The acquired raw CT volume data needs to undergo normalization preprocessing to eliminate differences caused by different scanning devices or protocols. Specifically, the spatial dimensions of the CT volume data are interpolated or cropped to uniformly adjust its spatial dimensions to the model's preset input dimensions, for example... Simultaneously, the CT values of each voxel in the volume data are linearly normalized, and optionally mapped to... or Within the interval, the normalization formula can be expressed as: ,in These are the original CT values. and These are the minimum and maximum CT values in the CT volume data, respectively. This operation ensures the consistency of data intensity and lays the foundation for subsequent feature extraction.
[0042] In some embodiments, for step S2, based on the trained segmentation model, the normalized 3D CT volume data is denoted as... The data is input into the initial feature embedding module. The core objective of this module is to transform dense voxel data into a high-dimensional feature sequence that is more suitable for subsequent Transformer structure processing, thereby achieving effective compression of data dimensionality and preliminary extraction of feature information.
[0043] Specifically, three-dimensional convolution operations are used as linear embedding layers. For example, a convolution kernel size of [size missing] is used. Step size is The number of output channels is The three-dimensional convolutional layer for input volume data This process is equivalent to dividing the input volume data into a series of non-overlapping voxel blocks, each voxel block being mapped through a linear projection. A 3D feature vector. After processing, an initial feature map is obtained. ,in , , This initial feature It will serve as the input for the first stage of the encoder, providing basic feature support for subsequent multi-stage encoding and feature enhancement.
[0044] In some embodiments, for step S3, the encoder consists of multiple sequentially connected encoding stages, each containing one or more deformable hybrid Transformer blocks and a downsampling layer. As the encoding process progresses, the spatial resolution of the feature map decreases progressively while the number of feature channels increases progressively, thereby gradually extracting multi-scale features from low-level texture to high-level semantics. In this embodiment, a frequency domain enhancement feature fusion mechanism adapted to the semantic level of the current stage is introduced at different encoding stages, namely, hierarchical perceptual frequency domain enhancement. This mechanism aims to address the problem that low-density, diffuse bleeds are easily "averaged" or submerged by deep semantic features during deep network encoding, and that improper application of frequency domain enhancement may strengthen non-target regions. Its core principle is to decouple and match frequency domain information with the semantic abstraction level of the Transformer encoder, and to adopt structured frequency domain information injection and modulation strategies at different levels, thereby specifically improving the representational ability of features at each level.
[0045] According to embodiments of this disclosure, the encoder's Each stage, for example The system is divided into three semantic levels. The shallow layer corresponds to the first encoding stage, where features mainly include low-level visual information such as local texture and edges. The middle layer can correspond to one or more intermediate encoding stages, where features are a mixture of low-level texture and high-level semantics, beginning to form a preliminary understanding of anatomical structures and lesion areas. The deep layer corresponds to the last encoding stage, where features contain rich global semantic information, corresponding to an abstract understanding of the overall morphology and location of the hemorrhage area. Different frequency domain enhancement modules are configured for these three levels: a first frequency domain enhancement module, a second frequency domain enhancement module, and a third frequency domain enhancement module, to achieve precise adaptation to the semantic features of each level.
[0046] In one embodiment, the first frequency domain enhancement module is deployed after the first stage of the encoder, and its input is the shallow coded features output from that stage. The core objective of this module is to suppress high-frequency noise and enhance the subtle grayscale variation trend caused by low-density hemorrhage while preserving the main spatial structure, thereby solving the noise interference problem that may be caused by directly introducing the original frequency domain information into the shallow layers, and providing cleaner weak signal characteristics for subsequent layers.
[0047] like Figure 3 As shown, Figure 3A schematic diagram of the first frequency domain enhancement processing flow provided in the embodiments of this application. Specifically, it includes: In S301, frequency domain transformation and low-frequency extraction are performed on the input feature map. Perform a Fast Fourier Transform along the spatial dimension to convert spatial domain features into frequency domain features, thereby separating different frequency components. For each channel of the feature map... Calculate its three-dimensional discrete Fourier transform, the formula is as follows: ,in express The One channel, This represents the three-dimensional Fast Fourier Transform operation. Through this transformation, the frequency domain representation is obtained. The representation in the complex field can fully preserve the amplitude and phase information in the frequency domain.
[0048] In S302, low-frequency mask generation. A three-dimensional low-frequency mask is created. This mask is used to filter low-frequency components in the frequency domain. The mask corresponds to a value of 1 for low-frequency components in the center region of the frequency domain and a value of 0 for high-frequency components in the edge region. For example, it can be used to filter components based on whether the Euclidean distance from the center of the frequency domain is less than a threshold. To define the mask, the distance is calculated as follows: ,in These are the three-dimensional coordinates of a point in the frequency domain space, when hour, ,otherwise Frequency domain representation is achieved through this mask. By performing element-wise multiplication channel by channel, low-frequency components are retained while high-frequency components are filtered out. The formula is as follows: ,in This indicates element-wise multiplication. Broadcasting at the channel dimension ensures consistency with... The dimensions are perfectly matched, thus achieving unified filtering for all channels.
[0049] In S303, inverse transform and feature generation are performed. This involves the filtering low-frequency domain representation. Performing an inverse fast Fourier transform converts the frequency domain information back to the spatial domain, yielding a low-frequency feature map in the spatial domain. The formula is ,in This represents a three-dimensional inverse fast Fourier transform operation. The low-frequency feature map focuses on the subtle gray-level variation trends in the bleeding area, effectively suppressing high-frequency noise interference and highlighting the overall distribution pattern of low-density bleeding.
[0050] In S304, the original spatial features are fused with low-frequency features. The original spatial features are then... With extracted low-frequency features A fusion process is performed to simultaneously preserve the spatial structure information of the original features and the weak signal enhancement information of the low-frequency features. The fusion method can be element-wise addition or channel concatenation followed by a 1×1×1 convolution for channel integration. For example, a learnable weighted summation method can be used, with the formula: ,in and These are learnable scalar weight parameters, or weight vectors that can be learned independently for each channel. During training, the model will adaptively learn. and The value of is determined to achieve the optimal fusion ratio between the original spatial features and the low-frequency enhanced features. The output of the first frequency domain enhancement process will be used as the input to the next encoding stage and will also be provided to the skip connections, providing a better input basis for mid-level feature extraction.
[0051] In one embodiment, the second frequency domain enhancement module is deployed in the middle stage of the encoder, and its input is the mid-level coded features output from the current stage. The core objective of this module is not only to extract low-frequency information, but also to introduce frequency gradient analysis to distinguish the direction of bleeding diffusion from inherent anatomical cavities, enhance the perception of morphological continuity, solve the problem of difficulty in distinguishing bleeding areas from anatomical structures caused by the mixing of low-level textures and high-level semantics in mid-level features, effectively model the continuity and diffusion characteristics of low-density bleeding between anatomical structures, and achieve accurate differentiation between quiescent effusion and active bleeding.
[0052] Please see Figure 4 , Figure 4 This is a schematic diagram of the second frequency domain enhancement processing flow provided in an embodiment of this application. Specifically, it includes: In S401, low-frequency and frequency gradient extraction are performed. Similar to the first frequency domain enhancement process, this operation... Performing a Fast Fourier Transform yields the frequency domain representation. and apply low-frequency mask. Acquiring low-frequency components This is done to preserve weak signal information in the low-frequency region. Furthermore, the amplitude spectrum in the frequency domain is calculated. ,in The amplitude spectrum, representing the modulus of a complex number, reflects the intensity information of each frequency component and highlights differences in frequency distribution. Above, along the three spatial frequency axes, i.e. The axes correspond to the image respectively. The gradient is calculated along the direction to capture the drasticness of frequency changes. A larger gradient value indicates a more significant frequency change at that location, potentially corresponding to edges or textured regions in the spatial domain. For example, along... The gradient in the direction can be approximated as: ,along The gradient in the direction is ,along The gradient in the direction is By aggregating the gradients in the three directions, for example by calculating the L2 norm, a three-dimensional frequency gradient saliency map is obtained. The aggregation formula is The value of this graph is large where the frequency changes drastically, which can effectively indicate complex textures or edge areas in the spatial domain and provide key information for distinguishing the direction of bleeding spread from anatomical cavities.
[0053] In S402, gradient-guided low-frequency adaptive modulation is used. The frequency gradient saliency map is then used. After normalization, it is used as a spatial attention weight to achieve adaptive modulation of low-frequency features. Specifically, firstly, for Perform normalization processing and map its values to The normalization formula for the interval is: ,in and They are respectively Find the minimum and maximum values in the range. Then... Further mapping via the Sigmoid function to Intervals are used to obtain the attention map. The formula is The sigmoid function enhances the non-linear discriminative power of the attention map, making the weights of important regions closer to 1 and the weights of less important regions closer to 0. This attention map is used to modulate the non-linear discrimination of... Low-frequency features obtained by inverse transform ( The modulation formula is This operation aims to highlight low-frequency regions that exhibit significant gradient changes in the frequency domain, which may correspond to the hemorrhage diffusion front or complex boundaries, thereby enhancing the morphological continuity information of the hemorrhage region and suppressing interference from irrelevant regions.
[0054] In S403, the low-frequency characteristics after morphology-guided modulation With original spatial features The modulated low-frequency characteristics are then fused. With original spatial features The fusion process employs a channel attention mechanism to adaptively integrate the channel information of the two features. First, the... and By stitching along the channel dimension, the stitching feature is obtained. Then, a global average pooling layer is used to compress the concatenated features and extract global information along the channel dimension. The global average pooling formula is as follows: ,in ;Will Input two fully connected layers, with a non-linear activation function such as ReLU in between, to generate channel attention weight vectors. The first fully connected layer will dimensional vector mapping to After ReLU activation, the second fully connected layer maps it back to the dimension. We obtain the channel attention weights by defining the dimension; then we use this weight vector to concatenate the features. Each channel is recalibrated using the following calibration formula: ,in This represents element-wise multiplication of the channel dimension. Broadcasting is performed in the spatial dimension; finally, the number of channels is reduced back using a 1×1×1 convolution. Enhanced features are obtained This feature will serve as the input feature for the next stage of the encoder and will also be provided to the skip connections. The role of this convolutional layer is to integrate the calibrated channel information, compress redundant features, and improve the feature representation efficiency. The second frequency domain enhancement process introduces frequency gradient analysis and channel attention fusion, enabling the model to accurately perceive the directional information of the bleeding area diffusion, better model the continuous and diffuse characteristics of low-density bleeding, and effectively distinguish between quiescent effusion and active bleeding.
[0055] In one embodiment, the third frequency domain enhancement module is deployed at the deepest layer of the encoder, and its input is the deep-coded features. At a deeper level, features are highly abstracted, and directly fusing spatialized frequency domain features may interfere with the established semantic representation. Therefore, this module no longer outputs spatial features, but instead extracts statistical descriptors from the frequency domain to globally guide subsequent attention mechanisms and morphological learning modules. This achieves a functional transformation of frequency domain information from "feature enhancement" to "process modulation," enabling the model to adaptively adjust its internal feature aggregation and morphological learning strategies based on the global frequency domain characteristics of the input image, thus addressing the problem of lack of targeted feature aggregation caused by deep semantic feature abstraction.
[0056] Please see Figure 5 , Figure 5 A schematic diagram of the third frequency domain enhancement processing flow provided in the embodiments of this application. Specifically, it includes: In S501, frequency domain statistics are calculated. (For...) Performing a Fast Fourier Transform yields the frequency domain representation. And calculate its amplitude spectrum. The amplitude spectrum can reflect the overall distribution characteristics in the frequency domain. From Global statistical features are extracted to comprehensively characterize the macroscopic properties of the frequency domain, providing a foundation for subsequent parameter generation. For example, the energy distribution vector is calculated. The three-dimensional frequency domain space is divided into multiple radial bands or angular sectors. The radial band division method is to divide the space according to the Euclidean distance from the frequency domain center as the origin. The annular region is divided into angular sectors based on azimuth angle. The sum of the amplitude spectrum energies within each of the several sector-shaped regions represents the energy value of that region. The energy values of all regions together form an energy distribution vector. This vector reflects the distribution of frequency domain energy in different regions and can indicate the overall diffusion pattern of the bleeding area; calculate the spectral centroid. This involves calculating the weighted average coordinates of the amplitude spectrum across the three frequency axes, where the weighting coefficients are the amplitude values at each position. The calculation formula is as follows: , , The centroid reflects the concentration of the main frequency components and can indicate the main distribution direction of the bleeding area; calculate the spectral variance. This refers to calculating the degree of dispersion of the amplitude spectrum around the centroid, reflecting the complexity of the frequency distribution. The calculation formula is: , and The calculation method is similar; a larger variance indicates a more dispersed frequency distribution, corresponding to a more complex morphology of the bleeding region in the spatial domain. These statistics—energy distribution vector, spectral centroid, and spectral variance—are flattened and then concatenated to form a low-frequency statistical descriptive vector. ,in As a statistical feature dimension, this vector comprehensively covers key macroscopic information in the deep frequency domain.
[0057] In S502, the statistical description vector is mapped through a small multilayer perceptron to generate two sets of guiding parameters. The statistical description vector... A small multilayer perceptron is used to generate two sets of guiding parameters to achieve global modulation of subsequent modules. This multilayer perceptron contains two fully connected layers; the first fully connected layer... dimensional vector mapping to For example After the ReLU activation function introduces nonlinearity, the second fully connected layer maps it to... dimension The parameters are divided into two groups based on their function, serving as the overall guiding dimension. The first group consists of attention-guided parameters. The first group is used to modulate the window attention weights in subsequent decoders or Transformer blocks at the same layer, enabling the attention mechanism to focus on features related to the bleeding region and improving the targeting of attention allocation; the second group consists of offset constraint parameters. These parameters are used to constrain the offset learning in subsequent multi-scale deformable convolutional modules, ensuring that the deformation process of the deformable convolution better matches the shape of the bleeding area and avoiding excessive or unstable deformation. The output of the third frequency domain enhancement processing is these two sets of parameters, rather than spatial feature maps or deep features. It is directly passed to subsequent modules, and the generated parameters are used to guide the attention and deformation processes in the same layer or subsequent modules. It not only retains the abstract representation of deep semantic features, but also provides global guidance information through frequency domain statistical descriptors, realizing the precise modulation of the internal process of the model by frequency domain information.
[0058] In some embodiments, for step S4, in at least one stage of the encoder, a deformable hybrid window multi-head self-attention mechanism is used to model the input features. This mechanism, based on standard window self-attention, introduces a variable window partitioning strategy and a hybrid mechanism with convolution, further integrating frequency domain guidance from the corresponding frequency domain enhancement processing results to form a frequency domain-guided deformable hybrid window attention. It aims to address the problem that standard window attention, when dealing with blurred boundaries and diffusely distributed bleeds, has a fixed window shape selection and cannot adaptively focus on the region most relevant to the bleed diffusion pattern. By introducing frequency domain statistical information as a priori, it dynamically modulates the attention weights of different window shapes, enabling the model to allocate computational resources more intelligently and improve its feature modeling ability for diffusely bleed regions.
[0059] In the deformable hybrid window multi-head self-attention mechanism, the deformable hybrid window refers to the combination of various window shapes that are adaptively selected according to the feature level and bleeding diffusion mode, and the multi-head self-attention refers to dividing the feature into multiple heads and computing self-attention in parallel to capture feature dependencies of different dimensions.
[0060] Please see Figure 6 , Figure 6 A schematic diagram of the deformable hybrid window multi-head self-attention modeling process provided in this application embodiment. Specifically, it includes: In S601, deformable window partitioning is used. For the feature map input to this mechanism... First, it is uniformly divided along the channel dimension into Groups, for example Each group is assigned The purpose of grouping features into channels is to allow different window shapes to focus on capturing feature dependencies across different channel dimensions, thereby enhancing the diversity of feature modeling. For each group of features, a specific window partitioning strategy is employed to achieve comprehensive capture of both local details and global long-range dependencies.
[0061] For example, group 1 is a local cube window group, which spatially divides the feature map into regular, non-overlapping cube windows, for example, each window is sized as follows: Group 1 is primarily responsible for capturing local detail information, focusing on the interaction of local features in the feature map, and can accurately capture the local texture and edge information of the bleeding area; Group 2 is the axial strip window group, which divides the feature map into strip windows extending along the axial direction, i.e., the Z-axis, for example, dividing it into strip windows with a size of [missing information] on the XY plane. Small blocks, but maintaining the entire depth in the Z-axis direction. Group 1 is responsible for capturing long-range spatial dependencies along the axial direction, suitable for hemorrhage areas spreading along the axial direction; Group 2 is the coronal strip window group, which divides the feature map into strip windows extending along the coronal plane (Y-axis), focusing on long-range feature interactions in the coronal direction, and can effectively capture dependencies of hemorrhage areas spreading along the coronal plane; Group 3 is the sagittal strip window group, which divides the feature map into strip windows extending along the sagittal plane (X-axis), used to capture long-range dependencies in the sagittal direction, adapting to hemorrhage patterns spreading along the sagittal plane. The latter three groups of strip windows can effectively compensate for the insufficient receptive field of local windows, realizing the capture of global or long-range spatial dependencies across different directions, providing comprehensive spatial context information for feature modeling of diffuse hemorrhage areas.
[0062] In S602, frequency-domain guided window weight modulation is introduced. Before the standard multi-head self-attention calculation within each group, a frequency-domain guided weight modulation branch is introduced to achieve dynamic adaptation of attention weights for different window groups, so that the importance allocation of the window group matches the frequency domain characteristics of the current feature level.
[0063] The frequency domain enhancement processing result corresponding to the current coding stage is received as guiding information. For the processing of shallow coding features, the guiding information is the spatial domain enhanced feature output from the first frequency domain enhancement processing. Pooling summaries, for example, for Perform global average pooling to obtain a condensed guiding vector. For the processing of mid-level coding features, the guiding information is the spatial domain enhanced feature output from the second frequency domain enhancement processing. Pooling summaries, such as vectors after global average pooling. For processing deep encoded features, the attention guidance parameters generated by the third frequency domain enhancement process are used directly. This parameter has been generated through frequency domain statistical feature mapping, and can accurately reflect the guidance requirements of global frequency domain characteristics on the attention mechanism.
[0064] The guidance information is input into a small network, such as a multilayer perceptron, for processing. This network outputs a result through a combination of linear transformation and nonlinear activation. dimensional weight vector These correspond to the four window groups mentioned above. This multilayer perceptron contains one hidden layer with ReLU activation. The input dimension is the dimension of the guiding information, and the output dimension is... To ensure the weight vector accurately represents the relative importance of each group of windows, it is subjected to Softmax normalization, as shown in the formula: ( Normalized weight vector In, the values of each element are in Within the interval, and with a sum of 1, it can intuitively reflect the importance ratio of each group of windows to the final feature contribution under the current feature level and input context, and realize the dynamic allocation of window attention weights.
[0065] Multi-head self-attention is computed independently within each group. For the first... Group, input features Further divided into Each head has 1,000 channels. Each head independently computes self-attention to capture feature interaction information across different dimensions. Specifically, each head will input features... The query vector is mapped through three linear projection layers. Key vector Sum value vector Then Divide into multiple window-level vectors according to the window partitioning method. ; through calculation and The similarity is used to obtain the attention score. The similarity calculation uses a dot product method, and the formula is: ,in The dimension of the query vector is used to scale the attention score to avoid excessively large values; the attention score is then normalized using Softmax and then compared with... Multiply to obtain the self-attention output of the head in the current window. The window outputs of all heads within the same group are concatenated and passed through a linear projection layer to obtain the multi-head self-attention output of that group. .
[0066] Output of each group Concatenate along the channel dimension, and apply the corresponding normalized weights before concatenation. To scale the windows and reflect the differences in importance between the groups, the formula is: ,in This indicates a splicing operation along the channel dimension. Indicates the first Group output In terms of channel dimension and weight Perform element-wise multiplication. For example, when low-frequency statistical features indicate the presence of a distinct, axially diffuse pattern in the image, the attention-guided parameters... Alternatively, the network may generate a larger weight to allocate to the axial strip window group, thereby encouraging the model to make more use of the global context in that direction to integrate information, suppress local windows that may introduce noise, achieve intelligent allocation of attention resources, and improve the feature modeling effect of bleeding regions with specific diffusion patterns.
[0067] In S603, it's combined with lightweight convolutions. This is used to obtain window attention output. Simultaneously, this mechanism also includes a parallel lightweight convolutional path to combine the local feature extraction capabilities of convolution with the global dependency modeling capabilities of the attention mechanism, thereby enhancing the richness and robustness of feature representation. Convolutional operations excel at capturing local spatial correlations and translation invariance, while the attention mechanism excels at capturing global long-range dependencies. The combination of the two can achieve complementary advantages, comprehensively covering the local details and global morphological features of the bleeding region.
[0068] This lightweight convolutional path is applied to the input. The following operation is applied: Local spatial features are extracted using a 3×3×3 convolution. This kernel size effectively captures local neighborhood information in the 3D feature map. The convolution operation formula is as follows: ,in It is a 3×3×3 convolution kernel. This operation captures texture and edge information of local areas; nonlinearity is introduced through the GELU activation function, the formula for which is: ,in The cumulative distribution function is the standard normal distribution. Compared to the ReLU activation function, GELU introduces smoother nonlinearity, enhancing the model's expressive power. Channel dimension adjustment and feature fusion are achieved through 1×1×1 convolutions. The 1×1×1 convolution kernel linearly combines channel information without changing the spatial dimension, compressing redundant information and improving feature compactness. The formula is as follows: ,in The kernel is 1×1×1; finally, the feature distribution is standardized through layer normalization, and the layer normalization formula is: ,in The mean of the features, The variance of the feature To prevent tiny values with a denominator of zero, and For learnable scaling and offset parameters, normalization can stabilize the feature distribution and accelerate model convergence. Through these operations, the convolutional features are output. This feature focuses on the extraction and integration of local spatial features.
[0069] The output of this mechanism is obtained by a weighted sum of the results from the attention path and the convolution path, as shown in the formula: ,in It is a learnable parameter used to balance the contribution ratios of the two mechanisms, and its value ranges from [value range missing]. During training, the model will adaptively learn. The value of when the bleeding area is predominantly in a global diffusion mode. The value will approach 1, relying more on global dependency modeling of the attention mechanism; when the local details of the bleeding area are rich, The value of approaches 0, relying more on the local feature extraction of convolution. Through this adaptive balancing mechanism, the optimal combination of attention mechanism and convolution operation is achieved, ensuring effective modeling of the global diffuse bleeding region while strengthening the capture of local detailed features and improving the overall feature representation capability.
[0070] In some embodiments, a multi-scale deformable convolutional module is provided on the skip connection path between the encoder and decoder. This module receives encoded features from different stages of the encoder. Its spatial resolution decreases while the number of channels increases. Specifically, for a path connecting a specific decoding stage, this module receives feature maps from the encoder's corresponding layer and its adjacent layers. The goal of this module is to integrate multi-scale information and, through alignment and deformation, enable features to better adapt to the irregular geometry of the bleed region. This disclosure introduces a frequency-domain constrained offset learning mechanism in this module to address the problem that traditional 3D deformable convolutions easily produce unstable and excessive deformation offsets in low-contrast, uniformly textured diffuse bleed regions, leading to segmentation boundary jitter and inaccurate volume estimation. By utilizing mid-layer frequency domain information to constrain the learning of the offset field, the stability and continuity of the deformation process are improved.
[0071] Please see Figure 7 , Figure 7 This is a schematic diagram of the morphological constraint and offset learning process provided in an embodiment of this application. In S701, multi-scale feature alignment and fusion are performed. Features from different scales are... That is, high resolution, corresponding to shallow coding features and That is, low resolution, corresponding to deep encoded features being aligned to the same level through upsampling and downsampling operations. Medium resolution, corresponding to the spatial resolution of mid-level encoded features, aims to achieve spatial consistency of multi-scale features. For example, for high-resolution features... Downsampling is performed using a 3×3×3 convolution with a stride of 2. The downsampling operation halves the spatial dimension by adjusting the convolution stride, as shown in the formula. Reduce its spatial resolution to Consistent; for low-resolution features Upsampling is performed using trilinear interpolation. Trilinear interpolation doubles the spatial dimension by weighted averaging of neighboring voxels in 3D space. The formula is as follows: To improve its spatial resolution to Consistency ensures that the three feature maps are completely matched in spatial dimensions.
[0072] The three aligned features are concatenated along the channel dimension to obtain the fused multi-scale features. ,in They are respectively The number of channels, this feature integrates feature information at different scales, including detailed information from high-resolution features such as the local edges of the bleeding area, and high-level semantic information from low-resolution features such as the global morphology of the bleeding area. Next, for... Channel attention mechanisms, such as the squeeze-excitation (SE) module, are applied. This module adaptively enhances the feature information of important channels and suppresses interference from redundant channels. The SE module operates as follows: it compresses the channel-dimensional features into a one-dimensional vector using global average pooling, as shown in the formula: It captures global information from each channel; through two fully connected layers and a non-linear activation function, it generates channel attention weight vectors. The first fully connected layer will dimensional vector mapping to Dimension, among which The compression factor is used, and after ReLU activation, the second fully connected layer maps it back to... The dimension is then used to obtain channel attention weights through the Sigmoid activation function; these weight vectors are then used to concatenate the features. Each channel is recalibrated using the following calibration formula: ,in This represents element-wise multiplication along the channel dimension, ultimately yielding the enhanced fusion feature. This feature enables the effective integration and optimization of multi-scale information, providing high-quality feature input for subsequent migration field prediction.
[0073] In S702, frequency-domain guided offset learning and constraints enhance the fusion features. Input an offset prediction network, which typically contains several convolutional layers, and it progressively extracts features and performs dimensionality transformations to ultimately output a three-dimensional offset field. .in This indicates the size of the deformable convolution kernel, and 3 indicates that each sampling point is within... Offsets in three directions ( ), Let be the spatial dimension of the current feature map. The structure of the offset prediction network is as follows: First, deep features are extracted through two 3×3×3 convolutional layers, with the number of channels gradually increasing; then, the number of channels is converted to 1×1×1 convolutional layer. , to obtain the three-dimensional offset field This offset field is used to guide the sampling position adjustment of deformable convolutions, enabling the convolution kernel to adaptively shift towards the edges or details of the bleed region, thereby more accurately capturing the irregular geometry of the bleed region.
[0074] Obtain the frequency gradient saliency map from the corresponding second frequency domain enhancement processing result. Or processed attention map This image effectively indicates regions with complex textures and sharp edges, as well as diffuse regions with uniform textures and low contrast within the spatial domain. Because... The size may be related to the features in current multi-scale deformable convolutional modules. If the dimensions are inconsistent, resampling (upsampling or downsampling) is required to bring them to the same size. Trilinear interpolation can be used for resampling to obtain the constraint map. Constraint diagram Numerical characteristics and Consistent values in the spatial domain typically correspond to regions with complex textures and clear edges. These regions have obvious bleed boundaries, allowing for larger deformation offsets to accurately match the boundaries. Conversely, smaller values correspond to diffuse regions with uniform textures and low contrast. These regions have weak bleed signals and blurred boundaries, requiring limitations on the offset amplitude to avoid unstable deformation. This constraint map provides crucial spatial prior information for the optimization of the offset field.
[0075] Using constraint diagrams Migration field of the original prediction Modulation is performed at each spatial location to achieve adaptive constraints on the offset, ensuring that changes in the offset field match the characteristics of the spatial region. Specifically, this involves... After expanding the dimensions and Element-wise multiplication, for constraint graphs Perform dimensional expansion to make its dimensions equal to... Consistent, the expansion method involves broadcasting in both the channel and sampling point dimensions to obtain... Define mapping function right Perform transformations, for example ,in This is an adjustable parameter used to control the steepness of the Sigmoid function. This mapping function is used to... Values mapped to The range is adjusted to make the numerical range of the constraint map more suitable for modulating the offset; finally, the expanded constraint map is multiplied by the mapped constraint values to obtain the constrained offset field, as shown in the formula. Therefore, in the diffusion region, corresponding to Small value, Approaching 0 suppresses offset and avoids excessive unstable deformation; corresponding to complex boundary regions Large value Approximately 1, retain or even amplify the offset to ensure precise boundary matching. This is the final offset field after frequency domain constraints. This offset field can adapt to the irregular shape of the bleeding area and ensure the stability and rationality of the deformation process.
[0076] Using the constrained offset field For input features Perform 3D deformable convolution operations. The core of deformable convolution is to warp a regular sampling grid based on an offset field, adjusting the spatial position of each sampling point of the convolution kernel so that it can adaptively focus on feature locations more relevant to the bleeding morphology. Specifically, for each sampling point of the convolution kernel... ( Its original sampling location is Under the influence of the offset field, the actual sampling position is adjusted to Then, the feature values at the actual sampling locations are calculated using trilinear interpolation. The interpolation formula is as follows: ,in The weights are trilinear interpolation weights; finally, the interpolated feature values are multiplied by the convolution kernel weights and summed to obtain the output features of the deformable convolution. The formula is ,in These are the weights for the deformable convolution kernel. This operation allows deformable convolution to more accurately capture the irregular geometric shapes of bleeding regions, improving feature alignment accuracy and representational power.
[0077] Features output by deformable convolution Through additional convolutional layers and up / downsampling operations, the original input is regenerated. Output features that match scale and number of channels Specifically, for features that need to be recovered at high resolution... ,right Upsampling is performed and the number of channels is adjusted using a 1×1×1 convolution. For medium resolution features The number of channels can be adjusted directly using a 1×1×1 convolution. For low-resolution features ,right Perform downsampling and adjust the number of channels to These features, after being optimized through multi-scale fusion, offset constraints, and deformable convolution, not only retain the key information at each scale but also achieve precise feature alignment and shape adaptation. They are then passed to the corresponding stage of the decoder for fusion, providing high-quality feature input for subsequent decoding processes.
[0078] In some embodiments, for step S5, the decoder structure is symmetrical to the encoder and consists of multiple decoding stages. The core of each decoding stage is also one or more deformable hybrid Transformer blocks, which also contain frequency-domain guided deformable hybrid window multi-head self-attention. The decoding process starts from the deepest encoded features, gradually recovers the spatial resolution of the features, and integrates the multi-scale and multi-morphological information transmitted by the encoder to achieve accurate segmentation of the bleeding region.
[0079] In each decoding stage, the lower-resolution features output from the previous stage are upsampled, for example using trilinear interpolation or transposed convolution, to double their spatial resolution and halve their number of channels. Trilinear interpolation upsampling preserves the smoothness of the features, while transposed convolution can achieve more accurate resolution restoration through parameter learning; the choice depends on the specific needs. The upsampled features are denoted as... Its dimensions are ,in , The spatial dimension of the features of the previous stage.
[0080] Upsampled features The skip connection features, processed by multi-scale deformable convolutional modules from the corresponding stage of the encoder, are... The features are then fused. The fusion method typically involves concatenating along the channel dimension, integrating the decoder's upsampled features with the corresponding optimized features from the encoder into a single feature map. Its number of channels is ,in The number of channels for the corresponding stage features of the encoder, and the spatial dimension are... Consistency. The splicing operation can completely preserve the information of both features, providing a rich foundation for subsequent feature refinement.
[0081] After concatenation, a 1×1×1 convolutional layer is used for channel integration and feature refinement. This convolutional layer will... The concatenated feature mapping of the dimension is as follows Dimension, among which The preset number of channels for the current decoding stage is given by the formula: This operation can compress redundant channel information, integrate effective features, and improve the efficiency of feature representation. The fused features... Then, the deformable hybrid Transformer block of the current stage is input for further feature modeling. This module achieves an effective combination of global dependencies and local features through a hybrid mechanism of frequency domain-guided deformable hybrid window multi-head self-attention and lightweight convolution, further optimizing feature representation and improving the modeling accuracy of the bleeding region.
[0082] Through progressive upsampling and fusion, the spatial resolution of the feature map is gradually restored, from the deepest low-resolution features to a resolution similar to the initial embedded features. At the same time, it integrates multi-scale, multi-morphological information extracted from the encoding path, including both global morphological information of deep semantic features and local detail information of shallow features, providing rich and accurate feature support for the final segmentation result.
[0083] In some embodiments, for step S6, after the last decoding stage, the spatial resolution of the feature map has been restored to the same level as the initial embedded features. same( The feature map is input into a prediction head, which typically consists of a 1×1×1 convolutional layer. Its core function is to map the high-dimensional features to a class probability distribution. The number of output channels equals the number of segmented classes, for example, two classes: bleed and background. The channel dimension transformation is achieved through a 1×1×1 convolution, as shown in the formula. ,in For the final output features of the decoder, The dimension is ,in This represents the number of segmentation categories.
[0084] A convolutional layer is followed by a sigmoid activation function, which generates probabilities for each voxel belonging to each segmentation category. For example, in a binary classification task of bleeding and background, the sigmoid activation function maps the output probabilities to... In the interval, the output value of each voxel represents the probability that it belongs to the bleeding category, and the activation function formula is: Alternatively, for multi-class tasks such as bleeding, normal tissue, and other lesions, the Softmax activation function can be used to obtain the probability distribution of each voxel belonging to each class, which will not be elaborated here.
[0085] The prediction results are upsampled back to the size of the original input CT image through an inverse embedding operation. The anti-embedding operation can employ deconvolution or pixel rearrangement. For example, pixel rearrangement rearranges a high-channel-count, low-resolution feature map into a low-channel-count, high-resolution feature map, as shown in the formula: ,in The initial voxel block size is used for embedding. Alternatively, a threshold such as 0.5 can be applied directly to the probability map to obtain the final binary segmentation mask. For example, when the probability of bleeding in a voxel is greater than the threshold, the voxel is determined to be a bleeding region and marked as 1; when the probability is less than or equal to the threshold, it is determined to be a background region and marked as 0. This generates a clear and accurate bleeding region segmentation result, which can intuitively indicate the spatial location and extent of bleeding areas in the pleural or abdominal cavity, providing direct support for clinical bleeding volume assessment and diagnosis. It is understood that the above threshold can be set according to the actual situation, and this application does not impose any restrictions.
[0086] Therefore, this method constructs an efficient and accurate automatic segmentation model for thoracic and abdominal hemorrhage through hierarchical perceptual frequency domain enhancement, frequency domain-guided deformable hybrid window attention, and frequency domain-constrained multi-scale deformable convolution. Hierarchical perceptual frequency domain enhancement injects and modulates frequency domain information specifically according to the semantic hierarchical characteristics of different encoding stages, effectively strengthening the weak signals of low-density diffuse hemorrhage and suppressing interference from noise and non-target regions. Frequency domain-guided deformable hybrid window attention dynamically modulates the weights of different window groups, achieving adaptive capture of local details and global long-range dependencies, improving the feature modeling ability for hemorrhage regions with blurred boundaries and diffuse distribution. Frequency domain-constrained multi-scale deformable convolution ensures the stability and rationality of the deformation process through frequency domain information-constrained offset field learning, accurately adapting to the irregular geometric shape of the hemorrhage region. Meanwhile, the model adopts a U-shaped Transformer network architecture. Through the symmetrical design of the encoder and decoder and skip connections, it achieves effective integration of multi-scale features and accurate restoration of resolution, which significantly improves the segmentation accuracy and stability of low-density diffuse hemorrhage. The segmentation results are objective and quantitative, which can help doctors quickly locate the bleeding area and provide strong support for clinical decision-making.
[0087] Please see Figure 8 , Figure 8 This is a schematic diagram of an automatic segmentation device for thoracic and abdominal bleeding based on deep learning, provided in an embodiment of this application. Figure 8 As shown, the device includes: The data acquisition and standardization module 801 is used to acquire and standardize CT body data of the thoracic or abdominal cavity; The feature embedding module 802 is used to linearly embed the normalized CT volume data to generate initial features; The hierarchical-aware encoding module 803 is used to input the initial features into the encoder for multi-stage encoding to obtain encoded features at different levels. During the encoding process, according to the different semantic levels of the encoding stage, the encoded features at different levels are subjected to frequency domain enhancement processing corresponding to the semantic level of that level to generate hierarchical-aware frequency domain enhanced features. The deformable attention modeling module 804 is used to model the input features using a deformable hybrid window multi-head self-attention mechanism in at least one stage of the encoder; the deformable hybrid window multi-head self-attention mechanism generates frequency domain guiding weights for modulating the attention weights of different window types based on the frequency domain enhancement processing results corresponding to the current level, and uses the frequency domain guiding weights to perform weighted fusion of the attention calculation results of the divided different types of windows; The feature decoding and fusion module 805 is used to input the encoded features of different levels into the decoder for multi-stage decoding, and fuse them with the features of the corresponding level from the encoder to gradually restore the spatial resolution of the features. The segmentation result generation module 806 is used to generate the hemorrhage region segmentation result corresponding to the CT body data based on the features finally output by the decoder.
[0088] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit" and "module" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.
[0089] Each processing unit and / or module in the embodiments of this application can be implemented by an analog circuit that implements the functions described in the embodiments of this application, or by software that executes the functions described in the embodiments of this application.
[0090] Please see Figure 9 It shows a schematic diagram of the structure of an electronic device according to an embodiment of this application, which can be used to implement... Figure 1 The method in the illustrated embodiment. (As shown) Figure 9 As shown, the electronic device may include: The system includes at least one processor 901, at least one network interface 904, a user interface 903, a memory 905, and at least one communication bus 902. The communication bus 902 is used to enable connection and communication between the components. The user interface 903 may include buttons, and optionally include a standard wired or wireless interface. The network interface 904 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.
[0091] The processor 901 may include one or more processing cores and is connected to various parts within the device 900 through various interfaces and lines. It implements various functions and data processing of the device 900 by running or executing instructions, programs, code sets or instruction sets stored in the memory 905 and calling data in the memory 905.
[0092] The memory 905 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 905 includes a non-transitory computer-readable medium for storing instructions, programs, code, code sets, or instruction sets. The memory 905 may be divided into a program storage area and a data storage area, wherein the program storage area can be used to store instructions for implementing an operating system and instructions for implementing the foregoing method embodiments; the data storage area can be used to store data related to the relevant method embodiments. The memory 905 may also be at least one storage device located remotely from the processor 901. Figure 9 As shown, the memory 905, which serves as a computer storage medium, may contain an operating system, a network communication module, a user interface module, and program instructions.
[0093] In particular, the methods and / or embodiments in this application can be implemented as computer software programs. For example, the embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by processor 901, it performs the functions defined in the methods of this application.
[0094] Another embodiment of this application provides a storage medium storing computer program instructions thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of this application.
[0095] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
Claims
1. A deep learning-based automatic segmentation method for pleural and abdominal hemorrhage, characterized in that, include: S1, acquire and standardize CT body data of the thoracic or abdominal cavity; S2, linearly embeds the normalized CT volume data to generate initial features; S3, the initial features are input into the encoder for multi-stage encoding to obtain encoded features at different levels; during the encoding process, according to the different semantic levels of the encoding stage, the encoded features at different levels are subjected to frequency domain enhancement processing corresponding to the semantic level of that level to generate hierarchical-aware frequency domain enhanced features. S4, In at least one stage of the encoder, the input features are modeled using a deformable hybrid window multi-head self-attention mechanism; The deformable hybrid window multi-head self-attention mechanism generates frequency domain guiding weights for modulating the attention weights of different window types based on the frequency domain enhancement processing results corresponding to the current level, and uses the frequency domain guiding weights to perform weighted fusion of the attention calculation results of the divided different types of windows. S5, input the encoded features of different levels into the decoder for multi-stage decoding, and fuse them with the features of the corresponding level from the encoder to gradually restore the spatial resolution of the features; S6. Based on the features finally output by the decoder, generate the hemorrhage region segmentation result corresponding to the CT body data.
2. The method for automatic segmentation of pleural and abdominal hemorrhage based on deep learning according to claim 1, characterized in that, The step of performing frequency domain enhancement processing on the encoded features of different levels according to the semantic level of the encoding stage, corresponding to the semantic level of that level, includes: Perform a first frequency domain enhancement process on the shallow coding features. The first frequency domain enhancement process includes: performing a frequency domain transformation on the shallow coding features, extracting their low-frequency components, and converting the low-frequency components back to the spatial domain and then fusing them with the original shallow coding features. A second frequency domain enhancement process is performed on the mid-layer coding features. The second frequency domain enhancement process includes: performing a frequency domain transformation on the mid-layer coding features to extract their low-frequency components and frequency gradient information; using the frequency gradient information to modulate the spatial domain features obtained from the low-frequency components; and fusing the modulated spatial domain features with the original mid-layer coding features. A third frequency domain enhancement process is performed on the deep coding features. The third frequency domain enhancement process includes: performing a frequency domain transformation on the deep coding features and calculating their frequency domain statistical features; and mapping the frequency domain statistical features to generate attention guidance parameters and / or offset constraint parameters.
3. The method for automatic segmentation of pleural and abdominal hemorrhage based on deep learning according to claim 2, characterized in that: The deformable hybrid window multi-head self-attention mechanism generates frequency-domain guiding weights for modulating attention weights of different window types based on the frequency-domain enhancement processing results corresponding to the current level, including: When processing shallow or medium-layer encoded features, the frequency domain guiding weights are generated based on the spatial domain features output by the corresponding first or second frequency domain enhancement processing to modulate attention weights for different window types. When processing deep coding features, the frequency domain guiding weights are generated based on the attention guiding parameters generated by the third frequency domain enhancement processing to modulate the attention weights of different window types.
4. The method for automatic segmentation of pleural and abdominal hemorrhage based on deep learning according to claim 3, characterized in that, The step of inputting the encoded features from different levels into the decoder for multi-stage decoding and fusing them with features from the corresponding level of the encoder includes: Multi-scale deformable convolutional modules are set up on the skip connection path between the decoder and the encoder; The multi-scale deformable convolutional module receives encoded features from at least two different levels, fuses the aligned multi-scale features, and predicts the three-dimensional spatial offset field based on the fused features. Using the frequency domain enhancement processing result corresponding to the multi-scale deformable convolution module, the three-dimensional spatial offset field is constrained to obtain the constrained offset field. The constrained offset field is used to perform deformable convolution operations on the fused features, and the result is passed to the decoder for fusion.
5. The method for automatic segmentation of pleural and abdominal hemorrhage based on deep learning according to claim 4, characterized in that, The step of constraining the three-dimensional spatial offset field using the frequency domain enhancement processing result corresponding to the multi-scale deformable convolution module includes: When the features processed by the multi-scale deformable convolution module correspond to the mid-layer encoded features, the frequency gradient information obtained by the second frequency domain enhancement process is used to generate a spatial constraint map. The spatial constraint map is used to modulate the predicted three-dimensional spatial offset field on a spatially position-by-spatial basis.
6. The method for automatic segmentation of pleural and abdominal hemorrhage based on deep learning according to claim 1, characterized in that, The different types of windows identified in the deformable hybrid window multi-head self-attention mechanism include: local cube window, axial strip window, coronal strip window, and sagittal strip window.
7. The method for automatic segmentation of pleural and abdominal hemorrhage based on deep learning according to claim 1, characterized in that, The deformable hybrid window multi-head self-attention mechanism also includes a lightweight convolutional path parallel to the window attention path, and the output of the window attention path and the output of the lightweight convolutional path are weighted and summed using a learnable weight parameter.
8. An automatic segmentation device for pleural and abdominal hemorrhage based on deep learning, characterized in that, include: The data acquisition and standardization module is used to acquire and standardize CT scan data of the thoracic or abdominal cavity; The feature embedding module is used to linearly embed the normalized CT volume data to generate initial features; The hierarchical-aware encoding module is used to input the initial features into the encoder for multi-stage encoding to obtain encoded features at different levels. During the encoding process, according to the different semantic levels of the encoding stage, the encoded features at different levels are subjected to frequency domain enhancement processing corresponding to the semantic level of that level to generate hierarchical-aware frequency domain enhanced features. A deformable attention modeling module is used to model input features using a deformable hybrid window multi-head self-attention mechanism in at least one stage of the encoder. The deformable hybrid window multi-head self-attention mechanism generates frequency domain guiding weights for modulating the attention weights of different window types based on the frequency domain enhancement processing results corresponding to the current level, and uses the frequency domain guiding weights to perform weighted fusion of the attention calculation results of the divided different types of windows. The feature decoding and fusion module is used to input the encoded features of different levels into the decoder for multi-stage decoding, and fuse them with the features of the corresponding level from the encoder to gradually restore the spatial resolution of the features. The segmentation result generation module is used to generate the hemorrhage region segmentation result corresponding to the CT body data based on the features finally output by the decoder.
9. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A storage medium storing computer program instructions thereon, characterized in that, The computer program instructions can be executed by a processor to implement the deep learning-based automatic segmentation method for thoracic and abdominal hemorrhage as described in any one of claims 1-7.