Hebrew Script Mode Classifier
The Hebrew Script Mode Classifier is a deep learning model for classifying
handwritten Hebrew document images into two script mode categories:
The accompanying inference interface also produces a spatial attention
overlay showing the regions that received higher weights from the model's
gated-attention pooling layer.
Model Details
Model Description
The model processes a handwritten Hebrew document image using a ConvNeXt
feature extractor followed by masked gated-attention pooling and a binary
classification head.
The pixel mask prevents padded image regions from contributing to the
attention pooling operation. The output consists of class probabilities for
square and non_square.
The public checkpoint is approximately 950 MB.
- Shared by: Tel Aviv University Computational Humanities (TAU-CH) GitHub organization
- Model type: Image classifier with a ConvNeXt backbone and masked gated-attention pooling
- Task: Hebrew script mode classification
- Language: Hebrew handwritten document images
- Number of classes: 2
- Classes:
square, non_square
- Framework: PyTorch and timm
- Checkpoint format: PyTorch
.pt
- Base architecture: ConvNeXt; the exact backbone configuration is stored in the checkpoint
- Default backbone fallback:
convnext_base.fb_in22k_ft_in1k
Model Sources
-
-
-
-
Paper: TODO: add the publication link when available
Uses
Direct Use
The model is intended for classification of handwritten
Hebrew document images into square and non-square script modes.
The provided Colab interface allows users to:
- Start the inference environment.
- Upload a handwritten Hebrew document image.
- Receive class probabilities for square and non-square.
- View an attention heatmap overlaid on the input image.
The simplest way to use the model is through the public Colab notebook:
Mixed-Script Documents
A page may contain multiple hands, scripts, annotations, marginalia, or mixed
square and non-square writing. The model returns one page-level classification
and does not explicitly model mixed-script content.
Image Cropping
Images larger than the configured maximum dimensions are center-cropped.
Relevant evidence near the page boundaries may therefore be excluded.
The public inference code uses checkpoint-configured maximum dimensions, with
a fallback of 2500 × 2500 pixels.