Skip to content

Unnati1007/AyurPredict-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌿 AyurPredict-AI

AyurPredict is an AI-driven platform that predicts interactions between Ayurvedic herbs and biological targets, helping researchers and users discover potential therapeutic applications. The system bridges the gap between traditional Ayurvedic medicine and computational biology by applying trustworthy machine learning models to predict herb-target interactions with high precision.


🌟 Key Innovation

AyurPredict applies Trustworthy Machine Learning to traditional medicine. Instead of just focusing on raw accuracy, the models are optimized for precision and prediction stability. This ensures that the herbal recommendations and target predictions are reliable, biologically plausible, and safe for clinical research environments.

📊 System Stats

  • 20+ Ayurvedic Herbs (e.g., Ashwagandha, Tulsi, Brahmi, Giloy)
  • 300+ Active Compounds
  • 8,000+ Interactions recorded
  • ~87% Cross-Validated Accuracy

🚀 Features & Pathways

1️⃣ User Mode (Symptom → Herbs Recommendation)

Designed for general users seeking herbal recommendations based on specific symptoms.

  • How it works: Enter symptoms (e.g., "anxiety", "insomnia", "fatigue"). The model extracts related therapeutic properties (e.g., Property_adaptogenic, Property_sedative) and predicts the most effective Ayurvedic herbs.
  • Output: Returns ranked recommended herbs along with predicted strength scores and safety/risk warnings.

2️⃣ Researcher Mode (Herb → Target Prediction)

Designed for researchers and practitioners studying herb-target bioactivity.

  • How it works: Search for an Ayurvedic herb. The model leverages its feature-rich dataset to predict biological targets, interaction pathways, and bioactivity scores.
  • Output: Detailed targets, top chemical compounds, interaction pathways, and therapeutic effects.

🧠 System Architecture & Methodology

Data Pipeline

  • Data Collection: Extracted from BindingDB and curated Ayurvedic databases.
  • Dataset: Over 8,000 interactions across 20+ herbs.
  • Feature Engineering: Includes categorical encoding of herbs/targets, bioactivity metrics (Ki, IC50), compound details, and interactions (Herb_Target_Interaction, Herb_Target_Specificity).

Machine Learning Pipeline

  • Models Evaluated: Random Forest Regressor, Gradient Boosting Regressor, XGBoost.
  • Optimization Strategy: Hyperparameter tuning using GridSearchCV/RandomizedSearchCV to target precision over raw accuracy.
  • Biological Constraints: Parameters tuned to respect biological plausibility and limit overfitting.

🏆 Why Random Forest?

After extensive testing, Optimized Random Forest was chosen as the production model due to:

  1. Highest Precision (0.5699): Critical for trustworthy medical predictions.
  2. Best Prediction Stability (0.3075): Produces consistent and reliable outputs.
  3. Lowest Overfitting Gap (0.1229): Generalizes better to unseen data.

🛠️ Technology Stack

  • Backend: Flask (Python)
  • Machine Learning: Scikit-Learn (RandomForestRegressor), XGBoost
  • Data Manipulation: Pandas, NumPy, Joblib (for model serialization)
  • Frontend: HTML, CSS, Bootstrap 5, JavaScript (Jinja2 Templates)
  • Data Visualization: Matplotlib, Seaborn

📁 Project Structure

AyurPredict-AI/
│
├── app.py                  # Main Flask application and API routes
├── model/                  # ML core and serialized artifacts
│   ├── ayurpredict_trustworthy_optimized_model.pkl
│   ├── feature_encoders.pkl
│   ├── ayurpredict_model_ready.csv
│   └── script.py           # Core logic (AyurPredictSystem class)
├── templates/              # Jinja2 HTML templates
│   ├── index.html          # Landing page
│   ├── user.html           # User Pathway interface
│   ├── researcher.html     # Researcher Pathway interface
│   └── documentation.html  # Comprehensive system documentation
├── static/                 # CSS and JavaScript assets
└── data/                   # Data files and charts (scatter plots, radar charts)

⚙️ Getting Started

Prerequisites

  • Python 3.8+

Installation Steps

  1. Clone the repository:

    git clone https://github.com/Unnati1007/AyurPredict-AI.git
    cd AyurPredict-AI
  2. Install required dependencies:

    pip install Flask scikit-learn pandas numpy joblib xgboost
  3. Run the application:

    python app.py
  4. Access the Web UI: Open your browser and navigate to http://127.0.0.1:5000/


📝 API Endpoints

1. POST /api/analyze-symptoms

  • Description: Predicts the best herbs based on a provided symptom.
  • Payload: {"symptoms": "anxiety"}
  • Response: JSON containing recommended herbs, therapeutic properties, predicted strengths, and safety risks.

2. POST /api/analyze-herb

  • Description: Provides research targets and bioactivity predictions for a specific herb.
  • Payload: {"herb": "Ashwagandha"}
  • Response: JSON containing predicted targets, active compounds, interaction pathways, therapeutic effects, and safety tips.

⚠️ Disclaimer

For research purposes only. The predictions made by AyurPredict are based on computational machine learning models and have not been evaluated by medical professionals. This tool is not intended for medical diagnosis, treatment, or to replace professional medical advice.


📜 License

This project is licensed under the MIT License. See the LICENSE file for details.


👩‍💻 Author

Unnati1007

About

A symptom based herb predictor and researcher

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages