EAV123's picture
Update README.md
de2d72c verified

A newer version of the Streamlit SDK is available: 1.44.1

Upgrade
metadata
title: Microbial Susceptibility Analyzer
emoji: πŸ‘
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.43.2
app_file: app.py
pinned: false
license: mit
thumbnail: >-
  https://cdn-uploads.huggingface.co/production/uploads/64774490312e3909019550f0/JWfMLBEIsP543Hu2G5yAR.jpeg

Microbial Susceptibility Analyzer

Overview

The Microbial Susceptibility Analyzer is a Streamlit-based web application that combines machine learning and rule-based decision making to predict antibiotic resistance patterns. The application provides:

  • Susceptibility predictions for organism-antibiotic combinations
  • Rule-based guidance for treatment decisions
  • AI-powered explanations and recommendations
  • Batch prediction capabilities for CSV datasets

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/microbial-susceptibility-analyzer.git
cd microbial-susceptibility-analyzer
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables: Create a .streamlit/secrets.toml file with your API keys:
OPENAI_API_KEY = "your_openai_api_key"
OPENAI_BASE_URL = "https://api.openai.com/v1"

Usage

Run the application:

streamlit run app.py

The application provides several pages:

  • Home: Project overview and introduction
  • Susceptibility Analysis: Single prediction interface
  • AI Assistant: Expert system for detailed explanations
  • Data Upload: Batch prediction for CSV files
  • About: Project information and contact details

File Structure

microbial-susceptibility-analyzer/
β”œβ”€β”€ app.py                 # Main application file
β”œβ”€β”€ prediction.py          # Prediction logic
β”œβ”€β”€ ai_assistant.py        # AI integration
β”œβ”€β”€ utils.py               # Utility functions
β”œβ”€β”€ config.py              # Configuration settings
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ README.md              # This documentation
β”œβ”€β”€ label_encoders/        # Label encoding files
β”‚   β”œβ”€β”€ organism_label_encoder.json
β”‚   β”œβ”€β”€ antibiotic_label_encoder.json
β”‚   └── ...
β”œβ”€β”€ models/                # Trained models
β”‚   β”œβ”€β”€ best_model.pkl
β”‚   └── best_model_1.pkl
└── data/                  # Data files
    β”œβ”€β”€ implied_susceptibility_rules.csv
    └── microbiology_cultures_implied_susceptibility.csv

Configuration

The application requires the following configuration:

  1. Model Path: Set in config.py
  2. Encoder Directory: Set in config.py
  3. OpenAI API: Configure in .streamlit/secrets.toml

License

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

Contact

For questions or support, contact:
Chukwuebuka Anulunko
[email protected]