Skip to content

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MedXAI

MedXAI Logo

A Lightweight, Modular, and Production-Ready Python Toolkit for Medical Imaging AI

PyPI Version Python Versions License Build Status Code Style Platform GitHub Stars GitHub Forks GitHub Issues Downloads


Overview

MedXAI is an open-source Python library that simplifies the development of modern Medical Imaging Artificial Intelligence (Medical AI) applications. The library provides a carefully designed collection of reusable components for medical image preprocessing, segmentation evaluation, loss functions, radiomics analysis, explainable AI, and post-processing utilities.

The primary goal of MedXAI is to reduce the amount of boilerplate code researchers repeatedly implement across projects while promoting reproducibility, modularity, and clean software engineering practices.

Whether you are building a segmentation model for ultrasound, CT, MRI, retinal imaging, histopathology, or dermoscopy, MedXAI provides standardized implementations of commonly used algorithms so researchers can focus on model development instead of repeatedly rewriting utility code.

Unlike many research repositories that contain task-specific implementations, MedXAI is designed as a general-purpose toolkit that integrates naturally into existing PyTorch pipelines while remaining lightweight, dependency-conscious, and easy to extend.

The library emphasizes

  • Reproducible research
  • Modular software design
  • High-performance implementations
  • CPU and CUDA compatibility
  • Clean APIs
  • Easy integration into existing projects
  • Research-friendly documentation
  • Production-ready code quality

Core Capabilities & Features

MedXAI provides a high-performance, end-to-end ecosystem designed for reproducible medical imaging research and production-grade clinical AI pipelines. Seamlessly integrated with PyTorch, NumPy, and scikit-image, the toolkit delivers GPU-accelerated spatial segmentation metrics, numerically stable hybrid loss functions (such as Dice-BCE and Focal Tversky), clinical-grade preprocessing, and automated post-processing utilities for boundary refinement. Additionally, it empowers advanced diagnostic workflows with vectorized radiomics feature extraction (GLCM and LBP), model-agnostic Explainable AI (Grad-CAM), epistemic uncertainty estimation, and memory-safe sliding-window inference for large multi-dimensional volumetric arrays.


Project Structure

medxai/

├── metrics/
├── losses/
├── preprocessing/
├── radiomics/
├── explain/
├── postprocessing/
├── models/
├── utils/
├── tests/
├── docs/
└── examples/

Installation

Install from PyPI

pip install medxai

Install Latest Development Version

pip install git+https://github.com/aman0311x/medxai.git

Clone Repository

git clone https://github.com/aman0311x/medxai.git

cd medxai

Requirements

  • Python 3.9+
  • PyTorch
  • NumPy
  • OpenCV
  • scikit-image
  • matplotlib

Development Setup

Create a virtual environment.

python -m venv .venv

Activate it.

Linux / macOS

source .venv/bin/activate

Windows

.venv\Scripts\activate

Install MedXAI in editable mode.

pip install -e .

Install development dependencies.

pip install -r requirements-dev.txt

Running Tests

Execute all unit tests.

pytest

Run with coverage.

pytest --cov=medxai

Documentation

Comprehensive documentation, API references, and tutorials are available in the docs/ directory.

Future online documentation will be available via GitHub Pages.


Roadmap

Upcoming releases aim to include

  • MONAI interoperability
  • 3D medical image support
  • Transformer-based utilities
  • Diffusion model utilities
  • Vision-Language Model helpers
  • Additional radiomics descriptors
  • Medical foundation model interfaces
  • DICOM utilities
  • ONNX export
  • Benchmark datasets
  • More XAI algorithms
  • Clinical evaluation metrics

Contributing

We welcome contributions from researchers, students, clinicians, and open-source developers.

There are many ways you can contribute to MedXAI:

  • Report bugs
  • Improve documentation
  • Suggest new features
  • Improve existing implementations
  • Add unit tests
  • Optimize performance
  • Add new Medical AI utilities
  • Improve API consistency
  • Fix typos
  • Review pull requests

Contribution Workflow

  1. Fork the repository.
  2. Create a new branch.
git checkout -b feature/my-feature
  1. Commit your changes.
git commit -m "Add new feature"
  1. Push your branch.
git push origin feature/my-feature
  1. Open a Pull Request.

Please ensure that all new code

  • follows PEP8
  • includes documentation
  • passes all tests
  • maintains backward compatibility where possible

We appreciate every contribution, regardless of size.


Code of Conduct

Please be respectful and constructive when participating in discussions, reporting issues, or contributing code.

By participating in this project, you agree to foster a welcoming and inclusive community.


Security

If you discover a security vulnerability, please do not create a public issue.

Instead, contact the maintainer directly so the issue can be responsibly addressed before public disclosure.


License

This project is distributed under the MIT License.

You are free to

  • use
  • modify
  • distribute
  • sublicense
  • include in commercial projects

provided that the original copyright notice and license are retained.

See the LICENSE file for complete details.


Citation

If MedXAI contributes to your research, software, or publication, please cite the project.

@software{rahman2026medxai,
  author       = {Mohammad Amanour Rahman},
  title        = {MedXAI: A Lightweight Python Toolkit for Medical Imaging AI},
  year         = {2026},
  publisher    = {GitHub},
  url          = {https://github.com/aman0311x/medxai},
  license      = {MIT}
}

Support the Project

If MedXAI has been useful in your research or projects, consider supporting the project by

⭐ Starring the repository

🐛 Reporting bugs

💡 Suggesting new features

📝 Improving documentation

🤝 Contributing code

📢 Sharing the project with the Medical AI community

Every contribution helps make MedXAI better for researchers worldwide.


About

Simple, lightweight, and reproducible medical imaging AI toolkit.

Topics

Resources

Contributing

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages