Skip to main content

Arabic Medical AI Platform - Datasets, RAG, and Vision Models

Project description

๐Ÿฅ Shifaa - Arabic Medical AI

Shifaa Logo

Revolutionizing Arabic Medical AI for the MENA Region

Python 3.8+ License: MIT HuggingFace Open In Colab

Features โ€ข Installation โ€ข Quick Start โ€ข Documentation


๐ŸŒŸ What is Shifaa?

Shifaa is a comprehensive medical AI specifically designed for Arabic-speaking healthcare professionals, researchers, and developers across the MENA region.

Shifaa addresses the critical gap in Arabic healthcare technology by providing:

  • Curated Arabic Medical Datasets - Access to 120K+ real medical consultations
  • Intelligent RAG System - Medical information retrieval with 84K+ knowledge base
  • Pre-trained Vision Models - 7 medical imaging models for diagnosis and segmentation

โœจ Key Features

๐Ÿ“Š Comprehensive Datasets

  • 35,648 Arabic mental health consultations across 7 specializations
  • 84,422 medical consultations covering 16 specializations and 585 diagnoses
  • High-quality, structured data with no missing values
  • Easy access through HuggingFace integration

๐Ÿค– Intelligent RAG System

  • Automatic medical specialty detection from queries
  • Semantic search over 84,000+ consultations
  • Hierarchical topic path identification (585 medical topics)
  • Multi-stage pipeline: Query โ†’ Specialty โ†’ Topics โ†’ Retrieval โ†’ Insights
  • Supports Arabic and multilingual queries

๐Ÿ‘๏ธ Medical Vision Models

  • 4 Classification Models: Brain tumors, COVID-19, diabetic retinopathy, eye diseases
  • 3 Segmentation Models: Heart CT, skin cancer, breast cancer
  • Accuracy up to 98.55% on medical imaging tasks
  • Automatic model download and caching from HuggingFace
  • Built-in visualization and inference tools

๐Ÿš€ Installation

Quick Install

pip install shifaa

From Source

git clone https://github.com/AhmedSeelim/shifaa.git
cd shifaa
pip install -e .

Requirements

  • Python 3.8+
  • PyTorch
  • Transformers
  • LangChain
  • ChromaDB

For complete requirements, see requirements.txt.


โšก Quick Start

1. Load Datasets

from shifaa.datasets import load_shifaa_mental_dataset, load_shifaa_medical_dataset

# Load mental health consultations
mental_data = load_shifaa_mental_dataset()
print(f"Loaded {len(mental_data)} mental health consultations")

# Load medical consultations
medical_data = load_shifaa_medical_dataset()
print(f"Loaded {len(medical_data)} medical consultations")

2. Use Medical RAG

from shifaa.rag import MedicalRAGSystem
import os

# Set your Google API key
os.environ["GOOGLE_API_KEY"] = "your-api-key-here"

# Initialize RAG system (auto-downloads vector database)
rag = MedicalRAGSystem()

# Query in Arabic
results = rag.process_query("ู…ุง ู‡ูŠ ุฃุนุฑุงุถ ุงู„ุณูƒุฑูŠุŸ")

# Access results
print(f"Specialties: {[s.specialty for s in results.specialties]}")
print(f"Insights: {[i.information for i in results.insights]}")

3. Analyze Medical Images

from shifaa.vision import VisionModelFactory

# Classification: Brain tumor detection
model = VisionModelFactory.create_model(
    model_type="classification",
    model_name="Brain_Tumor"
)
result = model.run("brain_scan.jpg", show_image=True)
print(f"Prediction: {result['predicted_class']}")
print(f"Confidence: {result['confidence']:.2f}%")

# Segmentation: Skin cancer detection
seg_model = VisionModelFactory.create_model(
    model_type="segmentation",
    model_name="Skin_Cancer"
)
results = seg_model.run("skin_lesion.jpg", show_image=True)
image = results["image"]
mask = results["predicted_mask"]

๐Ÿ“š Modules Overview

๐Ÿ“Š Datasets Module

Access curated Arabic medical datasets hosted on HuggingFace.

Features:

  • Simple API for loading datasets
  • Automatic caching
  • 120K+ consultations covering mental health and general medicine

Example:

from shifaa.datasets import load_shifaa_medical_dataset
dataset = load_shifaa_medical_dataset()

Available Datasets:

โ†’ Full Datasets Documentation


๐Ÿค– RAG Module

Medical Retrieval-Augmented Generation system for intelligent information retrieval.

Features:

  • 4-stage pipeline: Specialty detection โ†’ Topic identification โ†’ Consultation retrieval โ†’ Insight extraction
  • Semantic search over 84K+ consultations
  • 585 hierarchical medical topics
  • Arabic language support

Example:

from shifaa.rag import MedicalRAGSystem

rag = MedicalRAGSystem()
results = rag.process_query("ูƒูŠู ุฃุนุงู„ุฌ ุงู„ุตุฏุงุน ุงู„ู…ุฒู…ู†ุŸ")

Pipeline Architecture:

User Query
    โ†“
Specialty Detection (23 specialties)
    โ†“
Topic Path Identification (585 topics)
    โ†“
Semantic Retrieval (84K+ consultations)
    โ†“
Medical Insights Extraction

โ†’ Full RAG Documentation


