MIT BioInstrumentation Laboratory

Quantitative Optical Gas Imaging of Bovine Methane Emissions

Autonomous camera tracking and spatiotemporal plume segmentation in respiration chambers

Thanh Nha Nguyen, Michael Aling, Ian Hunter

Massachusetts Institute of Technology

Contact: thanhnha@mit.edu

Cows release methane mainly by belching, and the gas is invisible to the eye. We aim a cooled mid-infrared camera at a cow's nostrils inside respiration chambers that independently measure total methane, and built a pipeline that extracts the faint, flickering plume as candidate plume regions. Resolving single eructations—rather than multi-minute averages—opens the way to linking emissions directly to a cow's behaviour at the moment of release. This companion page walks through the work with the videos a static poster cannot show.

28×
100-year global warming potential of methane relative to CO₂
~400 g
enteric methane emitted by a single dairy cow per day
$2M
cost of a single respiration chamber, the reference instrument
<$0.1M
cost of a cooled optical gas imaging camera

01 · The measurement bottleneck

Enteric methane is large, and hard to measure at scale

Enteric methane from cattle is one of agriculture's largest greenhouse-gas sources: globally, cattle rival the passenger-car fleet in climate warming. Feed additives, diet changes, and selective breeding can all lower emissions, but proving those reductions requires measuring many animals—and measurement remains the bottleneck.

More than 95% of a cow's enteric methane exits through the nose and mouth via eructation (belching) and exhaled breath. Standard methods rely on sealed respiration chambers or SF₆ tracer halters. Whereas each eructation lasts only seconds, existing instruments report averages over minutes to days.

TechniqueHardware costInvasivenessSettingTime resolution
Respiration chamberUp to $2M (facility)ConfinementSealed roomτ ≈ 8–10 min (chamber turnover)
GreenFeed (C-Lock)ModerateVoluntary feeder visitsBarn or pasture3–7 min per visit
SF₆ tracer gasModerateRumen bolus and halterBarn or pastureHours to days
Mid-infrared optical gas imaging (this work)< $0.1M (camera)Non-invasiveChamber and barn30 frames/s (single breaths)

The gap: no existing method is simultaneously non-invasive, scalable, cost-effective, and operable in the animal's natural environment. Optical gas imaging can fill that gap, but commercial cameras were never tailored to cattle breath plumes.

References: IPCC AR5 WG1 Ch. 8 (2014); Bannink et al. (2011); Tseten et al. (2022); Hammond et al., Anim. Prod. Sci. 56:181 (2016), GreenFeed; Pinares-Patiño et al., GRA Technical Manual on Respiration Chamber Designs (2014). Hardware costs are indicative.

02 · Mid-infrared radiative transfer

Methane absorbs and emits at 3.3 µm

Methane strongly absorbs and emits infrared radiation around 3.3 µm. Our cooled FLIR GIS-320 camera (GF320 core) restricts sensitivity to 3.2–3.4 µm, so a methane plume registers as a radiance change against the background.

A plume produces contrast only when its temperature differs from the background: warm breath in front of a cooler wall adds radiance, whereas gas at the wall's temperature is invisible. We therefore line each chamber with a matte black backdrop (Krylon flat black paint, mid-infrared emissivity ≈ 0.95 or higher), suppressing thermal reflections of the warm cow so the camera views a uniform background temperature.

HITRAN methane absorbance spectrum with the camera's 3.2 to 3.4 micrometre passband shaded over the strongest absorption peak.
CH₄ absorbance (HITRAN, 297 K, 1 atm air). The shaded 3.2–3.4 µm passband covers the fundamental absorption peak.
Radiative transfer diagram showing an infrared camera viewing a gas plume against a background of known emissivity and temperature.
Simplified OGI radiative path. Jobert et al., Sensors 26(10):3270, 2026, Fig. 4 (CC BY 4.0).

The sensor measures background radiation transmitted through the plume plus radiation emitted by the gas itself. Subtracting the unobstructed background gives the radiance contrast:

