Quiz: Building a Real-Time Object Detection Pipeline¶
Test your understanding of building a real-time object detection pipeline with these review questions.
1. What is edge AI?¶
- Converting a model's internal numbers from high precision to a lower precision format
- A curated online collection of pretrained models organized by task
- Running a machine learning model's inference directly on a local device at the location where data is captured, instead of sending it to a distant server
- A minimum confidence score below which a detection is discarded
Show Answer
The correct answer is C. Edge AI describes running a machine learning model's inference directly on a local device — a phone, a camera, a Raspberry Pi 5 — at the location where data is captured, avoiding the network delay, connectivity dependency, and privacy questions that sending data to a distant server introduces. Option A describes model quantization, option B describes a model zoo, and option D describes a detection threshold.
Concept Tested: Edge AI
2. How does model quantization relate to model compression?¶
- Model compression and model quantization are unrelated techniques that are never used together
- Model quantization is the general practice of reducing model size, while model compression is one specific quantization technique
- Model compression only applies to TFLite files, while model quantization only applies to ONNX files
- Model quantization is the most common compression technique, converting a model's numbers from a high-precision format to a lower-precision one, and belongs under the broader practice of model compression
Show Answer
The correct answer is D. Model compression is the general practice of reducing a trained model's size and computational cost, and model quantization — converting weights from a high-precision format to a lower-precision one — is described as the most common compression technique used for edge deployment. Option A contradicts their described relationship, option B reverses the general/specific roles, and option C invents a file-format restriction not in the chapter.
Concept Tested: Model Quantization
3. How does inference latency differ from frames per second (FPS) as a pipeline performance measure?¶
- Inference latency and FPS both measure exactly the same thing, expressed in different units
- Inference latency measures the time for just the inference stage on one frame, while FPS measures the whole pipeline's throughput across capture, preprocessing, inference, and postprocessing
- FPS measures only the camera's capture speed, while inference latency measures the display's refresh rate
- A pipeline with low inference latency is always guaranteed to have a high FPS
Show Answer
The correct answer is B. Inference latency is the time elapsed for just the inference stage on a single frame, while FPS measures the entire pipeline's throughput from capture through action, across every stage — meaning the two metrics are related but not identical. Option A incorrectly treats them as the same measurement. Option C misassigns each metric to an unrelated component, and option D is explicitly contradicted by the chapter's own warning about chasing latency alone.
Concept Tested: Inference Latency
4. A detector proposes four overlapping boxes around the same dog, with confidence scores 0.88, 0.81, 0.70, and 0.55, all significantly overlapping each other. Applying non-maximum suppression as described in this chapter, how many of these four boxes are kept?¶
- 1
- 4
- 0
- 2
Show Answer
The correct answer is A. Non-maximum suppression keeps only the highest-confidence box in each cluster of significantly overlapping boxes for the same class and discards the rest as duplicates; since all four boxes significantly overlap each other, only the 0.88-confidence box survives. Option B ignores suppression entirely, option C incorrectly discards even the best detection, and option D keeps more boxes than the algorithm's logic allows when all four genuinely overlap.
Concept Tested: Non Maximum Suppression
5. A program records start_time = 2.150 seconds and end_time = 2.168 seconds around a single inference call. What is the inference latency in milliseconds?¶
- 1.8 ms
- 180 ms
- 18 ms
- 0.18 ms
Show Answer
The correct answer is C. The elapsed time is end_time − start_time = 2.168 − 2.150 = 0.018 seconds, and multiplying by 1000 to convert to milliseconds gives 18 ms, matching the chapter's own latency-measurement code pattern. Options A, B, and D each result from a decimal-place error in the seconds-to-milliseconds conversion.
Concept Tested: Inference Latency
6. A student wants their Pi 5 vision project to recognize a specific school mascot costume, a category no pretrained model was originally trained on, using only a few hundred photos and a laptop rather than a data center. Which approach from this chapter fits this constraint?¶
- Use transfer learning, starting from a pretrained model and retraining only its final layers on the small custom dataset
- Train a brand-new neural network completely from scratch using only the few hundred photos
- Skip model deployment entirely and rely on manual visual inspection instead of a model
- Increase the detection threshold until the pretrained model happens to recognize the mascot
Show Answer
The correct answer is A. Transfer learning starts from a pretrained model that already knows general visual features and retrains only its final layers on a much smaller, new labeled dataset, needing far fewer example images and far less computing time than training from scratch — exactly matching the constraints described. Option B requires resources well beyond a classroom project's reach. Option C abandons the vision task entirely, and option D misunderstands the detection threshold, which cannot make a model recognize a class it was never trained on.
Concept Tested: Transfer Learning
7. A student measures a very low inference latency of 8 ms per frame using their Hailo accelerator, but the overall pipeline only achieves 12 frames per second, far below what 8 ms latency alone would suggest. What is the most likely explanation, based on this chapter?¶
- The Hailo accelerator's TOPS rating must be misreported
- Non-maximum suppression always limits FPS to exactly 12, regardless of other stages
- The model must not have been quantized correctly
- FPS depends on the entire pipeline, not just inference, so a slow capture, preprocessing, or postprocessing stage is likely capping the overall frame rate
Show Answer
The correct answer is D. The chapter explicitly warns that FPS is a property of the whole pipeline — capture through action — so a slow camera read or a heavy postprocessing step can cap frame rate even with a lightning-fast inference stage, exactly matching this scenario. Option A misattributes the gap to hardware misreporting, option B invents a fixed NMS limit that doesn't exist, and option C misdiagnoses quantization, which affects latency and accuracy, not FPS specifically.
Concept Tested: Frames Per Second
8. A student raises their pipeline's detection threshold from 0.4 to 0.8 to reduce the number of false alarms in a busy scene. Based on this chapter's guidance, what tradeoff should they expect?¶
- Both false positives and false negatives will decrease with no downside
- Inference latency will increase substantially as a direct result
- False positives will decrease, but some real, visually ambiguous objects may now be missed as false negatives
- The model will automatically switch from object detection to image classification
Show Answer
The correct answer is C. The chapter explains that raising the detection threshold reduces false positives, since weak, likely-wrong guesses get discarded, but risks increasing false negatives, since a real but visually ambiguous object might also fall below the raised bar. Option A ignores this explicit tradeoff. Option B confuses a postprocessing setting with the separate inference stage, and option D describes an unrelated, impossible behavior change.
Concept Tested: Detection Threshold
9. A team needs their Pi 5 project to sustain at least 25 frames per second running a medium-sized object detection model for a live demo. Based on the chapter's benchmark comparison of CPU-only inference versus the two AI HAT+ variants, which configuration should the team choose, and why?¶
- CPU-only inference, since it avoids the added cost of an AI HAT+ entirely
- Either AI HAT+ variant, since the chapter shows accelerated inference achieves dramatically lower latency and higher FPS than CPU-only inference, especially as model size grows
- It is impossible to determine without first performing transfer learning
- CPU-only inference, since frames per second depends only on the camera, not on inference hardware
Show Answer
The correct answer is B. The chapter's benchmark chart shows CPU-only inference with far higher latency and far lower FPS than either AI HAT+ variant, with the gap widening as model size increases — a medium-sized model sustaining 25 FPS is exactly the kind of workload a hardware accelerator is built for. Option A and D both dismiss a documented, significant performance gap, and option C introduces an irrelevant prerequisite unrelated to hardware selection.
Concept Tested: Hardware Accelerator
10. A student is designing a Pi 5 project to detect a specific piece of lab equipment that no pretrained model recognizes, using a small set of self-collected photos, running entirely on-device with no internet connection required during operation. Which combination of design decisions best satisfies all of these constraints, based on concepts from this chapter?¶
- Send every camera frame to a cloud server for classification, since cloud inference is more accurate than on-device inference
- Train a completely new neural network from scratch on the Pi 5's CPU using the small photo set
- Use image classification with no bounding boxes, since location information is unnecessary for any detection task
- Use transfer learning to add the equipment as a custom object class to a pretrained model, then deploy the resulting quantized model to run inference locally on the Hailo accelerator, consistent with edge AI
Show Answer
The correct answer is D. This combination satisfies every stated constraint: transfer learning adds the new custom object class using only a small dataset, quantization keeps the resulting model efficient for edge hardware, and running inference on the Hailo accelerator keeps everything local and internet-independent, exactly matching edge AI. Option A directly violates the no-internet-during-operation requirement. Option B ignores the small-dataset constraint that makes transfer learning necessary in the first place, and option C discards location information the project may need to identify the equipment within a scene.
Concept Tested: Custom Object Class