πΈ IrisAI β Flask ML Web Application
A machine learning web app that classifies Iris flowers using a Random Forest model, built with Flask.
π Project Structure
ml_flask_app/
βββ app.py # Main Flask application
βββ train_model.py # Model training script
βββ requirements.txt # Python dependencies
βββ users.db # SQLite database (auto-created)
βββ model/
β βββ iris_model.pkl # Trained Random Forest model
β βββ scaler.pkl # StandardScaler
β βββ class_names.pkl # Class label names
βββ templates/
βββ base.html # Shared layout
βββ login.html # Login page
βββ register.html # Registration page
βββ predict.html # Prediction form & results
π Setup & Run
# 1. Install dependencies
pip install -r requirements.txt
# 2. (Optional) Retrain the model
python train_model.py
# 3. Run the app
python app.py
Then open http://127.0.0.1:5000 in your browser.
π Default Login
- Username:
admin - Password:
password123
Or register your own account at /register.
π€ Model Details
| Item | Value |
|---|---|
| Dataset | UCI Iris (150 samples, 4 features) |
| Algorithm | Random Forest (100 trees) |
| Accuracy | 90% on held-out test set |
| Classes | setosa, versicolor, virginica |
| Source | https://archive.ics.uci.edu/dataset/53/iris |
β¨ Features
- π Login & registration with SHA-256 password hashing
- π Real-time flower classification with confidence scores
- π Prediction history per user (stored in SQLite)
- π‘ Quick-fill example inputs for each species
- π± Responsive design