freshcrate
Skin:/
Home > Frameworks > medicalAI

medicalAI

Medical-AI is a AI framework specifically for Medical Applications https://aibharata.github.io/medicalAI/

Why this rank:Strong adoptionHealthy release cadence

Description

Medical-AI is a AI framework specifically for Medical Applications https://aibharata.github.io/medicalAI/

README

MedicalAI

Medical-AI is a AI framework for rapid protyping for Medical Applications


Documentation: https://aibharata.github.io/medicalAI/

Source Code: https://github.com/aibharata/medicalai

Youtube Tutorial: https://www.youtube.com/V4nCX-kLACg


Downloads Downloads Documentation Status Gitter

Medical-AI is a AI framework for rapid prototyping of AI for Medical Applications.

Installation

pip install medicalai
## Requirements Python Version : 3.5-3.7 (Doesn't Work on 3.8 Since Tensorflow does not support 3.8 yet.

Dependencies: Numpy, Tensorflow, Seaborn, Matplotlib, Pandas

NOTE: Dependency libraries are automatically installed. No need for user to install them manually.

Usage

Getting Started Tutorial: Google Colab Google Colab Notebook Link

Importing the Library

import medicalai as ai

Using Templates

You can use the following templates to perform specific Tasks

Load Dataset From Folder

Set the path of the dataset and set the target dimension of image that will be input to AI network.

trainSet,testSet,labelNames =ai.datasetFromFolder(datasetFolderPath, targetDim = (96,96)).load_dataset()
- trainSet contains 'data' and 'labels' accessible by trainSet.data and trainSet.labels
- testSet contains 'data' and 'labels' accessible by testSet.data and testSet.labels
- labelNames contains class names/labels

Check Loaded Dataset Size

print(trainSet.data.shape)
print(trainSet.labels.shape)

Run Training and Save Model

trainer = ai.TRAIN_ENGINE()
trainer.train_and_save_model(AI_NAME= 'tinyMedNet', MODEL_SAVE_NAME='PATH_WHERE_MODEL_IS_SAVED_TO', trainSet, testSet, OUTPUT_CLASSES, RETRAIN_MODEL= True, BATCH_SIZE= 32, EPOCHS= 10, LEARNING_RATE= 0.001)

Plot Training Loss and Accuracy

trainer.plot_train_acc_loss()

Generate a comprehensive evaluation PDF report

trainer.generate_evaluation_report()

PDF report will be generated with model sensitivity, specificity, accuracy, confidence intervals, ROC Curve Plot, Precision Recall Curve Plot, and Confusion Matrix Plot for each class. This function can be used when evaluating a model with Test or Validation Data Set.

Explain the Model on a sample

trainer.explain(testSet.data[0:1], layer_to_explain='CNN3')

Loading Model for Prediction

infEngine = ai.INFERENCE_ENGINE(modelName = 'PATH_WHERE_MODEL_IS_SAVED_TO')

Predict With Labels

infEngine.predict_with_labels(testSet.data[0:2], top_preds=3)

Get Just Values of Prediction without postprocessing

infEngine.predict(testSet.data[0:2])

Alternatively, use a faster prediction method in production

infEngine.predict_pipeline(testSet.data[0:1])

Advanced Usage

Code snippet for Training Using Medical-AI

## Setup AI Model Manager with required AI. 
model = ai.modelManager(AI_NAME= AI_NAME, modelName = MODEL_SAVE_NAME, x_train = train_data, OUTPUT_CLASSES = OUTPUT_CLASSES, RETRAIN_MODEL= RETRAIN_MODEL)

# Start Training
result = ai.train(model, train_data, train_labels, BATCH_SIZE, EPOCHS, LEARNING_RATE, validation_data=(test_data, test_labels), callbacks=['tensorboard'])

# Evaluate Trained Model on Test Data
model.evaluate(test_data, test_labels)

# Plot Accuracy vs Loss for Training
ai.plot_training_metrics(result)

#Save the Trained Model
ai.save_model_and_weights(model, outputName= MODEL_SAVE_NAME)

Automated Tests

To Check the tests

    pytest

To See Output of Print Statements

    pytest -s 

Author

Dr. Vinayaka Jyothi

Release History

VersionChangesUrgencyDate
v1.2.9-rcLatest release: v1.2.9-rcLow7/28/2021
v1.2.8-rcMinor Bug Fixes to Multi Label Classification and Adding AutoML SupportLow10/19/2020
v1.2.7-rcFixed MultiClassification Bug For Image Sequence Method Autoreport Generator Minor Bug FixesLow9/21/2020
v1.2.5-rcMulti Class Support Experimental Version for Dataloaders Low9/21/2020
v1.2.2-rcNew Data Processors: 1. TF.Data + Albuminations 2. Keras Sequence + Albuminations Core Function Major Changes 1. Exposing Workers and Final Activations Low7/18/2020
v1.1.59- Multi-GPU Support by Default - Network Factory Parameters Cleaned - Minor Bug Fixes - Network Initialization Bug Fixes - Optimizer API Expose - Networks get variable Name change for consistency - Predict on Generator - Bug Fix Reverted. - Resnet Network Clean up and Resnet50, Resnet50V2, Resnet101,Resnet101V2, Resenet152,Resenet152V2 Added.Low6/5/2020
v1.1.52- DCM Processing Optimization for Production - Minor Bug Fixes - Download Bug Fix for HTTPS - Minor Update to Inference Functions - Explain Method Update to Inference and Training Low5/23/2020
v1.1.41Release v1.1.41Low5/10/2020
v1.1.0- Improved Dataset Processing Speed and Memory Load - New Networks Added Low4/13/2020
v1.0.8Update to Requirements in Setup File, so that the library is fully ready to use.Low4/2/2020
v1.0.7- Major Bug Fixes - Update to access methodsLow3/31/2020
v1_04Depreciation Warning Bug FixesLow3/28/2020
v1.0.3Fix PIP Installation ErrorsLow3/28/2020
v1_02Bug Fixes for Installation ErrorsLow3/28/2020
v1_01Built on Tensorflow. Focus on making Training, inference, and experimentation easier to even common man.Low3/28/2020

Dependencies & License Audit

Loading dependencies...

Similar Packages

modular-image-classification-frameworkA modular deep learning framework for training and evaluating image classification models on datasets like CIFAR-10 and MNIST. Supports configurable CNN architectures, automated training, and performamain@2026-05-28
JackrabbitAIA Python framework for building flexible, multi-provider AI applications and Discord bots using OpenAI and Cohere.main@2026-05-28
Wee-Orchestrator🍀 Self-hosted multi-agent AI orchestrator — chat with Claude, Gemini & Copilot CLI from Telegram, WebEx, or browser. 5 runtimes, 17+ models, task scheduling, skill plugins.main@2026-05-08
acr-frameworkACR Control Plane: runtime control & governance for agentic AI (six-pillar enforcement).v1.1.0
surfThe open framework for extensible & grounded AI agent orchestration.0.0.0

More in Frameworks

deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of ta
simBuild, deploy, and orchestrate AI agents. Sim is the central intelligence layer for your AI workforce.
ctranslate2Fast inference engine for Transformer models
schemathesisProperty-based testing framework for Open API and GraphQL based apps