๐Ÿ‘๏ธ Vision Module

Pre-trained deep learning models for medical image analysis.

Classification Models (4):

Model Task Accuracy HuggingFace
Brain Tumor Tumor classification 98.55% Link
COVID-19 Chest X-ray diagnosis 91.6% Link
Diabetic Retinopathy DR severity detection 98.55% Link
Eye Disease Eye disease classification 95% Link

Segmentation Models (3):

Model Task Dice Score HuggingFace
Heart CT Heart segmentation 0.9479 Link
Skin Cancer Lesion segmentation 0.9175 Link
Breast Cancer Tumor segmentation 0.9179 Link

Example:

from shifaa.vision import VisionModelFactory

model = VisionModelFactory.create_model("classification", "Brain_Tumor")
result = model.run("brain_scan.jpg", show_image=True)

โ†’ Full Vision Documentation


๐Ÿ“– Documentation


๐ŸŽ“ Examples

Try in Google Colab

The easiest way to get started is with our interactive Colab notebook:

Open In Colab

Local Examples

# Clone the repository
git clone https://github.com/AhmedSeelim/shifaa.git
cd shifaa

# Run examples
python examples/datasets_example.py
python examples/rag_example.py
python examples/vision_example.py

๐Ÿ“Š Datasets on HuggingFace

All Shifaa datasets are hosted on HuggingFace for easy access:


๐Ÿค– Models on HuggingFace

All vision models are available on HuggingFace:

Classification:

Segmentation:

RAG Vector Database:


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Shifaa Ecosystem                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚  โ”‚   Datasets   โ”‚  โ”‚     RAG      โ”‚  โ”‚    Vision    โ”‚      โ”‚
โ”‚  โ”‚              โ”‚  โ”‚              โ”‚  โ”‚              โ”‚      โ”‚
โ”‚  โ”‚ โ€ข Mental     โ”‚  โ”‚ โ€ข Medical    โ”‚  โ”‚ โ€ข Brain      โ”‚      โ”‚
โ”‚  โ”‚   Health     โ”‚  โ”‚   RAG        โ”‚  โ”‚   Tumor      โ”‚      โ”‚
โ”‚  โ”‚   (35K)      โ”‚  โ”‚ โ€ข Vector DB  โ”‚  โ”‚ โ€ข COVID-19   โ”‚      โ”‚
โ”‚  โ”‚ โ€ข Medical    โ”‚  โ”‚   (84K)      โ”‚  โ”‚ โ€ข Diabetic   โ”‚      โ”‚
โ”‚  โ”‚   (84K)      โ”‚  โ”‚ โ€ข Semantic   โ”‚  โ”‚   Retinopathyโ”‚      โ”‚
โ”‚  โ”‚              โ”‚  โ”‚   Search     โ”‚  โ”‚ โ€ข Segmentationโ”‚      โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ”‚                                                               โ”‚
โ”‚  HuggingFace Integration โ€ข Automatic Caching โ€ข Easy API     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค Contributing

We welcome contributions from the community! Whether it's:

  • ๐Ÿ› Bug fixes
  • โœจ New features
  • ๐Ÿ“š Documentation improvements
  • ๐ŸŒ Translations
  • ๐Ÿ“Š New datasets
  • ๐Ÿค– New models

๐Ÿ“ Citation

If you use Shifaa in your research, please cite:

@software{shifaa2025,
  title={Shifaa: Arabic Medical AI Platform},
  author={Ahmed Selim and Mariam Hassan and Ghada Saeed and Arwa Mohamed and Nour Ali and Hager Mohamed},
  year={2025},
  url={https://github.com/AhmedSeelim/shifaa},
  note={Datasets and models available at https://huggingface.co/Ahmed-Selem}
}

๐Ÿ“„ License

This project is licensed under the MIT License.


๐ŸŒ Links & Resources


๐Ÿ’ฌ Support


๐Ÿ™ Acknowledgments

Special thanks to:

  • The Arabic medical community for their invaluable feedback
  • HuggingFace for hosting our datasets and models
  • All contributors who made this project possible
  • The MENA healthcare professionals using Shifaa

๐ŸŒŸ Star History

If you find Shifaa useful, please consider giving it a star โญ

Star History Chart


Made with โค๏ธ for the MENA healthcare community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shifaa-0.1.0.tar.gz (62.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shifaa-0.1.0-py3-none-any.whl (57.2 kB view details)

Uploaded Python 3

File details

Details for the file shifaa-0.1.0.tar.gz.

File metadata

  • Download URL: shifaa-0.1.0.tar.gz
  • Upload date:
  • Size: 62.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for shifaa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4f93d5d12fa4860663ca71a749b6a671242e301a7cae150423fba734c143834
MD5 64b7208fd11a32e81aaf5cde8d85e820
BLAKE2b-256 56695623c2ddabde7039f0fc252e54c06faa8a7423ef5f5ecea9f79f9c684b81

See more details on using hashes here.

File details

Details for the file shifaa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shifaa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for shifaa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 953b2c90538354d9dbf2e692a8162bf38dae90db1a140d264f1d28732ab578a0
MD5 6bd6cc0379d838f5a660351fae50c2fe
BLAKE2b-256 7ad0a8e94d7f0331970ab49be5ae497933398d630eab2351e9381c199b435bdd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page