Accurate segmentation of bone structures is crucial for diagnosing fractures, planning surgeries, and monitoring the progression of diseases like osteoporosis.
Maksim Sukhodolov | November 18th, 2024
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.
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.
With CIDN, we shifted our focus from image preprocessing to improving the model’s architecture. We introduced two key components:
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 improves the contour fit around the bone for more accurate segmentation
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.
Comparison between an original X-ray and a version enhanced with BAB
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
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.
We employed several metrics to assess segmentation performance:
CIDN metrics: Dice, Accuracy, Sensitivity, Specificity
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.
Demonstration of the CIDN model detecting vessels in medical images with mask overlay
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
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
These are the original blood vessels image, the benchmark mask, and the SE-RegUNet mask overlay
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.
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.
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!
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.
Accurate segmentation of bone structures is crucial for diagnosing fractures, planning surgeries, and monitoring the progression of diseases like osteoporosis.
Bone diseases can develop unnoticed and lead to severe consequences if not detected in time. Doctors face numerous X-rays every…
Use Kaggle datasets for research responsibly. Steps: Create an account, explore, check licenses, clean data, conduct research, cite, and share.
Imagine you’re working late into the night, super pumped about implementing this cutting-edge AI model you found in a recent…
All of us have faced the existential question "Who am I?" when meeting a new person, or when being interviewed…
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.
contact@setronica.com
+1 929 260 3113
Slovenia:
Kolodvorska 7, 1000 Ljubljana
USA:
211 E 7th St, Austin, TX 78701
© Copyright 2024 Setronica. All Rights Reserved.