Gallbladder polyp four-classification method, gallbladder polyp four-classification model training method, electronic device and storage medium
By using a three-way encoder and temporal attention pooling technology, multimodal ultrasound imaging features of gallbladder polyps are extracted and fused, solving the problem of difficulty in distinguishing early gallbladder cancer from adenomatous polyps in existing technologies, and achieving accurate four-category diagnosis of gallbladder polyps.
Patent Information
- Application Number
- CN202611432582.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-24
AI Technical Summary
Existing ultrasound modalities are insufficient to independently support accurate four-category diagnosis of gallbladder polyps, especially since early gallbladder cancer and adenomatous polyps appear similar on grayscale ultrasound and color Doppler ultrasound. Ultrasound contrast imaging only observes keyframes, resulting in the loss of temporal dynamic information.
Three independent encoders are used to extract multi-scale features from grayscale ultrasound, Doppler images and ultrasound contrast images respectively. A 3D convolutional encoder is used to extract the spatiotemporal features of ultrasound contrast image sequences. Through temporal attention pooling and hierarchical fusion techniques, dynamic perfusion feature vectors are aggregated to achieve cross-modal feature fusion and four-class classification decision.
It achieves end-to-end automated diagnosis from multimodal ultrasound imaging to four-category diagnosis, improving the accuracy of four-category gallbladder polyp classification, especially effectively distinguishing early gallbladder cancer from benign polyps.
Smart Images

