A lightweight approach for automatic segmentation of 2D X-ray coronary artery images using shallow multi-layer perceptrons and morphological filtering.
The Hessian matrix stores second-order spatial derivatives of pixel intensity values for detecting tubular structures:
Where I_xx and I_yy are second-order partial derivatives along x and y axes, and I_xy = I_yx is the mixed partial derivative.
The Frangi filter enhances narrow, elongated structures while suppressing blobs and background:
Where:
math R = \frac{|\lambda_1|}{|\lambda_2|}differentiates between blobs and tubesmath S = \sqrt{\lambda_1^2 + \lambda_2^2}measures combined eigenvalue magnitudeαcontrols blob structure penalizationβcontrols plate-like structure penalizationγmodulates sensitivity to background texture
A shallow neural network with:
- Single input neuron (pixel intensity)
- 2 hidden layers with 9 neurons each
- ReLU activation for hidden layers
- Softmax output activation
- Weighted binary cross-entropy loss to handle class imbalance
Finds optimal threshold by maximizing inter-class variance:
Where w_1, w_2 are class probabilities and μ_1, μ_2 are class means.
- Data Augmentation: Horizontal flipping for robustness
- Preprocessing:
- Frangi multiscale filtering (σ ∈ {1.8, 1.9, ..., 4.0})
- Small-object removal (5000 pixel threshold) to eliminate artifacts
- Training: 5-fold cross-validation with 212 training samples
- Segmentation: Otsu's method applied to predicted foreground probabilities
DCA1 Database: 130 grayscale X-ray coronary angiograms (300×300 pixels) with expert-labeled ground truth from the Mexican Social Security Institute Cardiology Department.
- Training: 212 samples
- Validation: 56 samples
- Class imbalance: Vessel pixels comprise 15-19% of total pixels
| Metric | Filtered | Unfiltered |
|---|---|---|
| AUROC | 0.948 | 0.760 |
| Dice | 0.61 | 0.15 |
| Sensitivity | 0.79 | 0.21 |
| Specificity | 0.95 | 0.91 |
| Precision | 0.51 | 0.15 |
| IoU | 0.44 | 0.10 |
- Preprocessing improved Dice score by 4x and sensitivity by 3.8x
- Otsu thresholds: 0.10-0.14 (filtered) vs 10⁻³-10⁻² (unfiltered)
- Performance comparable to Cervantes et al. with much simpler architecture
- Python 3.10.12 on Google Colab
- Intel Core i5-1135G7 (2.40GHz, 16GB RAM)
- NumPy, scikit-image, Matplotlib, PyTorch
- Young, I. (1983). Image analysis and mathematical morphology. Cytometry, 4, 184-185.
- Frangi, A. et al. (2000). Multiscale Vessel Enhancement Filtering. Medical Image Computing and Computer-Assisted Intervention, 1496.
- Luo, Y. & Sun, L. (2023). Digital subtraction angiography image segmentation based on multiscale Hessian matrix. Journal of Radiation Research and Applied Sciences, 16(3).
- Ma, G., Yang, J., & Zhao, H. (2020). A coronary artery segmentation method based on region growing. Technology and Health Care, 28, S463-S472.
- Cervantes-Sanchez, F. et al. (2019). Automatic Segmentation of Coronary Arteries using Multiscale Analysis and Artificial Neural Networks. Applied Sciences, 9(24), 5507.
- Park, T. et al. (2022). Deep Learning Segmentation in 2D X-ray Images. Diagnostics, 12(4), 778.
- Iyer, K. et al. (2021). AngioNet: a convolutional neural network for vessel segmentation. Scientific Reports, 11, 18066.
Code Repository: https://github.com/eigenchip/xca_image_segmentation
License: MIT