Sign in or create a free account to continue.

ROB-410 · Lesson 12 of 12 · 34 min

Deployment, evaluation and capstone: a learning pipeline for pick-and-place

The previous lessons built the tools: decision processes, reinforcement learning, simulation, imitation, representations and foundation models. This final lesson is about using them responsibly on a real robot. It covers how to measure whether a learned policy is good enough, with honest statistics; how to wrap learned policies in safety layers and build an argument that the system is acceptably safe; what Canadian and American law says about recorded demonstration data and AI governance at the time of writing (October 2026); and how to monitor a policy once deployed. It ends with a capstone that ties the course together: designing a complete learning pipeline for a pick-and-place cell.

Measuring success honestly

The basic metric for most robot tasks is the success rate: the fraction of trials in which the task is completed according to a precise, written criterion. Defining success precisely is the first discipline. 'Placed the part' must say where, within what tolerance, within what time, and whether a drop and re-grasp counts. Ambiguous criteria let evaluators, consciously or not, favour the method they hope will win. Where possible, success should be judged automatically or by someone who does not know which policy ran.

A success rate from a finite number of trials is an estimate with uncertainty. The naive interval \( \hat{p} \pm 1.96 \sqrt{\hat{p}(1-\hat{p})/n} \) behaves badly for the small trial counts and high success rates typical of robotics: at 20 successes in 20 trials it gives an interval of zero width. The Wilson score interval is a better default.

\[\frac{\hat{p} + \frac{z^2}{2n}}{1 + \frac{z^2}{n}} \;\pm\; \frac{z}{1 + \frac{z^2}{n}} \sqrt{\frac{\hat{p}(1-\hat{p})}{n} + \frac{z^2}{4n^2}}\]

Here \( \hat{p} = k/n \) is the observed success rate from \( k \) successes in \( n \) trials and \( z = 1.96 \) for 95 % confidence.

Wilson intervals stay sensible at small trial counts and high success rates
# Wilson score intervals for robot success rates
import numpy as np
def wilson(k, n, z=1.96):
    p = k / n
    denom = 1 + z**2 / n
    mid = (p + z**2 / (2 * n)) / denom
    half = z / denom * np.sqrt(p * (1 - p) / n + z**2 / (4 * n**2))
    return mid - half, mid + half
for k, n in [(18, 20), (20, 20), (45, 50), (90, 100), (196, 200)]:
    lo, hi = wilson(k, n)
    print(f"{k:3d}/{n:3d} = {k/n:6.1%}   95% interval {lo:6.1%} to {hi:6.1%}")
# Do two policies differ? Compare intervals (a rough check) for 41/50 vs 47/50
for k in (41, 47):
    lo, hi = wilson(k, 50)
    print(f"policy with {k}/50: {lo:.1%} to {hi:.1%}")
Output
 18/ 20 =  90.0%   95% interval  69.9% to  97.2%
 20/ 20 = 100.0%   95% interval  83.9% to 100.0%
 45/ 50 =  90.0%   95% interval  78.6% to  95.7%
 90/100 =  90.0%   95% interval  82.6% to  94.5%
196/200 =  98.0%   95% interval  95.0% to  99.2%
policy with 41/50: 69.2% to 90.2%
policy with 47/50: 83.8% to 97.9%

Two lessons stand out. Twenty trials cannot distinguish 90 % from 75 %, and even 20 successes out of 20 is consistent with a true rate as low as about 84 %. And overlapping intervals are a warning sign that a comparison may be inconclusive; to decide, use a proper two-proportion test or, for paired comparisons on the same initial conditions, a paired test.

Worked problem

How many trials are needed?

A deployment requires evidence that a picking policy's failure rate is below 2 % with 95 % confidence. If every trial succeeds, how many consecutive successes are needed?

Show solution
  1. If the true failure rate were 2 %, the chance of \( n \) straight successes is \( 0.98^n \).
  2. We need \( 0.98^n \le 0.05 \), so \( n \ge \ln 0.05 / \ln 0.98 \approx 148.3 \).
  3. This is the rule of three: with zero failures in \( n \) trials, the 95 % upper bound on the failure rate is about \( 3/n \); \( 3 / 0.02 = 150 \).

Answer: About 150 consecutive successful trials; any failure means more trials are needed.

Trials needed to show a failure rate below a target when no failures are observed
Target maximum failure rateTrials with zero failures needed (95 %)At 30 trials per hour
10 %29About 1 hour
5 %59About 2 hours
2 %149About 5 hours
1 %299About 10 hours
0.1 %2,995About 100 hours

