A smart AI-powered grading system that evaluates handwritten student answers by combining OCR, NLP, and semantic similarity. Upload an answer sheet, compare it with the model answer, and automatically compute a fair grade.
AutoGradeAI is an AI-powered automated grading system designed to streamline the evaluation of handwritten student answers.
Traditional grading requires teachers to manually read and score each answer. This project eliminates that burden by combining OCR (Optical Character Recognition) and semantic similarity models to evaluate answers intelligently.
When an answer sheet is uploaded:
- EasyOCR extracts text from the scanned handwritten answer.
- TextBlob corrects spelling errors introduced during OCR extraction.
- SentenceTransformers generates embeddings for both student and model answers.
- The system computes a semantic similarity score between them.
- The similarity score is converted into a final grade based on configurable weightage.
The result is a system that evaluates answers based on meaning rather than exact wording, making grading more fair and efficient.
| Feature | Description |
|---|---|
| ๐ง AI-Powered Grading | Uses semantic similarity instead of simple keyword matching |
| ๐ Handwritten Text Extraction | EasyOCR extracts text directly from scanned answer sheets |
| โ๏ธ Spelling Correction | TextBlob automatically corrects OCR mistakes |
| ๐ฏ Semantic Similarity Evaluation | SentenceTransformers compares meaning between answers |
| โ๏ธ Custom Weightage System | Teachers can define marks per question |
| ๐ Similarity-Based Grading | Marks are calculated from similarity score percentages |
| ๐ Interactive Web App | Built with Streamlit for easy use |
graph TD
A[๐ค Teacher uploads answer sheet] --> B[Streamlit Web Interface]
B --> C[Image Processing]
C --> D[EasyOCR Text Extraction]
D --> E[TextBlob Spelling Correction]
E --> F[Student Answer Embedding]
G[Model Answer] --> H[Model Embedding]
F --> I[Semantic Similarity Calculation]
H --> I
I --> J[Similarity Score %]
J --> K[Weightage-based Grade Calculation]
K --> L[Final Marks Output]
The grading process consists of four main stages:
1๏ธโฃ OCR Extraction
- EasyOCR scans the uploaded answer sheet
- Extracts the handwritten content into machine-readable text
2๏ธโฃ Text Cleaning
- TextBlob performs spelling correction
- Ensures OCR errors do not affect evaluation
3๏ธโฃ Semantic Comparison
- SentenceTransformers generates embeddings
- Cosine similarity measures how closely answers match
4๏ธโฃ Grade Computation
- Similarity score converted into marks
- Adjusted based on teacher-defined weightage
| Component | Technology |
|---|---|
| Programming Language | Python |
| Web Interface | Streamlit |
| OCR Engine | EasyOCR |
| Semantic Similarity | SentenceTransformers |
| Spelling Correction | TextBlob |
| Image Processing | PIL |
| Numerical Processing | NumPy |
automated-grading-system/
โ
โโโ app.py # Streamlit application
โโโ grading_engine.py # Core grading logic
โโโ ocr_processor.py # EasyOCR extraction
โโโ similarity_model.py # SentenceTransformer embedding + similarity
โโโ utils/
โ โโโ spell_correct.py # TextBlob spelling correction
โ โโโ image_utils.py # Image preprocessing utilities
โ
โโโ requirements.txt # Python dependencies
โโโ README.md
- Python 3.9+
- pip
- GPU optional (for faster OCR processing)
git clone https://github.com/your-username/automated-grading-system.git
cd automated-grading-systempip install -r requirements.txtThis installs:
- Streamlit
- EasyOCR
- SentenceTransformers
- TextBlob
- NumPy
- Pillow
Launch the Streamlit app:
streamlit run app.pyThe application will start locally:
http://localhost:8501
Upload a scanned image of the student answer sheet.
Supported formats:
- PNG
- JPG
- JPEG
Provide the correct reference answer that will be used for evaluation.
Define the maximum marks for the question.
Example:
Total marks: 10
Click Evaluate, and the system will:
- Extract text using OCR
- Correct spelling
- Compute semantic similarity
- Calculate final marks
| Metric | Result |
|---|---|
| Corrected Student Answer | Displayed in UI |
| Similarity Score | 87% |
| Total Marks | 10 |
| Marks Awarded | 8.7 |
| Setting | File | Description |
|---|---|---|
| OCR Model | ocr_processor.py |
EasyOCR language settings |
| Similarity Model | similarity_model.py |
SentenceTransformer model |
| Grading Logic | grading_engine.py |
Score calculation formula |
| UI Interface | app.py |
Streamlit UI |
Improve results by:
- Using high-resolution images
- Avoiding skewed answer sheets
- Ensuring clear handwriting
OCR and embeddings can be slow on CPU.
Solutions:
- Enable GPU for EasyOCR
- Use lighter SentenceTransformer models
- ๐ Multi-language grading
- โ๏ธ Improved handwriting recognition
- ๐ง Context-aware answer evaluation
- ๐๏ธ Student result database
- ๐ Analytics dashboard for teachers
- ๐ Bulk grading support
This project is licensed under the MIT License.
This project was built using several powerful open-source technologies:
- EasyOCR โ text extraction from images
- TextBlob โ spelling correction and NLP utilities
- SentenceTransformers โ semantic similarity modeling
- Streamlit โ rapid web app development for AI projects
Transforming traditional grading into intelligent AI evaluation.
AutoGradeAI โ because grading should measure understanding, not just keywords.