Skip to page content
SAVRN
Search Plan a project

Open-weight model · Image classification

BedNet

by Adamgoza SugaryCoffee/BedNet

BedNet is an open-weight model for image classification from Adamgoza, released under Creative Commons Attribution 4.0. Its published files total 32.6 MB.

Binary image classifier that answers one question from a fixed bed-camera view: is there a printed object on the print bed? Built for autonomous 3D-print-farm fulfillment (auto-releasing completed prints without a human looking at every camera frame).

Parameters—
Context—
Weights32.4 MB
Licensecc-by-4.0
AccessOpen weights
Monthly Downloads—

Model Card

By Adamgoza, published under cc-by-4.0, revision 92ccee46732b.

Binary image classifier that answers one question from a fixed bed-camera view: is there a printed object on the print bed? Built for autonomous 3D-print-farm fulfillment (auto-releasing completed prints without a human looking at every camera frame). Live inference on frames from two printers never seen during training. Banner shows the model's actual output: ~1,200 frames from 29 farm printers. Labels derived from operational events and then manually audited by the operator (7 corrections applied via a review tool): Convention: clear means a clean bed — filament scraps and debris count as occupied. Split is group-aware (all frames from one printer/camera go to exactly one split), so test…

Read Adamgoza's full model card

BedNet — 3D Printer Bed Occupancy Classifier

Binary image classifier that answers one question from a fixed bed-camera view: is there a printed object on the print bed? Built for autonomous 3D-print-farm fulfillment (auto-releasing completed prints without a human looking at every camera frame).

Model at a glance

Task binary image classification (bed clear vs occupied)
Architecture EfficientNet-B0 (ImageNet-pretrained backbone, fine-tuned end-to-end)
Parameters 4,010,110 (~4.0 M) — of which the new 2-class head is 2,562
Model size 16 MB fp32 (.pt and .onnx)
Input RGB image, resized bilinear to 288×288, ImageNet normalization
Output [clear, occupied] logits → softmax → P(occupied)
Speed ~30 ms/frame CPU (onnxruntime-node) · <5 ms/frame GPU
Training data ~1,200 farm bed-camera frames, operator-audited labels (see caveat below)
License CC-BY 4.0 (attribution required)

What it does — example outputs

Live inference on frames from two printers never seen during training. Banner shows the model's actual output:

What it is

  • Architecture: EfficientNet-B0 (ImageNet-pretrained), final layer replaced with a 2-class head (clear / occupied). Input 288×288, ImageNet normalization, bilinear resize.
  • Domain: fixed-position bed cameras on FDM printers (PEI/spring-steel sheets, mixed workshop lighting). Not designed for arbitrary photos of 3D prints.
  • Deployment: exported to ONNX (opset 17), runs in-process via onnxruntime-node in ~30 ms CPU / <5 ms GPU per frame. Ships as a fast-path: only confident "clear" predictions auto-release; everything else falls through to a human or an LLM reviewer.

Training data

~1,200 frames from 29 farm printers. Labels derived from operational events and then manually audited by the operator (7 corrections applied via a review tool):

Label Source Meaning
clear manual-clear-* frames operator confirmed bed empty after removing parts
clear baseline-match PASS pixel diff against the printer's empty-bed baseline
occupied post-print-reference-* captured at print completion, part still on bed
occupied parts_present BLOCKED still matches the occupied reference

Convention: clear means a clean bed — filament scraps and debris count as occupied.

Split is group-aware (all frames from one printer/camera go to exactly one split), so test frames come from devices never seen in training.

Results

Scored on the held-out test split (201 frames, unseen printers) against operator-validated labels:

accuracy precision recall
overall 0.891
occupied 0.893 0.909
clear 0.888 0.868

In production calibration (thresholded at P(occupied) ≤ 0.15 for auto-release, on the shipped ONNX preprocessing): zero false releases across the held-out set; first false release appears at threshold 0.20. The model is used as a speed-up only — it can fast-path confident clears but never overrides other safety checks.

Before vs after fine-tuning (same held-out test set)

accuracy AUC
Random guess 0.500 0.500
Frozen ImageNet backbone + linear probe (i.e. before fine-tuning) 0.896 0.957
BedNet (full fine-tune) 0.891 0.960

