A two-stage lightweight network-based pleural and abdominal effusion detection and segmentation method
By using a two-stage lightweight network framework, combined with SL-YOLO and SLNet models, the problem of balancing accuracy and computational efficiency in existing technologies is solved. This enables efficient and accurate detection and segmentation of pleural and peritoneal effusions in low-resource environments, improving diagnostic efficiency and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- THE NAVAL MEDICAL UNIV OF PLA
- Filing Date
- 2026-02-11
- Publication Date
- 2026-07-31
AI Technical Summary
Existing deep learning models suffer from several problems in detecting and segmenting pleural and peritoneal effusions: difficulty in balancing accuracy and computational efficiency, high algorithm complexity leading to challenges in clinical deployment, and insufficient robustness. In particular, their generalization ability is limited in small targets and low-contrast regions, making it difficult to meet the real-time diagnostic needs of low-resource environments.
A two-stage lightweight network is adopted. In the first stage, the SL-YOLO detection model is used to locate the liquid accumulation region. In the second stage, a lightweight improved SLNet segmentation model is used for accurate segmentation. Through structures such as multi-kernel depthwise separable convolution, gated network and region-aware decoding layer, the computational complexity is reduced and the segmentation accuracy is maintained.
It enables efficient and accurate detection and segmentation of pleural and peritoneal effusions in low-resource environments, significantly improving diagnostic efficiency and robustness, reducing false positive and false negative rates, and adapting to the real-time diagnostic needs of various clinical environments.
Smart Images

