Admin 10 Jun 2026 18:26

 

Marathi Character Recognition Using Deep Learning

Marathi, spoken by more than 80 million people, uses the Devanagari script with several languagespecific modifications. Automatic recognition of Marathi characters is essential for digitizing printed material, enabling realtime translation, and building assistive technologies for visually impaired users. In the past decade, deep learningparticularly convolutional neural networks (CNNs)has become the dominant approach for optical character recognition (OCR). This page explains the problem domain, data preparation, model design, training strategies, and evaluation techniques that are most effective for Marathi character recognition.

1. Understanding the Script

The Marathi alphabet consists of:

  • Vertical and horizontal strokes typical of Devanagari.
  • 45 basic consonants and 13 vowels.
  • Numerous ligatures (conjunct consonants) that create new visual forms.
  • Vowel signs (matras) that appear above, below, before or after the base consonant.

Because of these combinatorial possibilities, a single word can contain dozens of distinct glyphs. A robust recognizer must therefore handle:

  • Variations in font style (e.g., Times New Roman, Devanagari MT, handwritten styles).
  • Noise introduced by scanning or photographing documents.
  • Skew and perspective distortion.

2. Data Collection & Preprocessing

2.1 Datasets

Publicly available sources include:

  • Marathi Handwritten Character Dataset (MHCD) 42,000 isolated characters written by 500 volunteers.
  • Devanagari Handwritten Character Dataset (DHCD) contains many characters common to Marathi.
  • Customgenerated synthetic data using font rendering libraries (e.g., python-pil or opencv).

2.2 Preprocessing Pipeline

def preprocess(img):    # 1. Convert to grayscale    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)    # 2. Binarise with Otsu threshold    _, binary = cv2.threshold(gray, 0, 255,                              cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)    # 3. Remove small noise    kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (3,3))    clean = cv2.morphologyEx(binary, cv2.MORPH_OPEN, kernel)    # 4. Deskew    coords = np.column_stack(np.where(clean > 0))    angle = cv2.minAreaRect(coords)[-1]    if angle < -45:        angle = -(90 + angle)    else:        angle = -angle    (h, w) = clean.shape    M = cv2.getRotationMatrix2D((w//2, h//2), angle, 1.0)    deskewed = cv2.warpAffine(clean, M, (w, h),                              flags=cv2.INTER_CUBIC,                              borderMode=cv2.BORDER_REPLICATE)    # 5. Resize to 32x32 while keeping aspect ratio    resized = cv2.resize(deskewed, (32, 32), interpolation=cv2.INTER_AREA)    return resized

The above routine produces a uniform 3232 binary image suitable for feeding into small CNNs.

3. Model Architecture

For isolated character classification, a shallow CNN often outperforms deeper models because the input resolution is low and the number of classes (~60) is manageable.

3.1 Baseline CNN

model = tf.keras.Sequential([    tf.keras.layers.Conv2D(32, (3,3), activation='relu',                         input_shape=(32,32,1)),    tf.keras.layers.MaxPooling2D(2,2),    tf.keras.layers.Conv2D(64, (3,3), activation='relu'),    tf.keras.layers.MaxPooling2D(2,2),    tf.keras.layers.Conv2D(128, (3,3), activation='relu'),    tf.keras.layers.Flatten(),    tf.keras.layers.Dense(256, activation='relu'),    tf.keras.layers.Dropout(0.5),    tf.keras.layers.Dense(num_classes, activation='softmax')])

Key design choices:

  • Small kernels (33) capture fine strokes.
  • Dropout mitigates overfitting on limited handwritten data.
  • Using BatchNormalization after each convolution can improve convergence.

3.2 Transfer Learning Option

If larger datasets are unavailable, pretrained models such as MobileNetV2 or EfficientNetB0 can be finetuned on 3232 grayscale images (after upsampling to the required input size). The advantage is faster convergence and better generalisation, especially when dealing with complex ligatures.

4. Training Strategies

  • Data Augmentation random rotations (15), shear, scaling (0.91.1), and elastic distortions mimic handwriting variability.
  • Class Balancing oversample scarce ligature classes or use weighted categorical crossentropy.
  • Learning Rate Scheduling ReduceLROnPlateau or cosine decay helps avoid plateaus.
  • Early Stopping monitor validation loss to prevent overfitting.

5. Evaluation Metrics

Besides overall accuracy, the following metrics are useful for a script with many similar shapes:

  • Topk Accuracy (k=3) useful when downstream language models can resolve ambiguities.
  • Confusion Matrix visualises systematic confusions (e.g., between and ).
  • Precision/Recall per Class highlights underrepresented ligatures.

6. PostProcessing with Language Models

Pure visual recognition rarely achieves >95% accuracy on realworld documents because many glyphs look alike. Integrating a language model (LM) dramatically improves results:

  • Train an ngram model on a large Marathi corpus; use it to rerank the topk predictions.
  • Employ a transformerbased model (e.g., mBERT finetuned on Marathi) to provide contextual corrections.
  • For handwritten notes, a beam search that combines visual scores with LM probabilities yields a balanced tradeoff.

