Parental Control Image Classifier β€” EfficientNetB0

Multi-label image classifier that detects harmful/NSFW content across 4 categories, fine-tuned from EfficientNetB0 (ImageNet weights) on ~79 k images.

Labels

Index Label Threshold
0 alcohol 0.50
1 drugs 0.50
2 sexual 0.50
3 extremism 0.50

Validation Results (Phase 2, 40 epochs)

Label Accuracy
alcohol 99.6 %
extremism 99.5 %
sexual 99.0 %
drugs 98.2 %

Best val_loss: 0.0948

Files

File Size Purpose
parental_control_b0.keras ~44 MB Full model β€” TF/Keras inference & fine-tuning
model_metadata.json < 1 KB Labels, thresholds, input spec
training_history.png 197 KB Loss & accuracy curves
threshold_calibration.png 81 KB Per-label threshold calibration

Quick Start

import tensorflow as tf, numpy as np, json
from huggingface_hub import hf_hub_download, snapshot_download
from PIL import Image

REPO = "damilareisaac/parental-control-efficientnet-b0"

# Download model and metadata
model_path = hf_hub_download(REPO, "parental_control_b0.keras")
meta       = json.load(open(hf_hub_download(REPO, "model_metadata.json")))

model = tf.keras.models.load_model(model_path)

img = Image.open("image.jpg").convert("RGB").resize(tuple(meta["input_size"]))
arr = np.expand_dims(np.array(img, dtype=np.float32), 0)
scores = model.predict(arr)[0]

for label, score in zip(meta["labels"], scores):
    flagged = score > meta["optimal_thresholds"][label]
    print(f"{label:<12} {score:.3f}  {'⚠️  FLAGGED' if flagged else 'βœ… ok'}")

Training

Full code: grindqueue/thesis_model_train

Hardware: Apple M4 Max (64 GB) β€” Metal GPU
Framework: TensorFlow 2.18 + tensorflow-metal 1.2.0
Dataset: sofialitvin/dataset-images

Downloads last month
74
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support