A multi-view bladder volume measurement method based on improved YOLO detection and positioning
By improving the multi-view bladder volume measurement method using YOLO detection and localization, and utilizing a joint neural network model for bladder ultrasound image preprocessing and scale detection, the problems of automation and accuracy in bladder volume measurement in existing technologies have been solved, achieving efficient and accurate bladder volume measurement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI TENTH PEOPLES HOSPITAL
- Filing Date
- 2026-06-24
- Publication Date
- 2026-07-24
AI Technical Summary
Existing methods for measuring bladder volume have problems such as being highly invasive, lacking accuracy, being highly dependent on physician experience, and being difficult to identify from multiple perspectives, making it difficult to achieve full automation and standardization.
An improved YOLO detection and localization method for multi-view bladder volume measurement was adopted. By combining a neural network model for bladder ultrasound image preprocessing, automatic classification and localization of the bladder region were achieved. Volume calculation and calibration were performed in conjunction with scale detection.
It improves the automation of bladder volume measurement, reduces reliance on physician experience, enhances measurement accuracy and robustness, adapts to different equipment and image quality, and meets clinical diagnostic needs.
Smart Images

Figure CN122453902A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and medical image processing, and specifically relates to a multi-view bladder volume measurement method based on improved YOLO detection and localization. Background Technology
[0002] Bladder volume measurement is an important examination procedure in clinical departments such as urology and emergency medicine. It is a method used to assess bladder function and related diseases, helping physicians determine whether bladder capacity and voiding function are normal, and whether there are problems such as urinary retention. As an important reference for modern medical diagnosis, accurate volume data plays an irreplaceable role in formulating treatment plans and monitoring postoperative recovery. Currently, the main methods for bladder volume measurement in clinical practice include catheterization and ultrasound measurement.
[0003] (1) Catheterization measurement. Catheterization measurement involves injecting maximum amount of normal saline into the patient's bladder and measuring the bladder capacity when the patient can no longer hold their urine. The amount of normal saline at this point represents the bladder capacity. Catheterization measurement is accurate, but as an invasive procedure, it causes significant pain to the patient and may lead to complications such as urethral mucosal damage and infection. Therefore, it is not suitable for frequent use as a routine monitoring method.
[0004] (2) Ultrasound measurement method. The ultrasound measurement method refers to measuring the amount of fluid in the bladder by scanning with an ultrasound scanner when the bladder is fully bladder-full. Specifically, the bladder is scanned by an ultrasound probe, and the length, width, and height of the bladder are measured using the ultrasound image. Then, the volume of the bladder is determined according to the ellipsoidal volume formula V=4. The volume is calculated as 3 × length × width × height. Ultrasound imaging technology is non-invasive, radiation-free, easy to operate, and repeatable. It is suitable for initial screening in outpatient settings and is currently the most widely used tool for bladder volume measurement in clinical practice.
[0005] While ultrasound imaging offers numerous advantages, its sensitivity and specificity vary considerably, leading to limited image resolution, blurred tissue boundaries, and complex noise interference, thus posing significant challenges to accurate diagnosis. Bladder volume estimation is heavily influenced by bladder morphology and relies heavily on the physician's experience and prior clinical knowledge. Furthermore, traditional methods have limitations in the automatic identification of multi-view sections and the detection and calibration of scales, hindering the achievement of efficient, accurate, and standardized fully automated volume measurement.
[0006] Therefore, how to effectively integrate deep learning algorithms to achieve automatic classification from multiple perspectives, automatic localization from various perspectives, and final volume calibration, while reducing reliance on physicians' personal experience, has become one of the important research directions and key technological development areas for automated bladder volume measurement and calibration based on ultrasound imaging.
[0007] Approximate Implementation Scheme In the field of medical target detection and quantitative assessment, the solution most similar in implementation logic to this invention is the Chinese invention patent CN 117911418B, entitled "A Lesion Detection Method, System, and Storage Medium Based on an Improved YOLO Algorithm." This method also addresses detection problems in medical images, improving upon the basic framework of YOLOv5. Its specific implementation steps are as follows: Step 1: Medical Image Acquisition and Lung Parenchyma Segmentation Preprocessing. First, raw lung CT image data is collected, and the DICOM format is converted to JPG format suitable for network training. Then, a pre-trained U-Net network model is used to perform preliminary segmentation of the medical images. Digital image processing techniques are used to connect the largest connected regions, thereby obtaining the complete lung parenchyma region of interest. Finally, a 10-fold data augmentation is performed using methods such as rotation, translation, mirroring, brightness transformation, and Gaussian blur to expand the training sample size.
[0008] Step 2: Improve the detection network construction and integrate multiple attention mechanisms. A deep neural network model integrating multiple attention mechanisms is constructed. In the backbone network, a bi-horizontal routing attention module (BiFormer module) is introduced based on YOLOv5. This module implicitly encodes positional information through 3×3 deep convolutions and applies a sparse sampling strategy to filter irrelevant key pairs, enhancing the extraction performance of small target features. In the head network, PANet and FPNet structures are adopted, and a SwinTransformer module is embedded. Its multi-head attention layers and residual connections capture global information and rich contextual information. For the loss function, a normalized Wasserstein distance loss function is introduced. Bounding boxes are modeled using a Gaussian distribution, and the second-order Wasserstein distance between the ground truth box and the predicted box is calculated to mitigate the differences between rectangles of different scales.
[0009] Step 3: Multi-scale Feature Extraction and Lesion Detection Evaluation. The enhanced dataset is input into the improved YOLO network for training. The backbone network ultimately outputs feature maps at three scales: 64×64, 32×32, and 16×16, which are then used by the head network for multi-scale feature processing. During the inference phase, the trained optimal model performs regression calculations on the CT images, identifying and labeling lesion locations using bounding boxes. The detection performance is evaluated based on metrics such as recall, precision, and mean precision.
[0010] From the perspective of device structure, this approximate solution consists of a medical image acquisition module, a deep neural network model construction module, and a detection module. These modules correspond to data segmentation and preprocessing, model architecture optimization integrating BiFormer and SwinTransformer, and the final lesion regression and quantitative evaluation logic, respectively.
[0011] Existing technologies often focus only on the target detection stage. Their core algorithms typically detect specific cross-sections based on prior knowledge. This results in a lack of ability to discriminate multi-view attributes (such as cross-sections and longitudinal sections), large detection errors, and poor target area localization. Furthermore, physicians who are not bladder specialists often struggle to accurately measure relevant data in actual clinical practice, requiring significant effort and preventing true end-to-end automation.
[0012] Furthermore, existing technologies also have shortcomings in terms of accuracy control in volume calculation. Due to differences in imaging parameters and sampling scaling ratios among different ultrasound devices, existing technologies often rely on manual input of scale parameters or specific device preset values, lacking an adaptive detection and calibration mechanism for scale information in the images; and the bladder morphology varies significantly under different filling states, making it difficult for the accuracy of the final generated volume values to meet the requirements of clinical-grade auxiliary diagnosis. Summary of the Invention
[0013] To address the problems existing in the prior art, the purpose of this invention is to realize an automated method that integrates multi-view ultrasound image recognition and bladder volume measurement, so as to reduce the reliance on professional prior knowledge and lower the operation threshold for non-professional physicians; at the same time, it ensures that the method can provide relatively objective diagnostic reference data under different equipment environments and image quality, thereby improving the scientific nature of assisted medical decision-making.
[0014] Technical solution A multi-view bladder volume measurement method based on improved YOLO detection and localization includes the following steps: Step 1: Preprocessing of bladder ultrasound image data We collected bladder ultrasound images containing both transverse and longitudinal sections; used image annotation tools to annotate the bladder regions in the images with bounding boxes and calibrated the scale area to record physical length information, thus constructing a training dataset with supervised labels; subsequently, we performed format standardization and digital sampling processing on the images, adjusting the resolution of all images to a uniform size to meet the input requirements of the neural network algorithm.
[0015] Step 2: Build a joint neural network model for viewpoint classification and bladder localization. A joint learning model based on an improved YOLO is constructed, comprising a classification sub-network and a detection sub-network. The classification sub-network extracts global features from the image and outputs the probability distribution of the cross-section category; the detection sub-network receives the original image, cross-section category labels, and feature information from the classification sub-network, accurately locates the bladder region, and outputs the bounding box coordinates. A feature extraction module for the classification sub-network and a feature fusion module between the two sub-networks are established, and a multi-task joint loss function is defined for model parameter updates.
[0016] Step 3: Cross-sectional and longitudinal section examination of bladder ultrasound imaging The images obtained after preprocessing in step 1 are input into the classification subnetwork of the joint neural network model for cross-sectional and longitudinal section category detection, outputting the original probability scores for the corresponding viewpoints of the two images. The model compares the scores, classifying the higher score as a longitudinal section and the lower score as a cross-section, thus determining the labels corresponding to the cross-sectional and longitudinal section images. Subsequently, the determined section category information and the original image pairs are input into the detection subnetwork to locate the bladder, obtaining the bounding box coordinates of the bladder in the section image and the detection confidence score.
[0017] Step 4: Scale Check Scale detection is performed by inputting the image into an improved detection subnetwork, identifying scale regions at the image edges, obtaining detection boxes, and calculating the image scale size based on the actual coordinates and image resolution.
[0018] Step 5: Bladder volume calculation and correction Based on the length and width of the cross-section obtained in step 3, and the height (slant diameter) of the longitudinal section, and combined with the scale coefficient obtained in step 4, the bladder volume is calculated. Finally, the bladder volume is calibrated, and the final bladder volume measurement result is output.
[0019] Beneficial effects Compared with the prior art, the method of the present invention has the following advantages: (1) Synergy of the multi-task joint architecture: This invention constructs an end-to-end joint learning framework that cascades the section classification task with the bladder localization task. By establishing a feature extraction and fusion module and introducing a multi-task joint loss function that includes classification, localization, and feature comparison, parameter synergy optimization among different sub-networks is achieved. This integrated design breaks the limitations of the independent operation of traditional single-task models, effectively avoids the cumulative error caused by step-by-step processing, and achieves efficient integration of the diagnostic process.
[0020] (2) Adaptability of multi-view classification: The multi-view automatic discrimination strategy proposed in this invention, based on the comparison of the original probability scores of the classification model, can effectively identify and distinguish the transverse and longitudinal attributes in ultrasound images. This scheme significantly enhances the robustness of the model when facing complex, multi-source medical data in the real world and lowers the operational threshold for non-bladder specialists.
[0021] (3) Accuracy of scale detection and volume correction: This invention achieves scale detection through a target detection model and, combined with a volume calibration mechanism, significantly improves the accuracy of measurement results. This scheme solves the problem of inconsistent scaling in imaging by different physicians or different ultrasound equipment, and compensates for deviations in the calculation formula through volume calibration. Experimental data show that on a clinical dataset containing 2000 groups, the model achieves a precision value of 93% and a mean accuracy (mAP) of 90% for bladder target detection, with an average inference time of only about 200 milliseconds. This demonstrates that the method possesses efficient real-time diagnostic performance while ensuring measurement accuracy. Attached Figure Description
[0022] Figure 1 This is a diagram of the multi-task joint architecture for perspective classification and bladder localization in this invention; Figure 2 This is a structural diagram of some modules of the improved YOLO model of the present invention; wherein, Figure 2 (a) is a structural diagram of the C2PSA-iAFF module. Figure 2 (b) is the structure diagram of the C3k2-iAFF module. Figure 2 (c) is the structure diagram of the C3k2-iAFF module. Figure 2 (d) is a structural diagram of the Bottleneck-iAFF module; Figure 3 This is the iterative attention feature fusion module of the present invention; wherein, Figure 3 (a) is the MS-CAM multi-scale channel attention module. Figure 3 (b) is the iAFF iterative attention feature fusion module; Figure 4 This is a diagram of the network architecture for scale detection in this invention; Figure 5 This is a schematic diagram of the original interface of the bladder size detection system provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the interface of the bladder size detection system provided in this embodiment of the invention after uploading an image; Figure 7 This is a schematic diagram of the predicted frame result interface after detection by the bladder size detection system provided in this embodiment of the invention; Figure 8 This is a schematic diagram of the volume measurement result interface after the bladder size detection system provided in this embodiment of the invention. Detailed Implementation
[0023] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0024] A multi-view bladder volume measurement method based on improved YOLO detection and localization, such as Figure 1 As shown, it includes the following steps: Step 1: Preprocessing of bladder ultrasound image data This embodiment first constructs a bladder ultrasound image dataset. The data samples cover transverse and longitudinal ultrasound images of the bladder from different patients.
[0025] To enable the model to accurately learn the morphological and positional characteristics of the bladder in transverse and longitudinal sections, the Labelimg image annotation tool was used to manually annotate the acquired ultrasound image data. Professional physicians used the preset horizontal rectangle tool in the Labelimg software to precisely select the bladder region.
[0026] After annotation, the software automatically generates annotations containing category information and bounding box location information, which serve as an important basis for model training. Each annotated target is mapped to a quintuple vector. ,in For category indexing, These represent the x and y coordinates of the center point of the bounding box, respectively. This indicates the width and height of the bounding box.
[0027] Simultaneously, this annotation tool was used to define rectangular bounding boxes for the scale regions in bladder ultrasound images. To ensure the accuracy of scale conversion, the longest side was consistently used as the reference during the annotation stage; that is, regardless of whether the scale is horizontally or vertically distributed in the image, the annotation box was based on its maximum extension direction. During the data preprocessing stage, the actual physical length corresponding to each annotation box was recorded. (Unit: centimeters)
[0028] Before inputting data into the model, a unified preprocessing operation is performed. The acquired images in various formats (such as PNG, JPG, BMP, etc.) are standardized and digitally sampled, and the resolution of all images is adjusted to the standard size of 224×224 to meet the input dimension requirements of the subsequent deep learning network.
[0029] Step 2: Build a joint neural network model for viewpoint classification and bladder localization. Joint neural network models include: classification subnetworks ( Figure 1 Top left), multi-scale feature extraction ( Figure 1 Left middle section), detection subnetwork ( Figure 1 (Top right)
[0030] The classification subnetwork uses the EfficientNet model for section attribute determination. The input is the pair of test images obtained after preprocessing in step 1, and the output is the section category label. The classification subnetwork is configured with nine cascaded processing stages. Stage 1 contains a 3×3 convolutional layer for initial feature extraction. Stages 2 to 8 consist of stacked Moving-Flip Bottleneck Convolutional Modules (MBConv). The internal structure of the MBConv module includes, in sequence: a 1×1 upscaling convolutional layer, a depthwise separable convolutional layer, a compression-activation network module (SE-Net), and a 1×1 downscaling convolutional layer. This module first expands the feature channels through upscaling convolution, then uses depthwise separable convolution and the SE-Net module for feature extraction and channel weight calculation, and finally compresses the feature channels through downscaling convolution to output the processed features. Stage 9 contains convolutional layers, pooling layers, and fully connected layers to map the extracted deep features to numerical values, outputting the original probability score of the image belonging to the longitudinal section category. By comparing paired images Value size, generate aspect category labels, score Larger input images are labeled "longitudinal section" and scored. Smaller input images are labeled "cross section".
[0031] Simultaneously, multi-scale feature extraction is performed, extracting the output features of the MBConv layer corresponding to stages 3, 5, and 7 as multi-scale feature sources. First, a 1×1 convolutional layer is used to align the feature maps of the three stages along the channel dimension. Then, upsampling is performed on the feature maps of stages 5 and 7 to make their spatial resolution consistent with that of the feature map of stage 3. Finally, the three aligned feature maps are concatenated along the channel dimension and fused through a convolutional layer to generate a fused feature map containing multi-scale contextual information, i.e., multi-scale fused features, for use by the subsequent detection sub-network.
[0032] After determining the cross-sectional attributes, the generated cross-sectional category labels and the original image to be tested are input together into the improved YOLO-V11 detection sub-network in the joint model to obtain the bounding box coordinates of the bladder in the cross-sectional image and the corresponding detection confidence.
[0033] Improve YOLO-V11 by using the same set of training data for both the detection and classification subnetworks.
[0034] The detection sub-network utilizes an improved YOLO-V11 deep learning algorithm, including the collaborative processing of the backbone network, neck network, and head network, to extract features from the preprocessed bladder ultrasound images.
[0035] Backbone Network: The backbone network includes Conv module, multi-level cascaded downsampling module and C3k2 module, fast spatial pyramid pooling (SPPF) module and C2PSA-iAFF module.
[0036] The image is first input to the Conv module, which includes a convolutional kernel, batch normalization, and an activation function. The convolutional kernel performs a sliding window scan on the image, weighted summing of local pixel regions to initially extract shallow geometric features such as the edge contours of the bladder wall and the texture of internal tissues. Batch normalization within the module improves the stability of the intermediate layer feature distribution; the activation function introduces non-linearity, enhancing the model's expressive power. After processing by the Conv module, the input image is converted into a feature map containing multi-channel shallow information.
[0037] Subsequently, the feature map enters a multi-level cascaded downsampling module and a C3k2 module (3 levels in this embodiment).
[0038] The downsampling is achieved through convolution (Conv k=3 s=2).
[0039] The C3k2 module (existing YOLO-V11 technology) divides the input features into two parts. One part is directly transmitted via residual connections, while the other part is transmitted through two cascaded C3k modules. Finally, the two parts of features are concatenated to extract deep features.
[0040] After being processed by a multi-stage cascaded downsampling module and C3k2 module, the resolution of the feature map is gradually reduced. The feature map is then input into the SPPF (Fast Spatial Pyramid Pooling) module, which uses max pooling of different sizes to globally fuse multi-scale local features, thereby outputting a uniform-sized feature map with contextual information.
[0041] The uniform-sized feature map output from the backbone network is input into the C2PSA-iAFF module along with the multi-scale fused features from the classification subnetwork.
[0042] like Figure 2As shown in (a), the C2PSA-iAFF module includes two processing units: a PSA attention (pointwise spatial attention) mechanism and an iterative attention feature fusion module iAFF. After the input features undergo preliminary convolution operations, while maintaining the height and width of the feature map, their total number of channels is equally divided into two parts, resulting in two parallel branches with half the number of channels. One part of the features is directly retained as the baseline features and passed to the concatenation module; the other part enters the PSA processing unit.
[0043] The PSA attention mechanism consists of two levels. It extracts multi-scale spatial information through convolutional kernels of different sizes and weights the feature channels to enhance the network's attention to targets at different scales. The features processed by PSA and the multi-scale fused features from the classification sub-network are used as input to the iterative attentional feature fusion (iAFF) module. Through the local and global attention iteration mechanism within iAFF, feature fusion of the two heterogeneous networks is achieved in both spatial and channel dimensions. The features fused by iAFF are then concatenated with the baseline features in the channel dimension, and a convolutional module is used for feature integration and dimensionality reduction, thereby completing the feature extraction of the backbone network.
[0044] Among them, the iAFF module is as follows Figure 3 As shown in (b), the processing procedure is as follows: First, the two input features are initially weighted and fused to obtain intermediate features: and These represent the features after two levels of PSA processing and the features from the classification subnetwork, respectively. This refers to the attention weight generation module MS-CAM (Multi-Scale Channel Attention Module), whose output range is within... between; This represents element-wise multiplication.
[0045] In the iAFF module's processing flow, the input features are first... and Add them together and input them into the attention weight generation module. Generate weights; then use these weights to extract elements. The characteristics of , using their complementary weights ( )extract The features are then analyzed, and finally, the two are added together to obtain the intermediate features of the initial fusion. .
[0046] Then, As input, the attention weights are recalculated to obtain the final fused features. : MS-CAM employs a dual-branch structure to process input features, then adds the two feature streams element-wise and activates them using a sigmoid function to generate channel attention weights, such as... Figure 3 As shown in (a).
[0047] Neck network: includes two cascaded upsampling and C3k2-iAFF modules (first C3k2-iAFF module and second C3k2-iAFF module) and two cascaded downsampling and C3k2-iAFF modules (third C3k2-iAFF module and fourth C3k2-iAFF module).
[0048] The neck network fuses the features extracted by the backbone network. The features output from the backbone network are input into a two-stage cascaded upsampling C3k2-iAFF module: the upsampling operation increases the resolution, aligning its spatial dimensions with the feature maps output from the middle layers of the backbone network. Then, it is concatenated with the features output from the last C3k2 module in the neck network, and input into the first C3k2-iAFF module for further fusion to obtain the fused features. The fused features are upsampled again, then concatenated with the features obtained from the second C3k2 module in the neck network, and finally passed through the second C3k2-iAFF module to complete the feature fusion.
[0049] The fused features are downsampled and reduced in size by convolution (Conv k=3 s=2), then concatenated with the fused features generated by the first C3k2-iAFF module, and then input into the third C3k2-iAFF module for processing.
[0050] The output of the third C3k2-iAFF module is downsampled again through convolution and concatenated with the output of the C2PSA-iAFF module in the backbone network before being input into the fourth C3k2-iAFF module for processing. The multi-scale features output from the second, third, and fourth C3k2-iAFF modules are then fed into the three detection heads of the head network, respectively.
[0051] This embodiment uses the C3k2-iAFF module in the aggregation path of the neck network, and its overall and internal nested structure is as follows: Figure 2 As shown in (b), (c), and (d), this module achieves deep feature extraction and attention fusion through a nested structure.
[0052] like Figure 2(b) The input features are first processed by a pre-convolution. Then, while maintaining the feature height and width, the total number of channels is equally divided into two parts, forming two parallel branches with half the number of channels. One branch is passed directly, retaining the original features and gradient information; the other branch passes through two cascaded C3k-iAFF modules sequentially. Finally, the features output from the two branches are concatenated with the features processed only by the pre-convolution, and then integrated and output through the final convolutional layer.
[0053] like Figure 2 (c) The C3k-iAFF module employs a residual structure. Features input to this module are first processed by a pre-layer CBS (Convolution-Batch Normalization-SiLU Activation) module. Subsequently, the features are divided into a backbone path and a residual path. In the backbone path, features are input to the core Bottleneck-iAFF unit for deep computation. In the residual path, features undergo no additional processing and are directly passed to the concatenation module. Finally, the two feature paths are concatenated along the channel dimension, and the integrated features are output again through the CBS module.
[0054] like Figure 2 (d) The Bottleneck-iAFF unit employs a residual structure with an attention mechanism. The feature flow entering this unit is divided into a backbone path and a residual path. In the backbone path, features are first sequentially processed through two cascaded CBS modules to extract local spatial features; subsequently, the features are continuously fed into two cascaded iAFF modules. Utilizing the local and global attention iteration mechanism within the iAFF, the network can adaptively redistribute weights for the current features, enhancing its ability to perceive multi-scale targets. In the residual path, the original input features are directly passed as input to the iAFF module. Finally, the deep fusion features output from the backbone path are element-wise added to the original features retained by the residual path to output the final features.
[0055] Head Network: The head network is the output part of the model, containing three detection heads (existing technology in YOLO-V11), which are respectively connected to the second, third, and fourth C3k2-iAFF modules in the neck network, receiving fused features at high, medium, and low resolution scales. The detection heads are responsible for regressing the bounding box of the target location and calculating the confidence score of the bladder within the bounding box. Finally, by combining the multi-scale detection results, the coordinates of the bladder and the corresponding confidence score are output.
[0056] During the network parameter update phase, the model constructs a model based on the classification focus loss. Comparative loss Dice loss and positioning focus loss The composite loss function is composed of all these components.
[0057] Specifically as follows: To make the predicted probability distribution of the classification subnetwork approximate the true distribution of manually labeled data, a focus loss function is used as part of the objective function for optimization. For each training sample, the difference between the predicted score and the true facet attribute is minimized using the backpropagation algorithm. Its mathematical expression is as follows: in, This represents the average loss value of the current training batch; This represents the total number of samples in the current training batch. For the first The true cross-sectional label of the image is defined as the longitudinal section. The cross-section is ; The first output of the model represents the... The original probability score of the image belonging to the longitudinal section has a value range of [value range missing]. interval; This is a class balancing factor used to adjust the weights of positive and negative samples, with a value range of [value missing]. ; For focusing parameters, and This parameter is adjusted or The numerical value of the term reduces the model's loss contribution to easily classified samples, thereby forcing the model to focus on learning difficult-to-classify samples during training.
[0058] To further enhance the classification subnetwork's ability to discriminate cross-sectional and longitudinal features, and to ensure that its extracted features exhibit higher inter-class separability and intra-class compactness in the vector space, this embodiment introduces a contrastive loss function as an auxiliary optimization objective. First, the global feature vector before the fully connected layer of the EfficientNet classification subnetwork is extracted. For any image pair in the training batch, the Euclidean distance between their feature vectors is calculated. Based on the label consistency of the image pairs, the model constrains the feature distribution through the contrastive loss function: when image pairs belong to the same viewpoint, the feature distance is minimized to cluster them in the feature space; when image pairs belong to different viewpoints, the feature distance is maximized to distance them from each other, until a preset marginal threshold is exceeded. Its mathematical expression is defined as follows: in, This represents the average contrastive loss value of the current training batch; The total number of sample pairs constructed; Indicates the first Euclidean distance between sample feature vectors; For the first Similarity labels for samples: when two images belong to the same physical slice category, a similarity label is defined. When belonging to different categories, define ; This is a preset marginal threshold used to control the minimum distance at which outlier samples are separated in the feature space. When the distance between outlier samples exceeds... When this happens, the loss is reduced to zero, thus preventing the model from over-optimizing the already well-separated samples.
[0059] The Dice loss function is used as one of the optimization objectives of the localization sub-network. This loss function aims to maximize the overlap between the predicted detection box region and the ground truth labeled region, thereby guiding the network to output a more accurate bladder boundary. The pixel-level overlap between the predicted boxes output by the detection sub-network and the manually labeled regions is calculated. For each sample in the training batch, the mathematical expression of the Dice loss function is defined as follows: in, This represents the Dice loss value for the current sample, and its value ranges from 1 to 2. ; This represents the total number of pixels in the image; The model predicts the first... The probability value of each pixel belonging to the bladder region, with a value range of [value]. ; Indicates the first The true label value of each pixel, when the pixel belongs to the bladder region. ,otherwise ; The smoothing coefficient is a very small positive number to prevent the denominator from being zero, which would lead to computational instability. It also smooths the loss value when both the prediction set and the true set are empty.
[0060] Because the bladder boundary is ambiguous in ultrasound images, this invention introduces a focus localization loss function to prevent severe foreground-background class imbalance and uneven distribution of easy and difficult samples during network training. This loss function no longer simply calculates the average error of all pixels, but instead introduces a dynamic weighting factor to reduce the weight of a large number of simple background pixels in gradient backpropagation, forcing the model to focus on optimizing those difficult-to-distinguish boundary pixels and small foreground regions. Its mathematical expression is defined as follows: in, This represents the localization focus loss value of the current image in the detection task; and These represent the height and width of the output image, respectively. Indicates the first The true label value of each pixel, when the pixel belongs to the bladder region. ,otherwise ; The model predicts the first... The probability value of each pixel belonging to the bladder region, with a value range of [value]. ; This is a balancing factor used to adjust the proportion of positive and negative samples (foreground and background) contributing to the total loss; For focusing parameters.
[0061] Finally, the model iteratively updates its parameters by minimizing the weighted sum of the four loss functions mentioned above, and its total loss is... satisfy: in, , , and These are the weight coefficients for the four loss functions.
[0062] Preprocessed bladder ultrasound images are used as input to a joint neural network model. Through learning from this data, the loss value is calculated, and the network parameters are continuously adjusted using the backpropagation algorithm, making the model's predictions increasingly closer to the actual labeled results. After training, a joint neural network model capable of being used for viewpoint classification and bladder localization is obtained.
[0063] Step 3: Cross-sectional and longitudinal section examination of bladder ultrasound imaging During the model inference phase, the uploaded paired bladder ultrasound images were analyzed. First, the classification subnetwork is used to extract features from the two images respectively, and the corresponding original predicted probability scores are output, denoted as... and To reduce model ambiguity, the model compares scores, classifying higher-scoring images as longitudinal sections and lower-scoring images as cross sections, thus determining the labels corresponding to the longitudinal and cross section images. Aspect attribute tags Define the following piecewise function: Accordingly, image The tag was automatically identified as .
[0064] Subsequently, the determined section category labels are concatenated with the original test image and input into the improved YOLO-V11 detection sub-network. This sub-network performs feature encoding and regression analysis on the image based on prior classification information, obtaining a series of output information, which further provides parameters for subsequent bladder volume calculation. Output category index This is used to indicate that the detection target is "bladder"; the coordinates of the bladder are output as a bounding box. Output predicted score , representing the confidence level that the target exists.
[0065] Step 4: Scale Check The detection model architecture used in this step is consistent with the improved YOLO-V11 detection subnetwork in step 2 above, and its model architecture is as follows: Figure 4 As shown. When the improved YOLO-V11 detection subnetwork outputs the predicted bounding box coordinates of the scale region. Next, the pixel differences between the bounding box along the horizontal and vertical axes are calculated, and the larger value is selected as the effective pixel length. : Combined with the preset physical length constant Derive the current scale coefficient (Unit: cm / pixel): in, The actual physical length (in centimeters) corresponding to the scale marking frame.
[0066] Step 5: Bladder volume calculation and correction Based on the length and width of the cross-section obtained in step 3, and the height (slant diameter) of the longitudinal section, and combined with the scale coefficient obtained in step 4, the bladder volume is calculated. Finally, the bladder volume is corrected according to the standard volume calibration threshold, and the final bladder volume measurement result is output.
[0067] Based on the classification results of step 3, the corresponding image features are extracted. Images labeled with Label 0 are identified as cross-sections, and images labeled with Label 1 are identified as longitudinal sections. The pixel length of the bladder is extracted from the cross-sectional images. and pixel width Extract the pixel height (i.e., oblique diameter) of the bladder from the longitudinal section image. Combined with the scale coefficient obtained in step 4. Convert the above pixel measurements to actual physical dimensions: The original volume prediction value is then calculated by multiplying the three values. (Unit: cubic centimeters): right Corrections were made to compensate for deviations in the ellipsoid calculation formula. The final volume measurement result after calibration. (Unit: cubic centimeters) The following piecewise function is used for calculation: When the original volume prediction value When the value is greater than 300, the bladder is considered to be in a distended state, and overestimation is mitigated by multiplying by a calibration factor of 0.52; when the original volume prediction value is... When the value is less than 200, the bladder is considered to be in a contracted or partially filled state. In this case, the boundary identification error is relatively large and is corrected by multiplying by a calibration factor of 0.75. At 200 When the value is in the range of 300, calculate and output the volume range value under the correction of two coefficients.
[0068] Method application: All experiments in this invention were performed on two NVIDIA RTX 3090 GPUs. During model training, the batch size was set to 4, the AdamW optimizer was used, the initial learning rate was configured to 1e-3, and a cosine learning rate decay mechanism was employed to minimize the total loss function. The specific values of the hyperparameters for this method are shown in Table 1.
[0069] Table 1. Value settings for various hyperparameters in this invention Dataset: The experiment was conducted on the dataset from Shanghai Tenth People's Hospital for both training and validation. The data statistics are shown in Table 2 below. Table 2 presents the statistics of the training and validation sets in this embodiment: Table 2. Statistical information of the dataset in this embodiment. Comparison of effects: Comparison 1 The ablation experiment results for the improved YOLO feature fusion module are shown in Table 2. This embodiment compares the detection performance of the original architecture and the feature fusion strategy based on C2PSA-iAFF and C3k2-iAFF of this invention in the detection sub-network. Both use the joint architecture and loss function of this invention, and the evaluation metrics are Precision and mAP (mean average accuracy), calculated as follows: in, (True Positives) represents the number of samples where the intersection-union ratio (IU) between the predicted bounding box and the ground truth bounding box is greater than or equal to a set threshold (0.5); (False Positives) represents the number of extra samples where the intersection-union ratio (IoU) between predicted and ground truth bounding boxes is less than a set threshold; these are the false positives. AP (Average Precision) is the average precision calculated at different recall thresholds. The formula for recall is: in, (False Negatives) represents the number of samples where the model failed to detect bladder targets, i.e., the number of missed detections. The area under the curve (AP) is calculated by plotting a Precision-Recall curve. mAP is the average AP across multiple classes, i.e.: This indicates the total number of categories of the detected targets. Indicates the first The average accuracy for each category. In this embodiment, mAP@0.5 refers to the average accuracy calculated when the intersection-union ratio threshold is strictly set to 0.5, indicating that as long as the overlap between the predicted bounding box and the ground truth bounding box reaches 50%, the detection can be considered correct.
[0070] As can be seen from Table 3, the feature fusion method based on iterative attention mechanism of this invention has a stronger ability to capture fuzzy boundaries when the detection model is trained using the same architecture.
[0071] Table 3 Ablation experiments for feature fusion strategies Comparison 2 This embodiment conducted a comparative experiment on network architecture, comparing the end-to-end detection method using a single YOLO network directly with the joint learning strategy of this invention, which uses EfficientNet as a classification sub-network to extract prior features and guides the detection sub-network through the feature channel. Both methods also used the improved C3k2-iAFF feature fusion module of this invention. As shown in Table 4, the multi-task joint learning method of this invention is intuitively superior to the conventional single-network detection method in terms of detection precision and mAP.
[0072] Table 4 Ablation experiments for joint network architecture Comparison 3 This embodiment conducted a comparative experiment on the final bladder volume measurement and calibration method, comparing the ellipsoid formula calculation method with the strategy of correcting the model's predicted volume using piecewise calibration. As shown in Table 5, the volume calibration method of this invention outperforms existing measurement methods in terms of Mean Relative Error (MRE) and Root Mean Square Error (RMSE). The mathematical formulas are defined as follows: in, This represents the total number of test samples participating in the evaluation; Indicates the system's response to the first... The bladder volume values predicted and calculated for each sample; Indicates the first The actual bladder volume value corresponding to each sample.
[0073] Table 5 Ablation experiments for volumetric measurement methods Example Based on this invention, a bladder volume measurement software using an improved YOLO detection and localization multi-view bladder volume measurement method is provided, with the interface shown below. Figure 5 As shown, the operation process is as follows: (1) The upper left corner of the interface is the file upload area. Users need to upload one cross-sectional and one longitudinal section ultrasound image respectively.
[0074] (2) The lower left corner of the interface is the detection setting area. The default scale value is set to 0. When the scale value is 0, the system will automatically activate the scale detection program in the backend to realize the automatic detection of the scale. If the user manually enters a specific scale value, the system will skip the detection step and perform subsequent conversion operations based on the entered scale.
[0075] (3) After the user imports the ultrasound image, the file upload area will display the filename of the uploaded image, and the preview of the original ultrasound image will be displayed synchronously in the effect display section on the right side of the interface. The user can operate on the preview image through the "zoom" and "reset" functions in this area, such as... Figure 6 As shown.
[0076] (4) After the user clicks the “Start Detection” button in the detection settings area, the system uses the method of the present invention to measure the bladder size.
[0077] (5) After the measurement is completed, a "Processed" label will be displayed next to the corresponding image in the file upload area; the effect display area will display the ultrasound image with the predicted bounding box. Figure 7Simultaneously outputting detection and calculation results, including: the scale of automatic detection or user input, the cross-sectional type corresponding to the two images, the cross-sectional dimensions (length, width), the longitudinal dimensions (oblique diameter), and the calibrated bladder volume calculation results, such as... Figure 8 As shown.
[0078] The above description is merely a description of preferred embodiments of this application and is not intended to limit the scope of this application in any way. Any changes or modifications made by those skilled in the art based on the above-disclosed technical content should be considered as equivalent and valid embodiments and fall within the scope of protection of the technical solution of this application.
Claims
1. A multi-view bladder volume measurement method based on improved YOLO detection and localization, characterized in that, Includes the following steps: Step 1: Preprocessing of bladder ultrasound image data We collected bladder ultrasound images containing both transverse and longitudinal sections; used image annotation tools to annotate the bladder regions in the images with bounding boxes and calibrated the scale area to record physical length information, thus constructing a training dataset with supervised labels; subsequently, we performed format standardization and digital sampling processing on the images, adjusting the resolution of all images to a uniform size. Step 2: Build a joint neural network model for viewpoint classification and bladder localization. Build a joint learning model based on the improved YOLO, including a classification subnetwork and a detection subnetwork; The classification subnetwork is used to extract global features of the image and output the probability distribution of the cross-section category; the detection subnetwork is used to receive the original image, cross-section category labels and feature information from the classification subnetwork, accurately locate the bladder region and output the bounding box coordinates; a feature extraction module for the classification subnetwork and a feature fusion module between the two subnetworks are established, and a multi-task joint loss function for updating model parameters is defined; Step 3: Cross-sectional and longitudinal section examination of bladder ultrasound imaging The images obtained after preprocessing in step 1 are input into the classification subnetwork of the joint neural network model to perform cross-sectional and longitudinal section category detection, and the original probability scores of the corresponding viewpoints of the two images are output respectively. The model compares the scores and identifies the high-scoring images as longitudinal sections and the low-scoring images as transverse sections, thus determining the labels corresponding to the transverse and longitudinal section images. Subsequently, the determined section category information and the original image are input into the detection sub-network to locate the bladder, and the bounding box coordinates of the bladder in the section image and the detection confidence are obtained. Step 4: Scale Check Perform scale detection by inputting the image into the improved detection subnetwork, identifying the scale region of the image edge, obtaining the detection box, and calculating the scale size of the image based on the actual coordinate position and image resolution; Step 5: Bladder volume calculation and correction Based on the length and width of the cross section obtained in step 3, and the height of the longitudinal section, and combined with the scale coefficient obtained in step 4, the bladder volume is calculated; finally, the bladder volume is calibrated, and the final bladder volume measurement result is output.
2. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 1, characterized in that, Step 1 specifically involves: First, a bladder ultrasound image dataset was constructed, with data samples covering transverse and longitudinal ultrasound images of the bladder of different patients. The acquired ultrasound image data were manually annotated using the Labelimg image annotation tool; professional physicians used the preset horizontal rectangle tool in the Labelimg software to select the bladder region. After annotation, the software automatically generates annotations containing category information and bounding box location information, which serve as the basis for model training; each annotated target is mapped to a quintuple vector. ,in For category indexing, These represent the x and y coordinates of the center point of the bounding box, respectively. Indicates the width and height of the bounding box; At the same time, the scale area in the bladder ultrasound image was marked with a rectangular box using the annotation tool; Record the actual physical length corresponding to each annotation box. ; Before inputting data into the model, a unified preprocessing operation is performed: the acquired images of various formats are standardized and digitally sampled, and the resolution of all images is adjusted to the standard size of 224×224 to meet the input dimension requirements of the subsequent deep learning network.
3. The multi-view bladder volume measurement method based on improved YOLO detection and localization as described in claim 1, characterized in that, Step 2 specifically involves: The joint neural network model includes: a classification subnetwork, a multi-scale feature extraction subnetwork, and a detection subnetwork; The classification subnetwork uses the EfficientNet model for cross-section attribute determination. The input is the test image pair obtained after preprocessing in step 1, and the output is the cross-section category label. The classification subnetwork is configured to include nine cascaded processing stages; Stage 1 consists of a 3×3 convolutional layer for initial feature extraction. Stages 2 through 8 are composed of stacked shift-flip bottleneck convolutional modules (MBConv). The internal structure of the MBConv module includes, in sequence, a 1×1 upscaling convolutional layer, a depthwise separable convolutional layer, a compression-activation network (SE-Net) module, and a 1×1 downscaling convolutional layer. This module first expands the feature channels through upscaling convolution, then uses depthwise separable convolution and the SE-Net module for feature extraction and channel weight calculation, and finally compresses the feature channels through downscaling convolution to output the processed features. Stage 9 includes convolutional layers, pooling layers, and fully connected layers to map the extracted deep features into numerical values, outputting the raw probability score of the image belonging to the longitudinal section category. By comparing paired images Value size, generate aspect category labels, score Large input images are labeled "longitudinal section" and scored. Small input images are labeled "cross-section"; Multi-scale feature extraction is performed, extracting the output features of the MBConv layer corresponding to stages 3, 5, and 7 as multi-scale feature sources. First, a 1×1 convolutional layer is used to align the feature maps of stages 3, 5, and 7 along the channel dimension. Then, an upsampling operation is performed on the feature maps of stages 5 and 7 to make their spatial resolution consistent with that of the feature map of stage 3. Finally, the three sets of aligned feature maps are concatenated along the channel dimension and fused through a convolutional layer to generate multi-scale fused features for use by the subsequent detection sub-network. After determining the cross-sectional attributes, the generated cross-sectional category labels and the original image to be tested are input into the detection sub-network in the joint model to obtain the bounding box coordinates of the bladder in the cross-sectional image and the corresponding detection confidence. The detection subnetwork and the classification subnetwork use the same set of training data.
4. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 3, characterized in that, The detection sub-network utilizes an improved YOLO-V11 deep learning algorithm, including the collaborative processing of the backbone network, neck network, and head network, to extract features from the preprocessed bladder ultrasound images. The backbone network includes Conv modules, multi-level cascaded downsampling modules and C3k2 modules, fast spatial pyramid pooling SPPF modules and C2PSA-iAFF modules; The image is first input to the Conv module, which includes a convolution kernel, batch normalization and activation function; the convolution kernel is used to perform a sliding window scan on the image, and the local pixel regions are weighted and summed to initially extract the edge contour of the bladder wall and the shallow geometric features of the internal tissue texture; Batch normalization within the module improves the stability of the intermediate layer feature distribution; The activation function introduces nonlinear factors to enhance the model's expressive power; after processing, the input image is converted into a feature map containing multi-channel shallow information. Subsequently, the feature map is input into a 3-level cascaded downsampling module and a C3k2 module; The module downsampling is achieved through convolution Conv k=3 s=2; The C3k2 module divides the input features into two parts. One part is directly transmitted through the residual connection, and the other part is transmitted through two cascaded C3k modules. Finally, the two parts of features are concatenated to extract deep features. After being processed by a multi-stage cascaded downsampling module and C3k2 module, the resolution of the feature map is gradually reduced. The feature map is then input into the fast spatial pyramid pooling (SPPF) module, which uses max pooling of different sizes to globally fuse multi-scale local features, thereby outputting a uniform-size feature map with contextual information. The C2PSA-iAFF module inputs uniform-sized feature maps with multi-scale fused features from the classification sub-network; The C2PSA-iAFF module includes two processing units: a PSA attention mechanism and an iterative attention feature fusion module iAFF. After the input features undergo preliminary convolution operations, while keeping the height and width of the feature map unchanged, the total number of channels is equally divided into two parts, thus obtaining two parallel branches with half the number of channels. Some features are directly retained as baseline features and passed to the stitching module; the other part enters the PSA processing unit. The PSA attention mechanism consists of two levels. It extracts multi-scale spatial information through convolutional kernels of different sizes and weights the feature channels to enhance the network's attention to targets at different scales. The features processed by PSA and the multi-scale fused features from the classification sub-network are used as inputs to the iAFF (Iterative Attention Feature Fusion) module. Through the local and global attention iteration mechanism inside iAFF, the features of the two heterogeneous networks are fused in the spatial and channel dimensions. The features fused by iAFF are concatenated with the baseline features in the channel dimension, and then a convolution module is used for feature integration and dimensionality reduction, thereby completing the feature extraction of the backbone network.
5. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 4, characterized in that, The neck network includes two cascaded upsampling and C3k2-iAFF modules, namely the first C3k2-iAFF module and the second C3k2-iAFF module, and two cascaded downsampling and C3k2-iAFF modules, namely the third C3k2-iAFF module and the fourth C3k2-iAFF module. The features output from the backbone network are input to a two-stage cascaded upsampling and C3k2-iAFF module: the upsampling operation increases the resolution, aligning its spatial dimensions with the feature maps output from the middle layers of the backbone network. Then, it is concatenated with the features output from the last C3k2 module in the neck network, and input to the first C3k2-iAFF module for further fusion to obtain fused features. The fused features are then upsampled again, concatenated with the features obtained from the second C3k2 module in the neck network, and then passed through the second C3k2-iAFF module to complete feature fusion. The fused features are downsampled and reduced in size by convolution Conv k=3 s=2, and then concatenated with the fused features generated by the first C3k2-iAFF module. Finally, they are input into the third C3k2-iAFF module for processing. The output of the third C3k2-iAFF module is downsampled again through convolution, concatenated with the output of the C2PSA-iAFF module in the backbone network, and then input into the fourth C3k2-iAFF module for processing. The multi-scale features output by the second, third, and fourth C3k2-iAFF modules are respectively fed into the three detection heads of the head network; Head network: The head network is the output part of the model, which contains three detector heads that are respectively connected to the second, third and fourth C3k2-iAFF modules in the neck network, and receive fused features at three different resolution scales: high, medium and low. The detection head is responsible for regressing the target's location bounding box and calculating the confidence score of the bladder within that bounding box. Finally, it integrates the multi-scale detection results and outputs the coordinates of the bladder and the corresponding confidence score.
6. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 5, characterized in that, The C3k2-iAFF module achieves deep feature extraction and attention fusion through a nested structure; The input features are first processed by a pre-convolution. Then, while keeping the feature height and width unchanged, the total number of channels is equally divided into two parts, thus forming two parallel branches with half the number of channels. One branch is passed directly, retaining the original features and gradient information. The other branch passes through two cascaded C3k-iAFF modules in sequence. Finally, the features output from the two branches are concatenated with the features processed only by the pre-convolution, and then integrated and output through the final convolutional layer. The C3k-iAFF module adopts a residual structure. The features input to this module are processed by a pre-processing CBS module. Subsequently, the features are divided into a backbone path and a residual path. In the backbone path, the features are input to the core Bottleneck-iAFF unit for deep computation. In the residual path, the features are directly passed to the splicing module without additional processing. Finally, the two features are spliced in the channel dimension and the integrated features are output again through the CBS module. The Bottleneck-iAFF unit employs a residual structure with an attention mechanism. The feature flow entering this unit is divided into a main path and a residual path. In the main path, features are first sequentially extracted into spatial local features by two cascaded CBS modules. Subsequently, the features are continuously fed into two cascaded iAFF modules. In the residual path, the original input features are directly passed to the iAFF modules as input. Finally, the deep fusion features output from the main path are added element-wise to the original features retained by the residual path to output the final features.
7. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 3, characterized in that, The joint neural network model, during the network parameter update phase, constructs a model based on classification focus loss. Comparative loss Dice loss and positioning focus loss The composite loss function is composed of all these components. Specifically as follows: For each training sample, the difference between the predicted score and the true cross-sectional attribute is minimized using the backpropagation algorithm; its mathematical expression is as follows: in, This represents the average loss value of the current training batch; This represents the total number of samples in the current training batch. For the first The true cross-sectional label of the image is defined as the longitudinal section. The cross-section is ; The first output of the model represents the... The original probability score of the image belonging to the longitudinal section has a value range of [value range missing]. interval; This is a class balancing factor used to adjust the weights of positive and negative samples, with a value range of [value missing]. ; For focusing parameters, and This parameter is adjusted or The numerical value of the item reduces the model's loss contribution to easily classified samples, thereby forcing the model to focus on learning difficult-to-classify samples during training; A contrastive loss function is introduced as an auxiliary optimization objective: First, the global feature vector before the fully connected layer of the EfficientNet classification sub-network is extracted; for any image pair in the training batch, the Euclidean distance between their feature vectors is calculated; based on the label consistency of the image pair, the model constrains the feature distribution through the contrastive loss function: when image pairs belong to the same viewpoint, they are clustered in the feature space by minimizing the feature distance; when image pairs belong to different viewpoints, they are moved away from each other by maximizing the feature distance until a preset marginal threshold is exceeded; its mathematical expression is defined as follows: in, This represents the average contrastive loss value of the current training batch; The total number of sample pairs constructed; Indicates the first Euclidean distance between sample feature vectors; For the first Similarity labels for samples: when two images belong to the same physical slice category, a similarity label is defined. When belonging to different categories, define ; This is a preset marginal threshold used to control the minimum distance at which outlier samples are separated in the feature space; The Dice loss function aims to maximize the overlap between the predicted detection bounding box and the ground truth labeled region, thereby guiding the network to output a more accurate bladder boundary. The overlap between the predicted bounding box output by the detection sub-network and the manually labeled region is calculated at the pixel level. For each sample in the training batch, the mathematical expression of the Dice loss function is defined as follows: in, This represents the Dice loss value for the current sample, and its value ranges from 1 to 2. ; This represents the total number of pixels in the image; The model predicts the first... The probability value of each pixel belonging to the bladder region, with a value range of [value]. ; Indicates the first The true label value of each pixel, when the pixel belongs to the bladder region. ,otherwise ; For smoothing coefficients; Instead of introducing a localization focus loss function, this method uses a dynamic weighting factor to reduce the weight of simple background pixels in gradient backpropagation, forcing the model to focus on optimizing indistinguishable boundary pixels and small foreground regions; its mathematical expression is defined as follows: in, This represents the localization focus loss value of the current image in the detection task; and These represent the height and width of the output image, respectively. Indicates the first The true label value of each pixel, when the pixel belongs to the bladder region. ,otherwise ; The model predicts the first... The probability value of each pixel belonging to the bladder region, with a value range of [value]. ; This is a balancing factor used to adjust the proportion of positive and negative samples contributing to the total loss. For focusing parameters; Finally, the model iteratively updates its parameters by minimizing the weighted sum of the above loss functions, and its total loss is... satisfy: in, , , and These are the weight coefficients for each loss function; Preprocessed bladder ultrasound images are used as input to a joint neural network model. By learning from these data, the loss value is calculated, and the backpropagation algorithm is used to continuously adjust the network parameters so that the model's prediction results are increasingly close to the actual labeled results. After training, a joint neural network model that can be used for view classification and bladder localization is obtained.
8. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 1, characterized in that, Step 3 specifically involves, during the model inference phase, analyzing the uploaded paired bladder ultrasound images... First, the classification subnetwork is used to extract features from the two images respectively, and the corresponding raw predicted probability scores are output, denoted as... and By comparing the scores, the images with higher scores are identified as longitudinal sections, and those with lower scores as transverse sections. Labels are then assigned to the corresponding transverse and longitudinal section images. Aspect attribute tags Define the following piecewise function: Accordingly, the image The tag was automatically identified as ; Subsequently, the determined section category label and the original image to be tested are concatenated and input into the detection sub-network. Based on the classification prior information, the image is subjected to feature encoding and regression analysis to obtain output information, which provides parameters for subsequent bladder volume calculation. The output includes: category index This is used to indicate that the detection target is "bladder"; the coordinates of the bladder are output as a bounding box. Output predicted score , representing the confidence level that the target exists.
9. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 1, characterized in that, Step 4 specifically involves: The detection subnetwork's detection head outputs the predicted bounding box coordinates of the scaled region. Next, the pixel differences between the bounding box along the horizontal and vertical axes are calculated, and the larger value is selected as the effective pixel length. : Combined with the preset physical length constant Derive the current scale coefficient : in, This is the actual physical length corresponding to the scale label frame.
10. The multi-view bladder volume measurement method based on improved YOLO detection and localization according to claim 1, characterized in that, Step 5 specifically involves: Based on the length and width of the cross section obtained in step 3, and the height of the longitudinal section, and combined with the scale coefficient obtained in step 4, the bladder volume is calculated. Then, the bladder volume is corrected according to the standard volume calibration threshold, and the final bladder volume measurement result is output. Extracting the pixel length of the bladder from a cross-sectional image and pixel width Extract the pixel height, i.e., the slant diameter, of the bladder from the longitudinal section image. Combined with scale factor Convert pixel measurements to actual physical dimensions: The original volume prediction value is then calculated by multiplying the three values. : right Corrections were made to compensate for deviations in the ellipsoid calculation formula, resulting in the final calibrated volume measurement result. The following piecewise function is used for calculation: When the original volume prediction value When the value is greater than 300, the bladder is considered to be in a distended state, and overestimation is mitigated by multiplying by a calibration factor of 0.52; when the original volume prediction value is... When the value is less than 200, the bladder is considered to be in a contracted or partially filled state. In this case, the boundary identification error is relatively large and is corrected by multiplying by a calibration factor of 0.
75. At 200 When the value is in the range of 300, calculate and output the volume range value under the correction of two coefficients.