\[ \Delta L_G = \underbrace{\left(1 - e^{-\alpha c_X L}\right)}_{\text{share absorbed}}\;\underbrace{\left[L_0(T_G) - L_B\right]}_{\text{temperature contrast}} \]

Here \(c_X L\) is the methane column density (concentration × path length), \(\alpha\) is the absorption coefficient, and \(L_0(T)\) is the blackbody radiance at temperature \(T\). Either zero methane or zero temperature contrast yields zero signal.

Single-pixel, single-frame detection limit

Adjust the sliders for a single pixel and single frame at a contrast-to-noise ratio (CNR) of 1.

140 ppm
minimum detectable column 14 ppm·m

This calculation represents an idealised physical bound, not an empirical detection rate. For an optically thin plume (\(\alpha c_X L \ll 1\)) and small thermal contrast \(\Delta T = T_G - T_B\), the signal linearises to \(\Delta I \approx k\, c_X L\, \Delta T\), where \(k\) is the camera's band responsivity. Equating \(\Delta I\) to the measured pixel noise σ = 0.62 counts (≈ 15 mK per frame) with σ/k ≈ 290 ppm·m·K gives \((c_X L)_{\min} = (\sigma/k)/\Delta T\). Practical detection requires a margin above noise and loses contrast as exhaled breath cools; spatiotemporal averaging across frames and neighbouring pixels (§06) recovers sensitivity.

03 · Field proof of concept

First trials in a working dairy barn

Before deploying in respiration chambers, we tested a battery-powered portable OGI rig at Fairvue Farms, a family-owned dairy in Woodstock, Connecticut, to verify that the camera could resolve cow breath plumes along an active feed bunk.

Visualising an eructation at the feed bunk

Mid-IR, frame differencing. Exhaled methane appears as bright, flickering puffs at the nostrils.
Visible light, same feed bunk. Eructations leave no visual or audible cue—as the farm manager put it: "I've never seen a cow burp."

The barn trial showed that OGI resolves breath plumes alongside natural behaviour, but could not tell us how much methane each plume carries. Quantifying emissions required co-locating the camera with a simultaneous reference instrument: a respiration chamber.

04 · Chamber integration & autonomous tracking

Co-locating the camera with reference gas analysers

A respiration chamber is a sealed stall ventilated at a known airflow rate while gas analysers measure methane in the exhaust stream. We installed our OGI payload inside chambers at Cornell University and at AgResearch Grasslands in New Zealand so the camera and chamber monitor the same cow simultaneously.

Cornell University

First-generation camera payload, mounted on the chamber wall:

  • FLIR GIS-320 cooled OGI camera (mid-IR methane and visible channels)
  • Intel RealSense camera (depth and colour video)
  • Gremsy T7 two-axis gimbal for remote pointing
  • Jetson computer with a 5 TB drive for recording, streaming, and networking
  • HDMI transmitter for local wireless viewing, plus a Digilent board and RC receiver for gimbal commands

Because the cow alternates between lying down and standing at the trough, the black backdrop must span both viewing angles.

AgResearch Grasslands, New Zealand

Overhead camera view of the chamber stall outlining the resting and eating zones.
Primary head zones inside the stall: resting / ruminating and eating.

Here the camera payload hangs from the overhead chamber frame looking down on both zones. To follow the cow between resting and feeding positions, we subsequently mounted the payload on a motorized ceiling rail.

Wall-mounted camera payload with gimbal mounted above the stall, looking down.
Overhead camera payload

Motorized ceiling rail and 15 Hz nose tracking

9× speed. The motorized ceiling rail carries the camera between the resting and eating zones.

For the final four trial days, the payload rode a motorised ceiling rail (Arduino, stepper motor, and limit switches) between the two zones. Because the rail moves quietly and slowly, the cows tolerated it well—though curious animals occasionally came within 4 inches of the lens.

An onboard Intel NUC detects a stripe of livestock marking paint (tail paint) on the cow's nose bridge at 15 Hz and steers the gimbal via PD control with a dead zone, keeping the nostrils framed without chasing small twitches. Operators control live viewing, tracking, recording, and rail position day and night from a laptop or phone over a Tailscale VPN.