Honest reading: with only ~1,200 training frames, full fine-tuning beats a trivial linear probe only slightly — ImageNet's backbone already recognizes printed objects well. Fine-tuning's real gains are the calibrated probabilities (which make the zero-false-release threshold possible), Grad-CAM localization, and a small deployable model. Both rows hit the same wall: more labeled data, not more training tricks, is what moves this number.

Read these numbers with context: training data was very limited (~1,200 frames from one print farm). More labeled data would give a better model — see Limitations.

Files

file description
bednet.pt PyTorch checkpoint (EfficientNet-B0, 2-class head)
bednet.onnx deployed ONNX export (opset 17), bit-identical argmax to PyTorch on real frames

Usage (PyTorch)

import torch
from torchvision import models, transforms
from PIL import Image

m = models.efficientnet_b0(weights=None)
m.classifier[1] = torch.nn.Linear(m.classifier[1].in_features, 2)
m.load_state_dict(torch.load("bednet.pt", map_location="cpu", weights_only=False)["state_dict"])
m.eval()

tfm = transforms.Compose([
    transforms.Resize((288, 288)),   # bilinear — keep the default, Lanczos shifts calibration
    transforms.ToTensor(),
    transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])

with torch.no_grad():
    p_occupied = float(torch.softmax(m(tfm(Image.open("frame.jpg").convert("RGB"))[None]), 1)[0, 1])

print(f"P(occupied) = {p_occupied:.3f}")   # auto-release beds at <= 0.15; do not exceed ~0.2 without recalibration

Usage (ONNX Runtime)

Preprocess exactly as above (resize bilinear to 288×288 — in sharp use kernel: "linear"), normalize with ImageNet stats, NCHW float32 input named from the graph. Output is [1, 2] logits [clear, occupied].

import onnxruntime as ort, numpy as np
sess = ort.InferenceSession("bednet.onnx")
# x: (1,3,288,288) float32, ImageNet-normalized
logits = sess.run(None, {sess.get_inputs()[0].name: x})[0]
p_occupied = float(np.exp(logits[0][1]) / np.exp(logits).sum())

Grad-CAM localization

The last EfficientNet feature block supports Grad-CAM against the occupied logit; it reliably circles the part driving an occupied call (used in the operator review UI for "why is this flagged").

Limitations & honest caveats

  • Very limited training data — this is the biggest constraint. The model was trained on only ~1,200 frames (~700 after deduplication), which is a tiny fraction of what an image classifier normally uses. This number is not a ceiling: with more labeled frames — even a few thousand covering more printers, parts, lighting conditions, and failure modes — the same architecture should get meaningfully better. Treat these metrics as "what's achievable with one farm's worth of data," not what this approach caps out at.
  • Domain-specific. Trained on frames from one farm's fixed cameras. Expect degradation on new printer models, camera angles, or lighting; recalibrate the release threshold on your own data before automating anything.
  • Not an object detector. It answers bed-level occupancy only; localization is coarse (Grad-CAM), not boxed detection.
  • Glare and surface texture are the main false-positive driver; debris/small parts are the main misses.
  • The 89.1% test accuracy is on a small (201-frame) holdout — confidence intervals are wide.

Intended use / out of scope

Intended: gating print-bed verification steps in a 3D-print farm where a human or another system reviews non-confident frames. Not intended: safety-critical autonomy, anything where a false "clear" causes harm without a second check.

License & attribution

This model is released under CC-BY 4.0: you are free to use, modify, and redistribute it — including commercially — as long as you credit the author. Attribution means keeping this notice visible wherever the model or its derivatives ship:

BedNet (c) SugaryCoffee — https://huggingface.co/SugaryCoffee/BedNet — licensed under CC-BY 4.0.

If you use it in a paper, cite:

@misc{bednet2026,
  author       = {SugaryCoffee},
  title        = {BedNet: 3D Printer Bed Occupancy Classifier},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/SugaryCoffee/BedNet}}
}

Identity and Version

Repository
SugaryCoffee/BedNet
Publisher
Adamgoza
Task
Image classification
Modality
Image
Library
Not stated by the source
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
92ccee46732b6a2ea5931c898912b64109c88948
First published
2026-09-23
Last updated
2026-09-23

Files and Weights

13 files, 32.6 MB in total. The weights are 2 files totalling 32.4 MB in onnx, pt.

