Teaching a neural net what a dog eating looks like

How we calibrated synthetic IMU signals with allometric scaling and head-bob physics to detect pet feeding.

We wanted to detect eating and drinking from a neck-mounted IMU, but we had no real eating data from our own collar. On real Mendeley dog recordings, eating recall was 33.8%: the model missed "quiet eating", where low head movement looks like sleep. This is what we tried, and what we changed in April.

What we tried

We tried adding the ActBeCalf dataset from Zenodo: 30 calves, using only its eating and drinking labels.

We also tried adding separate rest and run classes to the four we had: sleep, walk, play and eat.

And our step counts came from a pedometer trained on human gait.

What actually happened

The calf data made the dog model worse: dog macro F1 dropped from 0.916 to 0.854. Calf signals are too different from dog signals; cross-species transfer does not work for this task.

Adding rest and run collapsed F1. At the collar sensor, low-motion rest is indistinguishable from sleep, and running overlaps walking along the gallop/trot/walk continuum. We kept the 4-class model (sleep, walk, play, eat) as a deliberate floor for usable F1.

Step counting does not work on dogs. A quadruped gait plus head bob confuses a detector built for human gait. The step_count column in our database is effectively dead.

The fix

In late March we had already split FilterNet into filternet_cat.onnx and filternet_dog.onnx; the ML server routes by the pet_type parameter. The cat model, trained on the Dunford dataset (9 cats, 40 Hz) plus synthetic cats, reached an F1 of 0.989. The pipeline:

cd ml/pet-activity
source .venv/bin/activate
python -m src.data.preprocess --all
python -m src.data.windowing
python train_split.py

On 13 April we moved all dataset loaders to the 4-class schema and replaced the flat dog chew frequency in the synthetic generator with allometric scaling by body mass, chew_freq = 6.55 * mass_kg^(-0.43) (Gerstner et al. 2010). That gives 1.1-1.7 Hz for large dogs and 2.3-3.4 Hz for small dogs. We calibrated the synthetic eating signal against real IMU measurements, raising chewing amplitude to 0.15-0.35 g and gyro amplitude to 20-60 dps.

We also rewrote the synthetic eating generator with a head bob at 0.5-1.5 Hz, and applied a random full SO(3) rotation per window to cover real collar orientations; Y-axis acceleration ranges from +0.24 to -0.70 across dogs. The retrained unified FilterNet reached a test macro F1 of 0.964 and an eating F1 of 0.991.

The same day we raised the firmware's motion/calm threshold from 30 mg to 60 mg. Device baseline noise, measured from our database records, is about 43 mg, so at 30 mg the collar always detected motion: it never entered calm mode or deep sleep, drained the battery, and produced non-sleep classifications while stationary. 60 mg leaves a 17 mg margin above the noise.

What's still open

Eating recall on real Mendeley dogs rose only from 33.8% to 37.4%. That is the domain gap: the model still misses quiet eating, which looks like sleep to the IMU.

The way forward is more real labelled data: the SensiML dog dataset (40+ breeds, with eating, drinking and chewing), which we have yet to request, and labelled recordings from our own collar.

If you're building something similar

  • Do not expect cross-species transfer learning to work for IMU data. Train on the specific animal you are tracking.
  • Human pedometer algorithms do not work on dogs. If you need stride counting, build a dog-specific model.
  • When generating synthetic IMU data, apply full 3D rotations to account for the unpredictable orientation of a wearable device.
  • Measure your hardware's baseline noise floor before setting motion thresholds. A threshold below the noise floor will keep the device awake permanently.

Have a thought?

We build in public to learn. If you've solved this on nRF52 before, let us know.

Reply by email

Denys Zarubin

Founder, Spain

Investors

Request the deck

Join the
early list.

Prototype phase. Not certified. Not for sale. No payment required.

You’re on the list. We’ll email you when the collar is ready. In the meantime, download the free Fudini app.