Figure CN122023374B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image analysis technology, and in particular to a method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network. Background Technology
[0002] Pleural and peritoneal effusions are common clinical conditions referring to the accumulation of abnormal fluid in the pleural or abdominal cavities, often associated with diseases of organs such as the heart, liver, kidneys, and lungs. Timely and accurate detection and segmentation of pleural and peritoneal effusions are crucial for disease diagnosis, treatment planning, and prognosis assessment. Traditional methods of detecting pleural and peritoneal effusions rely on manual image analysis, with doctors manually identifying the effusion area based on imaging features. This method is not only time-consuming but also limited by the doctor's experience and skill level, easily leading to subjective and inconsistent diagnostic results.
[0003] With the development of medical imaging technology, especially the widespread application of ultrasound imaging in the detection of pleural and peritoneal effusions, imaging methods have provided more accurate diagnostic evidence. However, effusion areas in ultrasound images often exhibit low contrast and blurred boundaries, and appear as small targets in multi-phase or dynamic scans. This means that existing pleural and peritoneal effusion detection techniques largely rely on manual annotation or semi-automated auxiliary tools, resulting in low efficiency and cumbersome operation. Therefore, improving the automation level of pleural and peritoneal effusion detection and segmentation, reducing the workload of physicians, and enhancing diagnostic efficiency have become urgent problems to be solved.
[0004] In recent years, the rapid development of deep learning and computer vision technologies has provided new solutions for medical image analysis. Automated image analysis methods based on deep learning models such as convolutional neural networks (CNNs) have made significant progress in the detection and segmentation of pleural and peritoneal effusions. These methods can accurately identify pleural and peritoneal effusion regions by automatically learning image features, thereby improving detection efficiency and accuracy. However, existing deep learning models still face several core problems: First, it is difficult to balance accuracy and computational efficiency, and most high-precision models cannot meet the needs of real-time clinical processing; second, the high complexity of the algorithms leads to difficulties in clinical deployment, and there is a lack of lightweight designs for low-resource environments; finally, the models lack robustness, and their generalization ability is limited, especially for small targets and low-contrast regions, when faced with diverse images from different patients and different devices. Their performance is unstable, affecting their universality and reliability in real-world clinical applications.
[0005] Therefore, how to design a lightweight deep learning model suitable for low-power or mobile computing environments, which can maintain high detection and segmentation accuracy while effectively addressing the segmentation challenges of small targets and blurred boundaries, remains an important issue facing the technology. Summary of the Invention
[0006] The purpose of this invention is to provide a method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network, so as to solve the problems in the background art.
[0007] To achieve the above objectives, this invention provides a method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network, comprising the following steps: S1. Collect multiple sets of thoracic and abdominal ultrasound images, and have professionals mark the detection boxes and segmentation masks for the fluid accumulation areas in the images to form a training dataset; S2. Construct a two-stage deep learning network model. In the first stage, the SL-YOLO detection model designed for small object detection is used to locate the effusion region. In the second stage, the lightweight and improved SLNet segmentation model is used to accurately segment the effusion region. Among them, the SLNet segmentation model is a lightweight improvement model of the U-Net architecture. The SLNet segmentation model uses a multi-kernel deep separable convolutional module to replace the standard convolution for feature extraction in the encoding path, introduces a gated network between the encoder and decoder for adaptive feature selection skip connections, and introduces a region-aware decoding layer in the decoding path to fuse global and local contextual features, so as to maintain segmentation accuracy while reducing computational complexity. S3. Using the training dataset, train the SL-YOLO detection model and the SLNet segmentation model respectively; S4. Input the images of the thoracic and abdominal cavities to be processed into the trained SL-YOLO detection model, and output the detection boxes of one or more fluid accumulation detection areas; S5. Input the image region captured by the detection box into the trained SLNet segmentation model and output the corresponding fluid accumulation region segmentation mask.
[0008] Preferably, the training dataset constructed by S1 includes thoracic and abdominal ultrasound images from patients of different genders, ages, and medical histories, covering a variety of conditions including normal images, mild effusion, and severe effusion.
[0009] Preferably, the convolutional layers of the encoding path in the SLNet segmentation model employ multi-kernel depthwise separable convolution (MSDWC) for feature extraction, specifically as follows: ; in, This indicates a depthwise separable convolution with a kernel size of k. This represents the ReLU activation function. This indicates a batch normalization operation. Represents the set of convolution kernel sizes. Indicates the input image; The convolutional layer MSDWCL of the encoding path is composed of one or more multi-kernel depthwise separable convolutional MSDWCs connected sequentially. The specific calculation formula is as follows: ; in, This represents the standard convolution operation. This represents the combined operation of batch normalization and ReLU activation function.
[0010] Preferably, the specific operation flow of the region-aware decoding layer of the SLNet segmentation model is as follows: a. Global features are extracted using Global Max Pooling (GMP) operations, and local features are extracted using Local Max Pooling (LMP) operations. Specifically: ; ; in, and These represent global features and local features, respectively. Indicates global max pooling. This indicates local max pooling. Indicates an extension operation. This represents the input features that are processed by the gating network and then sent to the region-aware decoding layer. b. Element-wise sum the global and local features, calculate the perceptual weights using the sigmoid activation function, and then element-wise multiply these weights with the input features to obtain the enhanced spatial region perception module output. Specifically, it is expressed as: ; in, Represents product of elements. This represents element-wise sum. This represents the Sigmoid activation function; c. The final output is obtained by decoding the region-aware decoder and then sent to the segmentation head to output the liquid accumulation region segmentation mask.
[0011] Preferably, the gating network of the SLNet segmentation model receives the gating signal. and convolutional layer features The gated features are processed by grouped convolution and the gated attention weights are calculated to output gated features, specifically represented as follows: ; ; ; in, Represents grouped convolution. Indicates fusion characteristics, This indicates the attention weight of the gating. This indicates a gating feature.
[0012] Preferably, the loss function for training the SL-YOLO detection model in S3 includes location loss, confidence loss, and class loss, specifically expressed as follows: ; in, The weights representing the coordinate loss The weights representing the confidence loss. The weights representing the class loss, These are labels for the real category. It is the label for predicting the category. and These indicate whether the mesh contains objects. and These represent the confidence levels for the true and the predicted values, respectively. and These are the actual and predicted bounding box parameters, respectively.
[0013] Preferably, the loss functions used for training the SLNet detection model in S3 include the Binary Cross-Entropy (BCE) loss function, the DICE loss function, and the Focal Loss loss function, specifically expressed as follows: ; ; ; ; in, Indicates the true label, This indicates the model output. This indicates the number of groups of objects predicted by the model. This represents the predicted probability of the model. This indicates an adjustable factor.
[0014] Therefore, the present invention employs the above-mentioned method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network, which has the following beneficial effects: (1) This invention decouples the detection and segmentation tasks by constructing a two-stage framework consisting of an SL-YOLO model specifically designed for small target detection and a lightweight, improved SLNet segmentation model. This ensures high efficiency while accurately identifying and segmenting pleural and peritoneal effusion areas. Through the efficient feature extraction and refined region perception mechanism in SLNet, the accuracy of effusion segmentation is significantly improved, especially in complex medical images, where it exhibits higher robustness and effectively reduces false positive and false negative rates.
[0015] (2) The present invention has carried out a lightweight design in the segmentation stage. By introducing multi-core deep separable convolution, gated network and region-aware decoding layer in SLNet, the computational complexity and resource consumption of the model are significantly reduced. This design not only ensures efficient operation on devices with limited computing resources, but also improves the adaptability of the model, enabling it to have strong cross-scenario deployment capabilities and meet the real-time diagnostic needs of various clinical environments.
[0016] (3) The two-stage network framework of this invention can realize the automatic detection and accurate segmentation of pleural and peritoneal effusions, providing doctors with a real-time and efficient auxiliary diagnostic tool. Through the automated effusion detection and segmentation process, the diagnostic efficiency is significantly improved, the reliance on human intervention is reduced, and clinicians are supported to make faster and more accurate decisions, effectively improving the accuracy of clinical diagnosis and treatment.
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0018] Figure 1 This is a flowchart of a method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network according to the present invention. Figure 2 This is a network model architecture diagram of a two-stage lightweight network-based method for detecting and segmenting pleural and peritoneal effusions according to the present invention. Figure 3 This is a diagram of the SLNet segmentation model framework for a two-stage lightweight network-based method for detecting and segmenting pleural and peritoneal effusions according to the present invention. Detailed Implementation
[0019] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely illustrates 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.
[0020] Example like Figure 1 As shown, this invention provides a method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network, comprising the following steps: S1. Collect multiple sets of thoracic and abdominal ultrasound images, and have professionals mark the effusion areas in the images with detection boxes and segmentation masks to form a training dataset. The training dataset includes thoracic and abdominal ultrasound images from patients of different genders, ages and medical histories, covering normal images, mild effusion and severe effusion.
[0021] The dataset in this embodiment mainly comes from collaborations with relevant hospitals, covering imaging data of pleural and peritoneal effusions of different types, sizes, and shapes. The acquired images include both normal and abnormal effusion areas, ensuring the breadth and representativeness of the dataset. The following is a description of the main data collected: (1) Data type collected: The data covers different types of pleural and peritoneal effusions, including effusions in different locations and with varying degrees, aiming to comprehensively reflect the diversity of effusions. The dataset includes normal pleural and peritoneal imaging, mild effusions, severe effusions, and effusions in different organs (such as the pleural and abdominal cavities) to ensure data comprehensiveness. The collected samples include patients of different genders, ages, and medical histories to ensure the breadth and representativeness of the data.
[0022] (2) Data acquisition environment: All data were acquired using high-resolution ultrasound equipment, following standardized medical operating procedures to ensure consistent image quality. Image acquisition covered different scanning angles, scanning equipment parameters, and image processing settings to ensure the applicability and quality stability of the data under various scanning conditions.
[0023] (3) Data labeling: Detection box annotation: During data annotation, detection boxes are first created for the pleural and peritoneal effusion areas in each image. This annotation defines the approximate location of the effusion area, providing localization information for subsequent segmentation tasks. The detection box annotation is performed by professional radiologists to ensure accurate localization of the effusion area.
[0024] Segmentation Mask Annotation: Building upon the bounding box annotation, refined segmentation mask annotations are applied to areas of fluid accumulation in the image. These mask annotations precisely define the contours of the fluid accumulation areas, ensuring accurate identification of the fluid boundaries in subsequent segmentation tasks. This segmentation annotation is also performed by an experienced team of physicians, ensuring a high degree of accuracy in the segmentation results for the fluid accumulation areas.
[0025] S2. To improve the efficiency and adaptability of the model, this embodiment constructs a two-stage deep learning network model to perform the detection and segmentation tasks of pleural and peritoneal effusions, respectively. It combines efficient target detection with refined image segmentation methods. Through the two-stage processing flow, the accuracy and efficiency of effusion diagnosis are significantly improved. The overall network model architecture diagram is shown below. Figure 2 As shown, this embodiment uses a lightweight network structure, which significantly reduces computational complexity while ensuring accuracy, and can adapt to the application needs of different devices and clinical environments.
[0026] The first phase involves detecting effusion regions in pleural and abdominal images. Given that pleural and abdominal effusions often appear as small, low-contrast targets in ultrasound images, this embodiment utilizes the existing SL-YOLO detection model specifically designed for small target detection. This model has been validated in published literature to maintain lightweight design (few parameters, fast computation) while achieving good detection accuracy for small targets. Leveraging its target detection algorithm, it can efficiently identify and locate effusion regions. Its lightweight nature ensures low inference latency, enabling rapid determination of the effusion region's location in real-time clinical applications, providing accurate bounding box information for subsequent segmentation tasks.
[0027] The SL-YOLO detection model achieves fast target localization and classification through a convolutional neural network (CNN). In each input image, it quickly identifies and outlines potential fluid accumulation regions; specifically, given an input image I∈R... H×W×D In this model, H and W represent the length and width of the image, and D=3 indicates the RGB three-channel input. The SL-YOLO detection model first divides the input image into an S×S grid. After feature extraction by a convolutional neural network (CNN), it uses a fully connected layer to predict B bounding boxes for each grid, outputting an S×S×B×(5+C) dimensional tensor. Here, "5" includes four parameters (x, y, w, h) representing the position and size of each bounding box and a parameter representing the confidence of the presence of a target within the bounding box. C=1 is the number of categories, indicating whether there is pleural or peritoneal effusion.
[0028] The output tensor is processed by the non-maximum suppression (NMS) algorithm to eliminate redundant detection boxes. The NMS algorithm retains the box with the highest confidence and deletes the box with high overlap (IoU) with it, thus outputting the final liquid accumulation region detection result.
[0029] Based on the detection results of the first stage, the second stage task is to accurately segment the detected effusion region. This task is accomplished using a lightweight SLNet segmentation model. The U-Net model is widely used in medical image processing due to its efficient image segmentation capabilities, but the traditional U-Net model is computationally complex. To address the problem of limited computing resources, this embodiment makes targeted lightweight and performance enhancement improvements to the U-Net architecture: (1) Multi-kernel depthwise separable convolution (MSDWC) is used in the encoding path to replace the standard convolution, thereby significantly reducing the number of parameters and computational cost; (2) A gating network is introduced between the encoder and decoder to adaptively filter and enhance the features of skip connections; (3) A region-aware decoding layer is introduced in the decoding path to effectively fuse global and local contextual information and improve the segmentation capability of blurred boundaries. These improvements enable SLNet to maintain high-precision segmentation of small target regions of pleural and peritoneal effusion while significantly reducing computational complexity. Through lightweight design, the number of network parameters is reduced, the inference speed is improved, and the model can run on low-power devices, adapting to actual clinical needs.
[0030] This embodiment uses a lightweight SLNet segmentation model, the framework of which is as follows: Figure 3 As shown, while ensuring segmentation accuracy, the computational resource requirements of the model are reduced. The SLNet segmentation model can accurately segment the pleural and abdominal effusion areas and provide high-quality segmentation masks, providing doctors with clear outlines of the effusion areas.
[0031] The SLNet segmentation model improves upon the standard U-Net architecture by retaining its basic encoder-decoder framework but replacing the standard convolutional layers in the encoding path with multi-kernel depthwise separable convolutional (MSDWC) modules. Additionally, a region-aware decoding layer is added to enhance the feature fusion capability of the decoding path, and a gating network is added to optimize skip connections between the encoding and decoding paths.
[0032] To reduce network weight, multi-kernel depthwise separable convolutions (MSDWC) are used for feature extraction in the convolutional layers. This design significantly reduces the number of parameters and computational complexity of the model through depthwise separable convolutions. Simultaneously, the parallel extraction of features using multi-size convolutional kernels enhances the model's ability to capture features at different scales, achieving weight reduction while avoiding a decrease in representational power. Specifically: ; in, This indicates a depthwise separable convolution with a kernel size of k. This represents the ReLU activation function. This indicates a batch normalization operation. Represents the set of convolution kernel sizes. Indicates the input image; The convolutional layer MSDWCL is composed of one or more multi-kernel depthwise separable convolutional MSDWCs connected sequentially. The specific calculation formula is as follows: ; in, This represents the standard convolution operation. This represents the combined operation of batch normalization and ReLU activation function.
[0033] The region-aware decoding layer decodes features from both local and global perspectives within a spatial region. The global branch extracts the most salient global features from the feature map using Global Max Pooling (GMP) operations, while the local branch extracts more detailed features from the local region using Local Max Pooling (LMP) operations. This dual-branch structure can collaboratively perceive both the overall distribution and local details of the fluid accumulation region, which is particularly helpful in improving the segmentation accuracy of blurred or irregular fluid boundaries. The specific operation process is as follows: a. Global features are extracted using Global Max Pooling (GMP) operations, and local features are extracted using Local Max Pooling (LMP) operations. Specifically: ; ; in, and These represent global features and local features, respectively. Indicates global max pooling. This indicates local max pooling. Indicates an extension operation. This represents the input features that are processed by the gating network and then sent to the region-aware decoding layer. b. Element-wise sum the global and local features, calculate the perceptual weights using the sigmoid activation function, and then element-wise multiply these weights with the input features to obtain the enhanced spatial region perception module output. Specifically, it is expressed as: ; in, Represents product of elements. This represents element-wise sum. This represents the Sigmoid activation function; c. The final output is obtained by decoding the region-aware decoder and then sent to the segmentation head to output the liquid accumulation region prediction mask.
[0034] Gating network receives gate control signals and convolutional layer features By processing through grouped convolutions and calculating gated attention weights, gated features are output. This mechanism adaptively filters and strengthens key features passed from the encoder to the decoder, suppressing irrelevant or noisy information, thereby optimizing information flow and improving the model's attention to key regions and segmentation robustness. Specifically, it is expressed as follows: ; ; ; in, Represents grouped convolution. Indicates fusion characteristics, This indicates the attention weight of the gating. This indicates a gating feature.
[0035] S3. Based on the constructed annotated dataset of pleural and abdominal effusions, the designed SL-YOLO detection model and SLNet segmentation model were systematically trained. During evaluation, the model's performance on key metrics such as accuracy, recall, and Dice coefficient was monitored, and its adaptability to different lesion morphologies and background complexity was analyzed. Through continuous evaluation and optimization, the model was ensured to stably and accurately perform real-time detection and segmentation of pleural and abdominal effusions in different datasets and real-world clinical scenarios, providing reliable support for medical diagnosis.
[0036] Training the SL-YOLO detection model is achieved by minimizing a loss function, which consists of three parts: location loss, confidence loss, and class loss, specifically expressed as follows: ; in, The weights representing the coordinate loss The weights representing the confidence loss. The weights representing the class loss, These are labels for the real category. It is the label for predicting the category. and These indicate whether the mesh contains objects. and These represent the confidence levels for the true and the predicted values, respectively. and These are the actual and predicted bounding box parameters, respectively.
[0037] Based on the above loss function, the difference between the network's predicted value and the true label is calculated, and the network is trained until convergence.
[0038] The loss functions used to train the SLNet detection model include the Binary Cross-Entropy (BCE) loss function, the DICE loss function, and the Focal Loss loss function, specifically expressed as follows: ; ; ; ; in, Indicates the true label, This indicates the model output. This indicates the number of groups of objects predicted by the model. This represents the predicted probability of the model. This indicates an adjustable factor, used to adjust the degree of influence of the modulation factor.
[0039] Based on the above loss function, the difference between the network's predicted value and the true label is calculated, and the network is trained until convergence.
[0040] S4. Input the images of the thoracic and abdominal cavities to be processed into the trained SL-YOLO detection model, and output one or more detection boxes of the effusion detection area marked with the location coordinates. S5. Based on the coordinates of each detection box, crop out the corresponding local region image from the original image; input each local region image into the trained SLNet segmentation model in sequence. The model outputs a segmentation mask with the same size as the input region and a pixel value of 0 (background) or 1 (liquid).
[0041] This two-stage design (first detecting and locating, then segmenting the local area) effectively narrows the search range of the segmentation network and reduces the computation of irrelevant background, thereby significantly improving the overall system processing efficiency while ensuring accuracy.
[0042] Therefore, the present invention adopts the above-mentioned method for detection and segmentation of pleural and peritoneal effusion based on a two-stage lightweight network. Through efficient detection and accurate segmentation process, it realizes the automated identification and segmentation of pleural and peritoneal effusion regions. While ensuring accuracy, it greatly improves computational efficiency and model adaptability, and can meet the needs of real-time clinical diagnosis and complex medical image analysis.
[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for pleural and peritoneal effusion detection and segmentation based on a two-stage lightweight network, characterized in that, Includes the following steps: S1. Collect multiple sets of thoracic and abdominal ultrasound images, and have professionals mark the detection boxes and segmentation masks for the fluid accumulation areas in the images to form a training dataset; S2. Construct a two-stage deep learning network model. In the first stage, the SL-YOLO detection model designed for small object detection is used to locate the effusion region. In the second stage, the lightweight and improved SLNet segmentation model is used to accurately segment the effusion region. Among them, the SLNet segmentation model is a lightweight improvement model of the U-Net architecture. The SLNet segmentation model uses a multi-kernel deep separable convolutional module to replace the standard convolution for feature extraction in the encoding path, introduces a gated network between the encoder and decoder for adaptive feature selection skip connections, and introduces a region-aware decoding layer in the decoding path to fuse global and local contextual features, so as to maintain segmentation accuracy while reducing computational complexity. S3. Using the training dataset, train the SL-YOLO detection model and the SLNet segmentation model respectively; S4. Input the images of the thoracic and abdominal cavities to be processed into the trained SL-YOLO detection model, and output the detection boxes of one or more fluid accumulation detection areas; S5. Input the image region captured by the detection box into the trained SLNet segmentation model and output the corresponding fluid accumulation region segmentation mask.
2. The two-stage lightweight network-based pleural and peritoneal effusion detection and segmentation method according to claim 1, characterized in that: The training dataset constructed by S1 includes chest and abdominal ultrasound images from patients of different genders, ages, and medical histories, covering a variety of conditions including normal images, mild effusion, and severe effusion.
3. The method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network according to claim 1, characterized in that, The convolutional layers of the encoding path in the SLNet segmentation model use multi-kernel depthwise separable convolution (MSDWC) for feature extraction, specifically as follows: ; in, This indicates a depthwise separable convolution with a kernel size of k. This represents the ReLU activation function. This indicates a batch normalization operation. Represents the set of convolution kernel sizes. Indicates the input image; The convolutional layer MSDWCL of the encoding path is composed of one or more multi-kernel depthwise separable convolutional MSDWCs connected sequentially. The specific calculation formula is as follows: ; in, This represents the standard convolution operation. This represents the combined operation of batch normalization and ReLU activation function.
4. The method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network according to claim 3, characterized in that, The specific operation flow of the region-aware decoding layer of the SLNet segmentation model is as follows: a. Global features are extracted using Global Max Pooling (GMP) operations, and local features are extracted using Local Max Pooling (LMP) operations. Specifically: ; ; in, and These represent global features and local features, respectively. Indicates global max pooling. This indicates local max pooling. Indicates an extension operation. This represents the input features that are processed by the gating network and then sent to the region-aware decoding layer. b. Element-wise sum the global and local features, calculate the perceptual weights using the sigmoid activation function, and then element-wise multiply these weights with the input features to obtain the enhanced spatial region perception module output. Specifically, it is expressed as: ; in, Represents product of elements. This represents element-wise sum. This represents the Sigmoid activation function; c. The final output is obtained by decoding the region-aware decoder and then sent to the segmentation head to output the liquid accumulation region segmentation mask.
5. The method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network according to claim 4, characterized in that, The gating network of the SLNet segmentation model receives the gating signal. and convolutional layer features The gated features are processed by grouped convolution and the gated attention weights are calculated to output gated features, specifically represented as follows: ; ; ; in, Represents grouped convolution. Indicates fusion characteristics, This indicates the attention weight of the gating. This indicates a gating feature.
6. The method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network according to claim 1, characterized in that, The loss function for training the SL-YOLO detection model in S3 includes location loss, confidence loss, and class loss, specifically expressed as follows: ; in, The weights representing the coordinate loss The weights representing the confidence loss. The weights representing the class loss, These are labels for the real category. It is the label for predicting the category. and These indicate whether the mesh contains objects. and These represent the confidence levels for the true and the predicted values, respectively. and These are the actual and predicted bounding box parameters, respectively.
7. The method for detecting and segmenting pleural and peritoneal effusions based on a two-stage lightweight network according to claim 1, characterized in that: The loss functions used in training the SLNet detection model in S3 include the Binary Cross-Entropy (BCE) loss function, the DICE loss function, and the Focal Loss loss function, specifically expressed as follows: ; ; ; ; in, Indicates the true label, This indicates the model output. This indicates the number of groups of objects predicted by the model. This represents the predicted probability of the model. This indicates an adjustable factor.