AI & Computer Vision, lesson 15 of 52

Field Trip Prep: Your Data Collection Plan

intermediate24 min read

Introduction

In lesson 28 you'll take a laptop to a real football field and collect a dataset. A film crew never turns up and "sees what happens": they bring a shot list. Today you'll write yours: where the camera goes, how many frames of each class you need, the settings for bright sunlight, who does which job, and what you'll do when things go wrong.

By the end of this lesson you'll be able to:

  • Turn the data-quality lessons from lesson 10 to lesson 14 into concrete field capture decisions
  • Design a camera position plan that maximises variety and reduces bias
  • Set a target count for each class, and explain why the numbers differ
  • Configure capture.py (blur threshold, interval, class) for outdoor sport
  • Assign team roles for the field trip
  • Write a 1-page Field Collection Brief that a teacher can review and approve
  • Anticipate field-specific failure modes and write down what the team will do about each

Working principle

Why plan first?

Sessions 10 to 14 taught what makes data good, how to capture it, label it, split it, and how to treat the people in it. Now you turn that into a plan. Without a plan, teams capture whatever is in front of them, miss whole classes, and come back with unusable footage. A pre-approved brief prevents that.

Every rule in the brief must trace back to a lesson:

Earlier lessonBecomes a field rule
lesson 10: "Frames from one video are near-identical, so counting them is misleading""Capture from 3 different camera positions, and start a new session at each one"
lesson 11: "A background class teaches the model what nothing looks like""Capture at least 40 empty-pitch frames"
lesson 13: "Split by session, so we need several sessions per class""At least 10 sessions per class: rotate position every 20 minutes"
lesson 14: "Ask first, collect little, delete it""Signed forms for every child in frame. Camera points at the pitch, not the stands."

If you can't trace a rule back to a lesson, go back to that lesson before the trip.

Field Trip 1: overview

Trip numberField Trip 1 of 3 (lesson 28, lesson 39 and lesson 50)
Sessionlesson 28: Football field data capture
LocationFootball field (arrange access with the school administration)
Duration2 hours on site, plus travel
Team size3 to 4 students per team, 2 to 4 teams per class
Hardware1 laptop and 1 webcam per team (no GPU needed)
Target output200+ usable frames per team across all 4 classes
Quality barAccept rate 60% or more, all classes at 40 or more usable frames

Anticipated field failure modes and what to do

Each team must address all of these in its brief.

Failure modeWhy it happensMitigation
Webcam too far from the actionObjects too small: the ball can be under 5 pixels widePlace the webcam within about 15 m of the play area. Use a closer angle for ball-specific capture.
All frames from one camera angleDistribution bias: the model fails at other anglesPlan 3 positions (sideline, behind goal, elevated). Rotate every 20 minutes. Press N for a new session each time.
Ball class badly under-representedThe ball is visible only briefly, so most frames show playersGive one team member the job of ball-only sessions during set pieces.
Motion-blur rejection above 80%Webcam auto-exposure reacts slowly outdoorsFix the webcam exposure by hand if the driver allows. Lower BLUR_THRESHOLD from 80 to about 50 for outdoors.
Laptop overheats, script crashesDirect sun, CPU load and battery heatWork in shade. Plug in if possible. Restart capture.py every 30 minutes (counts are rebuilt from the files).
Someone forgets to switch CLASS_NAMEEvery frame saved in the wrong classOne person is the Class Manager and owns all class changes.
Roboflow mobile upload fails on sitePoor mobile data at the fieldCreate the Roboflow project beforehand. Annotate after returning, from the downloaded images.
Frames captured during dead-ball timePlayers are not in position, so the frames are irrelevantPause auto-capture during stoppages (P). Use manual capture (SPACE) in active play.
A parent has not signed, or a bystander objectsConsent gaps (lesson 14)Keep the signed-forms list at the field. Stop and delete frames for anyone who objects.

capture.py field configuration

Open your capture.py from lesson 11 and change the constants at the top for outdoor football. Write each setting in your brief, with a reason.

# ---------------- FIELD TRIP CONFIGURATION (lesson 15 review, lesson 28 deployment) ----------------
CLASS_NAME = "player"           # change per session: player | ball | goal | background
DATASET_ROOT = "field_trip_1"   # a separate root folder for field data
 
BLUR_THRESHOLD = 50.0           # classroom default was 80. Lower outdoors (speed, wind, distance)
CAPTURE_INTERVAL = 0.0          # 0 = SPACE only. Switch to 0.8 for passive capture
MIN_DIFF = 800                  # higher than the classroom 500: the pitch background is static
CAMERA_INDEX = 0                # test before leaving. Use 1 or 2 if it fails
SAVE_QUALITY = 92               # keep high. Compress later if storage is short
MOTION_ONLY = False             # True: only try to save when something moves
 
TARGET_COUNTS = {
    "player": 80,               # majority class, easy to collect
    "ball": 80,                 # priority: a small object seen briefly, so it needs the same effort
    "goal": 40,                 # static object: capture first, then move on
    "background": 40,           # empty pitch sections as null examples
}
# Total target: 240 frames captured, about 150 after the filters (at about 60% accept rate)

Question: why is the ball target as high as the player target even though a ball is a tiny part of every image?

Team roles for Field Trip 1

Each team of 3 or 4 assigns these roles before arriving at the field. Roles rotate every 30 minutes.

