CoolFace
Modelpublic

damilareisaac/parental-control-efficientnet-b0

sourceHugging Facegpl-3.0updated 4mo agoView on Hugging Face
1likes4downloads
Model Card

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

IndexLabelThreshold
0alcohol0.50
1drugs0.50
2sexual0.50
3extremism0.50

Validation Results (Phase 2, 40 epochs)

LabelAccuracy
alcohol99.6 %
extremism99.5 %
sexual99.0 %
drugs98.2 %

Best val_loss: 0.0948

Files

FileSizePurpose
parental_control_b0.keras~44 MBFull model — TF/Keras inference & fine-tuning
model_metadata.json< 1 KBLabels, thresholds, input spec
training_history.png197 KBLoss & accuracy curves
threshold_calibration.png81 KBPer-label threshold calibration

Quick Start

python
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