https://github.com/bonfry/vessel_tree_identification
Biometric identification system using retinal vessel trees, featuring automated optic disc detection, extraction, and robust feature-based matching algorithms.
https://github.com/bonfry/vessel_tree_identification
computer-vision healthcare-application opencv opencv-python
Last synced: 5 months ago
JSON representation
Biometric identification system using retinal vessel trees, featuring automated optic disc detection, extraction, and robust feature-based matching algorithms.
- Host: GitHub
- URL: https://github.com/bonfry/vessel_tree_identification
- Owner: bonfry
- License: apache-2.0
- Created: 2024-11-20T10:09:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-12-16T10:44:11.000Z (6 months ago)
- Last Synced: 2025-12-19T23:53:27.252Z (6 months ago)
- Topics: computer-vision, healthcare-application, opencv, opencv-python
- Language: Python
- Homepage:
- Size: 4.82 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vessel Tree Identification
**Authors:** Simone Bonfrate
**Institution:** Faculty of Computer Science (FIC), University of Coruna (UDC)
## Overview
This project implements a computer vision system for retinal image matching based on the unique structure of retinal vessel trees. It addresses challenges in biometric identification such as variations in orientation, lighting, and noise. The system extracts the vessel tree from retinal images and performs feature-based matching to identify individuals.
## Project Structure
```
.
├── LICENSE
├── README.md
├── main.py # Main entry point of the application
├── docs/
│ ├── report.md # Detailed project report
│ └── images/ # Images for documentation
├── images/
│ ├── ref_images/ # Reference retinal images
│ └── test_images/ # Test retinal images
└── libs/
├── __init__.py
├── preprocessing.py # Image preprocessing (CLAHE, Gaussian Blur)
├── detection_step.py # Automatic Optic Disc Detection
├── extraction_step.py # Vessel Tree Extraction
├── similarity_step.py # Feature Matching (AKAZE) & Scoring
└── experiments_manager.py # Experiment logging and artifact saving
```
## Methodology
The pipeline consists of three main stages:
1. **Preprocessing (`libs/preprocessing.py`)**
* Images are enhanced using Contrast Limited Adaptive Histogram Equalization (CLAHE) to improve local contrast and Gaussian Blur to reduce noise.
2. **Automatic Optic Disc Detection (`libs/detection_step.py`)**
* The system employs a **Brute-force approach** to automatically locate the optic disc.
* It iterates through various combinations of:
* Template Matching methods (`cv2.TM_CCORR`, `cv2.TM_SQDIFF`, `cv2.TM_CCOEFF`)
* Template sizes
* Template intensities
* The best candidate is selected based on an intensity score, ensuring the brightest region (characteristic of the optic disc) is accurately identified.
3. **Vessel Tree Extraction (`libs/extraction_step.py`)**
* The region of interest (ROI) around the detected optic disc is isolated.
* Inverse thresholding is applied to separate the darker vessel structures.
* Morphological erosion removes noise and artifacts, resulting in a clean vessel tree mask.
4. **Vessel Tree Matching (`libs/similarity_step.py`)**
* **Feature Extraction:** The Accelerated KAZE (AKAZE) algorithm detects keypoints and generates binary descriptors.
* **Matching:** Descriptors are matched using Brute-Force matching with Hamming distance.
* **Verification:** RANSAC-based homography filters "good matches" (inliers).
* **Scoring:** A similarity score (0 to 1) is calculated based on the ratio of inliers to total matches.
## Installation
1. Clone the repository:
```bash
git clone
cd vessel_tree_identification
```
2. Install the required dependencies:
```bash
pip install opencv-python numpy matplotlib pandas
```
## Usage
To run the identification pipeline and generate the similarity matrix:
```bash
python main.py
```
The script will:
1. Load test and reference images from the `images/` directory.
2. Process each image to extract the vessel tree.
3. Compare every test image against every reference image.
4. Output a similarity matrix to the console and save results in the `experiments/` folder.
## Results
The system achieves high accuracy in identifying matching vessel trees. Below is the similarity matrix generated from the latest automatic analysis:
```
\ R074.pgm R118.pgm R142.pgm R158.pgm R191.pgm R217.pgm
R075.pgm 1.0 0.0 0.0 0.000000 0.000 0.0
R119.pgm 0.0 1.0 0.0 0.000000 0.000 0.0
R143.pgm 0.0 0.0 1.0 0.000000 0.000 0.0
R159.pgm 0.0 0.0 0.0 0.916667 0.000 0.0
R192.pgm 0.0 0.0 0.0 0.000000 0.875 0.0
R218.pgm 0.0 0.0 0.0 0.000000 0.000 0.0
```
## References
* OpenCV Documentation: Histogram Equalization, AKAZE local feature matching, Smoothing Images.
* Towards Data Science: Vision Transformers.