The problem

Recognizing handwritten Sanskrit characters and words is difficult, and I wanted to compare classic ML against deep learning on the same task.

The solution

A FastAPI backend serving three model approaches (Pixel MLP, CNN embeddings with Linear SVM, and an end-to-end CNN), with an HTML/CSS/JS frontend for uploading images and viewing predictions.

How it works

Architecture & flow

  1. 1

    User uploads an image in the browser

  2. 2

    FastAPI preprocesses the image

  3. 3

    The selected model predicts the character or word

  4. 4

    Low-confidence inputs return 'unclassified'

  5. 5

    Evaluation endpoints report model performance

Problems I hit

Challenges and how I solved them

Challenge 1

Blank, blurry or unrelated images still produced confident-looking wrong answers.

How I fixed it

Added an 'unclassified' output for low-quality, ambiguous or out-of-dataset inputs.

Challenge 2

Fairly comparing very different models.

How I fixed it

Added evaluation endpoints so every model is measured the same way.

Results

  • Three model approaches compared in one app
  • Deployed on Render

What I learned

  • Image preprocessing
  • Classic ML vs CNN trade-offs
  • Serving models with FastAPI
  • Handling uncertain predictions safely

Project Overview

A machine learning and deep learning based recognition system for uploaded Sanskrit character and word images. The project provides a web interface where users can upload images and get predictions from trained models.

Core features

  • Upload Sanskrit character or word images for prediction.
  • FastAPI backend exposes prediction and evaluation APIs.
  • Frontend is built with HTML, CSS, and JavaScript.
  • Supports multiple model approaches including Pixel MLP, CNN embeddings with Linear SVM, and an end-to-end CNN model.
  • Returns unclassified output for blank, low-quality, ambiguous, or out-of-dataset inputs.
  • Includes model evaluation endpoints for checking model performance.

Interview angle

This project is useful to explain computer vision basics, image preprocessing, ML vs CNN model comparison, FastAPI model serving, API-based prediction flow, and how trained ML models are integrated into a web application.

Related

More machine learning projects

Machine Learning Completed

ZonePredict AI - PUBG Safe-Zone Prediction

Uses 438 real PUBG matches to test whether machine learning can guess where the next safe zone will be. Seven models are compared against a simple baseline, and the results can be explored on a clickable map.

PythonPandasScikit-learnXGBoostTensorFlow +3