A machine learning-based Streamlit web application for predicting Tilapia fish disease risk using IoT water quality parameters like Dissolved Oxygen and pH. This app supports training, evaluating, saving, and making real-time predictions.
- 📤 Upload Excel dataset with timestamped IoT water quality data
- 🔍 Train an SVM classifier using grid search with hyperparameter tuning
- 📈 Visualize model metrics: Accuracy, Precision, Recall, F1-score
- 🔥 Confusion matrix and decision boundary plots
- 💾 Save and load trained models --
Your Excel file should contain the following columns:
DatetimeDissolved Oxygen (mg/L)pHDisease Occurrence (Cases)
A binary target disease is derived internally as:
df['disease'] = (df['Disease Occurrence (Cases)'] > 1.5).astype(int)
Clone the repository
git clone https://github.com/your-username/fish-disease-prediction.git
cd fish-disease-prediction
Create a virtual environment
python -m venv venv
source venv/bin/activate # For Linux/macOS
venv\Scripts\activate # For Windows
Install dependencies
pip install -r requirements.txt
Run the Streamlit app
streamlit run frontend.py
📁 Project Structure
.
├── core.py # Core ML logic (data processing, training, evaluation)
├── frontend.py # Streamlit frontend UI
├── model.pkl # Saved trained model (generated after training)
├── requirements.txt # Python dependencies
└── README.md # Project documentation
-
Upload your IoT dataset (Excel) via the sidebar
-
Configure test window size and SVM parameters (C, gamma, kernel)
-
Click “Run Model” to train and evaluate
-
Visualize performance and decision boundaries
-
Click “Save Model” to persist the best model
-
Switch to the “Predict” tab to use manual inputs for disease prediction


