This model is a fine-tuned Vision Transformer (ViT) for document layout classification based on the DocLayNet dataset.
Trained on images of the document categories from DocLayNet dataset where the categories namely(with their indexes) are :
1{'financial_reports': 0,
2 'government_tenders': 1,
3 'laws_and_regulations': 2,
4 'manuals': 3,
5 'patents': 4,
6 'scientific_articles': 5}
7
The model was trained on DocLayNet-base dataset, which is available on the Hugging Face Hub:
pierreguillou/DocLayNet-base
DocLayNet is a comprehensive dataset for document layout analysis, containing various document types and their corresponding layout annotations.
Trained for 10 epochs on a single gpu for ~10 mins.
1{
2 'batch_size': 64,
3 'num_epochs': 20,
4 'learning_rate': 1e-4,
5 'weight_decay': 0.05,
6 'warmup_ratio': 0.2,
7 'gradient_clip': 0.1,
8 'dropout_rate': 0.1,
9 'label_smoothing': 0.1,
10 'optimizer': 'AdamW'
11}
12
1from transformers import pipeline
2
3# Load the model using the image-classification pipeline
4pipe = pipeline("image-classification", model="kaixkhazaki/vit_doclaynet_base")
5
6# Test it with an image
7result = pipe("path_to_image.jpg")
8print(result)
9