Success rate is not the only metric. Report cycle time, the number and kinds of failures, human interventions per hour, damage incidents, near misses, and performance broken down by condition: object type, lighting, clutter and position. A policy that averages 95 % but fails on every transparent object has a specific, fixable problem that the average hides. Evaluation should include conditions outside the training data and should be repeated after every change to the policy, data or hardware.

Layers of safety around a learned policy

A neural policy cannot be exhaustively verified, so safety is built in layers around it, as lesson 6 introduced. At the bottom, hardware and functional safety measures, such as emergency stops, safety-rated monitored speed and separation and force limits for collaborative robots, are designed to standards such as ISO 10218 and ISO/TS 15066 and must not depend on the learned policy at all. Above that, a classical low-level controller enforces joint, velocity and torque limits. A safety filter, such as a control barrier function or a workspace monitor, checks each commanded action and replaces unsafe ones. Runtime monitors watch for out-of-distribution inputs, such as unusual images or unfamiliar states, and slow or stop the robot or ask a person for help. Only then does the learned policy propose actions.

An end-to-end pipeline for a pick-and-place cell, drawn left to right: data collection by teleoperation and simulation, training of a policy, offline evaluation in simulation, staged real-world trials, deployment, and monitoring. A feedback arrow returns from monitoring to data collection. Beneath the deployment stage, nested boxes show the learned policy inside a safety filter, inside a low-level controller, inside hardware safety functions.
A learning pipeline for a pick-and-place cell, with the deployed policy wrapped in safety layers

A safety case is a structured argument, supported by evidence, that a system is acceptably safe for a specific use in a specific environment. For a learned system it typically argues that hazards were identified through risk assessment; that each hazard is mitigated by layers that do not rely on the learned policy behaving well; that the policy's operating domain is defined, such as object types, lighting and speeds; that monitors detect departures from that domain; and that testing provides statistically meaningful evidence of performance within it. Standards for machine-learning components in safety-related systems are still developing, at the time of writing, so a conservative architecture, in which the learned policy affects productivity but not safety, is the norm in industry.

Worked problem

Out-of-distribution monitoring

A picking policy computes features from an image encoder. In validation, the distance from each image's features to the nearest training feature has a 99th percentile of 0.42. In deployment, an image scores 0.71. What should the system do, and how could the threshold be chosen?

Show solution
  1. A score above the 99th percentile means the scene looks unlike anything in training, perhaps a new object, a reflection or a blocked camera.
  2. The robot should not trust the policy: it can slow down, re-image, skip the item or ask an operator.
  3. Choose the threshold on validation data to trade false alarms against missed anomalies, and log every alarm for review and possible new training data.

Answer: Treat the input as out of distribution, act conservatively and log it; set the threshold from validation statistics and adjust from logged alarms.

Data and AI governance in Canada and the United States

Learned robots raise legal questions that hand-coded robots rarely did. Demonstration recordings capture video and audio of operators, coworkers and sometimes customers or homes, and policies may be trained on that data indefinitely.

In Canada, the Personal Information Protection and Electronic Documents Act, PIPEDA, governs personal information collected in commercial activity in most provinces; it requires meaningful consent, limits on collection and use to identified purposes, safeguards and access rights. Quebec's Law 25, phased in from 2022 to 2024, modernized that province's private-sector privacy law with stronger consent rules, privacy impact assessments for certain projects, and transparency about automated decisions. Alberta and British Columbia have their own private-sector privacy acts. Biometric information such as face images is treated as sensitive, generally requiring express consent.

In the United States there is no comprehensive federal privacy law at the time of writing. Instead, a growing number of states have consumer privacy laws, led by California's Consumer Privacy Act as amended by the California Privacy Rights Act, which give rights to know, delete and limit the use of sensitive data. Illinois's Biometric Information Privacy Act, BIPA, requires written notice and consent before collecting biometric identifiers such as face geometry and allows private lawsuits, which has produced substantial litigation; Texas and Washington have biometric laws too. Sector rules, such as health privacy rules, may also apply.

AI-specific governance also differs. Canada's proposed Artificial Intelligence and Data Act, AIDA, part of Bill C-27, died on the order paper when Parliament was prorogued in January 2025, so Canada has no federal AI statute at the time of writing; the government's Voluntary Code of Conduct on the Responsible Development and Management of Advanced Generative AI Systems, launched in September 2023, remains a non-binding reference. In the United States, Executive Order 14110 on safe, secure and trustworthy AI was revoked in January 2025, and federal policy shifted towards reducing barriers to AI development; in December 2025 Executive Order 14365, Ensuring a National Policy Framework for Artificial Intelligence, sought a single national approach and challenged conflicting state AI laws. Some states, such as Colorado, have passed AI laws of their own. Teams selling into Europe must also consider the EU AI Act, adopted in 2024 with obligations phasing in over several years, which treats AI that serves as a safety component of machinery as high risk.

