Skip to content

A1pha-Z3r0/FMD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bacterial Infection Detection Web App

Description

This repository contains two separate web applications for detecting bacterial infections in fruits using image classification:

  1. Microscopic Images:
    This app is designed to classify bacterial infections using microscopic images of fruit samples.

  2. Macroscopic Images:
    This app focuses on classifying infections using macroscopic images of fruits.

Both applications can classify images into one of seven categories, including five types of bacterial infections, a healthy class, and an unknown class:

  • Streptococcal
  • Staphylococcus
  • E. coli
  • Klebsiella
  • Pseudomonas
  • Healthy
  • Unknown

The model was trained specifically on images of three fruits:

  • Green Apple
  • Tomato
  • Strawberry

The application combines VGG19 and Vision Transformer (ViT) models to produce accurate classification results.

Installation

To set up this project on your local machine, follow these steps:

  1. Clone the repository
    git clone https://github.com/A1pha-Z3r0/FMD.git
    cd FMD
  2. Set up a virtual environment (optional but recommended)
    python3.10 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install the dependencies
    pip install -r requirements.txt
  4. Download the necessary model files Before running either project, download the model files:
    bash download_models.sh
    Note: If the bash script doesn't download the models, you can manually download them using the link below and place them in the appropriate directory: **Link:**https://drive.google.com/drive/folders/19BDQ2pEjPD47Y6qnieiKriKlTA_kTRbf?usp=drive_link
  5. Download Model Files After downloading, ensure that you adjust the model file paths in the app.py files as necessary to match your directory structure.

Usage

To use the web application:

  1. Navigate into any of the directory
  2. Run the FastAPI server
    uvicorn app:app --reload
  3. Access the web app Open your web browser and navigate to http://localhost:8000
  4. Upload images for classification The microscopic model has higher accuracy on microscopic images. The macroscopic model has higher accuracy on macroscopic images

Features

  1. Microscopic App: Classifies microscopic images into 7 categories, including 5 bacterial infections.
  2. Macroscopic App: Classifies macroscopic images into the same 7 categories.
  3. Combined Models: Utilizes both VGG19 and Vision Transformer (ViT) models for enhanced accuracy.
  4. Easy Setup: Built using FastAPI for a simple and quick setup process.
  5. User-Friendly Interface: Easy-to-use web interface for uploading images and viewing results.

About

This repository contains two separate web applications for detecting bacterial infections in fruits using image classification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors