Tag: Infra

  • MSD0001 Real-Time Factory Product Inspection

    

    You are tasked with designing and deploying a deep learning-based computer vision system for real-time quality control on a high-speed manufacturing assembly line. The system must classify each product as ‘Pass’ or ‘Fail’ due to surface defects (scratches, cracks, misalignments).

    Describe the complete end-to-end system design, from data acquisition and model selection to deployment and post-deployment maintenance.

    Crucially, how would you address the challenges of real-time inference speed and the severe class imbalance due to the fact that defects are rare?

    Problem framing diagram: a high-speed line producing 600 units per minute with surface defects flows into a question mark, with required outputs Pass or Fail within a 100 millisecond per unit budget at a 0.1 percent defect rate

    The Problem: 600 units per minute stream past a camera. Design the system that fills the question mark: real-time Pass/Fail within 100ms per unit, with defects occurring at only ~0.1%.

    Answer

    The solution is an Edge-AI Computer Vision Pipeline. It starts with a controlled imaging setup to capture consistent, high-quality images. The core is a lightweight CNN (e.g., MobileNetV2) fine-tuned via transfer learning, trained with a specialized loss (Focal Loss) to handle the rare-defect imbalance. Deployment runs on a local Edge GPU to guarantee low-latency inference, and a continuous MLOps loop monitors performance and retrains the model against new or subtle defects (concept drift).

    (1) Data & Setup: Controlled environment (lighting/staging) plus high-resolution cameras; transfer learning reduces the need for large-scale defect collection.
    (2) Imbalance Handling: Focal Loss (or weighted loss) combined with heavy data augmentation and oversampling of the rare ‘Fail’ class.
    (3) Model Architecture: A lightweight CNN (MobileNetV2, EfficientNet-B0) chosen for speed over a large, deep network.
    (4) Real-Time Deployment: Edge deployment on an industrial GPU (e.g., NVIDIA Jetson) with ONNX/TensorRT optimization and INT8 quantization to stay inside a sub-100ms budget.
    (5) Post-Deployment MLOps: Log every classification (especially false negatives) and trigger periodic retraining to combat model drift.

    End-to-end edge-AI quality control pipeline: camera and lighting feed preprocessing, an edge CNN classifier, a pass/fail actuator, and a logging path that loops back to periodic retraining

    Figure 1: The end-to-end pipeline. Solid arrows are the real-time inference path (capture → preprocess → edge CNN → actuator); the dashed loop is the offline MLOps path: logged hard examples and low-confidence frames flow back into retraining.

    Clarify Before Designing:
    (1) Throughput: line speed in units per minute, and the per-unit latency budget?
    (2) Defect Ontology: a closed set of defect types, or can new types appear in production?
    (3) Deployment Constraints: is cloud inference acceptable, or must everything run on-prem at the line?
    (4) Data Availability: how many labeled ‘Fail’ examples exist today, and what is the true defect rate?
    (5) Cost Asymmetry: the business cost of a false accept (defect escapes) versus a false reject (good unit scrapped)?


    Login to view more content
  • ML0066 Model Capacity

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

  • ML0039 Distributed Training

    This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.