{"id":14970734,"url":"https://github.com/aibharata/medicalai","last_synced_at":"2025-10-26T13:31:12.327Z","repository":{"id":45461559,"uuid":"249692520","full_name":"aibharata/medicalAI","owner":"aibharata","description":"Medical-AI is a AI framework specifically for Medical Applications https://aibharata.github.io/medicalAI/","archived":false,"fork":false,"pushed_at":"2023-06-26T10:52:14.000Z","size":886,"stargazers_count":19,"open_issues_count":4,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T19:12:12.424Z","etag":null,"topics":["ai-framework","keras","medical-applications","medical-imaging","pdf-report","prediction","tensorflow","tensorflow2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aibharata.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-03-24T11:40:38.000Z","updated_at":"2024-10-19T13:44:03.000Z","dependencies_parsed_at":"2023-01-23T15:16:12.989Z","dependency_job_id":null,"html_url":"https://github.com/aibharata/medicalAI","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibharata%2FmedicalAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibharata%2FmedicalAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibharata%2FmedicalAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aibharata%2FmedicalAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aibharata","download_url":"https://codeload.github.com/aibharata/medicalAI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238337307,"owners_count":19455285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-framework","keras","medical-applications","medical-imaging","pdf-report","prediction","tensorflow","tensorflow2"],"created_at":"2024-09-24T13:44:03.835Z","updated_at":"2025-10-26T13:31:11.926Z","avatar_url":"https://github.com/aibharata.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://aibharata.github.io/medicalAI/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/aibharata/medicalAI/master/logo/logo.png\" alt=\"MedicalAI\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eMedical-AI is a AI framework for rapid protyping for Medical Applications\u003c/em\u003e\n\u003c/p\u003e\n\n\n---\n\n**Documentation**: \u003ca href=\"https://aibharata.github.io/medicalAI/\" target=\"_blank\"\u003ehttps://aibharata.github.io/medicalAI/\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/aibharata/medicalai\" target=\"_blank\"\u003ehttps://github.com/aibharata/medicalai\u003c/a\u003e\n\n**Youtube Tutorial**: \u003ca href=\"https://www.youtube.com/V4nCX-kLACg\" target=\"_blank\"\u003ehttps://www.youtube.com/V4nCX-kLACg\u003c/a\u003e\n\n---\n\n\n[![Downloads](https://pepy.tech/badge/medicalai)](https://pepy.tech/project/medicalai) [![Downloads](https://pepy.tech/badge/medicalai/month)](https://pepy.tech/project/medicalai/month) [![Documentation Status](https://readthedocs.org/projects/medicalai/badge/?version=latest)](https://medicalai.readthedocs.io/en/latest/?badge=latest) [![Gitter](https://badges.gitter.im/aibh-medicalAI/devteam.svg)](https://gitter.im/aibh-medicalAI/devteam?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge) \n\n\nMedical-AI is a AI framework  for rapid prototyping of AI for Medical Applications.\n\n## Installation\n\n\u003cdiv class=\"termy\"\u003e\n\n```py\npip install medicalai\n```\n\n\u003c/div\u003e\n## Requirements\nPython Version : 3.5-3.7 (Doesn't Work on 3.8 Since Tensorflow does not support 3.8 yet.\n\nDependencies: Numpy, Tensorflow, Seaborn, Matplotlib, Pandas\n\n    NOTE: Dependency libraries are automatically installed. No need for user to install them manually.\n\n## Usage\n### Getting Started Tutorial: Google Colab [Google Colab Notebook Link](https://colab.research.google.com/drive/1Wma4i5f11oyYrrkz0Y-3FOyPGmIpwKdD)\n\n### Importing the Library\n```py \nimport medicalai as ai\n```\n\n## Using Templates\nYou can use the following templates to perform specific Tasks\n\n### Load Dataset From Folder\nSet the path of the dataset and set the target dimension of image that will be input to AI network.\n```py \ntrainSet,testSet,labelNames =ai.datasetFromFolder(datasetFolderPath, targetDim = (96,96)).load_dataset()\n```\n    - trainSet contains 'data' and 'labels' accessible by trainSet.data and trainSet.labels\n    - testSet contains 'data' and 'labels' accessible by testSet.data and testSet.labels\n    - labelNames contains class names/labels\n\n### Check Loaded Dataset Size\n```py \nprint(trainSet.data.shape)\nprint(trainSet.labels.shape)\n```\n\n### Run Training and Save Model\n```py\ntrainer = ai.TRAIN_ENGINE()\ntrainer.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)\n```\n\n\n### Plot Training Loss and Accuracy\n```py\ntrainer.plot_train_acc_loss()\n```\n\n### Generate a comprehensive evaluation PDF report \n```py\ntrainer.generate_evaluation_report()\n```\nPDF report will be generated with model sensitivity, specificity, accuracy, confidence intervals,\nROC Curve Plot, Precision Recall Curve Plot, and Confusion Matrix Plot for each class.\nThis function can be used when evaluating a model with Test or Validation Data Set.\n\n### Explain the Model on a sample\n```py\ntrainer.explain(testSet.data[0:1], layer_to_explain='CNN3')\n```\n\n\n### Loading Model for Prediction \n```py\ninfEngine = ai.INFERENCE_ENGINE(modelName = 'PATH_WHERE_MODEL_IS_SAVED_TO')\n```\n\n\n### Predict With Labels \n```py\ninfEngine.predict_with_labels(testSet.data[0:2], top_preds=3)\n```\n### Get Just Values of Prediction without postprocessing\n```py\ninfEngine.predict(testSet.data[0:2])\n```\n\n### Alternatively, use a faster prediction method in production\n```py\ninfEngine.predict_pipeline(testSet.data[0:1])\n```\n## Advanced Usage\n\n### Code snippet for Training Using Medical-AI \n```py\n## Setup AI Model Manager with required AI. \nmodel = ai.modelManager(AI_NAME= AI_NAME, modelName = MODEL_SAVE_NAME, x_train = train_data, OUTPUT_CLASSES = OUTPUT_CLASSES, RETRAIN_MODEL= RETRAIN_MODEL)\n\n# Start Training\nresult = ai.train(model, train_data, train_labels, BATCH_SIZE, EPOCHS, LEARNING_RATE, validation_data=(test_data, test_labels), callbacks=['tensorboard'])\n\n# Evaluate Trained Model on Test Data\nmodel.evaluate(test_data, test_labels)\n\n# Plot Accuracy vs Loss for Training\nai.plot_training_metrics(result)\n\n#Save the Trained Model\nai.save_model_and_weights(model, outputName= MODEL_SAVE_NAME)\n```\n\n## Automated Tests\nTo Check the tests\n\n        pytest\n\nTo See Output of Print Statements\n\n        pytest -s \n\n## Author\nDr. Vinayaka Jyothi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faibharata%2Fmedicalai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faibharata%2Fmedicalai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faibharata%2Fmedicalai/lists"}