Buckets:
8.9 GB
20 files
Updated about 2 months ago
Ctrl+K
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| notebooks | 2 items | ||
| .gitattributes | 1.57 kB xet | aacf151a | |
| README.md | 3.98 kB xet | 00731318 | |
| added_tokens.json | 707 Bytes xet | a1d47d24 | |
| chat_template.jinja | 5.29 kB xet | 5633af92 | |
| classifier_config.json | 138 Bytes xet | b53696e7 | |
| classifier_head.safetensors | 5.25 MB xet | 7e16005d | |
| config.json | 1.55 kB xet | 3ee33e2f | |
| generation_config.json | 213 Bytes xet | c10616bd | |
| merges.txt | 1.67 MB xet | 87912eed | |
| model-00001-of-00002.safetensors | 4.99 GB xet | bf6161d1 | |
| model-00002-of-00002.safetensors | 3.89 GB xet | c823c789 | |
| model.safetensors.index.json | 64.8 kB xet | 537e7a62 | |
| preprocessor_config.json | 782 Bytes xet | 17427eab | |
| special_tokens_map.json | 613 Bytes xet | 8b458476 | |
| tokenizer.json | 11.4 MB xet | ee1e4cb8 | |
| tokenizer_config.json | 5.45 kB xet | 82373467 | |
| video_preprocessor_config.json | 817 Bytes xet | c336fbe2 | |
| vocab.json | 2.78 MB xet | 9208e1be |
Qwen2.5-VL-3B-SCT-Classifier
A Vision-Language Model fine-tuned to classify SEC proxy statement tables as Summary Compensation Tables (SCT) vs non-SCT tables.
Model Description
This model adds a classification head on top of Qwen/Qwen2.5-VL-3B-Instruct for binary table classification. The base model is frozen and only the classifier head is trained.
Task: Given an image of a table from SEC DEF14A filings, classify whether it's a Summary Compensation Table or not.
Architecture
- Base Model: Qwen/Qwen2.5-VL-3B-Instruct (frozen)
- Classifier Head: Linear(2048→512) → ReLU → Dropout(0.1) → Linear(512→2)
- Pooling: Mean pooling over last hidden states
Training
- Dataset: pierjoe/sec-table-classifier
- ~1,500 positive samples (SCT tables)
- ~3,000 negative samples (other tables from same documents)
- Loss: CrossEntropyLoss with class weights [1.0, 2.0] to reduce false negatives
- Optimizer: AdamW, LR=5e-6
- Epochs: 3
- Batch Size: 2
Performance
- Test Accuracy: ~99%
- False Negatives: Minimized via weighted loss (priority: don't miss real SCT tables)
Usage
import torch
import torch.nn as nn
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from safetensors.torch import load_file
from PIL import Image
# Define classifier
class VLMClassifier(nn.Module):
def __init__(self, base_model, num_labels=2):
super().__init__()
self.base_model = base_model
hidden_size = base_model.config.hidden_size
self.classifier = nn.Sequential(
nn.Linear(hidden_size, 512),
nn.ReLU(),
nn.Dropout(0.1),
nn.Linear(512, num_labels)
)
def forward(self, input_ids, attention_mask, pixel_values, image_grid_thw):
outputs = self.base_model(
input_ids=input_ids,
attention_mask=attention_mask,
pixel_values=pixel_values,
image_grid_thw=image_grid_thw,
output_hidden_states=True,
return_dict=True
)
hidden_states = outputs.hidden_states[-1]
pooled = hidden_states.mean(dim=1)
return self.classifier(pooled.float())
# Load model
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-3B-Instruct")
base_model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"Qwen/Qwen2.5-VL-3B-Instruct",
torch_dtype=torch.bfloat16,
device_map="cuda:0"
)
model = VLMClassifier(base_model, num_labels=2).to("cuda")
model.classifier.load_state_dict(load_file("classifier_head.safetensors"))
model.eval()
# Inference
img = Image.open("table.png").convert("RGB")
messages = [[{
"role": "user",
"content": [
{"type": "image", "image": img},
{"type": "text", "text": "Classify this table."}
]
}]]
texts = [processor.apply_chat_template(m, tokenize=False, add_generation_prompt=True) for m in messages]
inputs = processor(text=texts, images=[img], padding=True, return_tensors="pt")
with torch.no_grad():
logits = model(
inputs["input_ids"].to("cuda"),
inputs["attention_mask"].to("cuda"),
inputs["pixel_values"].to("cuda", dtype=torch.bfloat16),
inputs["image_grid_thw"].to("cuda")
)
prob_sct = torch.softmax(logits, dim=-1)[0, 1].item()
print(f"P(SCT) = {prob_sct:.3f}")
# Use threshold 0.3 for fewer false negatives
is_sct = prob_sct >= 0.3
Files
classifier_head.safetensors- Classifier head weightsclassifier_config.json- Model configurationconfig.json- Base model confignotebooks/- Training and testing notebooks
Citation
Part of SEC executive compensation extraction pipeline.
License
Apache 2.0 (same as base model)
- Total size
- 8.9 GB
- Files
- 20
- Last updated
- Jun 27
- Pre-warmed CDN
- US EU US EU