← Capabilities

Background Subtraction

Robust animal detection through adaptive background modeling

Three background models — static, MOG2, and KNN — adapt to lighting changes, reject shadows, and maintain detection through gradual environmental shifts without manual threshold adjustment.

Background Subtraction
3
Background model options
Auto
Lighting adaptation
Yes
Shadow rejection
0
Manual threshold adjustments
The problem

Fixed detection thresholds fail when lighting changes

Standard tracking uses a brightness threshold to separate the animal from the arena floor. When room lights change (door opening, circadian cycle), shadows move, or bedding shifts, the threshold becomes invalid and detection is lost.

  • Circadian light/dark transitions invalidate fixed brightness thresholds
  • Shadows cast by the animal or experimenter create false detection regions
  • Bedding redistribution during the session changes the background appearance
The solution

Continuously adapting background model

ConductVision maintains a background model that updates continuously, separating the static (or slowly changing) arena from the moving animal. Shadow detection classifies shadow pixels separately from animal pixels.

  • Three models available: static (fastest), MOG2 (Gaussian mixture), KNN (non-parametric) — choose based on conditions
  • Shadow rejection prevents shadows from being classified as part of the animal
  • Gradual adaptation tracks slow environmental changes without losing the animal
Endpoints

Detection quality outputs

Foreground mask

Foreground mask

Per-frame binary foreground mask separating the animal from the adapted background — usable for downstream analysis.

PNG seriesNPY
Detection confidence trace

Detection confidence trace

Per-frame detection confidence score indicating how clearly the animal is separated from background — flags potential tracking issues.

CSV
Background model snapshot

Background model snapshot

Current background model image for visual verification that adaptation is tracking environmental changes correctly.

PNG
Applications

Variable-condition tracking scenarios

Home cage

24-hour home cage monitoring

Light/dark cycle transitions change arena illumination dramatically. Adaptive background maintains tracking through the transition.

Measures
  • Detection continuity
  • Cross-cycle tracking
  • Transition recovery time
Dynamic lighting

Light/dark box and CPP

Moving between light and dark compartments changes local illumination. Background subtraction adapts per-region.

Measures
  • Compartment detection rate
  • Transition accuracy
  • Shadow rejection rate
Multi-day recording

Extended continuous tracking

Bedding shifts, food/water changes, and gradual soiling change the arena appearance over days. Adaptive models maintain detection.

Measures
  • Multi-day detection rate
  • Background model drift
  • Adaptation response time
Outdoor/semi-outdoor

Variable natural lighting

Field stations and semi-outdoor enclosures experience cloud cover changes and sun angle shifts. KNN model handles non-stationary backgrounds.

Measures
  • Outdoor detection rate
  • Cloud-transition robustness
  • Sun-angle adaptation
Compared to typical systems

How ConductVision differs

FeatureConductVisionTypical systems
Background model3 adaptive models (static/MOG2/KNN)Fixed threshold
Shadow handlingAutomatic shadow rejectionShadows detected as animal
Lighting change toleranceContinuous adaptationRe-calibrate manually
Threshold tuningNot requiredPer-session adjustment
24h recording supportAdapts through light/dark cycleFails at light transitions

Track through any lighting condition

Upload a recording with changing lighting and see adaptive background maintain detection.