CoolFace
Modelpublic

kaixkhazaki/deit_doclaynet_base

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes10downloads
Model Card

Data-efficient Image Transformer(DeiT) for Document Classification(DocLayNet)

This model is a fine-tuned Data-efficient Image Transformer(DeiT) for document image classification based on the DocLayNet dataset.

Trained on images of the document categories from DocLayNet dataset where the categories namely(with their indexes) are :

{'financialreports': 0, 'governmenttenders': 1, 'lawsandregulations': 2, 'manuals': 3, 'patents': 4, 'scientific_articles': 5}

Model description

DeiT(facebook/deit-base-distilled-patch16-224) finetuned on document classification

Training data

DocLayNet-base https://huggingface.co/datasets/pierreguillou/DocLayNet-base

Training procedure

hyperparameters:

{ 'batchsize': 128, 'numepochs': 20, 'learningrate': 1e-4, 'weightdecay': 0.1, 'warmupratio': 0.1, 'gradientclip': 0.1, 'dropoutrate': 0.1, 'labelsmoothing': 0.1 'optmizer': 'AdamW' }

Evaluation results

Test Loss: 0.8134, Test Acc: 81.56%

Usage

python
from transformers import pipeline

# Load the model using the image-classification pipeline
pipe = pipeline("image-classification", model="kaixkhazaki/vit_doclaynet_base")

# Test it with an image
result = pipe("path_to_image.jpg")
print(result)