Overview
This repository contains the replication package, neural network training workflows, post-training quantization (PTQ INT8) pipelines, and statistical modeling scripts accompanying the research paper:
"Non-Intrusive Monitoring System with Embedded Computer Vision and Spatio-Temporal Poisson Regression for Sea Turtle Nest Conservation"
Sensors (MDPI), 2026.
Research Project: INCYT-PNF-2026-S73-217 (UPSE / TECED Research Group).
The proposed system integrates Edge AI (TinyML on ESP32-S3), sub-GHz wireless telemetry (LoRa 868 MHz), offline-first mobile synchronization, and spatio-temporal Poisson regression to provide real-time early warnings against nocturnal clutch predation by feral dogs (Canis lupus familiaris) on endangered sea turtle nesting beaches (Chelonia mydas and Lepidochelys olivacea) in REMACOPSE, Ecuador.
Contents of this Package
notebook_entrenamiento.ipynb (Jupyter Notebook):
- Data Preprocessing & Augmentation: Photometric contrast/brightness perturbations (±20%), random horizontal flips, and negative zoom scaling simulating receding predators on beach sand.
- Transfer Learning & Fine-Tuning: Custom MobileNetV3-Small binary classification head architecture (939,697 parameters).
- Post-Training Quantization (PTQ INT8) Pipeline: TensorFlow Lite Converter routine generating full integer quantization with input affine parameters (Sin = 1.0, Zin = -128) and output scaling (Sout = 0.00390625, Zout = -128).
- Empirical Threshold Sweep (τ ∈ [0.30, 0.90]): Calibration script for optimal discrimination threshold at τ = 0.80.
- Statistical Validation Suite: Confusion matrix generation, asymptotic Wilson score 95% confidence intervals, 100,000 non-parametric bootstrap resamples, exact binomial tests against No-Information Rate (p = 2.09 × 10-25) and balanced chance (p = 1.31 × 10-30), Cohen's Kappa (κ = 0.6967), and Matthews Correlation Coefficient (MCC = 0.6972).
poisson_regression_service.py (Analytical Microservice):
- Zero-Filling Grid Expansion: Imputation of 3D matrix (Cameras × Days × Hours) over 672 space-time units (168 h/week exposure per station).
- Harmonic Feature Engineering: Continuous circular transformations (sin / cos) for intradiurnal (24 h) and weekly (7 d) cycles with spatial fixed effects.
- Model Diagnostics: Pearson dispersion test (φ = 1.048), Cameron–Trivedi overdispersion test (p = 0.232), Likelihood Ratio Test vs. Negative Binomial (NB2), and Huber–White robust standard errors (HC1).
Key Benchmarks & Reported Results
- Model Compression: 72.0% reduction from 4.13 MB FLOAT32 to 1.18 MB INT8 footprint.
- Target Hardware Footprint: < 450 KB SRAM tensor arena; ≈ 215 ms inference latency on Seeed Studio XIAO ESP32-S3 (Xtensa LX7 @ 240 MHz).
- Classification Accuracy: 84.96% (F1 = 83.41%) at τ = 0.80 on independent test partition (N = 246).
- Poisson Model Fit: AIC = 412.35, Pseudo-R2 = 0.3840, execution runtime < 4.2 s.
Requirements & Environment
Python ≥ 3.9 with standard deep learning and statistical libraries:
pip install tensorflow numpy scipy statsmodels scikit-learn matplotlib seaborn
Data Privacy & Sensitive Locations Notice
In compliance with institutional conservation agreements and environmental protection protocols for endangered species (Chelonia mydas, Lepidochelys olivacea), raw high-resolution field photographs containing exact GPS coordinates of active nests in REMACOPSE are restricted. The provided notebook includes the synthetic tensor schemas, validation subsets, and full pipeline required to reproduce all model training, quantization, and statistical modeling steps.