Web controller. Active tracking: the red reticle follows the tail-paint marker on the nose bridge.
Tracker view of a cow with pink paint on its nose, very close to the camera.
Curious cow inspecting the camera at close range
System block diagram showing the FLIR camera, RealSense, gimbal, and rail connected to the on-site Intel NUC and linked over Tailscale VPN to remote devices and cloud storage.
Telemetry and data architecture. In the chamber → on site → anywhere. Tap to enlarge.

Hardware evolution across the chamber trials

Computer
Jetson
→ Intel NUC
Gimbal control
RC receiver + PPM emulation
→ MAVLink, direct
Viewing
HDMI transmitter, RTSP stream
→ web app on any device
Tracking
manual
→ automatic (tail paint)
Camera position
fixed
→ motorised rail

05 · Automated stationary-scene curation

Screening recordings for stationary, in-profile scenes

Our spatiotemporal filter (§06) treats variations slower than ~0.5 s as background and faster fluctuations as candidate gas. That assumption holds only when the camera is stationary, the cow is in profile, and the black backdrop sits behind the nostrils.

Ideal geometry: stationary camera, cow in profile

30 Jan, 06:44. Nostrils framed against the matte black backdrop.
31 Jan, 21:22. Stationary framing with stall rails and chain behind the head.

Even in these well-framed clips, the warm head and reflective metal rails dominate the raw image while the breath plume remains invisible. Extracting that faint plume is the task of §06.

Excluded footage: motion and framing failures

Gimbal panning: moving background edges mimic gas
Swinging head and chain: rapid motion aliases as gas
Cow leaves frame: nostrils out of view
Cow fills frame: no backdrop behind nostrils

Usable-footage yield across 53 hours of recordings

Automated screening of every recording followed by manual pose verification. Hover or tap a bar to view its share of the 53 h total.

About 6% of the raw footage is usable as is. Isolating those stationary, well-framed stretches is the pipeline's first step.

06 · Revealing the plume

Selective filtering and windowed RMS activity

A breath plume changes the image by about a count; the camera's noise is 0.6 counts. Three steps separate the two: follow the slow background, average the noise away while letting fast changes through, and measure how much each pixel flickers.

Block diagram: incoming frames feed an exponential filter that tracks the background; the background-subtracted signal passes through a selective temporal filter and a spatial filter, and a 0.5 s windowed RMS computes the activity A(x,t).
Grey blocks: adapted from Jobert et al., Sensors 26(10):3270, 2026, Fig. 12 (CC BY 4.0). Maroon block: our windowed RMS stage. Tap to enlarge.
  1. 1
    Follow the background. An exponential temporal filter remembers about half a second (at 30 frames/s):
    \[ I^*_t = p_0\, I_t + (1 - p_0)\, I^*_{t-1}, \qquad p_0 = \tfrac{1}{15} \]
  2. 2
    Average noise, pass gas. The change from the background is filtered again, but its averaging switches off when a change is too big to be noise. A sigmoid gate in noise units sets the switch at 2σ:
    \[ \delta I^*_t = K * \Big[\, p\,(I_t - I^*_{t-1}) + (1-p)\,\delta I^*_{t-1} \Big], \qquad p = p_0 + \frac{1 - p_0}{1 + e^{-3(|\Delta|/\sigma - 2)}} \]
    where \(K\) is a 1-pixel spatial blur and \(\Delta\) is the step change from the previous filtered output.
  3. 3
    Measure the flicker. Turbulent eddies break a plume into puffs, so one pixel's column both shifts and flickers. The RMS over a 0.5 s window keeps both; camera noise averages to zero and adds only a fixed σ²:
    \[ A(x,t) = \sqrt{\operatorname{mean}_{0.5\,\text{s}}\big(\delta I^{*2}\big)}, \qquad A^2 = \underbrace{\big(\operatorname{mean}\,\delta I^*\big)^2}_{\text{shift}} + \underbrace{\operatorname{var}\,\delta I^*}_{\text{fluctuation}} \]
