BODOQUE
A two-tier camera node for streams that are dry most of the year. A small TinyML camera watches the streambed and powers up a Raspberry Pi and an HD camera only when water appears. I designed the system, built the prototype and its field test unit, and evaluated it on a year of real stream data: about 97% less energy than the always-on station it was meant to replace.

A camera that watched dry riverbeds
The Mar Menor lagoon takes in nutrients and sediment through ephemeral streams that only run after heavy rain. Our project already had camera stations on them, recording around the clock and sending video over 4G only when a weather service reported rain nearby.
In 2023 the Rambla del Albujón ran in four events, 21.15 hours in total. The station spent the rest of the year filming an empty bed, and it missed flows when local rain was not caught by the weather stations. The question behind BODOQUE: can a camera node spend energy only when there is water to measure?
Two tiers: a cheap camera decides, a big one measures
BODOQUE (Bimodal Observational Device for Optimizing QUantification of ephemeral streams) splits the node in two. An Arduino Nicla Vision runs a tiny water-or-no-water classifier, checking the streambed once a minute in our evaluation. It draws 6.7 mW asleep and 388.5 mW while capturing frames.
When it sees water, it tells a LILYGO T3S3 (an ESP32-S3 board) to close a relay that powers a Raspberry Pi 4 and a Vivotek HD camera. The camera records short clips, and the Pi fetches them and runs the discharge measurement: Photrack's image velocimetry code, which my colleague Javier Prades ported to ARM so it runs on the Pi. The Pi hands back a small JSON file (time, discharge, water level) over serial. The T3S3 stores it on a microSD card and sends it to a gateway over AlLoRa, my LoRa protocol.
When the water is gone, the Pi shuts itself down before the relay opens, and the high-power side drops out of the energy budget. The camera that runs all the time is the cheap one.

Choosing the computer by measuring it
I first evaluated Javier's ARM port in the first BODOQUE paper, and expanded the comparison for the journal version. We ran the discharge code ten times per video on five boards: Jetson AGX Xavier, Jetson AGX Orin, Jetson Orin Nano, Raspberry Pi 4 (4 GB) and Coral Dev Board Mini, using four-second videos from four sites and logging time and power to get the energy per measurement.
The AGX boards were the fastest and the hungriest. The Coral drew the least power but took so long that its energy came close to the AGX Orin, and the Orin Nano was slightly more efficient than the Pi. Results did not need to be real time, so the Pi 4 won on price (about $110 against $500), on community support, and because the existing stations already had one.

Picking a model that fits a microcontroller
I trained seven small CNN designs in eight variants each (color or grayscale, 96 or 160 px, sigmoid or softmax), quantized them to int8 and profiled them for the Nicla Vision.
To rank them I designed MeTINCA, a score that weighs F1 (50%) against loss, file size, RAM, ROM and inference time (10% each), and penalizes models whose training and validation scores drift apart. The winner, G_rgb_96_softmax, scored F1 0.921 in 28.09 KB, with 89 ms per inference and 6.5 frames per second on the device.
Earning trust with a smaller field test
The project's priority was data for the Mar Menor digital twin, so the team was not ready to let a TinyML model switch off the main camera. I took the low-power half, the Nicla Vision and the LoRa board, added a 3,500 mAh battery and a microSD card, and designed a 3D-printed case: the BODOQUE Dataset Collector.
It photographs the stream every few minutes, labels each picture and stores it, so we could check the model against reality and collect new training images. We installed it next to one of the existing stations. Its battery life is estimated at nearly a month.
The Collector was the first of our small battery camera nodes. Its successors, boat-counting cameras that report over AlLoRa, are now being tested at the Albufera de València, in a part of the project led today by my colleague Javier Prades.
What a year of real data says
The full system stayed a prototype, so I evaluated it on data instead. I fed the 2023 Albujón record from the old always-on station through a power model of BODOQUE's four operating states.
BODOQUE came out at 3.80 kWh for the year against 127.28 kWh for the always-on station, a 97.01% cut, sending 411 result files (35.32 KB) over AlLoRa. In simulation, varying detection precision and recall, video length, sampling interval and radio throughput kept the savings between 80.58% and 97.01%. Precision drives the energy, recall drives how much data you catch, and even the worst recall tested caught over 99% of the data.

Adapting to new streams
A new site can confuse a small model, and retraining on only the new images makes it forget the old ones. We compared four ways to retrain on an RTX 4090. QSIMOV's partial retraining kept F1 0.88 on the old sites and 0.96 on the new one, against 0.53 and 0.60 on the old sites for fine-tuning and plain retraining, while using 64% less time and 73% less energy than full retraining, which scored best (0.97 and 0.99).
I refined these retraining strategies during my 2024 research stay at ICTP in Trieste, and the comparison was published at CARLA 2024 with Marco Zennaro.
Who built it with me
BODOQUE is the second of the two main contributions of my PhD thesis at UPV, supervised by José María Cecilia and Pietro Manzoni, and part of the EU H2020 SMARTLAGOON project. Javier Prades ported Photrack's discharge code to ARM, Salvador Peña-Haro of Photrack AG worked with us on the discharge measurement, and Erika Rosas helped with the methodology and with writing the articles.
The work is published at ACM MobiHoc 2023, at CARLA 2024, and in Engineering Applications of Artificial Intelligence (2025); see publications. The code is open source on GitHub.