Arabic Medical AI Platform - Datasets, RAG, and Vision Models
Project description
๐ฅ Shifaa - Arabic Medical AI
Revolutionizing Arabic Medical AI for the MENA Region
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:
- Mental Health Consultations - 35,648 consultations
- Medical Consultations - 84,422 consultations
โ 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
๐๏ธ 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)
๐ Documentation
- Installation Guide - Detailed setup instructions
- Datasets Documentation - Dataset details and usage
- RAG Documentation - RAG system guide
- Vision Documentation - Medical imaging models
- Contributing Guide - How to contribute
- Colab Notebook - Interactive examples
๐ Examples
Try in Google Colab
The easiest way to get started is with our interactive Colab notebook:
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:
-
- 35,648 consultations
- 7 specializations
- 123 specific diagnoses
-
- 84,422 consultations
- 16 specializations
- 585 hierarchical diagnoses
- Average answer length: 273 words
๐ค Models on HuggingFace
All vision models are available on HuggingFace:
Classification:
- Brain Tumor - ResNet18
- COVID-19 - ResNet50
- Diabetic Retinopathy - EfficientNetB0
- Eye Disease - EfficientNetB0
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
- GitHub: github.com/AhmedSeelim/shifaa
- HuggingFace: huggingface.co/Ahmed-Selem
- PyPI: pypi.org/project/shifaa
- Colab Notebook: Try Shifaa in Colab
๐ฌ Support
- Issues: GitHub Issues
- Email: ahmedselimmahmoud1@gmail.com
๐ 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 โญ
Made with โค๏ธ for the MENA healthcare community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4f93d5d12fa4860663ca71a749b6a671242e301a7cae150423fba734c143834
|
|
| MD5 |
64b7208fd11a32e81aaf5cde8d85e820
|
|
| BLAKE2b-256 |
56695623c2ddabde7039f0fc252e54c06faa8a7423ef5f5ecea9f79f9c684b81
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
953b2c90538354d9dbf2e692a8162bf38dae90db1a140d264f1d28732ab578a0
|
|
| MD5 |
6bd6cc0379d838f5a660351fae50c2fe
|
|
| BLAKE2b-256 |
7ad0a8e94d7f0331970ab49be5ae497933398d630eab2351e9381c199b435bdd
|