Enhancing Medical Image Segmentation with CIDN: A New Approach to Detecting Vessels and Bone Fractures

Enhancing Medical Image Segmentation with CIDN: A New Approach to Detecting Vessels and Bone Fractures

In healthcare, every second counts. As medical professionals race against time to diagnose and treat patients, AI is changing the game.

 

For example, problems with bones and heart health can get worse without anyone noticing. This can lead to big trouble if doctors don’t find these issues quickly. AI would help doctors spot the disease faster and more easily. 

 

At Setronica, we work hard to use the newest and best AI technology to solve problems like these. Previously, we adapted the SE-RegUNet model for bone fracture segmentation on X-ray images, employing image preprocessing methods. 

 

However, we encountered limitations in handling edge artifacts. This led us to explore a new approach using the Context Interactive Deep Network (CIDN) architecture.

Comparing our previous and current approaches

What we did before

In our earlier project with SE-RegUNet, we enhanced image contrast and sharpness using preprocessing techniques like CLAHE (Contrast Limited Adaptive Histogram Equalization) and USM (Unsharp Masking). While these methods helped highlight fractures on X-rays, they struggled with artifacts at the image edges.

 

Additionally, we faced training instability because of random weight initialization. We mitigated it by fixing the random seed and implementing early stopping when high losses occurred.

What’s new in our current approach

With CIDN, we shifted our focus from image preprocessing to improving the model’s architecture. We introduced two key components:

 

  • Boundary Attention Block (BAB). It enhances the model’s focus on object boundaries, especially at the edges of images.
  • Multi-scale Interactive Block (MIB). It allows the model to consider information at various scales, crucial for segmenting both small and large vessels.

 

We also developed a new combined loss function incorporating Active Contour Energy (ACE) Loss, improving the delineation of vessel contours.

 

ACE Loss works by creating an imaginary line (or contour) that moves and changes shape to fit around the object. If the line is too jagged or doesn’t follow the object’s edges well, the ACE Loss value will be high. The computer then adjusts the line to reduce this loss, making it smoother and more accurate. This process continues until the line fits the object as closely as possible.

ACE loss contour

ACE Loss improves the contour fit around the bone for more accurate segmentation

Technical implementation and key components

CIDN architecture and innovations

Boundary Attention Block (BAB)

The Boundary Attention Block (BAB) leverages the Discrete Wavelet Transform (DWT) to decompose images into frequency components, focusing on horizontal and vertical details while ignoring diagonal ones to reduce noise and enhance boundary attention. After applying inverse DWT, it effectively highlights object boundaries.

 

This way, BAB overcomes challenges in handling high-frequency components and tensor dimensions post-transformation.

boundary attention block

Comparison between an original X-ray and a version enhanced with BAB

Multiscale Interactive Block (MIB)

 

The Multi-scale Interactive Block (MIB) captures multiscale features by employing various convolutional kernels (3×1, 1×3, and 3×3) to create complex feature maps that represent both fine details and overall vessel structures. It balances weights across scales using global pooling and channel recalibration, enhancing multiscale interaction within the model’s bottleneck.

 

Code analysis and technical details

 

We created a custom dataset loader, “CustomDataset” that imports images and corresponding masks without applying preprocessing. Instead, it normalizes and converts them into tensors suitable for the model.

 

Combined loss function

 

  • Binary Cross-Entropy (BCE): Ensures basic prediction accuracy compared to ground truth masks.
  • Active Contour Energy (ACE) Loss: Focuses on extracting active object contours, improving predictions along vessel boundaries.

 

Balancing BCE and ACE components was critical to prevent overemphasis on contours or overall segmented areas.

 

Threshold setting

 

We carefully adjusted the threshold setting to balance sensitivity and specificity. After testing various values, we identified an optimal threshold at 0.3.

Metrics and evaluation

We employed several metrics to assess segmentation performance:

  • Dice Score: Measures overlap between predicted and true masks.
  • Accuracy: Indicates the percentage of correctly classified pixels.
  • Sensitivity (Recall): Reflects the model’s ability to detect all vessels.
  • Specificity: Shows how well the model avoids false positives.
  • F1-Score: Harmonic mean of precision and recall, important for imbalanced datasets.

CIDN metrics: Dice, Accuracy, Sensitivity, Specificity

Results and comparison

After training the CIDN model on the same dataset as SE-RegUNet, we observed several significant improvements:

 

