Lab 1 · Python Warm-up on Camera-Trap Metadata
Biological motivation
Before you train any model, you should know your data. For camera-trap images that means understanding the temporal distribution: when were cameras triggered? Which hours of the day? Across which months? Are there cameras with missing data or stuck-shutter problems? This lab builds those habits.
Data
The course provides a 200-image teaching subset of Oregon Critters in
data_sample/cameratraps/, plus a tidy CSV
data_sample/oregon_critters_subset.csv with one row per
bounding-box annotation (multiple rows per image for multi-animal frames). Columns:
image, label, category_id, datetime, location, width, height,
bbox_x, bbox_y, bbox_w, bbox_h, split, orig_id
The full Oregon Critters dataset (~100,000 images) is available at
LILA if you want to scale up later
— AzCopy or the azure-storage CLI work. For this lab the 200-image subset
is enough.
Tasks
Task 1 — warm-up (3 pts)
In a Jupyter notebook, load the metadata CSV with pandas. Print:
- The number of unique images (use
drop_duplicates("image"); the CSV has one row per bounding box). - The number of unique
locations. - The number of unique species (
label) excluding"empty". - The earliest and latest
datetimein the dataset.
Task 2 — per-location image counts (3 pts)
Build a bar chart of the number of images per camera location (top 30 if there are many),
sorted descending. Save as fig1_per_site.png. Include in your PDF.
Task 3 — diel activity for the top 3 species (6 pts)
For the 3 most-detected species (still excluding "empty"):
- Extract the hour of day from
datetime. - Compute the fraction of detections in each of the 24 hour-of-day bins, normalized within species.
- Plot all three species on the same axes (line plot, x = hour, y = fraction of detections).
Save as
fig2_diel.png.
Task 4 — EXIF sanity check (4 pts)
Pick 30 random images. For each, read the EXIF DateTimeOriginal and compare to
the datetime in the CSV. How many disagree by more than 60 seconds? (Common in
field data after SD-card copies between operating systems — the curated LILA subset
used here is clean, so expect near-zero. Report whatever you find.)
Task 5 — interpretation (4 pts)
In your PDF, write 100–200 words answering:
- Are the top species' diel patterns consistent with their natural history?
- What does the per-site count distribution tell you about sampling effort?
- Any data-quality flags you'd want to address before training a model on this data?
Go-further (counts toward the 4 "go-further" pts in your rubric)
Stratify the diel plots by month. Do you see seasonal shifts?
Rubric
| Component | Points |
|---|---|
| Code runs and produces required outputs | 10 |
| Written interpretation | 6 |
| Go-further task | 4 |
| Total | 20 |
Starter notebook: lab1_starter.py (run as a script or paste cells into Jupyter).