A brief comparison of rules relevant to robot-learning data and deployment, at the time of writing
IssueCanadaUnited States
General private-sector privacyPIPEDA federally; Quebec Law 25; Alberta and BC actsNo federal law; state laws such as California's CCPA as amended by the CPRA
Biometric data such as facesSensitive; express consent generally expectedState laws such as Illinois BIPA require written consent; private lawsuits possible
Federal AI statuteNone; AIDA died January 2025None; executive orders set federal policy
Soft-law guidanceVoluntary Code of Conduct (September 2023)Agency guidance and the NIST AI Risk Management Framework
Recent federal directionUnder review at the time of writingEO 14110 revoked January 2025; EO 14365 (December 2025) seeks a national framework
Machine safetyCSA Z434 adopting ISO 10218ANSI/A3 R15.06 adopting ISO 10218

Practical habits satisfy most regimes. Collect only the data the task needs, for example by pointing cameras at the workspace rather than at operators; tell people what is recorded and why, and obtain consent; blur or crop faces where they are not needed; set retention periods; secure and access-control datasets; record the provenance and licence terms of any external data or pretrained model; and document the policy's intended use and limits.

Worked problem

A privacy check for a demonstration campaign

A Montreal company plans to record 300 hours of teleoperated demonstrations in a client's warehouse, with an overhead camera that captures workers walking past, and to share the dataset with a US research partner. List the main steps.

Show solution
  1. Purpose and minimization: angle cameras at the work cell and crop or blur passers-by.
  2. Quebec Law 25: assess whether a privacy impact assessment is required, notably for transferring personal information outside Quebec, and inform affected workers.
  3. Consent and notice: written notice to workers and operators, with express consent for any retained biometric data.
  4. Transfer: a data-sharing agreement with the partner setting purpose, security, retention and deletion; check any state law the partner is subject to, such as BIPA if it is in Illinois.
  5. Records: a datasheet and retention schedule for the dataset.

Answer: Minimize and anonymize, assess and document under Law 25, notify and obtain consent, and govern the cross-border transfer by agreement.

Deployment and monitoring

Deployment should proceed in stages: shadow mode, in which the policy proposes actions that are logged but not executed; supervised operation at reduced speed with an operator ready to intervene; limited autonomous operation on a subset of items or shifts; and full operation with monitoring. At each stage, define in advance the metrics and thresholds that permit moving to the next. After deployment, monitor success rates, cycle times, interventions and out-of-distribution alarms continuously, because performance drifts as products, lighting, wear and seasons change. Logged failures and interventions are the most valuable new training data, closing the loop with the DAgger idea from lesson 8. Every policy update should be versioned, evaluated against the previous version on a fixed test suite, and deployed with a rollback plan.

Capstone: a learning pipeline for pick-and-place

Consider a cell where a robot arm picks mixed consumer products from a tote and places them into shipping boxes. The product catalogue changes weekly, so hand-coded grasping for each item is impractical. Pull the course together by designing the pipeline.

Worked problem

Designing the pick-and-place learning pipeline

Propose the learning approach, data plan, evaluation plan and safety architecture for the cell, with a target of 99 % pick success on known item types and safe handling of unfamiliar ones.

Show solution
  1. Problem framing (lessons 1 and 2): observation is an overhead RGB-D image plus wrist camera and joint states; actions are grasp poses and placement poses, with classical motion planning between them. Learning is used where it pays: choosing grasps for varied items.
  2. Approach: start from a pretrained vision encoder (lesson 10), and either a foundation model fine-tuned on the cell (lesson 11) or a specialist generative grasp policy (lesson 9).
  3. Data (lessons 7 and 9): synthetic grasps on thousands of randomized object models in simulation with domain randomization, plus about 500 teleoperated real demonstrations, with a documented, privacy-reviewed collection protocol.
  4. Improvement (lesson 8): run HG-DAgger, where operators correct failures during supervised operation, and add those corrections to the data each week.
  5. Reward and RL (lessons 4 to 6): optionally fine-tune with a sparse success reward in simulation, guarded against reward hacking by checking videos and secondary metrics.
  6. Evaluation: a fixed test suite of item types, Wilson intervals, at least 300 trials with no more than one failure to support a 99 % claim, broken down by item category, plus out-of-distribution items.
  7. Safety: fenced cell or speed and separation monitoring to ISO 10218; joint and workspace limits in the controller; an out-of-distribution monitor that diverts unfamiliar items to a manual station; staged deployment with rollback.

