retina-age-analysis / README.md
ramankamran's picture
Upload README.md with huggingface_hub
ffdd3f4 verified
|
Raw
History Blame Contribute Delete
4.58 kB
---
license: mit
task_categories:
- image-classification
- image-regression
tags:
- medical
- retina
- age-prediction
- fundus-images
size_categories:
- 1K<n<10K
---
# Retina Age Analysis Dataset
## Dataset Description
This dataset contains **9,857 retinal fundus images** from **5,393 patients** for age prediction tasks.
### Dataset Summary
- **Task**: Age prediction from retinal fundus images
- **Images**: 9,857 high-quality retinal images
- **Patients**: 5,393 unique patients
- **Age Range**: 5-97 years
- **Image Format**: JPEG
- **Average Image Size**: ~1 MB
### Supported Tasks
1. **Regression**: Predict continuous age (5-97 years)
2. **Classification**: Predict age group (5 classes: pediatric, young adult, middle age, senior, elderly)
### Data Splits
| Split | Images | Patients | Percentage |
|-------|--------|----------|------------|
| Train | 6,902 | 3,775 | 70% |
| Validation | 1,493 | 809 | 15% |
| Test | 1,462 | 809 | 15% |
**Note**: Split at patient level to prevent data leakage.
### Age Distribution
| Age Group | Age Range | Count | Percentage |
|-----------|-----------|-------|------------|
| Pediatric | 5-17 | 291 | 3.0% |
| Young Adult | 18-39 | 1,447 | 14.7% |
| Middle Age | 40-59 | 2,946 | 29.9% |
| Senior | 60-74 | 3,484 | 35.3% |
| Elderly | 75+ | 1,689 | 17.1% |
### Dataset Structure
```
retina-age-analysis/
├── images/ # 9,857 retinal fundus images
│ ├── img00001.jpg
│ ├── img00002.jpg
│ └── ...
└── splits/ # Train/val/test split CSV files
├── train.csv # 6,902 samples
├── val.csv # 1,493 samples
└── test.csv # 1,462 samples
```
### Data Fields
Each CSV file contains:
- `image_id`: Image filename (without extension)
- `patient_id`: Unique patient identifier
- `patient_age`: Age in years (target variable for regression)
- `age_group_broad`: Age category name
- `age_group_broad_numeric`: Age category index (0-4, target for classification)
- `patient_sex`: Gender (1=Male, 2=Female)
- `exam_eye`: Eye examined (1=Right, 2=Left)
- `diabetic_retinopathy`: DR status (0=No, 1=Yes)
- `camera`: Camera type used
- Additional clinical features
### Usage Example
```python
from datasets import load_dataset
from PIL import Image
import pandas as pd
# Load dataset
dataset = load_dataset("ramankamran/retina-age-analysis")
# Load splits
train_df = pd.read_csv("hf://datasets/ramankamran/retina-age-analysis/splits/train.csv")
val_df = pd.read_csv("hf://datasets/ramankamran/retina-age-analysis/splits/val.csv")
test_df = pd.read_csv("hf://datasets/ramankamran/retina-age-analysis/splits/test.csv")
# Load an image
from huggingface_hub import hf_hub_download
img_path = hf_hub_download(
repo_id="ramankamran/retina-age-analysis",
filename="images/img00001.jpg",
repo_type="dataset"
)
image = Image.open(img_path)
# Get corresponding label
label = train_df[train_df['image_id'] == 'img00001']['patient_age'].values[0]
```
### PyTorch DataLoader
See the training code in the repository for PyTorch DataLoader implementation with:
- Data augmentation (rotation, flip, brightness, contrast)
- ImageNet normalization
- Batch loading
### Baseline Results
**Regression (Age Prediction):**
- MAE: 7-10 years (baseline)
- Target: < 5 years (optimized)
**Classification (Age Groups):**
- Accuracy: 70-75% (baseline)
- Target: 85-90% (with semi-supervised learning)
### License
MIT License
### Citation
If you use this dataset, please cite:
```bibtex
@dataset{retina_age_analysis,
author = {Raman Kamran},
title = {Retina Age Analysis Dataset},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/ramankamran/retina-age-analysis}
}
```
### Dataset Curators
Dataset cleaned and prepared by ramankamran.
### Preprocessing
- Removed images with missing age labels (33.5% of original data)
- Removed inadequate quality images (8.9%)
- Verified all image files exist
- Created stratified train/val/test splits
- Patient-level splitting to prevent data leakage
### Intended Use
- Medical image analysis research
- Age prediction from retinal images
- Transfer learning for ophthalmology tasks
- Semi-supervised learning experiments
### Limitations
- Class imbalance (elderly patients over-represented, pediatric under-represented)
- Single imaging center data
- Requires domain knowledge for clinical interpretation
### Additional Information
For training code and examples, see: [GitHub Repository](https://github.com/ramankamran/retina-age-analysis)