SparkAI is a full-stack AI-powered web application designed to predict student academic performance and provide personalized recommendations. The system leverages Machine Learning techniques to identify at-risk students and assist teachers, students, and administrators with data-driven insights.
This project is developed as a Final Year Engineering Project and follows both academic (IEEE) and industry-level standards.
Teacher Dashboard with student performance overview
Student Dashboard with personal metrics
AI Performance Prediction Form
| Role | Capabilities |
|---|---|
| Admin | โข Add/delete users โข Upload student data via CSV โข Manage all records |
| Teacher | โข View analytics dashboard โข Identify at-risk students โข View prediction history โข Download AI reports |
| Student | โข View personal dashboard โข Receive AI recommendations โข Track history โข Download PDF reports |
| Component | Marks | Weight |
|---|---|---|
| ๐ Assignments | 10 | 10% |
| ๐ Midterm | 20 | 20% |
| ๐งช Internal Score | 30 | 30% |
| ๐ End-term (Predicted) | 40 | 40% |
| Category | Score Range | Risk Level |
|---|---|---|
| ๐ข Excellent | 80-100 | Low Risk |
| ๐ต Good | 70-79 | Low Risk |
| ๐ก Average | 60-69 | Medium Risk |
| ๐ด Needs Improvement | Below 60 | High Risk |
- High Risk: Total score < 60 OR Attendance < 60%
- Medium Risk: Total score < 70 OR Attendance < 75%
- Low Risk: All other cases
- Class overview statistics
- Student list with detailed scores (A/10, M/20, I/30, E/40)
- Risk level indicators with color coding
- Performance distribution charts
- Advanced filtering and sorting
- CSV export functionality
- Personal metrics dashboard
- Score breakdown with progress bars
- AI performance insights
- Personalized recommendations
- Recent prediction history
- PDF report download
- Timeline view of all predictions
- Detailed score breakdowns
- Performance trend analysis
- Category distribution charts
- Export to CSV
Intelligent academic assistant that provides guidance on:
- ๐ Attendance improvement strategies
- ๐ Study planning and time management
- โ๏ธ Exam preparation techniques
- ๐ GPA enhancement tips
โ ๏ธ Risk level analysis- ๐ฏ Personalized recommendations
Features:
- Quick action buttons for common queries
- Conversation history tracking
- Export chat functionality
- Real-time typing indicators
- Clean, modern chat interface
AI-generated comprehensive student progress report including:
- Student information and profile
- Academic metrics with score breakdown
- AI-predicted performance category
- Risk level analysis
- Personalized recommendations
- Total score calculation
- Performance trends
Admin can upload multiple students via CSV with automatic login credential generation:
roll_no,name,attendance,assignments_score,midterm_score,internal_score,final_score,study_hours,performance
101,John Doe,85,9,17,25,32,3,Good
102,Jane Smith,92,9,18,28,36,3,Excellent
๐ง Machine Learning Architecture
Models Used
Model Type Purpose Output
Regression End-term prediction 0-40 marks
Classification Performance category Excellent/Good/Average/Poor
Algorithms
Random Forest Regressor
Random Forest Classifier
Gradient Boosting (optional)
Ensemble methods
Feature Engineering
Attendance percentage
Assignments score (0-10)
Midterm score (0-20)
Internal score (0-30)
Study hours per day
Interaction features
Academic score ratios
Fallback Formula
When ML models are unavailable, the system uses:
text
Predicted End-term = (Academic Scores ร 70%) + (Attendance ร 30%)
Where Academic Scores = Assignments + Midterm + Internal (max 60 marks)
๐ Project Structure
text
SparkAI-Student-Performance-Prediction/
โ
โโโ ๐ app.py # Main Flask application
โโโ ๐ model_train.py # ML model training
โโโ ๐ database_setup.py # Database initialization
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ student_data.csv # Sample dataset
โโโ ๐ .gitignore # Git ignore rules
โโโ ๐ README.md # Documentation
โ
โโโ ๐ ml_model/ # Trained ML models
โ โโโ endterm_predictor_40.joblib
โ โโโ performance_classifier.joblib
โ โโโ label_encoder.joblib
โ โโโ scaler.joblib
โ โโโ feature_columns.joblib
โ
โโโ ๐ database/ # SQLite database
โ โโโ student_system.db
โ
โโโ ๐ templates/ # HTML templates
โ โโโ base.html
โ โโโ index.html
โ โโโ login.html
โ โโโ predict.html
โ โโโ result.html
โ โโโ teacher_dashboard.html
โ โโโ student_dashboard.html
โ โโโ admin_dashboard.html
โ โโโ prediction_history.html
โ โโโ student_history.html
โ โโโ chatbot.html
โ โโโ student_profile.html
โ
โโโ ๐ static/ # Static assets
โ โโโ css/
โ โโโ js/
โ โโโ images/
โ
โโโ ๐ screenshots/ # Project screenshots
โโโ teacher-dashboard.png
โโโ student-dashboard.png
โโโ prediction-form.png
โโโ chatbot.png
๐ Installation & Setup
Prerequisites
Python 3.8 or higher
pip package manager
SQLite3
Git
Step-by-Step Installation
Clone the repository
bash
git clone https://github.com/yourusername/SparkAI-Student-Performance-Prediction.git
cd SparkAI-Student-Performance-Prediction
Create virtual environment
bash
# Windows
python -m venv venv
venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activate
Install dependencies
bash
pip install -r requirements.txt
Set up database
bash
python database_setup.py
Train ML models (optional)
bash
python model_train.py
Note: The app includes a fallback formula, so training is optional. The system works perfectly even without trained models.
Run the application
bash
python app.py
Access the application
text
http://localhost:5000
๐ Default Login Credentials
Role Username Password Description
Admin admin admin123 Full system access
Teacher teacher teacher123 View analytics and student data
Student student101 student123 Personal dashboard access
Tip: After starting the app, visit /add-sample-data to populate the database with 100+ sample students for testing.
๐ Database Schema
Users Table
sql
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE,
password TEXT,
role TEXT CHECK(role IN ('admin', 'teacher', 'student')),
roll_no INTEGER
);
Students Table
sql
CREATE TABLE students (
roll_no INTEGER PRIMARY KEY,
name TEXT,
attendance REAL,
assignments_score REAL,
midterm_score REAL,
internal_score REAL,
final_score REAL,
study_hours REAL,
performance TEXT
);
Prediction History Table
sql
CREATE TABLE prediction_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
roll_no INTEGER,
assignments_score REAL,
midterm_score REAL,
internal_score REAL,
predicted_endterm REAL,
total_score REAL,
predicted_label TEXT,
date_time TEXT,
FOREIGN KEY (roll_no) REFERENCES students(roll_no)
);
๐งช Model Performance Metrics
Regression Model (End-term Predictor)
Metric Value
Rยฒ Score 0.85-0.92
RMSE ยฑ3-4 marks
MAE ยฑ2-3 marks
Classification Model (Performance Category)
Metric Value
Accuracy 88-94%
Precision 0.87-0.93
Recall 0.86-0.92
F1-Score 0.86-0.92
๐ฏ Use Cases
Early Intervention - Identify at-risk students before they fail
Personalized Learning - Tailored recommendations for each student
Data-Driven Decisions - Help teachers make informed decisions
Progress Tracking - Monitor student improvement over time
Administrative Planning - Generate reports for stakeholders
Student Self-Assessment - Students can track their own progress
๐ฎ Future Enhancements
Deep Learning Models - LSTM for time-series prediction
LLM Integration - Advanced chatbot with GPT capabilities
Real-time Analytics - WebSocket-based live updates
Cloud Deployment - AWS/Azure/GCP hosting
Mobile App - React Native or Flutter app
Multi-language Support - Hindi, regional languages
LMS Integration - Moodle, Canvas plugins
Advanced Visualizations - Interactive charts with D3.js
Email Notifications - Automated alerts for at-risk students
WhatsApp Bot - Chatbot integration with WhatsApp
๐จโ๐ Author
RAKESH G
๐ Engineering Student, KRMU (K.R. Mangalam University)
๐ค AI / Machine Learning Minor Project
๐ง Email: 2401201064@krmu.edu.in
๐ LinkedIn: linkedin.com/in/rakesh-g
๐ฑ GitHub: github.com/rakeshg
๐ License
This project is developed for educational purposes as part of a Final Year Engineering Project.
text
MIT License
Copyright (c) 2026 RAKESH G
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
๐ Acknowledgements
K.R. Mangalam University - Project guidance and support
Scikit-learn - Machine learning library
Flask Community - Web framework
Tailwind CSS - UI components
Font Awesome - Icons
Chart.js - Data visualization
ReportLab - PDF generation
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (git checkout -b feature/AmazingFeature)
Commit your changes (git commit -m 'Add some AmazingFeature')
Push to the branch (git push origin feature/AmazingFeature)
Open a Pull Request
โญ Show Your Support
If you find this project useful, please consider giving it a star on GitHub! โญ
<div align="center"> <sub>Built with โค๏ธ for better education outcomes | Final Year Engineering Project 2026</sub> <br> <sub>๐ K.R. Mangalam University | ๐
February 2026</sub> </div> ```