Improved dice score: The CIDN model demonstrated a notably better Dice Score, particularly in the edge regions of the images. This improvement indicates that the model is more accurate in distinguishing between the foreground and background, especially around the boundaries of objects, which is crucial for precise segmentation tasks.

 

Enhanced sensitivity and specificity: This means CIDN was more effective in detecting small vessels, which are often challenging to identify because of their size and complexity. Additionally, the model reduced the number of false positives, leading to more reliable and accurate segmentation results. This balance between sensitivity (true positive rate) and specificity (true negative rate) is essential for applications where both the detection of true positives and the minimization of false positives are critical.

CIDN in medical imaging

Demonstration of the CIDN model detecting vessels in medical images with mask overlay

Comparative advantages of CIDN over SE-RegUNet:

The CIDN model offers several significant advantages over the SE-RegUNet model, making it a superior choice for image segmentation tasks.

 

No preprocessing required: One of the standout features of CIDN is its ability to operate directly on raw images. Unlike SE-RegUNet, which required preprocessing steps like CLAHE and USM to enhance image quality, CIDN eliminates the need for these additional steps.

 

Advanced loss function: The CIDN model employs a combined loss function that includes both Binary Cross-Entropy (BCE) and Active Contour Energy (ACE) Loss. While BCE ensures basic prediction accuracy by comparing the predicted masks to the ground truth, ACE Loss focuses on extracting active object contours, leading to better delineation of boundaries. This combination results in more precise contour detection and overall improved segmentation performance compared to using only BCE, as in SE-RegUNet.

 

Avoidance of artifacts: CIDN reduces the likelihood of introducing artifacts that could negatively impact the model’s performance. This streamlined approach ensures that the model operates more efficiently and effectively, providing cleaner and more accurate segmentation results.

 

Let’s compare the results. In these examples, the upper image is enhanced with SE-RegUNet, the lower one – with CIDN:

These are the original X-ray image, the benchmark mask, and the SE-RegUNet mask overlay

bone imaging CIDN

These are the original X-ray image, the benchmark mask, and the CIDN mask overlay

And here’s how the two models handle images of blood vessels: On the images below we have

blood vessels imaging SE RegUNet

These are the original blood vessels image, the benchmark mask, and the SE-RegUNet mask overlay

blood vessels imaging CIDN

These are the original blood vessels image, the benchmark mask, and the CIDN mask overlay

Comparison of the two results shows us the advantage of the second model (CIDN) because of the edge handling.

Potential applications and limitations

Where the model excels

Medical diagnostics: Automated detection of vascular anomalies, bone fractures, tumors, and other pathologies.

 

Low-contrast image analysis: CIDN’s architectural strengths make it effective where standard methods falter.

Where caution is advised

Real-time processing needs: The model’s complexity may demand significant computational resources.

 

Diverse data types: Additional training or adaptation might be necessary for data vastly different from the training set.

Future plans

Our successful implementation of the CIDN architecture for vessel segmentation on angiographic images and bone fracture detection on X-rays marks a significant advancement in medical imaging technology. This achievement shows how CIDN can improve diagnostic accuracy and efficiency in various medical applications.

 

Looking ahead, we aim to reduce the computational requirements of the CIDN model to make it usable in real-time applications. This means optimizing the model so it can process images quickly and efficiently without losing accuracy. 

 

Another goal is to adapt the CIDN model for other medical imaging tasks, such as detecting tumors or anomalies in MRI and CT scans. By doing this, we can use the model’s advanced capabilities to tackle a wider range of diagnostic challenges in the medical field.

 

To further improve the model’s performance, we plan to add new blocks and functions to the CIDN architecture. This involves researching and implementing innovative components that can enhance the model’s accuracy and stability.

 

These future directions highlight our commitment to advancing medical imaging technology and improving patient outcomes through continuous innovation and optimization.



If you’re interested in learning more about our projects or discussing collaboration opportunities, please reach out to us!

Let’s start building something great together!

Contact us today to discuss your project and see how we can help bring your vision to life. To learn about our team and expertise, visit our ‘About Us‘ webpage.




    This site is protected by reCAPTCHA and the Google
    Privacy Policy and Terms of Service apply.

    Related posts

    • All Posts
    • Artificial intelligence

    SETRONICA


    Setronica is a software engineering company that provides a wide range of services, from software products to core business applications. We offer consulting, development, testing, infrastructure support, and cloud management services to enterprises. We apply the knowledge, skills, and Agile methodology of project management to integrate software development and business objectives effectively and efficiently.