RoleDuties
OperatorControls the laptop and runs capture.py. Watches the blur score in the preview. Presses SPACE at key moments. Announces when a class target is reached.
Class ManagerOwns every CLASS_NAME change. Tracks the count per class from the CSV log. Calls the switch when a target is reached. Prevents the most common field error: the wrong class folder.
SpotterWatches the play and calls moments worth capturing ("corner kick, get the ball!", "both goalkeepers are in view!"). Guides the operator without touching the laptop.
Logger and ReviewerWatches the log CSV on a second device. Flags any drop in accept rate. Photographs the camera positions for the trip report. Notes technical problems and keeps the consent list.

In a team of three, the Logger and the Spotter share a role.

Your Field Collection Brief

Share as a Google Doc, one per team. Maximum 1 page when printed. It must be approved before Field Trip 1 (lesson 28).

Team name
Team members
Field trip date

Section 1: Class capture targets

ClassTarget framesMinimum acceptableJustification (link to a lesson)
player40
ball40
goal20
background20

Section 2: Camera positions

PosLocation descriptionClasses to captureDuration
A
B
C

Section 3: capture.py configuration

SettingValue we will useJustification
BLUR_THRESHOLD
CAPTURE_INTERVAL
MIN_DIFF
SAVE_QUALITY
CAMERA_INDEX

Section 4: Team role assignment

RoleNameSpecific duty at the field
Operator
Class Manager
Spotter
Logger and Reviewer

Section 5: Our 5 non-negotiable quality rules

Write 5 rules your team will enforce. Each must trace back to a lesson from lesson 10 to lesson 14. Example: "We will capture at least 80 ball frames, because the ball is small and seen briefly, so it needs the same effort as the players."

1
2
3
4
5

Section 6: Consent and privacy (from lesson 14)

QuestionOur answer
Who signs the forms and where is the list kept at the field?
What do we do if someone refuses or objects?
Where does the camera point? Where won't it point?
Where is the data stored and when is it deleted?

Section 7: Contingency plans

What will you do if each of these happens at the field?

ScenarioOur response
Accept rate drops below 30%
Ball count is still below 30 after 45 minutes
Laptop battery dies at 60 minutes
The webcam is not recognised (cap.isOpened() is False)

What you'll need

  • Your capture.py from lesson 11
  • Your team (3 or 4 people)
  • The Field Collection Brief template below

Build it

A planning calculator

You check whether their targets fit in the time they have. It's a small script that turns the plan into minutes.

def plan(targets, accept_rate=0.6, tries_per_minute=6, minutes_available=90, switch_minutes=2):
    """
    targets: frames you want KEPT per class, e.g. {"player": 80, "ball": 80}
    accept_rate: share of tries that pass the blur and duplicate filters (0 to 1)
    tries_per_minute: how many times a minute you can realistically try a capture by hand (SPACE)
    """
    kept_per_minute = accept_rate * tries_per_minute
    rows = []
    total_minutes = 0.0
    for cls, n in targets.items():
        minutes = n / kept_per_minute + switch_minutes
        total_minutes += minutes
        rows.append((cls, n, round(n / accept_rate), round(minutes, 1)))
 
    print(f"{'class':<12}{'keep':>6}{'try':>6}{'minutes':>9}")
    for cls, keep, tries, minutes in rows:
        print(f"{cls:<12}{keep:>6}{tries:>6}{minutes:>9}")
    print(f"Total: {round(total_minutes, 1)} minutes of {minutes_available} available")
    if total_minutes > minutes_available:
        print("Too much for the time. Lower a target, or find a way to raise the accept rate.")
    else:
        spare = round(minutes_available - total_minutes, 1)
        print(f"Fits, with {spare} minutes to spare for moving between positions and surprises.")
    return total_minutes
 
 
plan({"player": 80, "ball": 80, "goal": 40, "background": 40})
print()
plan({"player": 80, "ball": 80, "goal": 40, "background": 40}, accept_rate=0.3)

Question: what happens to the plan if the accept rate falls from 60% to 30%? Which section of the brief tells you what to do?

If it goes wrong

ErrorCauseFix
Targets are "as many as possible"No planGive a number and a reason
All three positions are on the same sidelineConvenienceDifferent angle and distance for each
Settings copied from the classroom unchangedNot thinking about outdoorsAsk "what is different outside?"
Class Manager and Operator are the same personShort on peopleThe Class Manager can be the Logger, but never the Operator
Contingency says "ask the teacher"Avoiding the problemThe teacher can't fix a flat battery. Ask for a spare charger, power bank, or paper log.
Consent section left blankTreating lesson 14 as a separate topicReturn the brief: no consent plan, no trip

Try it

  • Work out the shutter time needed to keep a ball travelling at 50 km/h within 5 pixels of blur at 10 m distance
  • Draw a pitch diagram with the camera positions, field of view, and distance to the near and far players
  • Write a step-by-step "capture protocol" for the Class Manager

Check what you learnt

  1. Why move the camera to a new position every 20 minutes?

  2. Why capture at least 40 empty-pitch frames?

  3. Who makes sure frames go in the right class folder?

  4. In bright sun, what should you check most in the preview?

  5. Where should the camera point?

Conclusion

A field trip without a plan brings back unusable footage. Your Field Collection Brief sets camera positions, per-class targets, capture settings, team roles and backup plans, and every rule in it traces back to a lesson from Unit 3.

What next?

Next: How neural networks learn. Unit 4 starts: how neural networks actually learn.