Downloads · 30 days
18
49% of all-time downloads
shra012/qwen3.8-27b-ucf-shoplifting-lora
qwen3.8-27b-ucf-shoplifting-lora is a video-text-to-text model from shra012. Use it for the video-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
A LoRA adapter for Qwen/Qwen3.8-27B (revision 1d4bf0f2ff60) that scores 8-second CCTV clips for suspected shoplifting. It was built for KryptonxWatch, where detections are shown on a timeline for a person to review. I…
Downloads · 30 days
18
49% of all-time downloads
All-time downloads
37
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.7 GB · 100%
From the Hugging Face model README
A LoRA adapter for Qwen/Qwen3.8-27B (revision 1d4bf0f2ff60) that scores
8-second CCTV clips for suspected shoplifting. It was built for KryptonxWatch, where detections
are shown on a timeline for a person to review. It is not an automated decision system.
The difference from zero-shot is not conclusive: at least one seed's 95% CI for ΔAUROC includes 0, so this study does not show that fine-tuning helps.
Point estimates favour the adapter on AUROC for every seed, but window AUPRC fell (0.142 zero-shot vs 0.112 mean); event localisation got worse ([email protected] 0.068 vs 0.027 mean; median onset error 3 s vs 15 s). Its events on shoplifting videos are much longer (median 4 s zero-shot vs 12 / 18 / 24 s for seeds 1-3), so it marks long stretches around a theft, not just the theft itself. For the timeline use case, the zero-shot model is currently at least as good.
Primary endpoint: window-level AUROC on the locked UCF-Crime test cohort (169 videos with at least one full window (2 normal test videos are shorter than 8 s), 5808 windows, 89 positive), fine-tuned vs zero-shot with the same prompt and frames. 95% CIs come from a paired bootstrap (2000 resamples) that resamples whole videos, because windows from the same video are not independent.
| Model | Window AUROC [95% CI] | ΔAUROC vs zero-shot [95% CI] | Window AUPRC | Video AUROC | Sensitivity at 1 FP/h (val threshold) | FP/h on normal test |
|---|---|---|---|---|---|---|
| Zero-shot | 0.895 [0.840, 0.946] | — | 0.142 | 0.860 | 0.393 | 29.1 |
| LoRA seed 1 | 0.917 [0.853, 0.968] | +0.022 [-0.019, 0.067] | 0.100 | 0.929 | 0.843 | 90.6 |
| LoRA seed 2 | 0.924 [0.865, 0.968] | +0.029 [-0.014, 0.072] | 0.110 | 0.940 | 0.820 | 93.7 |
| LoRA seed 3 | 0.926 [0.878, 0.965] | +0.031 [-0.004, 0.073] | 0.125 | 0.949 | 0.876 | 91.8 |
| LoRA mean ± SD (3 seeds) | 0.923 ± 0.005 | 0.027 ± 0.005 | 0.112 ± 0.013 | 0.939 ± 0.010 | 0.846 ± 0.028 | 92.1 |
The threshold for sensitivity and FP/h is set on validation Normal footage at about 1 false positive per hour, never on the test set. It does not transfer: validation has only about 6 minutes of Normal footage (7 videos, 85 windows), so the "1 FP/h" threshold is simply its highest-scoring normal window, and on the 150 test Normal videos it gives the FP/h shown above. Before deployment, set the threshold on a much larger sample of in-domain normal footage. The zero-shot test scores were sealed (checksum committed) before any fine-tuned model was frozen, and were read only for this comparison.
Windows at or above the threshold are merged into events (2 s gap merging). Parameters were pre-specified, not tuned: validation videos have no time stamps. With 4 s window resolution and a median annotated event length of 6.5 s, even perfect window scores give only about 0.56 recall at tIoU 0.5, so read the 0.5 columns with that ceiling in mind.
| Model | [email protected] | [email protected] | [email protected] | [email protected] | [email protected] | [email protected] | Median onset error (s) | Events on normal videos |
|---|---|---|---|---|---|---|---|---|
| Zero-shot | 0.320 | 0.058 | 0.068 | 0.240 | 0.043 | 0.037 | 3.000 | 79 |
| LoRA seed 1 | 0.320 | 0.050 | 0.039 | 0.080 | 0.013 | 0.002 | 13.000 | 100 |
| LoRA seed 2 | 0.280 | 0.050 | 0.033 | 0.080 | 0.014 | 0.002 | 15.000 | 97 |
| LoRA seed 3 | 0.160 | 0.027 | 0.009 | 0.080 | 0.014 | 0.002 | 18.000 | 111 |
study/.| Learning rate | Round | Val MIL NLL | Val video AUROC |
|---|---|---|---|
| 1e-4 | 1 | 0.0043 | 1.000 |
| 1e-4 | 2 | 0.0015 | 1.000 |
| 1e-4 | 3 | 0.0006 | 1.000 |
| 2e-4 | 1 | 0.0046 | 1.000 |
| 2e-4 | 2 | 0.0088 | 1.000 |
| 2e-4 | 3 | 0.0202 | 1.000 |
seed1/, seed2/, seed3/. SHA-256 checksums are in results/adapters.sha256.The model answers one fixed yes/no question per 8-second window (16 frames at 2 fps, native resolution), and the
score is P("yes") from the answer-token log-probabilities with thinking off. Use the exact prompt and scoring in
code/qwen_model.py, since other prompts or frame rates were not evaluated.
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor
import torch
processor = AutoProcessor.from_pretrained("Qwen/Qwen3.8-27B", revision="1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0")
model = AutoModelForImageTextToText.from_pretrained("Qwen/Qwen3.8-27B", revision="1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0", dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, "<this repo>")
code/localize.py turns window scores into events in the KryptonxWatch Detection format (startSec, endSec,
peakSec, confidence). results/detections_sample.json shows the output for a few test videos. The model gives no
location in the frame, so each keyframe box is the full frame.