Computational Pathology Research Framework

Logo

A tested PyTorch framework for computational pathology research with working benchmarks on PatchCamelyon and CAMELYON16

View on GitHub matthewvaishnav/computational-pathology-research

Documentation Index

Comprehensive documentation for the Computational Pathology Research Framework.


Getting Started

Installation and Setup

Tutorials


Training and Evaluation

PatchCamelyon (PCam)

CAMELYON16 Slide-Level

Evaluation Metrics


Architecture and Design

System Overview

Model Architectures

Data Pipeline


Deployment

Docker Deployment

REST API

Model Export


Development

Contributing

Testing

Build System


Performance and Optimization

Performance Analysis

Model Profiling


Results and Analysis

Benchmark Results

Project Portfolio

Roadmap


API Reference

Core Modules

Data Loading

from src.data import PatchCamelyonDataset, CAMELYONSlideDataset

Models

from src.models import SimpleClassifier, SimpleSlideClassifier
from src.models.pretrained import load_pretrained_encoder

Training

from src.training import train_epoch, evaluate

Utilities

from src.utils import set_seed, save_checkpoint, load_checkpoint

Quick Reference

Common Commands

Training

# PCam training
python experiments/train_pcam.py --config experiments/configs/pcam.yaml

# CAMELYON training
python experiments/train_camelyon.py --config experiments/configs/camelyon.yaml

Evaluation

# PCam evaluation
python experiments/evaluate_pcam.py \
  --checkpoint checkpoints/pcam/best_model.pth \
  --data-root data/pcam

# CAMELYON evaluation with CSV export
python experiments/evaluate_camelyon.py \
  --checkpoint checkpoints/camelyon/best_model.pth \
  --save-predictions-csv

Testing

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=src --cov-report=html

Model Profiling

# Profile inference time
python scripts/model_profiler.py \
  --checkpoint models/best_model.pth \
  --profile-type time

# Export to ONNX
python scripts/export_onnx.py \
  --checkpoint models/best_model.pth \
  --output models/model.onnx

Troubleshooting

Common Issues

CUDA Out of Memory

Slow Training

Poor Model Performance


Additional Resources

External Documentation

Research Papers

Community


Archived Documentation

Historical documentation and implementation notes are available in archive/.