Downloads · 30 days
8
15% of all-time downloads
Mitchins/anime-frame-interesting-classifier-cnn-v2
anime-frame-interesting-classifier-cnn-v2 is a machine learning model from Mitchins. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Architecture: EfficientNetV2-S (CNN) Framework: PyTorch Input Size: 224x224 RGB images Output: Binary classification (Boring/Interesting)
Downloads · 30 days
8
15% of all-time downloads
All-time downloads
55
Public
Parameters
20.3M
81.4 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors81.4 MB · 100%
From the Hugging Face model README
Architecture: EfficientNetV2-S (CNN)
Framework: PyTorch
Input Size: 224x224 RGB images
Output: Binary classification (Boring/Interesting)
Evaluated on v2.0 test set (433 frames):
Training data: 3,999 frames (4,432 total with test holdout)
What it does: Classifies anime frames as either "interesting" (depicting meaningful character/scene details) or "boring" (back-of-head shots, non-descript backgrounds, montages).
When to use:
When NOT to use:
All frames are 224x224 RGB anime screenshots.
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
# Load model (automatically uses SafeTensors)
processor = AutoImageProcessor.from_pretrained(
"hf_models/anime-frame-interesting-classifier-cnn-v2"
)
model = AutoModelForImageClassification.from_pretrained(
"hf_models/anime-frame-interesting-classifier-cnn-v2",
trust_remote_code=False # Safe: SafeTensors prevents code execution
)
image = Image.open('frame.png')
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
prediction = outputs.logits.argmax(-1).item()
print(f"Prediction: {'Interesting' if prediction == 1 else 'Boring'}")
from torchvision import models
import torch
from safetensors.torch import load_file
# Load model using SafeTensors (secure, no pickle deserialization)
model = models.efficientnet_v2_s()
model.classifier[1] = torch.nn.Linear(model.classifier[1].in_features, 2)
model.load_state_dict(load_file('model.safetensors'))
model.eval()
# Inference
import torchvision.transforms as transforms
from PIL import Image
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
])
image = Image.open('frame.png')
x = transform(image).unsqueeze(0)
with torch.no_grad():
output = model(x)
logits = output
prediction = logits.argmax(1).item()
confidence = logits.softmax(1)[0][prediction].item()
print(f"Prediction: {'Interesting' if prediction == 1 else 'Boring'}")
print(f"Confidence: {confidence:.2%}")
Security Note: This model uses SafeTensors format (not pickle). This prevents arbitrary code execution during model loading. For maximum safety, use HuggingFace Transformers with trust_remote_code=False.
See anime-frame-interesting-classifier-vit-v2 for transformer alternative:
| Metric | CNN (This Model) | ViT | Use Case |
|---|---|---|---|
| F1 | 95.15% | 94.92% | CNN: general, ViT: ensemble |
| Speed | Faster | Slower | CNN preferred for speed |
| Size | 20 MB | 20 MB | Similar footprint |
| Ensemble | Better precision with ViT voting | Better recall with CNN voting | Use together |
For maximum confidence, use ensemble voting: classify with both models and flag disagreements for manual review.
If you use this model, please reference: