
# Document Classification Model

## Overview
This model is trained for document classification using vision transformers (DiT).

## Model Details
* Architecture: Vision Transformer (DiT)
* Tasks: Document Classification
* Training Framework: 🤗 Transformers
* Base Model: microsoft/dit-large
* Training Dataset Size: 32786

## Training Parameters
* Batch Size: 256
* Learning Rate: 0.001
* Number of Epochs: 90
* Mixed Precision: BF16
* Gradient Accumulation Steps: 2
* Weight Decay: 0.01
* Learning Rate Schedule: cosine_with_restarts
* Warmup Ratio: 0.1

## Training and Evaluation Metrics
### Training Metrics
* Loss: 0.1915
* Grad Norm: 1.3002
* Learning Rate: 0.0009
* Epoch: 26.4186
* Step: 1704.0000

### Evaluation Metrics
* Loss: 0.9457
* Accuracy: 0.7757
* Weighted F1: 0.7689
* Micro F1: 0.7757
* Macro F1: 0.7518
* Weighted Recall: 0.7757
* Micro Recall: 0.7757
* Macro Recall: 0.7603
* Weighted Precision: 0.8023
* Micro Precision: 0.7757
* Macro Precision: 0.7941
* Runtime: 8.4106
* Samples Per Second: 433.1450
* Steps Per Second: 3.4480

## Usage

```python
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image

# Load model and processor
processor = AutoImageProcessor.from_pretrained("jnmrr/ds3-img-classification")
model = AutoModelForImageClassification.from_pretrained("jnmrr/ds3-img-classification")

# Process an image
image = Image.open("document.png")
inputs = processor(image, return_tensors="pt")

# Make prediction
outputs = model(**inputs)
predicted_label = outputs.logits.argmax(-1).item()
```

informe_social cargo_ingreso_mpe acta_registro_personal citacion_pnp acta_lectura_derechos_ley30364 acta_intervencion_minpu denuncia_policial providencia_fiscal consulta_medidas_proteccion oficio_medicina_legal oficio_evaluacion_psicologica resolucion_judicial_audiencia certificado_medico_legal ficha_datos_sidpol consulta_sucamec informe_mimp ficha_valoracion_riesgo_manual oficio_atencion_integral escrito_minpu informe_psicologico ficha_valoracion_riesgo_digital informe_medico croquis_domicilio ficha_datos_reniec escrito_pj evidencia_chat declaracion_minpu notificacion_resolucion_judicial_audiencia consulta_antecedentes_penales notificacion_detencion_pnp consulta_personas_sidpol escrito_pnp constancia_buen_trato declaracion_pnp escrito_mimp acta_intervencion_pnp constancia_notificacion cargo_ingreso_sij anexo_dni hoja_blanco consulta_requisitorias