Plot of gate weight p against step change in noise units, overlaid on gas-free noise histograms for sigma = 0.614 and 0.48 counts.
σ sets where the switch sits. We measured σ = 0.614 counts on gas-free footage. Frame differencing reads 0.48 (22% low) because consecutive frames share noise (ρ₁ = 0.38); at that value 11% of noise trips the gate instead of 5%. This σ, the raw pixel noise, only places the gate. Activity is measured in units of σout, the gas-free level of the windowed RMS itself (about 0.12 counts on the release footage, 0.2 on cow clips), and the thresholds in §08 are multiples of σout.
Time series of a single pixel's filtered signal, 0.5 s running mean, and 0.5 s running RMS with gas off and during a 0.4% methane release.
Single-pixel trace: gas off vs 0.4% release. The 0.5 s RMS jumps from a 0.12-count baseline to 1.1 counts when gas flows.

Controlled releases (0.4% methane): the windowed RMS detects 34% of gas pixels, against 15% from single frames at the same false-alarm rate (2.4×). 59% of the extra signal is in the fluctuation term. The full-trial analysis uses a 1 s window, which gives 3.4× (50% vs 15%) on the same release.

Tracing one clip through the filter stages

31 Jan, 21:22, 18 s. (1) Raw counts: the warm head dominates. (2) Change from background: a plume streams from the nose, buried in pixel noise. (3) Selective denoise: the noise is averaged away, the plume stays. (4) Activity, 0.5 s RMS in noise units: the plume stands out, but so do the moving head and the rails that reflect it.

07 · Masking non-gas artifacts

Warm head motion and specular metal both mimic gas

Side-by-side comparison of a raw thermal frame and its unmasked activity map, showing the moving head and reflective stall rails lighting up as brightly as the gas plume.
Left: raw counts. Right: activity with no masks. The cow moves: the head is far warmer than the backdrop, so every small movement is a large change at its edges. Metal reflects: rails and the chain mirror the warm cow and flicker as the head moves. The filter flags any fast change, so we remove pixels we know are not gas before measuring.

Cow mask: thermal thresholding

Pixels hotter than the clip's cow threshold (an Otsu split of its median frame). Cleaned up, holes filled, then grown by 8 px so the moving edge stays inside. The figures show the first version, which kept only the largest hot region; the pipeline now keeps every hot piece of at least 25 px, because a bar close to the camera can cut the cow in two.

Rail and chain mask: ridge geometry

A Hessian ridge filter (Jerman 2016, σ = 1–3 px) finds long, thin, bright lines. Kept if ≥ 40 px long, ≤ 15 px wide and warmer than their surroundings; grown 6 px for the chain's swing. Rails are found first, so a warm rail touching the cow is not swallowed into the cow mask.

Four-panel strip showing raw counts, the thermal cow mask with its 8 px dilation margin, the multiscale Hessian ridge response, and the final rail and chain mask.
Raw counts → thermal cow mask (+ 8 px margin) → Hessian ridge response → rail and chain mask.

Masking in action

(1) Masks on the raw frame: white outline is the cow plus its 8 px margin, blue is rails and chain. (2) The saturated head and the flickering rails sit almost entirely under the masks. (3) Masked activity: about half the image is removed, and what remains is mostly the plume below the nose.
Top: masks on the raw frame (white: cow + 8 px, blue: rails and chain). Middle: what the masks cover. Bottom: masked activity, mostly the plume below the nose.

Some activity still leaks at the moving head's edge, just outside the 8 px margin. The pipeline now keeps a pixel masked for 15 frames (0.5 s) after the cow leaves it, because the background filter still remembers the warm head there.

08 · Segmenting candidate plume regions

3D hysteresis connected-component labeling in (x, y, t)

  1. 1
    Grow across voxels with activity ≥ 2σout (exceeded by ~1 in 1,000 gas-free samples).
  2. 2
    Seed at cores of ≥ 5 px with activity ≥ 3σout (~1 in 1,000,000 gas-free samples).
  3. 3
    Connect contiguous voxels in (x, y, t) so each evolving puff forms a single 3D volume.
  4. 4
    Keep regions with a seed that touch the outlet: a 10 px circle where the plume leaves the nose, clicked once per clip in review.
  5. 5
    Measure each candidate region's onset, duration, peak activity, area, and maximum reach from the outlet.