Figure CN123160958A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a four-classification method for gallbladder polyps, a training method for a four-classification model of gallbladder polyps, an electronic device, and a storage medium. Background Technology
[0002] Ultrasound examination is the most commonly used first-line imaging method for gallbladder polyps. Clinically, routinely used ultrasound modalities include grayscale ultrasound (B-mode), color Doppler ultrasound (CDFI), and contrast-enhanced ultrasound (CEUS). Grayscale ultrasound can display the polyp's shape, size, boundaries, and echo characteristics; color Doppler ultrasound can detect blood flow signals inside and around the polyp, reflecting its blood supply status; contrast-enhanced ultrasound involves intravenous injection of microbubble contrast agents to dynamically observe the perfusion and clearance process of the contrast agent within the polyp, revealing the hemodynamic characteristics of the lesion.
[0003] However, the aforementioned single-modal image information each has its limitations and cannot independently support a precise four-category diagnosis of gallbladder polyps: grayscale ultrasound and color Doppler ultrasound provide static two-dimensional images, which can only reflect the morphology and blood supply status of the polyp at a certain moment, and cannot reveal the hemodynamic evolution of the lesion. For early gallbladder cancer, its appearance on grayscale ultrasound and color Doppler ultrasound is highly similar to that of adenomatous polyps; although contrast-enhanced ultrasound can provide dynamic perfusion information, the current diagnostic process often only observes or extracts a few key frames (such as peak frames) for interpretation. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a four-class classification method for gallbladder polyps, a four-class classification model training method for gallbladder polyps, an electronic device, and a storage medium to at least partially improve the above-mentioned problems.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, embodiments of the present invention provide a four-class classification method for gallbladder polyps, including: The grayscale ultrasound image, Doppler image, and ultrasound contrast image sequence of the same gallbladder polyp are input into the first encoder, the second encoder, and the third encoder, respectively, to extract their respective multi-scale feature maps; the third encoder is a 3D convolutional encoder, used to extract the spatiotemporal feature map of the ultrasound contrast image sequence; Temporal attention pooling is performed on the highest-level spatiotemporal feature map output by the third encoder to extract aggregated dynamic infusion feature vectors; The multi-scale feature maps output by the first encoder, the second encoder, and the third encoder are fused in layers to obtain multiple layered fused features. After aggregating the aforementioned layered fusion features, the data are input into the classification head to obtain the probability distribution of four pathological states: cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer.
[0006] Optionally, performing temporal attention pooling on the highest-level spatiotemporal feature map output by the third encoder to extract the aggregated dynamic infusion feature vector includes: Spatial global average pooling is performed on the feature map of each time frame in the highest-level spatiotemporal feature map to obtain the global description vector of each time frame. Each of the global description vectors is mapped through a fully connected layer to obtain the attention score for each time frame; The attention scores are normalized using the Softmax function to obtain the attention weight for each time frame; The aggregated dynamic infusion feature vector is obtained by weighting and summing the global description vectors with the attention weights.
[0007] Optionally, the multi-scale feature map includes a low-level feature map, at least one mid-level feature map, and a high-level feature map; the hierarchical fusion of the multi-scale feature maps output by the first encoder, the second encoder, and the third encoder to obtain multiple hierarchically fused features includes: Temporal average pooling is performed on the multi-scale feature maps of each level output by the third encoder to obtain static spatial feature maps of each level. After channel concatenation of the low-level feature maps of the three encoders, the first fused feature is obtained by convolutional compression; wherein, the low-level feature map of the third encoder is a low-level static spatial feature map obtained by time-averaged pooling. An adaptive weighted summation is performed on the mid-level feature maps of the three encoders to obtain at least one second fusion feature; wherein, the mid-level feature map of the third encoder is a mid-level static spatial feature map obtained after time-averaged pooling. The aggregated dynamic infusion feature vector and the high-level feature maps of the three encoders are input into the multi-head attention module for cross-modal interaction, and the classification token output by the multi-head attention module is extracted as the third fusion feature; wherein, the high-level feature map of the third encoder is a high-level static spatial feature map obtained after time average pooling.
[0008] Optionally, the aggregated dynamic infusion feature vector and the high-level feature maps of the three encoders are jointly input into a multi-head attention module for cross-modal interaction, and the classification token output by the multi-head attention module is extracted as a third fusion feature, including: The aggregated dynamic infusion feature vector is projected through a fully connected layer to the higher-level feature vector. Figure 1The feature dimensions are consistent, and the projection infusion token is obtained; The learnable classification token, the spatial token sequence obtained by spatial expansion of the high-level feature map of the first encoder, the spatial token sequence obtained by spatial expansion of the high-level feature map of the second encoder, the spatial token sequence obtained by spatial expansion of the high-level static spatial feature map of the third encoder, and the projected infusion token are concatenated to obtain the input token sequence. The input token sequence is input into the multi-head attention module, and the token at the beginning of the sequence output by the multi-head attention module, corresponding to the classification token, is extracted as the third fusion feature.
[0009] Optionally, after the step of inputting the grayscale ultrasound image, Doppler image, and contrast-enhanced ultrasound image sequence of the same gallbladder polyp into the first encoder, the second encoder, and the third encoder respectively, and extracting their respective multi-scale feature maps, the method further includes: Channel-space joint attention weighting is performed on the high-level feature maps output by each encoder to obtain the optimized high-level feature maps for each encoder; the channel-space joint attention weighting includes: Channel attention weighting is performed on the high-level feature maps output by each encoder to obtain the first intermediate feature map; For the first intermediate feature map, the maximum value and average value are calculated along the channel direction to obtain the spatial maximum value feature map and the spatial average value feature map; After concatenating the spatial maximum feature map and the spatial average feature map along the channel direction, the spatial attention weight map is generated by mapping through a convolutional layer and a sigmoid function. The first intermediate feature map is spatially weighted using the spatial attention weight map to obtain an optimized high-level feature map.
[0010] Optionally, before the step of inputting the grayscale ultrasound image, Doppler image, and contrast-enhanced ultrasound image sequence of the same gallbladder polyp into the first encoder, the second encoder, and the third encoder respectively to extract their respective multi-scale feature maps, the method further includes: Obtain a reference frame from the ultrasound contrast imaging sequence; the reference frame is the frame in which the contrast agent reaches the clearest boundary of the anterior polyp. For each frame in the ultrasound contrast image sequence, a pre-trained optical flow estimation network is used to calculate its dense optical flow field to the reference frame; Based on the dense optical flow field, each frame is non-rigidly registered using a spatial transformation network to align the pixel position of the polyp in each frame with the reference frame, thus obtaining a spatially aligned ultrasound contrast image sequence.
[0011] Optionally, after the step of obtaining the spatially aligned ultrasound contrast image sequence, the method further includes: Using the area of liver parenchyma adjacent to the polyp in the spatially aligned ultrasound contrast image sequence before the contrast agent arrives as the reference area, the average pixel intensity of each spatial position in the reference area in the first N frames is calculated as the baseline intensity map. The relative enhancement intensity of each frame in the spatially aligned ultrasound contrast image sequence is normalized using the baseline intensity map; the normalization calculation formula is:
[0012] in Let be the pixel intensity at spatial location (x, y) in frame t. The pixel intensity at spatial location (x, y) in the baseline intensity map. To prevent small constants from being divided by zero, This represents the standardized relative strength.
[0013] Secondly, embodiments of the present invention provide a method for training a four-class classification model of gallbladder polyps, including: Obtain a training sample set; the training sample set contains multiple sets of training samples, each set of training samples includes grayscale ultrasound images, Doppler images, ultrasound contrast imaging image sequences and their corresponding gallbladder polyp pathological type labels. The grayscale ultrasound images, Doppler images, and contrast-enhanced ultrasound images in each training sample are input into the gallbladder polyp four-classification method as described in any of the first aspects, and the predicted probability distribution of the gallbladder polyps belonging to cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer is obtained through forward propagation. The loss value is calculated based on the predicted probability distribution and the pathology type label; The network parameters of the gallbladder polyp four-classification model are updated by backpropagation based on the loss value.
[0014] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the method described in any of the above-mentioned embodiments.
[0015] Fourthly, embodiments of the present invention provide a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any of the preceding claims.
[0016] The present invention provides a four-class classification method for gallbladder polyps, a four-class classification model training method for gallbladder polyps, an electronic device, and a storage medium. By fusing multimodal ultrasound images and fully mining the complete temporal dynamic information of ultrasound contrast imaging, it has at least the following beneficial effects: First, by setting up three independent encoders to extract features from grayscale ultrasound images, Doppler images, and ultrasound contrast imaging sequences, comprehensive diagnostic information can be obtained from three dimensions: morphology, blood supply, and dynamic perfusion. This avoids the problem of insufficient information in a single modality and provides a sufficient multi-dimensional feature basis for accurate four-class classification.
[0017] Second, by using a 3D convolutional encoder in the third encoder to extract the spatiotemporal feature map of the ultrasound contrast imaging sequence, it is possible to simultaneously model the spatial and temporal dynamic features of the CEUS video and perform temporal attention pooling at its highest level. With learnable attention weights, it automatically focuses on the time period with the highest diagnostic value in the CEUS video sequence, condensing the complete perfusion dynamic information into an aggregated dynamic perfusion feature vector. This enables the accurate capture of the typical "fast forward and fast backward" clearance pattern of early gallbladder cancer, overcoming the defect of existing technologies that lose complete temporal dynamic information due to the use of only keyframes.
[0018] Third, by performing hierarchical fusion of multi-scale feature maps of the three modalities, the information of each modality can be gradually integrated at different semantic levels, enabling the model to make joint judgments using both dynamic and static signals. This effectively solves the clinical problem of difficulty in distinguishing between early gallbladder cancer and adenomatous polyps that are highly similar in static images.
[0019] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0020] 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.
[0021] Figure 1 A schematic structural block diagram of an electronic device provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a four-class classification method for gallbladder polyps provided in an embodiment of the present invention; Figure 3 A flowchart illustrating step S22 provided in an embodiment of the present invention; Figure 4 A flowchart illustrating step S23 provided in an embodiment of the present invention; Figure 5 This is a flowchart illustrating a four-classification model training method for gallbladder polyps provided in an embodiment of the present invention.
[0022] Icons: 100 - Electronic device; 101 - Memory; 102 - Communication interface; 103 - Processor; 104 - Communication bus. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0024] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0025] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0026] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0027] Gallbladder polyps are lesions protruding from the gallbladder wall. Clinically, they can be classified into four types based on their pathological nature: cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer. Cholesterol polyps and inflammatory polyps are benign lesions and usually do not require aggressive surgical intervention; regular follow-up is sufficient. Adenomatous polyps are precancerous lesions with a high potential for malignant transformation, and elective surgical removal is usually recommended once they are discovered. Early gallbladder cancer is an already developed malignant tumor that requires urgent radical surgery. The treatment strategies and prognoses for the four types differ significantly; therefore, accurate four-category diagnosis of gallbladder polyps before surgery is crucial for guiding clinical decisions and avoiding overtreatment or delay in treatment.
[0028] Currently, ultrasound examination is the most commonly used first-line imaging method for gallbladder polyps, offering advantages such as being non-invasive, convenient, and real-time. Clinically, routinely used ultrasound modalities include grayscale ultrasound, color Doppler ultrasound, and contrast-enhanced ultrasound. Grayscale ultrasound can display the polyp's morphology, size, boundaries, echo characteristics, and the layered structure of the gallbladder wall, serving as a fundamental method for polyp evaluation. Color Doppler ultrasound can detect the presence of blood flow signals within and around the polyp, reflecting its blood supply status. Contrast-enhanced ultrasound, through intravenous injection of microbubble contrast agents, dynamically observes the perfusion and clearance process of the contrast agent within the polyp, revealing its hemodynamic characteristics.
[0029] Based on the above, embodiments of the present invention provide a four-class classification method for gallbladder polyps, a training method for a four-class classification model of gallbladder polyps, an electronic device, and a storage medium. This method can simultaneously complete multimodal feature extraction, dynamic temporal modeling, cross-modal feature fusion, and four-class classification decision-making in a single model. It eliminates the need for manual design of radiomics features or reliance on expert experience for subjective judgment, achieving end-to-end automated diagnosis. It can effectively distinguish between early gallbladder cancer and benign polyps, improving the diagnostic accuracy of four-class classification of gallbladder polyps.
[0030] To implement the process steps and functions of this invention, please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic structural block diagram of an electronic device 100 provided in an embodiment of the present invention. The electronic device 100 includes a memory 101 and a processor 103, which are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 104 or signal lines. The memory 101 can be used to store software programs and modules, and the processor 103 executes the software programs and modules stored in the memory 101, thereby performing various functional applications and data processing.
[0031] Electronic device 100 can be, but is not limited to, a personal computer (PC), a server, a distributed computer, etc. It is understood that electronic device 100 is not limited to a physical server, but can also be a virtual machine on a physical server, a virtual machine built on a cloud platform, or any other computer that can provide the same functionality as the server or virtual machine. The operating system of electronic device 100 can be, but is not limited to, Windows, Linux, etc.
[0032] The memory 101 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0033] The communication connection between the electronic device 100 and external devices is achieved through at least one communication interface 102 (which can be wired or wireless).
[0034] Processor 103 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of this embodiment can be completed by integrated logic circuits in the hardware of processor 103 or by instructions in software form. Processor 103 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0035] Understandable. Figure 1 The structure shown is for illustrative purposes only; the electronic device 100 may also include components that are more advanced than those shown. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0036] The following is an exemplary description of the four-classification method for gallbladder polyps provided in an embodiment of the present invention. See also... Figure 2 The subject executing this method can be one of the above. Figure 1 The electronic device 100 shown, the method includes as follows Figure 2 The following steps are described: S21: Input the grayscale ultrasound image, Doppler image, and contrast-enhanced ultrasound image sequence of the same gallbladder polyp into the first encoder, the second encoder, and the third encoder, respectively, and extract their respective multi-scale feature maps. Among them, the third encoder is a 3D convolutional encoder, which is used to extract the spatiotemporal feature map of the contrast-enhanced ultrasound image sequence.
[0037] The images of the three modalities are derived from the same ultrasound examination of the same patient and correspond to each other in spatial location.
[0038] Grayscale ultrasound imaging is the basic imaging mode of conventional ultrasound examination. It transmits ultrasound waves and receives the echo signals reflected by tissues, displaying the morphology and structure of tissues at different gray levels. In this embodiment of the invention, the grayscale ultrasound image is a single static two-dimensional grayscale image used to provide morphological information of gallbladder polyps, including but not limited to: the size, shape, boundary features (clear or blurred), internal echo intensity (hyperecho, isoecho, or hypoecho), echo homogeneity, and the layered structure of the gallbladder wall.
[0039] Color Doppler flow imaging, based on grayscale ultrasound images, utilizes the Doppler effect to detect blood flow motion information and displays it as a color-coded overlay on the grayscale image. In this embodiment of the invention, the Doppler image is a single color two-dimensional overlay image used to provide hemodynamic information of gallbladder polyps, including but not limited to: the presence of blood flow signals inside and around the polyp, the abundance (sparse or abundant) of blood flow signals, blood flow morphology (punctate, linear, or dendritic), and blood flow distribution patterns. This information reflects the blood supply status of the polyp.
[0040] Contrast-enhanced ultrasound (CEUS) involves intravenously injecting microbubble contrast agents to enhance tissue echo signals, allowing for dynamic observation of the contrast agent's perfusion and clearance processes within the tissue. In this embodiment of the invention, the CEUS image sequence is a time-series video data covering three phases: the arterial phase, the portal venous phase, and the delayed phase. It comprises multiple consecutive frames (e.g., 30 to 60 frames) to provide dynamic perfusion information for gallbladder polyps, including but not limited to: the arrival time, peak time, peak intensity, clearance rate, and clearance pattern (rapid or slow clearance) of the contrast agent. This temporal dynamic information can reveal the hemodynamic evolution of the lesion.
[0041] The first encoder processes grayscale ultrasound images, the second encoder processes Doppler images, and the third encoder processes ultrasound contrast imaging sequences. The three encoders operate independently, do not share parameters, and each extracts multi-scale feature maps from its corresponding modality.
[0042] Both the first and second encoders can adopt the ResNet / ResNeXt-50 structure, which is pre-trained on ImageNet and then fine-tuned.
[0043] The third encoder is a 3D convolutional encoder, which can perform convolution operations on the input three-dimensional data (time × height × width) to simultaneously extract the spatial features (morphology, texture, etc. inside the image) and temporal features (dynamic evolution process between frames) of the ultrasound contrast image sequence, and output a spatiotemporal feature map containing the time dimension.
[0044] Optionally, the third encoder can be a lightweight (2+1)D ResNet-50, replacing the 3D convolutions in the standard ResNet with (2+1)D convolutions, decomposing the 3D convolutions into spatial 2D convolutions and temporal 1D convolutions, which significantly reduces the computational cost.
[0045] Multi-scale feature maps can include at least three levels: low-level feature maps correspond to higher spatial resolution and lower semantic level, preserving details such as edges and contours; high-level feature maps correspond to lower spatial resolution and higher semantic level, encoding global semantic information; and mid-level feature maps have spatial resolution and semantic level in between.
[0046] S22: Perform temporal attention pooling on the highest-level spatiotemporal feature map output by the third encoder to extract aggregated dynamic infusion feature vectors.
[0047] The highest-level spatiotemporal feature map contains multiple time frames, each corresponding to a spatial feature map. Temporal attention pooling automatically calculates the importance weight of each time frame through a learnable attention mechanism, and then weights and sums the features of each time frame to obtain a feature vector that integrates complete temporal dynamic information. This process enables the model to automatically focus on the time periods with the highest diagnostic value in the CEUS video sequence (such as the contrast agent arrival time, peak time, and clearance time), and condenses the complete perfusion dynamic information into the aggregated dynamic perfusion feature vector.
[0048] S23: Perform hierarchical fusion of the multi-scale feature maps output by the first encoder, the second encoder, and the third encoder to obtain multiple hierarchical fused features.
[0049] For the feature maps at each semantic level, fusion is performed separately. The feature maps at different levels can use the same fusion method or different fusion methods, thus obtaining multiple hierarchical fused features.
[0050] S24: After aggregating the features from each layer, input them into the classification head to obtain the probability distribution of four pathological states: cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer.
[0051] Finally, the hierarchical fusion features obtained in step S23 are subjected to global feature aggregation, and then the aggregated features are concatenated to form a comprehensive feature vector. This vector is then mapped to the four-dimensional output space through a fully connected layer. Finally, the output value is transformed into a probability distribution for four categories through the Softmax function, corresponding to cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer, respectively.
[0052] This method extracts multi-scale features from three modalities—grayscale ultrasound, Doppler ultrasound, and contrast-enhanced ultrasound—using three independent encoders. It fully mines the complete temporal dynamic information of contrast-enhanced ultrasound using a 3D convolutional encoder and temporal attention pooling. Through a hierarchical fusion strategy, it integrates edge contour information at the low level, adaptively fuses texture pattern information at the mid-level, and establishes cross-modal semantic associations between dynamic perfusion information and static spatial information at the high level. Finally, it aggregates the fused features from each layer and inputs them into a classification head to output a four-class probability distribution. This achieves end-to-end automated diagnosis from multimodal ultrasound image input to four-class diagnostic results, effectively distinguishing early gallbladder cancer from benign polyps and improving the diagnostic accuracy of four-class classification of gallbladder polyps.
[0053] In step S22, temporal attention pooling needs to be performed on the highest-level spatiotemporal feature map output by the third encoder to extract and aggregate dynamic perfusion feature vectors. Since the highest-level spatiotemporal feature map contains multiple time frames, each carrying perfusion state information at that moment, and different time frames contribute differently to the diagnosis (for example, frames in the clearance phase are more crucial for distinguishing early gallbladder cancer from adenomatous polyps), a mechanism that can automatically identify key frames and aggregate complete temporal information needs to be designed.
[0054] Therefore, in an optional embodiment of the present invention, an implementation of temporal attention pooling is provided. See also Figure 3 S22 may include the following sub-steps S221 to S224: S221: Perform spatial global average pooling on the feature map of each time frame in the highest-level spatiotemporal feature map to obtain the global description vector of each time frame.
[0055] Let the highest-level spatiotemporal feature map contain T time frames. The feature map of frame t is denoted as F4(t), with dimensions [C, H, W], where C is the number of channels, and H and W are the height and width of the feature map, respectively. Spatial global average pooling compresses the spatial feature map of each frame into a one-dimensional global description vector using the following formula:
[0056] in, Let be the global description vector for frame t, with dimension [C]. This step compresses the spatial information of each frame into a global description, providing a basis for subsequent calculation of inter-frame attention weights.
[0057] S222: Map each global description vector through a fully connected layer to obtain the attention score for each time frame.
[0058] The global description vector of each frame The input is fed into a fully connected layer, and the attention score for that frame is calculated through a linear transformation:
[0059] in, and For learnable weight matrices and biases, Let be the raw attention score (scalar) for frame t. This score reflects the model's initial assessment of the importance of that time frame.
[0060] S223: Normalize each attention score using the Softmax function to obtain the attention weight for each time frame.
[0061]
[0062] in, Let be the attention weight for frame t. This normalization process makes the attention weights of all frames form a probability distribution, which facilitates subsequent weighted summation.
[0063] S224: The global description vectors are weighted and summed using each attention weight to obtain the aggregated dynamic infusion feature vector.
[0064] Finally, the weighted sum of the global description vectors is performed to obtain the aggregated dynamic infusion feature vector:
[0065] in, The aggregated dynamic infusion feature vector has a dimension of [C].
[0066] Through the sub-steps S221 to S224, the model can automatically learn the importance weights of each time frame in the CEUS video sequence, and condense the complete perfusion dynamic information (including the arrival, peak, and clearance stages of the contrast agent) into a single aggregated dynamic perfusion feature vector, thereby accurately capturing the typical clearance pattern of early gallbladder cancer that is characterized by "rapid advance and rapid retreat".
[0067] Because the feature maps of the three modalities differ in data format—the first and second encoders output pure spatial feature maps, while the third encoder outputs spatiotemporal feature maps that include a time dimension—they cannot be directly fused. Furthermore, feature maps at different semantic levels carry different types of information: low-level feature maps contain detailed information such as edges and contours, mid-level feature maps contain pattern information such as texture and structure, and high-level feature maps contain global semantic information. Therefore, differentiated fusion strategies need to be designed for different levels to fully integrate the complementary information of each modality at each semantic level.
[0068] To this end, the embodiments of the present invention employ different fusion strategies: for low-level feature maps, the low-level visual information such as edges and contours of the three modalities is integrated through splicing and convolutional compression to establish spatial positional correspondence; for mid-level feature maps, the contribution of each modality is dynamically allocated according to the characteristics of the lesion through adaptive weighted summation to achieve complementary advantages between modalities; for high-level feature maps, the aggregated dynamic perfusion feature vector extracted in step S22 is cross-modal interacted with the high-level spatial feature maps of the three encoders to establish semantic association between dynamic perfusion information and static spatial information. Through the above three levels of fusion, the first fusion feature, the second fusion feature, and the third fusion feature are obtained respectively.
[0069] In one optional implementation, the multi-scale feature map includes a low-level feature map, at least one mid-level feature map, and a high-level feature map. This embodiment of the invention is illustrated using two mid-level feature maps. All three encoders output multi-scale feature maps. , , , The output of the first encoder is denoted as , , , The output of the second encoder is denoted as , , , The output of the third encoder is denoted as , , , See also Figure 4 S23 may include the following sub-steps S231 to S234: S231: Perform time-averaged pooling on the multi-scale feature maps of each level output by the third encoder to obtain static spatial feature maps of each level.
[0070] The feature maps output by the third encoder are spatiotemporal feature maps with dimensions [T, C, H, W], where T is the number of time frames corresponding to that level. Since the feature maps output by the first and second encoders are purely spatial feature maps and do not include a temporal dimension, to achieve dimension matching in subsequent fusion operations, the spatiotemporal feature maps of the third encoder need to be averaged along the time dimension. This averages the features at each spatial location on the time axis, compressing them into pure spatial feature maps. This step ensures that the feature maps of the three encoders at the same level have a consistent spatial dimension, providing a foundation for subsequent fusion operations.
[0071] The static spatial feature diagrams of each level are denoted as follows: , , , .
[0072] S232: After concatenating the channels of the low-level feature maps of the three encoders, the first fused feature is obtained by convolutional compression; wherein, the low-level feature map of the third encoder is the low-level static spatial feature map obtained after time average pooling.
[0073] The low-level feature maps of the three encoders The three modalities are concatenated along the channel dimension, merging their channel counts. Then, a 1×1 convolutional layer is used for channel compression, reducing the feature dimensionality while preserving effective information. After batch normalization and activation function processing, the first fused feature is obtained. This hierarchical fusion mainly integrates low-level visual information such as edges and contours from the three modalities, establishing spatial correspondences so that subsequent mid- and high-level fusions are based on accurate spatial alignment. The fusion method is represented as follows:
[0074]
[0075] in, This is the first fusion feature.
[0076] S233: Adaptively weighted summation of the mid-level feature maps of the three encoders to obtain at least one second fusion feature; wherein, the mid-level feature map of the third encoder is the mid-level static spatial feature map obtained after time average pooling.
[0077] In this embodiment of the invention, the intermediate-level feature maps correspond to the C2 and C3 level feature maps. First, global average pooling is performed on the intermediate-level feature maps of the three encoders to obtain global description vectors for each modality. The three global description vectors are then concatenated and mapped through a fully connected layer and a Softmax function to generate normalized weights for the three modalities. The three intermediate-level feature maps are then weighted and summed using these normalized weights to obtain the second fusion feature. This hierarchical fusion, through a data-driven dynamic weighting mechanism, adaptively allocates the contribution of each modality based on the characteristics of the lesions, enabling the model to automatically emphasize modal information with higher reliability in different cases, achieving complementary advantages between modalities. The fusion method of the second fusion feature corresponding to the C2 level feature map is as follows:
[0078] in, Each has its own normalized weight.
[0079] Similarly, the fused features corresponding to the C3 level feature map can be obtained. .
[0080] S234: The aggregated dynamic infusion feature vector and the high-level feature maps of the three encoders are input into the multi-head attention module for cross-modal interaction, and the classification token output by the multi-head attention module is extracted as the third fusion feature; wherein, the high-level feature map of the third encoder is the high-level static spatial feature map obtained after time average pooling.
[0081] In an optional implementation, step S234 may include the following sub-steps S2341 to S2343: S2341: Project the aggregated dynamic infusion feature vector through a fully connected layer to the higher-level feature vector. Figure 1 The characteristic dimensions are consistent, and the projection infusion token is obtained.
[0082] Aggregate dynamic infusion feature vector The dimensions and the number of channels in the high-level feature maps of the three encoders may differ. To enable interaction between dynamically injected features and static spatial features in a unified feature space, a fully connected layer is needed. The dimensional projection transformation is applied to the dimensions of the high-level feature map, so that its feature dimensions are consistent with those of each high-level feature map. Figure 1 To obtain the projection infusion token This step ensures that dynamically injected features can effectively interact semantically with static spatial features within the multi-head attention module.
[0083] S2342: The learnable classification token, the spatial token sequence obtained by spatial expansion of the high-level feature map of the first encoder, the spatial token sequence obtained by spatial expansion of the high-level feature map of the second encoder, the spatial token sequence obtained by spatial expansion of the high-level static spatial feature map of the third encoder, and the projected infusion token are concatenated to obtain the input token sequence.
[0084] The high-level feature maps of the three encoders all have dimensions [C, H, W], where H×W represents the number of spatial locations. Each high-level feature map is expanded along the spatial dimensions (i.e., each spatial location is treated as an independent token), resulting in its own spatial token sequence. The learnable classification token is placed at the beginning of the sequence, followed by the three spatial token sequences and the projected infusion token, forming the complete input token sequence. The classification token is a learnable parameter vector that acts as an "information aggregator" in the multi-head attention module, absorbing global information through interaction with all other tokens.
[0085] The input token sequence can be represented as:
[0086] in, For classification tokens, These are spatial token sequences corresponding to three types of high-level feature maps. For projecting the infusion token sequence.
[0087] S2343: Input the input token sequence into the multi-head attention module, and extract the first token in the sequence output by the multi-head attention module that corresponds to the class token as the third fusion feature.
[0088] The tokens in the input token sequence interact globally through a Multi-Head Attention (MHA) module. Each token calculates its attention weight with all other tokens using a Query-Key-Value mechanism, thus incorporating information from other tokens into its own features. After MHA processing, the classification token at the beginning of the sequence has absorbed the global information of all spatial and projective infused tokens through the attention mechanism. Its state encodes the comprehensive semantic information resulting from the cross-modal interaction between dynamic infused features and three modal static spatial features. Therefore, this classification token is extracted as the third fusion feature, which is represented as follows:
[0089] in, It is the input sequence The complete token sequence output after MHA cross-modal interaction; It is the updated state of the [CLS] token at the top of the sequence, serving as the third fusion feature. .
[0090] Through the above S2341 to S2343, the embodiments of the present invention realize deep cross-modal semantic association between dynamic perfusion features and static spatial features, enabling the model to make joint judgments using dynamic and static information at the high-level semantic level, thereby more effectively distinguishing between early gallbladder cancer and adenomatous polyps that are highly similar on static images.
[0091] In this example, the specific method of aggregation and splicing in step S24 is as follows: for Perform global average pooling separately to obtain the following results: ,Will and The combined feature vector is obtained by concatenating the features.
[0092] Following step S21, each encoder outputs its own multi-scale feature map. The high-level feature map contains the richest semantic information and will be used for subsequent hierarchical fusion. However, high-level feature maps typically contain a large number of channels, each corresponding to different semantic attributes (such as edge response, texture response, shape response, etc.), and different channels contribute differently to the classification of gallbladder polyps. Furthermore, different spatial locations carry different diagnostic values; the spatial location of the lesion region (the polyp itself) is far more important than the background region. Therefore, a mechanism is needed to filter out the most diagnostically valuable information in both the channel and spatial dimensions, allowing the model to focus on key features and key locations.
[0093] Therefore, in an optional embodiment of the present invention, after step S21, channel-space joint attention weighting is further performed on the high-level feature maps output by each encoder to obtain optimized high-level feature maps for each encoder. This channel-space joint attention weighting includes the following steps: S211: Perform channel attention weighting on the high-level feature maps output by each encoder to obtain the first intermediate feature map.
[0094] Let the input high-level feature map be F, with dimensions [C, H, W], where C is the number of channels, and H and W are the height and width of the feature map, respectively. First, global average pooling is used to compress the spatial information of each channel into a scalar, resulting in a channel description vector z with dimensions [C]:
[0095] in, This is the global description of the c-th channel.
[0096] Subsequently, z is input into a bottleneck structure consisting of two fully connected layers. The first layer reduces the dimension from C to C / r (where r is the reduction ratio), and after passing through the ReLU activation function, the second layer restores the dimension to C, which is then mapped to channel attention weights between 0 and 1 using the Sigmoid function. This process can be represented as:
[0097] in, and This is the weight matrix of the fully connected layer. For global average pooling, σ is the Sigmoid function.
[0098] Finally, the generated channel attention weights are applied to the original feature map. The corresponding channels are multiplied element-wise to obtain the first intermediate feature map after channel optimization. :
[0099] in, This involves element-wise multiplication. This step allows the model to automatically amplify channels that contribute more to the classification task and suppress irrelevant or interfering channels.
[0100] S212: For the first intermediate feature map, calculate the maximum value and average value along the channel direction to obtain the spatial maximum value feature map and the spatial average value feature map.
[0101] Obtaining the first intermediate feature map Then, spatial attention weighting is applied to it to generate a spatial attention weight map.
[0102] For the first intermediate feature map Calculate the maximum and average values along the channel direction to obtain two two-dimensional feature maps, denoted as follows: and Their dimensions are all [H, W].
[0103] S213: After concatenating the spatial maximum feature map and the spatial average feature map along the channel direction, the spatial attention weight map is generated by mapping through a convolutional layer and the Sigmoid function.
[0104] Feature map of spatial maximum value Spatial mean feature map The features are concatenated along the channel direction to obtain a feature map with dimensions [2, H, W]. This map is then fused using a convolutional layer with a kernel size of k×k (e.g., k=7). Finally, the feature map is mapped to a spatial attention weight map using the sigmoid function. Its dimensions are [H, W], and the value of each position is between 0 and 1, representing the importance of that spatial position:
[0105] in, This indicates a channel splicing operation. It is a convolutional layer. This is the Sigmoid function.
[0106] S214: Spatially weight the first intermediate feature map using the spatial attention weight map to obtain the optimized high-level feature map.
[0107] Finally, using the spatial attention weight map For the first intermediate feature map Spatial weighting is performed to obtain the optimized high-level feature map. Spatial attention weight map Broadcast along the channel dimension to Then perform element-wise multiplication using the same dimensions:
[0108] in, This is the final optimized high-level feature map.
[0109] Through the aforementioned channel-space joint attention weighting, the model can filter out the semantic attributes most relevant to diagnosis in the channel dimension, while focusing on the polyp location in the spatial dimension. This enhances and optimizes the high-level feature maps of each encoder used in subsequent hierarchical fusion. The optimized high-level feature map will replace the original high-level feature map in step S23 and subsequent high-level fusion steps.
[0110] During CEUS examinations, patients experience respiratory movements and slight probe movement, causing spatial displacement of the polyps in the image sequence. Taking a 48-frame video as an example, the patient's respiratory cycle is approximately 3 to 5 seconds. During acquisition, the polyps move up and down with diaphragmatic movement, with displacements reaching 10 to 20 pixels in severe cases. If the raw sequence is directly input into a third encoder, the same spatial location may correspond to different parts of the polyp in different frames during 3D convolution calculations. This results in the encoder learning "temporal variations" that are actually artifacts caused by spatial misalignment, rather than true perfusion dynamics. Therefore, it is necessary to eliminate inter-frame displacement to ensure that the pixel positions of the polyps in each frame remain spatially consistent along the time axis, guaranteeing that the temporal features extracted by the subsequent encoder accurately reflect the true perfusion dynamics.
[0111] Therefore, in one alternative implementation, prior to S21, the method may further include: S201: Obtain a reference frame from the ultrasound contrast imaging sequence; the reference frame is the frame in which the contrast agent reaches the clearest boundary of the anterior polyp.
[0112] In CEUS sequences, baseline images before the arrival of contrast agent are unaffected by the contrast agent enhancement effect and can most realistically reflect the anatomical structure of the tissue. The frame with the clearest polyp boundary displayed from the baseline images is selected as the reference frame. This serves as the target reference for subsequent spatial alignment.
[0113] S202: For each frame in the ultrasound contrast image sequence, a pre-trained optical flow estimation network is used to calculate the dense optical flow field to the reference frame.
[0114] For each frame in the sequence (t=1, 2, ..., T), a pre-trained lightweight optical flow estimation network (Recurrent All-pairs Field Transforms – small, RAFT-S) is used to estimate its path to the reference frame. Dense optical flow field ( , The optical flow field provides a two-dimensional displacement vector for each pixel, representing the offset of that pixel from its position in the current frame to the corresponding position in the reference frame. The optical flow estimation network is pre-trained and used directly for inference; it does not participate in the training of subsequent classification tasks, thus not increasing the training burden on the model.
[0115] S203: Based on the dense optical flow field, non-rigid registration is performed on each frame through a spatial transformation network to align the pixel position of the polyp in each frame with the reference frame, thus obtaining a spatially aligned ultrasound contrast image sequence.
[0116] Based on the dense optical flow field estimated in step S202 ( , A spatial transformation network is used to transform the current frame. A transformation is performed, moving each pixel to a new position according to the displacement vector indicated by the optical flow field. This process can be represented as:
[0117] in, This is the t-th frame image after registration. After the above non-rigid registration, the pixel positions of the polyps in each frame remain consistent along the time axis. This step eliminates inter-frame displacement caused by breathing motion and probe operation, ensuring that the changes in each spatial position extracted by the subsequent encoder in the time dimension can truly reflect the contrast agent perfusion dynamics at that location, rather than artifacts caused by positional jitter.
[0118] Significant differences exist in contrast agent dosage, cardiac output, and ultrasound equipment gain settings among patients, resulting in a lack of cross-patient comparability in absolute pixel intensity of CEUS images. For example, patient A has a baseline intensity of 50 and a peak intensity of 200; patient B has a baseline intensity of 80 and a peak intensity of 300. If absolute intensity values are directly input into the encoder, all values for patient B will be higher than those for patient A, but this difference may simply be due to different instrument gain settings or contrast agent dosages, rather than pathological differences. This individual variability causes the encoder to learn to "adapt to individual patient characteristics" rather than "recognize pathological patterns" during training, severely interfering with the model's learning of real perfusion dynamics. Therefore, a standardization method is needed to eliminate these individual differences and make the perfusion dynamic characteristics of different patients comparable.
[0119] Therefore, in one alternative implementation, after obtaining the spatially aligned ultrasound contrast image sequence, the following steps are also performed: S204: Using the area of liver parenchyma adjacent to the polyp in the spatially aligned ultrasound contrast imaging sequence before the contrast agent arrives as the reference area, calculate the average pixel intensity of each spatial location in the reference area in the first N frames, and use it as the baseline intensity map.
[0120] In a CEUS sequence, the first N frames before the contrast agent arrives (where N is 3 to 5, representing a stable period before the contrast agent reaches the tissue) reflect the baseline echo intensity of the tissue itself. A liver parenchyma region adjacent to the polyp is selected as the reference region. This region is similar to the polyp in imaging depth, experiences the same ultrasound attenuation and instrument gain settings, and serves as an ideal internal reference. For each spatial location (x, y) within the reference region, its average pixel intensity over the first N frames is calculated as the baseline intensity value for that location. .
[0121] S205: Normalize the relative enhancement intensity of each frame in the spatially aligned ultrasound contrast image sequence using the baseline intensity map; the normalization calculation formula is:
[0122] in Let be the pixel intensity at spatial location (x, y) in frame t. This represents the pixel intensity at spatial location (x, y) in the baseline intensity map. To prevent small constants from being divided by zero, This represents the standardized relative strength.
[0123] The function of this formula is to convert the change in the current intensity of each pixel relative to its baseline intensity into a multiple of the baseline intensity, i.e., the "enhancement ratio relative to the liver parenchyma". After the above standardization, the numerical scale of CEUS images from different patients is unified, the relative value of the liver parenchyma region is close to 0, and the relative value of the polyp region reflects its true enhancement relative to the liver parenchyma.
[0124] After the above preprocessing, the CEUS sequence possesses two key attributes: "spatial alignment" and "numerical comparability." This ensures that the temporal features extracted by the third encoder in the subsequent step S21 truly reflect the pathological perfusion dynamics, rather than artifact signals interfered with by respiratory motion or equipment differences. This provides a reliable data foundation for the accurate extraction of aggregated dynamic perfusion feature vectors in step S22.
[0125] Before the model is used in actual clinical practice, it needs to be trained to learn the mapping relationship from multimodal ultrasound images to four-category pathological types. This invention also provides a method for training a four-category gallbladder polyp model; see [link to relevant documentation]. Figure 5 The method includes: S31: Obtain the training sample set; the training sample set contains multiple sets of training samples, each set of training samples includes grayscale ultrasound images, Doppler images, ultrasound contrast imaging image sequences and their corresponding gallbladder polyp pathological type labels.
[0126] The pathological type label is one of four categories: cholesterol polyp, inflammatory polyp, adenomatous polyp, and early gallbladder cancer. Training samples can be derived from historical examination data from a hospital's ultrasound department, with experienced ultrasound physicians labeling each sample with its pathological type (using surgical pathology results or biopsy results as the gold standard). The training sample set should cover all four categories to ensure the model can learn the characteristic distributions of each category.
[0127] S32: Input the grayscale ultrasound images, Doppler images, and contrast-enhanced ultrasound image sequences from each training sample into the above-mentioned four-classification method for gallbladder polyps. After forward propagation, the predicted probability distribution of gallbladder polyps belonging to cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer is obtained.
[0128] Each training sample goes through the following steps in sequence: feature extraction in step S21, dynamic perfusion feature vector extraction in step S22, hierarchical fusion in step S23, and classification head mapping in step S24. Finally, a four-dimensional probability vector is output, with each dimension corresponding to the predicted probability of the four pathological types.
[0129] S33: Calculate the loss value based on the predicted probability distribution and pathology type label.
[0130] A predefined loss function is used to calculate the difference between the model's predictions and the true labels. Optionally, the loss function is Focal Loss, which can effectively address the imbalance of sample numbers in each class in the gallbladder polyp four-class classification task (e.g., early gallbladder cancer samples are far fewer than cholesterol polyp samples) by introducing a modulation factor into the standard cross-entropy loss. This loss function is expressed as:
[0131] in, The number of samples in the batch. Index for gallbladder polyp categories, For the first Class weight coefficient, To predict the probability that the i-th sample belongs to the k-th class for the model, Let i be the true label of the i-th sample. For focusing parameters.
[0132] S34: Update the network parameters of the gallbladder polyp four-classification model by backpropagation based on the loss value.
[0133] The gradient of the loss value with respect to each network parameter is calculated using the backpropagation algorithm. Then, an optimizer (such as Adam) is used to update the network parameters of the first encoder, second encoder, third encoder, and classification head along the gradient descent direction. Through multiple iterations of training, the model gradually converges and learns the optimal mapping from multimodal ultrasound images to four-category pathological types.
[0134] Through the above training process, the model can automatically learn the correlation between various modal features and pathological types from a large amount of labeled data, without the need for manual design of radiomics features or reliance on expert experience for subjective judgment, and finally obtain a gallbladder polyp diagnostic model with a high four-category accuracy.
[0135] In summary, the gallbladder polyp four-classification method, gallbladder polyp four-classification model training method, electronic device, and storage medium provided by the embodiments of the present invention extract multi-scale features of three modalities—grayscale ultrasound, Doppler ultrasound, and contrast-enhanced ultrasound—through three independent encoders, avoiding mutual interference between different modal features during the extraction stage, and enabling each encoder to focus on extracting effective information of its own modality. The 3D convolutional encoder and temporal attention pooling are used to fully mine the complete temporal dynamic information of contrast-enhanced ultrasound, enabling accurate capture of the typical "fast-forward and fast-backward" clearance pattern of early gallbladder cancer, overcoming the deficiency of existing technologies that rely solely on keyframes and lose complete temporal dynamic information. A hierarchical fusion strategy is used to integrate edge contour information at the low level, adaptively weightedly fuse texture pattern information at the mid-level, and aggregate dynamic information at the high level. The perfusion feature vector and the high-level static spatial feature maps of the three modalities are semantically correlated across modalities through a multi-head attention module, enabling dynamic clearance anomalies and static morphological anomalies to corroborate each other. This effectively solves the clinical challenge of distinguishing between early gallbladder cancer and adenomatous polyps in static images due to their high similarity. Channel-space joint attention weighting is introduced at the output of the high-level feature maps of each encoder, allowing the model to select the most diagnostically relevant semantic attributes in the channel dimension and focus on the polyp location in the spatial dimension, further improving the quality of feature expression. Preprocessing the ultrasound contrast-enhanced image sequence through motion compensation and relative enhancement intensity normalization eliminates the inter-frame displacement caused by respiratory motion and the numerical incomparability caused by cross-patient device / dose differences, providing a reliable data foundation for the accurate extraction of subsequent temporal features.
[0136] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0137] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0138] If the functionality is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0140] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A four-class classification method for gallbladder polyps, characterized in that, include: The grayscale ultrasound image, Doppler image, and ultrasound contrast image sequence of the same gallbladder polyp are input into the first encoder, the second encoder, and the third encoder, respectively, to extract their respective multi-scale feature maps; the third encoder is a 3D convolutional encoder, used to extract the spatiotemporal feature map of the ultrasound contrast image sequence; Temporal attention pooling is performed on the highest-level spatiotemporal feature map output by the third encoder to extract aggregated dynamic infusion feature vectors; The multi-scale feature maps output by the first encoder, the second encoder, and the third encoder are fused in layers to obtain multiple layered fused features. After aggregating the aforementioned layered fusion features, the data are input into the classification head to obtain the probability distribution of four pathological states: cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer.
2. The method according to claim 1, characterized in that, The step of performing temporal attention pooling on the highest-level spatiotemporal feature map output by the third encoder to extract aggregated dynamic infusion feature vectors includes: Spatial global average pooling is performed on the feature map of each time frame in the highest-level spatiotemporal feature map to obtain the global description vector of each time frame. Each of the global description vectors is mapped through a fully connected layer to obtain the attention score for each time frame; The attention scores are normalized using the Softmax function to obtain the attention weight for each time frame; The aggregated dynamic infusion feature vector is obtained by weighting and summing the global description vectors with the attention weights.
3. The method according to claim 1, characterized in that, The multi-scale feature map includes a low-level feature map, at least one mid-level feature map, and a high-level feature map; the multi-scale feature maps output by the first encoder, the second encoder, and the third encoder are fused in layers to obtain multiple layered fused features, including: Temporal average pooling is performed on the multi-scale feature maps of each level output by the third encoder to obtain static spatial feature maps of each level. After channel concatenation of the low-level feature maps of the three encoders, the first fused feature is obtained by convolutional compression; wherein, the low-level feature map of the third encoder is a low-level static spatial feature map obtained by time-averaged pooling. An adaptive weighted summation is performed on the mid-level feature maps of the three encoders to obtain at least one second fusion feature; wherein, the mid-level feature map of the third encoder is a mid-level static spatial feature map obtained after time-averaged pooling. The aggregated dynamic infusion feature vector and the high-level feature maps of the three encoders are input into the multi-head attention module for cross-modal interaction, and the classification token output by the multi-head attention module is extracted as the third fusion feature; wherein, the high-level feature map of the third encoder is a high-level static spatial feature map obtained after time average pooling.
4. The method according to claim 3, characterized in that, The aggregated dynamic infusion feature vector and the high-level feature maps of the three encoders are jointly input into a multi-head attention module for cross-modal interaction. The classification token output by the multi-head attention module is extracted as the third fusion feature, including: The aggregated dynamic infusion feature vector is projected through a fully connected layer to a feature dimension consistent with the high-level feature map to obtain the projected infusion token. The learnable classification token, the spatial token sequence obtained by spatial expansion of the high-level feature map of the first encoder, the spatial token sequence obtained by spatial expansion of the high-level feature map of the second encoder, the spatial token sequence obtained by spatial expansion of the high-level static spatial feature map of the third encoder, and the projected infusion token are concatenated to obtain the input token sequence. The input token sequence is input into the multi-head attention module, and the token at the beginning of the sequence output by the multi-head attention module, corresponding to the classification token, is extracted as the third fusion feature.
5. The method according to claim 1, characterized in that, After the step of inputting the grayscale ultrasound image, Doppler image, and contrast-enhanced ultrasound image sequence of the same gallbladder polyp into the first encoder, the second encoder, and the third encoder respectively, and extracting their respective multi-scale feature maps, the method further includes: Channel-space joint attention weighting is performed on the high-level feature maps output by each encoder to obtain the optimized high-level feature maps for each encoder; the channel-space joint attention weighting includes: Channel attention weighting is performed on the high-level feature maps output by each encoder to obtain the first intermediate feature map; For the first intermediate feature map, the maximum value and average value are calculated along the channel direction to obtain the spatial maximum value feature map and the spatial average value feature map; After concatenating the spatial maximum feature map and the spatial average feature map along the channel direction, the spatial attention weight map is generated by mapping through a convolutional layer and a sigmoid function. The first intermediate feature map is spatially weighted using the spatial attention weight map to obtain an optimized high-level feature map.
6. The method according to claim 1, characterized in that, Before the step of inputting the grayscale ultrasound image, Doppler image, and contrast-enhanced ultrasound image sequence of the same gallbladder polyp into the first encoder, second encoder, and third encoder respectively to extract their respective multi-scale feature maps, the method further includes: Obtain a reference frame from the ultrasound contrast imaging sequence; the reference frame is the frame in which the contrast agent reaches the clearest boundary of the anterior polyp. For each frame in the ultrasound contrast image sequence, a pre-trained optical flow estimation network is used to calculate its dense optical flow field to the reference frame; Based on the dense optical flow field, each frame is non-rigidly registered using a spatial transformation network to align the pixel position of the polyp in each frame with the reference frame, thus obtaining a spatially aligned ultrasound contrast image sequence.
7. The method according to claim 6, characterized in that, Following the step of obtaining the spatially aligned ultrasound contrast image sequence, the method further includes: Using the area of liver parenchyma adjacent to the polyp in the spatially aligned ultrasound contrast image sequence before the contrast agent arrives as the reference area, the average pixel intensity of each spatial position in the reference area in the first N frames is calculated as the baseline intensity map. The relative enhancement intensity of each frame in the spatially aligned ultrasound contrast image sequence is normalized using the baseline intensity map; the normalization calculation formula is: in Let be the pixel intensity at spatial location (x, y) in frame t. The pixel intensity at spatial location (x, y) in the baseline intensity map. To prevent small constants from being divided by zero, This represents the standardized relative strength.
8. A training method for a four-class classification model of gallbladder polyps, characterized in that, include: Obtain a training sample set; the training sample set contains multiple sets of training samples, each set of training samples includes grayscale ultrasound images, Doppler images, ultrasound contrast imaging image sequences and their corresponding gallbladder polyp pathological type labels. The grayscale ultrasound images, Doppler images, and contrast-enhanced ultrasound images in each training sample are input into the gallbladder polyp four-classification method as described in any one of claims 1 to 7, and the predicted probability distribution of the gallbladder polyps belonging to cholesterol polyps, inflammatory polyps, adenomatous polyps, and early gallbladder cancer is obtained through forward propagation. The loss value is calculated based on the predicted probability distribution and the pathology type label; The network parameters of the gallbladder polyp four-classification model are updated by backpropagation based on the loss value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 8.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 8.
