Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Python and Keras to segment blood vessels

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to use Python and Keras for blood vessel segmentation. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.

Motivation:

Automatic segmentation of medical images is an important step to extract useful information, which can help doctors make diagnosis. For example, it can be used to segment retinal blood vessels, represent their structure and measure their width, which can help diagnose retinal diseases.

In this article, a neural baseline will be implemented to apply image segmentation to retinal vessel images.

Data sets:

All experiments were performed throughout the article using the DRIVE (Digital Retinal Images for Vessel Extraction) dataset. It is a dataset of 40 retinal images (20 for training and 20 for testing), where vessels are annotated at the pixel level (see example above) to mark the presence (1) or absence (0) of each vessel. Pixel (i, j) of the image.

http://www.isi.uu.nl/Research/Databases/DRIVE/

Problem setting:

Question: If the pixel is part of a vessel in the image, you want to assign a label of "1" to each pixel, otherwise "0."

Intuition/Hypothesis: Neighbor pixel values are important for predicting each pixel (i, j), so context should be considered. The prediction does not depend on a particular position on the image, so the classifier should have some translation invariance.

Solution: Use CNN! The U-net architecture will be used for vessel segmentation. It is an architecture widely used for semantic segmentation tasks, especially in the medical field.

Model:

U-Net

The U-net architecture is encoder-decoder with some skip connections between encoder and decoder. The main advantage of this architecture is the ability to consider a wider range of contexts when predicting pixels. This is due to the large number of channels used in the upsampling operation.

Input image processing:

This series of processing steps is applied before feeding it back to the CNN.

Normalization: Divide pixel intensities by 255 so they are in the range 0-1.

Crop: Due to the aggregation operation, the network expects each dimension of the input image to be divisible by 2, so randomly crop 64 * 64 from each image.

Data enhancement: random flip (horizontal or vertical or both), random crop, random pan (horizontal or vertical or both), random zoom. Performed during training only.

Training three different models:

Pre-trained ImageNet VGG encoder + data enhancement.

Training from scratch + data augmentation.

Training from scratch without adding data.

The AUC ROC metric will be used to compare the three models, and only pixels within the retinal mask will be considered in the evaluation (meaning black edges around the image circle will not be calculated).

Results:

Pre-trained encoder + data enhancement AUC ROC: 0.9820

AUC ROC: 0.9806

Training from scratch without increasing AUC ROC: 0.9811

The performance of the three variations was close, but in this case, pre-training didn't seem to help, while the data increase was a little bit.

Best Model Prediction

The prediction in the picture above looks cool!

predictions based on basic facts

Differences between predictions and underlying facts are also plotted: false negatives in blue and false positives in red. You can see that the model has some difficulty predicting thin vessels that are only one or two pixels wide.

About "how to use Python and Keras for blood vessel segmentation" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report