7. Deployment Considerations

7.1 Edge Devices

Mobile or embedded platforms (Android, Raspberry Pi) benefit from model quantisation (int8) and pruning. TensorFlow Lite or ONNX Runtime enables sub100ms inference for a single character.

7.2 API Service

When processing full pages, it is common to split the pipeline:

  1. Document layout analysis (detect text lines and bounding boxes).
  2. Character segmentation (often using projection profiles or connected component analysis).
  3. Batch inference on the segmented patches.
  4. Reassembly of recognised characters into Unicode strings.

8. Common Challenges & Tips

  • Ligature Explosion: Limit the number of explicit classes by decomposing complex conjuncts into constituent parts and letting the LM recombine them.
  • Skewed Datasets: Augment the rare classes more aggressively; consider synthetic generation of specific ligatures.
  • Noise Sensitivity: Apply median filtering before binarisation, and use a small amount of Gaussian blur during augmentation to make the model robust.
  • Unicode Mapping: Ensure a consistent mapping between class indices and Marathi Unicode code points; store this mapping in a JSON file for reproducibility.

9. Sample Code EndtoEnd Pipeline

import tensorflow as tf, cv2, numpy as np, json, glob# Load class mapwith open('marathi_map.json') as f:    class_map = json.load(f)# Build model (use the baseline architecture)model = build_cnn(num_classes=len(class_map))model.compile(optimizer='adam',              loss='categorical_crossentropy',              metrics=['accuracy'])# Prepare data generatorstrain_datagen = tf.keras.preprocessing.image.ImageDataGenerator(        rescale=1./255,        rotation_range=15,        width_shift_range=0.1,        height_shift_range=0.1,        shear_range=0.15,        zoom_range=0.1,        horizontal_flip=False)train_gen = train_datagen.flow_from_directory(        'data/train',        target_size=(32,32),        color_mode='grayscale',        batch_size=64,        class_mode='categorical')val_datagen = tf.keras.preprocessing.image.ImageDataGenerator(rescale=1./255)val_gen = val_datagen.flow_from_directory(        'data/val',        target_size=(32,32),        color_mode='grayscale',        batch_size=64,        class_mode='categorical')# Traincallbacks = [    tf.keras.callbacks.EarlyStopping(patience=8, restore_best_weights=True),    tf.keras.callbacks.ReduceLROnPlateau(factor=0.5, patience=3)]model.fit(train_gen,          epochs=50,          validation_data=val_gen,          callbacks=callbacks)# Inference on a new imagedef recognise_character(img_path):    img = cv2.imread(img_path)    proc = preprocess(img) / 255.0    proc = np.expand_dims(proc, axis=[0,-1])   # shape (1,32,32,1)    probs = model.predict(proc)[0]    top3 = probs.argsort()[-3:][::-1]    predictions = [(class_map[str(i)], probs[i]) for i in top3]    return predictionsprint(recognise_character('samples/sample1.png'))

This script demonstrates loading a classtoUnicode map, training with augmentation, and performing inference on a single character image.

10. Future Directions

  • FewShot Learning: Apply metalearning (e.g., prototypical networks) to recognise new ligatures from only a handful of examples.
  • Joint DetectionRecognition: Use object detection frameworks (YOLO, FasterRCNN) to locate and classify characters simultaneously, reducing the need for separate segmentation.
  • Multilingual Models: Leverage shared Devanagari components across Hindi, Marathi, and Sanskrit to build a unified recogniser with languagespecific adapters.

By combining a welldesigned CNN, robust data augmentation, and contextual language modelling, it is possible to achieve highaccuracy Marathi character recognition suitable for both academic research and productiongrade OCR services.

Reference Files For Marathi Character Recognition Using Deep Learning
Screenshoot
File Name
7_may2019.pdf

File Size
0.24 MB

File Type
PDF

File Site
Description
This file is just a reference file for Marathi Character Recognition Using Deep Learning. Does not guarantee that the specific things you want are included in it.
Direct download (wait 10 seconds)

Marathi Character Recognition Using Deep Learning and Reference File Download Link


admin
Admin
2026-06-10 18:26:06

Marathi Character Recognition Using Ant Miner Algorithm and Reference File Download Link


admin
Admin
2026-06-09 04:58:09

Isolated Word Recognition For Marathi Language Using VQ And HMM and Reference File Downloa...


admin
Admin
2026-06-14 23:14:12

Online Handwritten Character Recognition Using Lipi Toolkit and Reference File Download Li...


admin
Admin
2026-06-14 03:30:20

Mesin Penggoreng Deep Fryer (deep Frying Machine) and Reference File Download Link


admin
Admin
2026-06-09 02:46:15