Answer: A hybrid pipeline: learned grasp selection on pretrained features, trained from simulation and teleoperated data, improved by interventions, evaluated with proper statistics, and wrapped in classical control and independent safety layers.

A trial harness that logs outcomes, cycle times and out-of-distribution diversions
# Capstone evaluation harness (listing only): log every trial for statistics and retraining
import json, time
def run_trial(policy, cell, item_id):
    obs = cell.observe()
    ood = monitor.score(obs) > OOD_THRESHOLD
    if ood:
        cell.divert(item_id)                 # unfamiliar item goes to the manual station
        return {"item": item_id, "result": "diverted"}
    grasp = policy.select_grasp(obs)
    ok = cell.execute_pick_and_place(grasp)  # motion planning and limits inside
    return {"item": item_id, "result": "success" if ok else "failure",
            "cycle_s": cell.last_cycle_time(), "t": time.time()}
with open("trials.jsonl", "a") as log:
    for item_id in test_suite:
        log.write(json.dumps(run_trial(policy, cell, item_id)) + "\n")

Common mistakes

  • MistakeReporting a success rate without the number of trials.

    InsteadAlways give \( k/n \) and a Wilson interval, with a precise written success criterion.

  • MistakeClaiming one policy beats another from overlapping intervals.

    InsteadRun more trials, use paired comparisons on matched initial conditions and a proper test.

  • MistakeRelying on the learned policy for safety.

    InsteadKeep hardware safety and limits independent of the policy; it should affect productivity, not safety.

  • MistakeRecording demonstrations without considering privacy law.

    InsteadMinimize, notify, obtain consent, secure the data and document it before collection.

  • MistakeDeploying and walking away.

    InsteadMonitor performance and out-of-distribution alarms, version policies and keep a rollback plan.

Summary and key terms

  • Success needs a precise criterion, blind or automatic judging, and reporting of trial counts.
  • Wilson intervals quantify uncertainty; showing a 1 % failure rate needs about 300 clean trials.
  • Report breakdowns by condition, interventions and failure modes, not only averages.
  • Learned policies sit inside layers: hardware safety, limits, safety filters and runtime monitors.
  • A safety case argues, with evidence, that a defined system is acceptably safe in a defined domain.
  • Canada and the US differ on privacy and AI governance; minimization, consent and documentation help everywhere.
  • Deploy in stages, monitor continuously and feed failures back into training.
Success criterion
A precise written definition of a successful trial.
Wilson score interval
A confidence interval for a proportion that behaves well at small samples.
Rule of three
With zero failures in \( n \) trials, the 95 % upper bound on failure rate is about \( 3/n \).
Safety case
A structured, evidence-based argument that a system is acceptably safe for a use.
Operating domain
The conditions under which a system is designed and validated to operate.
Out-of-distribution detection
Identifying inputs unlike the training data.
Shadow mode
Running a policy whose outputs are logged but not executed.
PIPEDA
Canada's federal private-sector privacy law.
BIPA
Illinois's Biometric Information Privacy Act.
EU AI Act
The European Union's risk-based regulation of AI systems.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Why is the naive interval poor at 20/20?

    Show answer

    It has zero width, implying certainty.

  2. Zero failures in 60 trials gives what approximate upper bound on failure rate?

    Show answer

    \( 3/60 = 5\% \).

  3. How many clean trials support a 0.5 % failure claim?

    Show answer

    About 600.

  4. Name two metrics besides success rate.

    Show answer

    Cycle time, interventions per hour, damage incidents, near misses.

  5. Which safety layer must never depend on the learned policy?

    Show answer

    Hardware and functional safety, such as emergency stops and force limits.

  6. What does a safety case need for a learned policy?

    Show answer

    Hazards, independent mitigations, a defined operating domain, monitors and test evidence.

  7. What happened to AIDA?

    Show answer

    It died when Parliament was prorogued in January 2025.

  8. What does BIPA require before collecting face geometry?

    Show answer

    Written notice and consent.

  9. What is shadow mode?

    Show answer

    The policy's actions are logged but not executed.

  10. Why are logged interventions valuable?

    Show answer

    They show exactly where the policy fails and become targeted training data.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz