Detección de objetos en el borde —microcontroladores y Raspberry Pi— para agricultura de precisión: donde el tamaño del modelo es la restricción que manda. Esta nota explica cómo el proceso de ablación sistemática redujo el DOD un ≈61% manteniendo la precisión, y por qué esa técnica importa para entender cualquier red neuronal componente a componente. Object detection at the edge — microcontrollers and Raspberry Pi — for precision farming: where model size is the binding constraint. This note explains how systematic ablation reduced the DOD by ≈61% while preserving precision, and why that technique matters for understanding any neural network component by component.
La visión por computador en agricultura de precisión no corre en servidores con GPU. Corre en microcontroladores y Raspberry Pi montados sobre robots y drones que operan entre hileras de cultivo. El modelo tiene que caber en la memoria del dispositivo, ejecutarse en tiempo real y funcionar sin conexión a internet. Esas tres restricciones juntas convierten el tamaño del modelo —no solo su precisión— en la variable de diseño más importante.
Computer vision in precision farming does not run on GPU servers. It runs on microcontrollers and Raspberry Pi units mounted on robots and drones operating between crop rows. The model has to fit in device memory, run in real time, and work without internet. Those three constraints together make model size — not just accuracy — the most important design variable.
Los robots de campo operan sin conectividad confiable. La inferencia local elimina latencia de red y dependencia de infraestructura cloud. El borde no es una opción: es la única arquitectura viable en campo abierto.
Field robots operate without reliable connectivity. Local inference eliminates network latency and cloud infrastructure dependency. The edge is not an option — it is the only viable architecture in open fields.
Memoria flash limitada, RAM escasa, sin GPU dedicada. Un modelo que funciona bien en un servidor puede ser literalmente imposible de cargar en un microcontrolador. El tamaño en disco y la huella de memoria son restricciones duras, no métricas secundarias.
Limited flash memory, scarce RAM, no dedicated GPU. A model that works well on a server may be literally impossible to load on a microcontroller. Disk size and memory footprint are hard constraints, not secondary metrics.
Ablación sistemática redujo el detector a menos de la mitad de su tamaño original manteniendo la precisión sobre el conjunto de datos de evaluación. Pequeño y capaz: los dos a la vez.
Systematic ablation reduced the detector to less than half its original size while preserving precision on the evaluation dataset. Small and capable: both at once.
El Depth Object Detector (DOD) es una CNN de aproximadamente un millón de parámetros, fuertemente inspirada en la arquitectura YOLOv8 (Ultralytics, AGPL-3.0). La característica que lo distingue es multi-tarea: no solo detecta objetos, sino que estima la profundidad por objeto, fusionando ambas salidas directamente en las cabezas de predicción. Las etiquetas de profundidad se sintetizan con MiDaS; el entrenamiento usa los conjuntos COCO 2017 y MinneApple.
The Depth Object Detector (DOD) is a CNN of approximately one million parameters, heavily inspired by the YOLOv8 architecture (Ultralytics, AGPL-3.0). Its distinguishing feature is multi-task: it not only detects objects but estimates per-object depth, fusing both outputs directly into the prediction heads. Depth labels are synthesized with MiDaS; training uses the COCO 2017 and MinneApple datasets.
| Atributo Attribute | Valor Value |
|---|---|
| Parámetros Parameters | ~1 M ~1 M |
| Inspiración del backbone Backbone inspiration | YOLOv8 (Ultralytics, AGPL-3.0) — fuertemente inspirado, no un fork YOLOv8 (Ultralytics, AGPL-3.0) — heavily inspired, not a fork |
| Cabezas Heads | Detección + profundidad por objeto (multi-tarea) Detection + per-object depth (multi-task) |
| Etiquetas de profundidad Depth labels | Sintetizadas con MiDaS Synthesized with MiDaS |
| Datasets Datasets | COCO 2017 + MinneApple |
| Postura de licencia License posture | Inspirado en AGPL-3.0; ver repositorio para detalles Inspired by AGPL-3.0; see repository for details |
El término ablación viene de la medicina y la neurociencia: en estudios de lesiones, los investigadores eliminan o dañan una región del cerebro y observan qué función se pierde. Aplicado a redes neuronales, el principio es el mismo: quitá —o simplificá— un componente a la vez y medí qué cambia.
The term ablation comes from medicine and neuroscience: in lesion studies, researchers remove or damage a brain region and observe which function is lost. Applied to neural networks, the principle is the same: remove — or simplify — one component at a time and measure what changes.
La clave es medir el delta en dos dimensiones simultáneamente: calidad (¿la precisión cae?) y costo (¿los parámetros o el tamaño bajan?). Si un bloque no mejora la calidad y solo encarece el modelo, no gana su lugar. Si lo eliminar no degrada la calidad pero sí reduce el tamaño, hay que eliminarlo. Esa lógica —aplicada sistemáticamente, componente a componente— es lo que convierte el diseño de arquitecturas de guesswork en evidencia.
The key is measuring the delta in two dimensions simultaneously: quality (does precision drop?) and cost (do parameters or size decrease?). If a block does not improve quality and only makes the model heavier, it does not earn its place. If removing it does not degrade quality but does reduce size, it must go. That logic — applied systematically, component by component — is what turns architecture design from guesswork into evidence.
Fig. 1 — El ciclo de ablación: cada vuelta aísla un componente, mide su delta en calidad y costo, y decide si se queda o se descarta. Fig. 1 — The ablation loop: each pass isolates one component, measures its quality and cost delta, and decides keep or discard.
Este proceso se puede aplicar a cualquier arquitectura de red neuronal: ¿necesita esta capa de atención? ¿Qué pasa si simplifico el cuello de botella? ¿Vale la pena este bloque residual extra? La ablación da respuestas con datos, no con intuición.
This process can be applied to any neural network architecture: does this attention layer earn its place? What happens if I simplify the bottleneck? Is this extra residual block worth it? Ablation gives answers with data, not intuition.
Aplicando el ciclo de ablación al DOD —identificando qué bloques ganaban su lugar en calidad sin justificarlo en costo— el modelo pasó de 4,18 MB a 1,6 MB: una reducción de aproximadamente el 61,46%. Y la precisión sobre MinneApple se mantuvo.
Applying the ablation loop to the DOD — identifying which blocks earned their place in quality without justifying it in cost — the model went from 4.18 MB to 1.6 MB: a reduction of approximately 61.46%. Precision on MinneApple was preserved.
| Métrica de tamaño Size metric | Valor Value |
|---|---|
| Antes Before | 4.18 MB |
| Después After | 1.6 MB |
| Reducción Reduction | ≈61.46% |
| Precisión (MinneApple) Precision (MinneApple) | preservada (cualitativo) preserved (qualitative) |
La lógica del recorte fue consistente con el ciclo: los bloques que aportaban calidad se conservaron; los que solo sumaban parámetros sin justificación en las métricas de evaluación se eliminaron o simplificaron. El resultado es un modelo que gana su tamaño — cada parámetro tiene un propósito medible.
The logic of the cut was consistent with the cycle: blocks that contributed quality were kept; those that only added parameters without justification in evaluation metrics were removed or simplified. The result is a model that earns its size — every parameter has a measurable purpose.
Reducir el modelo mediante ablación es el primer paso. El siguiente es llevarlo al hardware real: microcontroladores y Raspberry Pi montados sobre robots y drones de agricultura de precisión. Para eso, la cuantización comprime aún más el modelo —convirtiendo pesos de punto flotante a representaciones de menor precisión— sin requerir reentrenamiento completo. La entrega del modelo al dispositivo se gestiona mediante un pipeline de CI/CD e Infraestructura como Código (IaC), lo que hace el proceso reproducible y automatizado.
Reducing the model through ablation is the first step. The next is getting it onto real hardware: microcontrollers and Raspberry Pi units mounted on precision-agriculture robots and drones. For that, quantization compresses the model further — converting floating-point weights to lower-precision representations — without requiring full retraining. Model delivery to the device is managed through a CI/CD pipeline and Infrastructure as Code (IaC), making the process reproducible and automated.
| Aspecto Aspect | Detalle Detail |
|---|---|
| Dispositivos objetivo Target devices | Microcontroladores / Raspberry Pi Microcontrollers / Raspberry Pi |
| Cuantización Quantization | Reduce el tamaño del modelo post-entrenamiento para inferencia en dispositivos Further reduces post-training model size for device inference |
| CI/CD + IaC | Entrega automatizada y reproducible del modelo al hardware Automated, reproducible model delivery to hardware |
| Repositorio Repository | Jaramilloh/DOD-ci-cd ↗ |
En edge AI, el modelo correcto no es el más preciso: es el más pequeño que mantiene la precisión necesaria. La ablación es la herramienta que te permite llegar ahí con evidencia en lugar de intuición. Cada bloque que se descarta sin perder calidad es un argumento a favor de la arquitectura que queda. Eso es lo que hace que la ablación importe: no solo para el DOD, sino para entender cualquier red neuronal componente a componente.
In edge AI, the right model is not the most accurate: it is the smallest one that maintains the required precision. Ablation is the tool that gets you there with evidence instead of intuition. Every block discarded without losing quality is an argument for the architecture that remains. That is what makes ablation matter: not just for the DOD, but for understanding any neural network component by component.
El trabajo fue presentado en PAAMS 2024 y publicado en CCIS vol. 2149, Springer. El repositorio canónico del DOD y el pipeline de CI/CD están en GitHub.
The work was presented at PAAMS 2024 and published in CCIS vol. 2149, Springer. The canonical DOD repository and the CI/CD pipeline are on GitHub.
Jaramilloh/Depth-Object-Detector-DOD ↗ Jaramilloh/DOD-ci-cd ↗
| 01 | Efficient Depth Object Detection: Ablation-Driven Optimization for Lightweight YOLOv8 Architecture ↗ Efficient Depth Object Detection: Ablation-Driven Optimization for Lightweight YOLOv8 Architecture ↗ | Jaramillo-Hernández, Julián, Marco-Detchart, Rincón — PAAMS 2024, CCIS 2149, Springer Jaramillo-Hernández, Julián, Marco-Detchart, Rincón — PAAMS 2024, CCIS 2149, Springer |
| 02 | Application of Machine Vision Techniques in Low-Cost Devices to Improve Efficiency in Precision Farming ↗ Application of Machine Vision Techniques in Low-Cost Devices to Improve Efficiency in Precision Farming ↗ | Sensors 2024, DOI: 10.3390/s24030937 |