Weights2 files · 32.4 MB
Documentation2 files · 27.4 KB
Other8 files · 253.2 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
bednet.onnxWeights16.0 MB f202891ce9e2
bednet.ptWeights16.3 MB 0f4501d4f0e3
LICENSEDocumentation19.1 KB —
README.mdDocumentation8.3 KB —
examples/clear.jpgOther57.9 KB —
examples/demo_0_occupied.jpgOther22.6 KB —
examples/demo_1_occupied.jpgOther20.8 KB —
examples/demo_2_occupied.jpgOther21.2 KB —
examples/demo_3_clear.jpgOther18.4 KB —
examples/demo_4_clear.jpgOther19.2 KB —
examples/demo_5_clear.jpgOther18.9 KB —
examples/occupied.jpgOther74.2 KB —
.gitattributesRepository1.5 KB —

License and Download

License
cc-by-4.0
Access
Open weights, no gate
Download size
32.4 MB
Download from Adamgoza

Released by Adamgoza through its official repository on Hugging Face. Read the license.

Memory Requirements

PrecisionWeights in memory
As published32.4 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About BedNet

Can I use BedNet commercially?

Yes. BedNet is released under Creative Commons Attribution 4.0. CC BY 4.0 permits sharing and adapting the work, including commercially, provided the creator is credited and changes are indicated.

Similar Models

Model · Image classification

swinv2-tiny-patch4-window16-256

Microsoft

Swin Transformer v2 model pre-trained on ImageNet-1k at resolution 256x256. It was introduced in the paper Swin Transformer V2: Scaling Up Capacity and Resolution by Liu et al. and first released in this repository. Disclaimer: The team releasing Swin Transformer v2 did not write a model card for this model so this model card has been written by the Hugging Face team. The Swin Transformer is a type of Vision Transformer. It builds hierarchical feature maps by merging image patches (shown in gray) in deeper layers and has linear computation complexity to input image size due to computation of self-attention only within each local window (shown in red). It can thus serve as a general-purpose…

Open weights apache-2.0 transformers

Model · Image classification

AI-image-detector

Matthew Maybe

NOTE: Unless you are trying to detect imagery generated using older models such as VQGAN+CLIP, please use the updated version of this detector instead. This model is a proof-of-concept demonstration of using a ViT model to predict whether an artistic image was generated using AI. It was created in October 2022, and as such, the training data did not include any samples generated by Midjourney 5, SDXL, or DALLE-3. It still may be able to correctly identify samples from these more recent models due to being trained on outputs of their predecessors. Furthermore the intended scope of this tool is artistic images; that is to say, it is not a deepfake photo detector, and general computer imagery…

Open weights cc-by-4.0 transformers

Measured on device (edge-compat): Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.1 ms p50 (2026-08-31); browser · Chromium 151 (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/plantnet-300k-resnet18/CARD.md On-device fine-grained plant species identification — 1081 species — running fully on the LiteRT CompiledModel GPU delegate (no CPU fallback). A PlantNet-300K (NeurIPS 2021) ResNet18. ~16 ms/frame on a Pixel 8a. (mean [0.485,0.456,0.406], std [0.229,0.224,0.225]; center-crop then resize 224). Labels: class index i maps to the i-th species when the PlantNet-300K species-id strings are sorted (torchvision ImageFolder order); names…

Open weights apache-2.0 litert

Model · Image classification

traffic-sign-adverse-weather

Yy

Official model checkpoints for the solution in the Traffic Sign Recognition under Adverse Weather Competition. See classes.txt for the 25 traffic sign classes. For inference scripts, training code, and in-depth engineering retrospective, visit the GitHub Repository.

Open weights mit timm

Model · Image classification

tinyvit-5m-int8-imagenet

Core Epoch

TinyViT-5M (timm/tinyvit5m224.distin22kftin1k, Apache-2.0) quantized to INT8 with Kenosis — 128-image calibration, no retraining. 80.53% top-1 from a 9.2 MB single file, on ONNX Runtime or OpenVINO, CPU or GPU, no accelerator required. ImageNet-1K validation, 49,872 images (disjoint from the 128 calibration images). Measured on a CPU with AVX-VNNI; on CPUs without VNNI this model's INT8 top-1 sits ~0.9 below FP32 rather than 0.34. Input 1x3x224x224, RGB, /255, ImageNet mean/std. Output logits [1,1000], sorted-synset order. runclassify.py / evalimagenet.py reproduce the demo and table. tinyvit5m224int8kenosis.onnx (9,228,567 B) — SHA-256…

Open weights apache-2.0 onnx