File size: 5,834 Bytes
947bc05
 
e425c35
 
 
 
 
 
 
947bc05
 
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
 
 
 
 
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
 
 
 
 
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
947bc05
 
 
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
e425c35
947bc05
e425c35
 
 
947bc05
e425c35
947bc05
e425c35
 
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
e425c35
 
 
 
 
947bc05
e425c35
947bc05
e425c35
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
 
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
947bc05
 
 
e425c35
947bc05
e425c35
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
e425c35
 
 
 
 
 
947bc05
e425c35
947bc05
 
 
e425c35
 
 
 
947bc05
e425c35
947bc05
e425c35
 
 
 
947bc05
e425c35
947bc05
e425c35
947bc05
 
 
e425c35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
---
library_name: transformers
tags:
- text-classification
- korean
- ocr
- screenshot-classification
- klue-roberta
- capturemate
---

# CaptureMate Category Classifier v2 4-Class

OCR text-based screenshot category classifier for CaptureMate.

This model classifies OCR-extracted screenshot text into one of four app categories: `schedule`, `shopping`, `place`, and `memo`.

`unknown` samples are excluded from training. Ambiguous or low-confidence predictions should be handled by the application using a confidence threshold.

## Model Details

### Model Description

This model is a fine-tuned KLUE-RoBERTa based text classification model for CaptureMate, an iOS screenshot organization and action recommendation app.

The model receives OCR text extracted from screenshots and predicts the most relevant screenshot category.

- **Developed by:** CaptureMate
- **Model type:** Text classification
- **Language(s):** Korean, English, mixed OCR text
- **License:** Not specified
- **Finetuned from model:** KLUE-RoBERTa base
- **Number of labels:** 4

### Labels

| ID | Label | Description |
|---:|---|---|
| 0 | schedule | Schedule, reservation, ticket, event, or date-related screenshots |
| 1 | shopping | Shopping, product, price, payment, or commerce-related screenshots |
| 2 | place | Place, map, restaurant, store, travel, or location-related screenshots |
| 3 | memo | Text, article, note, content, or general information screenshots |

## Uses

### Direct Use

Use this model to classify OCR-extracted screenshot text into CaptureMate categories.

### Downstream Use

This model can be used inside a screenshot processing pipeline:

```txt
Screenshot
-> OCR text extraction
-> Text preprocessing
-> Category classification
-> Category-specific action recommendation
```

## Out-of-Scope Use

This model is not designed to:

- Classify original images directly
- Perform OCR
- Extract structured fields such as dates, prices, addresses, or product names
- Predict an `unknown` category directly
- Classify content outside the CaptureMate screenshot domain

## Bias, Risks, and Limitations

The model is trained on a small CaptureMate-specific screenshot OCR dataset. It may not generalize well to unrelated domains or OCR text from different user behavior patterns.

Known limitations:

- The model always predicts one of the four labels.
- There is no direct `unknown` output.
- Very short or noisy OCR text can lead to unstable predictions.
- Ambiguous cases such as ticket screenshots, food blog screenshots, or shopping-like memo content may be confused.

### Recommendations

Use a confidence threshold at inference time.

Example:

```txt
if confidence < 0.6:
    category = "unknown"
else:
    category = predicted_label
```

## How to Get Started with the Model

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name = "YOUR_USERNAME/capturemate-category-classifier-v2-4class"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

text = "2025.4.7 티켓 수령 공연 예약 정보"

inputs = tokenizer(
    text,
    return_tensors="pt",
    truncation=True,
    max_length=256
)

with torch.no_grad():
    outputs = model(**inputs)
    probs = torch.softmax(outputs.logits, dim=-1)
    pred_id = probs.argmax(dim=-1).item()
    confidence = probs[0][pred_id].item()

label = model.config.id2label[pred_id]

print(label, confidence)
```

## Training Details

### Training Data

The model was trained on OCR text extracted from screenshot images collected for the CaptureMate project.

Dataset split:

| Split | Samples |
|---|---:|
| Train | 340 |
| Validation | 73 |
| Test | 74 |

`unknown` samples were removed before creating the final training, validation, and test splits.

### Training Procedure

#### Preprocessing

- OCR text was extracted from screenshots.
- Empty text samples were removed.
- Labels outside the four target categories were excluded.
- Text was tokenized with the KLUE-RoBERTa tokenizer.
- Maximum sequence length: 256 tokens.

#### Training Hyperparameters

| Hyperparameter | Value |
|---|---:|
| Learning rate | 1e-5 |
| Epochs | 8 |
| Train batch size | 16 |
| Eval batch size | 16 |
| Warmup ratio | 0.1 |
| Weight decay | 0.01 |
| Best model metric | macro F1 |
| Seed | 42 |

## Evaluation

### Testing Data, Factors & Metrics

#### Testing Data

The test set contains 74 OCR text samples across four categories.

#### Metrics

The model was evaluated using:

- Accuracy
- Macro F1
- Macro precision
- Macro recall

Macro metrics are important because the dataset is not perfectly balanced across categories.

### Results

| Metric | Validation | Test |
|---|---:|---:|
| Accuracy | 98.63% | 94.59% |
| Macro F1 | 98.89% | 94.55% |
| Macro Precision | 99.07% | 93.91% |
| Macro Recall | 98.75% | 95.47% |

### Test Set Per-Class Results

| Class | Precision | Recall | F1-score | Support |
|---|---:|---:|---:|---:|
| schedule | 90.00% | 100.00% | 94.74% | 9 |
| shopping | 96.15% | 96.15% | 96.15% | 26 |
| place | 94.74% | 100.00% | 97.30% | 18 |
| memo | 94.74% | 85.71% | 90.00% | 21 |

### Confusion Matrix

Rows are true labels, columns are predicted labels.

| True \ Pred | schedule | shopping | place | memo |
|---|---:|---:|---:|---:|
| schedule | 9 | 0 | 0 | 0 |
| shopping | 0 | 25 | 0 | 1 |
| place | 0 | 0 | 18 | 0 |
| memo | 1 | 1 | 1 | 18 |

## Technical Specifications

### Model Architecture and Objective

- Architecture: KLUE-RoBERTa sequence classification
- Objective: Single-label multi-class classification
- Input: OCR text
- Output: One of four CaptureMate categories

### Software

- transformers
- datasets
- torch
- scikit-learn

## Model Card Authors

CaptureMate

## Model Card Contact

CaptureMate project maintainer