Skip to content

rakesh4407/SparkAI-Student-Performance-Prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SparkAI โ€“ Student Performance Prediction and Recommendation System

Python Flask ML License PRs Status

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.


๐Ÿ“ธ Screenshots

Teacher Dashboard

Teacher Dashboard with student performance overview

Student Dashboard

Student Dashboard with personal metrics

Prediction Form

AI Performance Prediction Form


โœจ Key Features

๐Ÿ” Role-Based Access Control

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

๐Ÿค– AI & Machine Learning

Scoring System (100 marks total)

Component Marks Weight
๐Ÿ“„ Assignments 10 10%
๐Ÿ“ Midterm 20 20%
๐Ÿงช Internal Score 30 30%
๐ŸŽ“ End-term (Predicted) 40 40%

Performance Categories

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

Risk Classification

  • High Risk: Total score < 60 OR Attendance < 60%
  • Medium Risk: Total score < 70 OR Attendance < 75%
  • Low Risk: All other cases

๐Ÿ“Š Dashboards & Analytics

๐Ÿ‘จโ€๐Ÿซ Teacher Dashboard

  • 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

๐Ÿ‘จโ€๐ŸŽ“ Student Dashboard

  • Personal metrics dashboard
  • Score breakdown with progress bars
  • AI performance insights
  • Personalized recommendations
  • Recent prediction history
  • PDF report download

๐Ÿ“ˆ Prediction History

  • Timeline view of all predictions
  • Detailed score breakdowns
  • Performance trend analysis
  • Category distribution charts
  • Export to CSV

๐Ÿ’ฌ AI Chatbot Assistant

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

๐Ÿ“„ PDF Report Generation

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

๐Ÿ“‚ CSV Bulk Upload

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> ```

About

๐ŸŽ“ AI-powered Student Performance Prediction System with ML. Predicts end-term scores, identifies at-risk students, provides personalized recommendations. Features role-based dashboards for teachers/students/admins, CSV upload, PDF reports, and AI chatbot. Built with Flask, Scikit-learn, Tailwind CSS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages