Define inputs and labels
Decide whether the model will use raw camera frames, precomputed visual features, or device telemetry, and create a labelled dataset that matches the chosen input.
Detect occupancy from camera. Measure latency and memory.
Occupancy detection for cameras is a binary classification task that must balance accuracy, latency and resource use on edge devices. Important practical concerns include choice of input modality (raw frames, lightweight features or telemetry), labelling ambiguity when people are partially visible, and runtime constraints such as model size, inference latency and power use.
Learning concept · Not a validated service
Occupancy detection for cameras is a binary classification task that must balance accuracy, latency and resource use on edge devices. Important practical concerns include choice of input modality (raw frames, lightweight features or telemetry), labelling ambiguity when people are partially visible, and runtime constraints such as model size, inference latency and power use.
A proposed application: reduce building energy use by switching lights or HVAC only when people are present, with a human-in-the-loop for edge cases. For security-sensitive uses (access decisions, surveillance) keep a human reviewer in charge; this project starter does not provide a production-safe system.
Decide whether the model will use raw camera frames, precomputed visual features, or device telemetry, and create a labelled dataset that matches the chosen input.
Fit a compact classifier (for example a shallow decision tree or small CNN) and measure on held-out data to establish a baseline for accuracy and resource use.
Profile single-sample inference time, memory usage and model size on the target device or an emulator to check edge constraints.
Add input validation, drift detection and a human-review flow for ambiguous predictions before deploying to devices.
The supplied starter generates a synthetic tabular classification dataset with sklearn.make_classification, fits a DecisionTreeClassifier, times repeated predictions for one sample, and prints latency and tree statistics. It does not use camera frames, image features or real sensor telemetry.
X, y = make_classification(n_samples=1000, n_features=12, n_informative=8, random_state=42)
model = DecisionTreeClassifier(max_depth=6, random_state=42)
model.fit(X, y)
sample = X[:1]
start = time.perf_counter()The starter uses synthetic tabular data (make_classification) rather than camera frames or sensor features, so its accuracy and latency measurements do not validate a camera-based occupancy detector. The small synthetic task cannot reveal issues such as visual occlusion, varying lighting, labelling noise or the cost of image preprocessing on an edge device.
A proposed extension: collect a small labelled dataset of edge-camera frames or lightweight visual features, train a compact model (quantised or TFLite) and add an API that returns predictions plus a confidence score for human review.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its Network Engineering Course, with placement support and hands-on labs.