Lab 1 · Python Warm-up on Camera-Trap Metadata

Worth: 20 points  |  Due: end of Day 1  |  Files to submit: lab1.ipynb (or .py) and a 1-page PDF with the two required plots and a short paragraph of interpretation.
Pre-reading: Python Crash Course.

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

Get the data: aiecol_cameratraps.zip (297 MB) — or the full bundle aiecol_data_sample.zip (395 MB). See the downloads page for layout.

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:

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"):

  1. Extract the hour of day from datetime.
  2. Compute the fraction of detections in each of the 24 hour-of-day bins, normalized within species.
  3. 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:

Go-further (counts toward the 4 "go-further" pts in your rubric)

Stratify the diel plots by month. Do you see seasonal shifts?

Rubric

ComponentPoints
Code runs and produces required outputs10
Written interpretation6
Go-further task4
Total20

Starter notebook: lab1_starter.py (run as a script or paste cells into Jupyter).