Two thresholds do what one can't. A high seed threshold means a region is almost never pure noise; a lower growing threshold lets each region spread to the plume's faint edges. Requiring the region to touch the nostril outlet rejects leftover clutter elsewhere in the frame.

(1) Thresholds: grow ≥ 2σ, seed ≥ 3σ. (2) Plume regions touching the outlet (circle). In this 18 s, one region, the plume, lasts the whole stretch. Region results are preliminary while artifact rejection is refined.
Top: thresholds, grow ≥ 2σ and seed ≥ 3σ. Bottom: the plume region touching the outlet (circle). One region lasts the whole 18 s. Region results are preliminary while artifact rejection is refined.

09 · Next: cross-calibrating with the chamber

Fast optical plumes vs. the chamber's well-mixed response

The camera sees each burp as it happens. The chamber mixes all of them into its air, which is replaced over several minutes, so it sees a smoothed sum. Both should account for the same methane.

A burp of mass \(m\) raises a well-mixed chamber of volume \(V\) by \(m/V\) at once; the air flow \(Q\) then washes it out with time constant \(\tau = V/Q\). Flow times the area under the chamber's curve gives back the methane:

\[ \Delta C(t) = \frac{m}{V}\, e^{-t/\tau}, \qquad \int Q\, \Delta C\, dt = m \]

Here \(\Delta C\) is mass concentration above background—the analyzer's mole fraction in ppm multiplied by methane density (0.716 g/L at STP).

Our chamber. The AgResearch chamber holds \(V\) = 15.8 m³ with an air flow of about 1.9 m³/min, so \(\tau = V/Q \approx\) 8.4 min. Fitting the decay after each door closure gives 9.5 min for CO₂ and 9.8 min for CH₄. A burp that lasts seconds is spread over about ten minutes in the chamber's record.

Interactive model: one hour of eructations through a mixing chamber

Synthetic illustration in arbitrary units (not measured data). Adjust the residence time τ to see how chamber mixing smooths sharp eructation impulses while conserving total methane mass.

Methane emitted
–
=
Flushed in exhaust air
–
+
Remaining in chamber at 60 min
–

Multi-day chamber trial coverage

Multi-day timeline of 30-second chamber methane concentration overlaid with coverage bars for raw camera recording, stationary-camera cow-in-frame intervals, and verified good-pose clips.
Chamber CH₄ every 30 s across the trial (two cows), with camera coverage. 53 h recorded over the same days; the cow is in frame with the camera still for 10 h; 3.2 h of good pose so far, spread across both cows and day and night.
Overnight trace on 30 January from 00:26 to 02:36 comparing chamber methane concentration with usable video clips and candidate plume regions.
One night, clip by clip. 30 Jan, 00:26–02:36: 34 usable minutes of candidate plume regions against chamber CH₄ between 60 and 115 ppm. Preliminary: regions are not yet merged into eructation events, and rejecting head-motion and reflection artifacts is ongoing.

Next steps toward event-level quantification

  1. 1
    Synchronize clocks. Verify and lock the camera-to-analyzer time offset.
  2. 2
    Respect the chamber's lag. Its air takes about 9 minutes to turn over (measured 8.4–9.8 min), so compare totals over windows of at least one turnover, not single breaths.
  3. 3
    Rate vs production. Events per measured minute against the chamber's methane production (flow × CH₄ rise) in the same windows.
  4. 4
    Test temporal lead–lag. Check whether bursts of high-activity plume regions precede rises in the chamber analyzer trace.
  5. 5
    Behaviour, event by event. Because the camera sees single eructations as they happen, emissions can be lined up with what the cow is doing at that moment: eating, ruminating, lying down or standing, head position. Chamber and tracer methods average over minutes to days and cannot make that link. This is the next analysis, not yet a result.