Edge AI · Ingeniería Mecatrónica · UAOEdge AI · Mechatronics Engineering · UAO

Jazmín.IA

Un sistema embebido de visión por computador que te acompaña mientras estudias o trabajas. An embedded computer vision system that keeps you company while you study or work.

Observa tu rostro con una cámara, detecta en tiempo real señales de tensión y cansancio y te avisa con calma cuando conviene una pausa. Todo ocurre dentro de una Arduino UNO Q: sin nube, sin internet y sin guardar una sola imagen. It watches your face through a camera, detects signs of tension and tiredness in real time and gently tells you when a break would help. Everything runs inside an Arduino UNO Q: no cloud, no internet and not a single image stored.

🧠 13 Action Units 📐 Geometría facialFacial geometry 🔒 100 % local100% on-device 🎓 WiML @ NeurIPS 2026 · Sydney
468puntos del rostro por fotogramaface landmarks per frame
13 AUsdetectadas por un modelo propiodetected by our own model
2,91 MBmodelo int8 (−90 % de tamaño)int8 model (−90% size)
0imágenes guardadas: solo númerosimages stored: numbers only
≈ 92 %acierto en vivo en la validación iniciallive accuracy in initial validation
El problemaThe problem

Tu rendimiento dice cuánto rendiste, no cómo estabasPerformance tells you how much you did, not how you felt

Programar, estudiar o responder una evaluación exige atención sostenida. El tiempo de respuesta o la tasa de error miden el resultado, pero llegan tarde: no avisan cuando el cansancio o la tensión ya están afectando a la persona.Coding, studying or taking a test demands sustained attention. Response time or error rate measure the outcome, but they arrive too late: they don't warn you when tiredness or tension is already affecting you.

El rostro hablaThe face speaks

El ceño fruncido, el parpadeo frecuente o los bostezos son señales visibles de carga y fatiga, y se pueden medir sin tocar a la persona.A frown, frequent blinking or yawning are visible signs of load and fatigue, and they can be measured without touching the person.

Sin nubeNo cloud

La mayoría de sistemas de análisis facial corre en servidores: más costo, más latencia y tu cara viajando por internet.Most facial analysis systems run on servers: more cost, more latency and your face travelling across the internet.

Apoyo, no diagnósticoSupport, not diagnosis

Jazmín.IA no adivina emociones: describe movimientos del rostro (FACS) y te sugiere respirar o descansar. No es una herramienta clínica.Jazmín.IA doesn't guess emotions: it describes facial movements (FACS) and suggests breathing or resting. It is not a clinical tool.

Cómo funcionaHow it works

De la cámara a la matriz de LED, en la misma placaFrom camera to LED matrix, on the same board

Cada fotograma recorre seis pasos. Las imágenes se descartan apenas se procesan: solo quedan medidas numéricas.Every frame goes through six steps. Images are discarded as soon as they are processed: only numeric measurements remain.

1

Cámara USBUSB camera

Captura el rostro a ≈ 5,8 fotogramas por segundo.Captures the face at ≈ 5.8 frames per second.

2

MediaPipe Face Mesh

Ubica 468 puntos del rostro en 3D.Locates 468 3D face landmarks.

3

Geometría + modeloGeometry + model

EAR, MAR, cejas y boca; y una red que estima 13 AUs cada 0,5 s.EAR, MAR, brows and mouth; plus a network estimating 13 AUs every 0.5 s.

4

Calibración personalPersonal calibration

10 s de cara neutral: cada persona se compara consigo misma.10 s of neutral face: each person is compared with themselves.

5

Motor de señalesSignal engine

Decide tensión, cansancio o bienestar con ventanas de tiempo e histéresis.Decides tension, tiredness or well-being with time windows and hysteresis.

6

RetroalimentaciónFeedback

Matriz LED, pantalla táctil con Jazmín e informe al terminar.LED matrix, touchscreen with Jazmín and an end-of-session report.

Arquitectura del sistema
Todo el análisis ocurre dentro de la placa: el MPU Qualcomm analiza y el MCU STM32 dibuja en la matriz.All analysis happens inside the board: the Qualcomm MPU analyzes and the STM32 MCU draws on the matrix.
Conexión interna
Tres programas que se hablan dentro de la placa (ver la sección de arquitectura).Three programs talking inside the board (see the architecture section).
Demo interactivaInteractive demo

Cambia la expresión y mira cómo reacciona JazmínChange the expression and watch Jazmín react

Elige un gesto. A la izquierda ves lo que mide el sistema; a la derecha, la pantalla real del modo producto y lo que muestra la matriz de LED de la placa.Pick a gesture. On the left you see what the system measures; on the right, the real product-mode screen and what the board's LED matrix shows.

Lo que ve el sistemaWhat the system sees

?
Cejas vs. tu neutralBrows vs. your neutral0 %
Ancho de boca vs. tu neutralMouth width vs. your neutral0 %
Parpadeos por minutoBlinks per minute16

La raya negra marca el umbral de cada medida. Valores ilustrativos.The black tick marks each measure's threshold. Illustrative values.

Pantalla del modo producto
Matriz LED 8 × 13 · Arduino UNO Q8 × 13 LED matrix · Arduino UNO Q

Modo productoProduct mode

Una sesión con Jazmín, pantalla por pantallaA session with Jazmín, screen by screen

Al encender la placa arranca sola en pantalla completa. No hay imagen de la cámara ni números: Jazmín da las indicaciones y el color de fondo cambia con el estado. Desliza para ver el recorrido.When the board powers on it starts by itself in full screen. There is no camera image and no numbers: Jazmín gives the instructions and the background color changes with the state. Swipe to follow the flow (the interface itself is in Spanish).

CalibrandoCalibrating Todo bienAll good TensiónTension CansancioTiredness No te veoCan't see you
Geometría y calibración personalGeometry and personal calibration

Las AUs alertan solo si la geometría las confirmaAUs only trigger an alert if geometry confirms them

Todas las medidas se dividen entre la distancia entre los ojos (no cambian si te acercas o te alejas) y se comparan con tus propios 10 segundos de cara neutral. Un umbral igual para todos no funcionó: con una persona, el 32 % de los fotogramas quedaba por debajo del umbral clásico de parpadeo con los ojos abiertos.Every measure is divided by the distance between the eyes (it doesn't change if you move closer or farther) and compared with your own 10 seconds of neutral face. A single threshold for everyone did not work: for one person, 32% of frames fell below the classic blink threshold with eyes open.

👁

ParpadeoBlink

EAR bajo tu umbral personal entre 0,03 y 0,6 s, medido con el reloj.EAR below your personal threshold for 0.03–0.6 s, timed by the clock.

🥱

BostezoYawn

MAR ≥ 1,8 × tu neutral durante ≥ 2 s, sin sonrisa ni ceño.MAR ≥ 1.8 × your neutral for ≥ 2 s, with no smile or frown.

😠

CeñoFrown

Cejas ≥ 7 % más bajas o juntas que la referencia adaptativa.Brows ≥ 7% lower or closer than the adaptive reference.

😊

SonrisaSmile

Boca ≥ 8 % más ancha que en la calibración.Mouth ≥ 8% wider than during calibration.

La regla de tensiónThe tension rule

  • Tensión corroborada: índice de AUs ≥ 1,20 en 20 s y ceño geométrico en ≥ 15 % de los últimos 6 s, oCorroborated tension: AU index ≥ 1.20 over 20 s and geometric frown in ≥ 15% of the last 6 s, or
  • Ceño sostenido en ≥ 40 % de los últimos 6 s.Sustained frown in ≥ 40% of the last 6 s.
  • La sonrisa anula la alerta (≥ 40 % de 6 s), salvo que el ceño llegue al 50 %.A smile cancels the alert (≥ 40% of 6 s), unless the frown reaches 50%.
  • Cansancio: parpadeo ≥ 24/min junto con bostezos agrupados en el último minuto.Tiredness: blinking ≥ 24/min together with clustered yawns in the last minute.
  • Histéresis: se apaga con umbrales más bajos; en una sesión de 388 s bajó los cambios de estado de 20 a 8.Hysteresis: it switches off at lower thresholds; in a 388 s session state changes dropped from 20 to 8.
I = Σ wk · max(0, fk − fkcal) + w12 · f12   (w12 = −1,5)

Solo cuenta lo que activas por encima de tu propio neutral. AU07 pesa más porque es la AU más asociada al estrés percibido (Blasberg et al., 2023).Only what you activate above your own neutral counts. AU07 weighs most because it is the AU most associated with perceived stress (Blasberg et al., 2023).

AUs y geometría
En una sesión etiquetada, las AUs del modelo se activaban casi igual en neutral, sonrisa y enojo; el ceño geométrico sí separaba el enojo.In a labeled session the model's AUs fired almost equally in neutral, smile and anger; the geometric frown did separate anger.
Modelo de aprendizaje profundoDeep learning model

Una imagen del rostro entra, 13 probabilidades de AU salenOne face image in, 13 AU probabilities out

Una versión ligera de ADMME (Wang et al., 2023): en lugar de tres ramas con flujo óptico, una sola MobileNetV2 que trabaja sobre un fotograma y cabe en la placa.A lightweight take on ADMME (Wang et al., 2023): instead of three branches with optical flow, a single MobileNetV2 working on one frame that fits on the board.

RostroFace256 × 256 × 3
→
MobileNetV2ImageNet
→
GAP1280
→
Dense + ReLU256
→
Dropout0,3
→
Sigmoid13 AUs
Arquitectura neuronal
40 584 imágenes de CASME II y SAMM anotadas con Py-Feat · entrenamiento en dos fases.40,584 CASME II and SAMM images annotated with Py-Feat · two-phase training.

Resultado en el conjunto de pruebaTest-set results

0,872AUC-ROC macro
0,706F1 macro (umbral por AU)macro F1 (per-AU threshold)
2,91 MBint8 (antes 30,06 MB)int8 (was 30.06 MB)
0,5 suna inferencia en la placaone inference on the board

Lo que aprendimos: desfase de dominioWhat we learned: domain shift

Con la cámara real, AU04, AU07, AU17 y AU24 se activaban casi siempre y la AU12 (sonrisa) casi nunca: en 47 s sonriendo, 0 %. Los datos de laboratorio (microexpresiones, sin habla, cámaras de alta velocidad) están lejos de una persona que trabaja frente a una webcam. Por eso la decisión final se apoya en la geometría y el modelo actúa como apoyo.With the real camera, AU04, AU07, AU17 and AU24 fired almost always and AU12 (smile) almost never: 0% during 47 s of smiling. Lab data (micro-expressions, no speech, high-speed cameras) is far from a person working in front of a webcam. That's why the final decision relies on geometry, with the model as support.

SoftwareSoftware

Tres programas que se hablan dentro de la placaThree programs talking inside the board

MPU · Python 3.11

main-jazminia.py

Cámara, MediaPipe, TensorFlow Lite, motor de señales, grabación CSV e interfaz web con FastAPI.Camera, MediaPipe, TensorFlow Lite, signal engine, CSV logging and the FastAPI web interface.

MPU · Python ≥ 3.13

led_bridge_helper

Servidor HTTP mínimo en 127.0.0.1:8765 que traduce cada patrón a una llamada RPC con arduino_app_bricks.Tiny HTTP server on 127.0.0.1:8765 that turns each pattern into an RPC call with arduino_app_bricks.

MCU · STM32U585

matrix_bridge.ino

Bridge.begin() y cuatro funciones: alerta «!», corazón, carita feliz y apagar.Bridge.begin() and four functions: "!" alert, heart, smiley and off.

¿Por qué dos procesos de Python?Why two Python processes?

MediaPipe funciona hasta Python 3.12 y la librería oficial del Bridge de Arduino exige 3.13: no pueden convivir. Se hablan por HTTP local, sin salir a ninguna red, y si la matriz falla el análisis sigue y la conexión se reintenta cada 3 s.MediaPipe works up to Python 3.12 and Arduino's official Bridge library requires 3.13: they can't share one interpreter. They talk over local HTTP without touching any network, and if the matrix fails the analysis keeps running and reconnects every 3 s.

Hardware

Una placa, un cable, cero computadores externosOne board, one cable, zero external computers

Conexión del hardware
Un concentrador USB-C reparte video, datos y energía hacia la placa con un solo cable.A USB-C hub carries video, data and power to the board through a single cable.
  • Arduino UNO Q (4 GB) — MPU Qualcomm QRB2210 con Debian Linux (cuatro núcleos a 2,0 GHz) + MCU STM32U585 con la matriz LED 8 × 13.Qualcomm QRB2210 MPU running Debian Linux (quad-core 2.0 GHz) + STM32U585 MCU driving the 8 × 13 LED matrix.
  • Cámara USB de pinzaClip-on USB camera — sobre el monitor, centrada con la mirada.on top of the monitor, aligned with your gaze.
  • Pantalla táctil de 7"7" touchscreen — IPS 1024 × 600, HDMI.
  • Concentrador USB-CUSB-C hub — HDMI, USB-A y entrada de carga PDand PD power input.
  • Cargador USB-C PDUSB-C PD charger — de pared, siempre conectado.wall charger, always connected.
En diseñoIn design

El dispositivo «Flor» 🌼The "Flor" device 🌼

Una maceta de escritorio de ≈ 200 × 125 × 70 mm que guarda la placa y el hub, deja ver la matriz LED por una ventana y sostiene la pantalla inclinada 15°, rodeada de pétalos. Diseñada en OpenSCAD para imprimirse en PETG.A ≈ 200 × 125 × 70 mm desk pot that holds the board and hub, shows the LED matrix through a window and holds the screen tilted 15°, surrounded by petals. Designed in OpenSCAD to be printed in PETG.

ResultadosResults

¿La alerta corresponde a lo que hace tu rostro?Does the alert match what your face is doing?

Los participantes hicieron expresiones guiadas mientras un supervisor las marcaba. Se compara, fotograma a fotograma, la etiqueta con la alerta que vio la persona en ese instante. Ninguna de estas sesiones se usó para ajustar umbrales.Participants made guided expressions while a supervisor labeled them. The label is compared, frame by frame, with the alert the person saw at that moment. None of these sessions were used to tune thresholds.

Acierto por expresión (%)Accuracy by expression (%)

Ver como tablaView as table

Del 18 % al 92 %From 18% to 92%

18 %→92 %

El 30 de septiembre el sistema alertaba el 99–100 % del tiempo y acertaba solo el 18 % en neutral. Tras el ajuste iterativo (prueba real → diagnóstico → replay → verificación), la validación con sesiones nuevas llegó a 92,5 % y 91,8 %.On 30 September the system alerted 99–100% of the time and was right only 18% of the time in neutral. After iterative tuning (real test → diagnosis → replay → check), validation on new sessions reached 92.5% and 91.8%.

Uso natural: 30 min dando claseNatural use: 30 min teaching

Alerta encendida solo el 0,5 % del tiempo, 0 bostezos falsos y 18,4 parpadeos por minuto, dentro del rango normal en reposo.Alert on only 0.5% of the time, 0 false yawns and 18.4 blinks per minute, within the normal resting range.

Lo que aún fallaWhat still fails

  • Enojos suaves: si las cejas bajan menos del 7 %, se detectan mal (70 % fuertes vs. 53 % suaves en el piloto).Mild frowns: if the brows drop less than 7% they are poorly detected (70% strong vs. 53% mild in the pilot).
  • Sonrisas que entrecierran los ojos pueden leerse como ceño.Smiles that squint the eyes can be read as a frown.
  • Pausas neutrales: el piloto las omitió por error (72 %); al repetirlo con pausas se llegó a 90 %.Neutral pauses: the pilot skipped them by mistake (72%); repeating it with pauses reached 90%.

Tono de piel y luzSkin tone and lighting

En el piloto, el acierto medio fue 86 % en tez blanca (3), 70 % en trigueña (7) y 38 % en el único participante de tez muy morena, que además estaba bajo luz cenital. Es solo descriptivo y no permite concluir una causa, pero es una alerta seria: por eso el sistema ahora mide la luz en cada fotograma y las próximas pruebas usarán la escala de Monk.In the pilot, mean accuracy was 86% for light skin (3), 70% for medium skin (7) and 38% for the only very dark-skinned participant, who was also under overhead light. It is only descriptive and cannot establish a cause, but it is a serious warning: the system now measures lighting on every frame and the next tests will use the Monk scale.

Privacidad y éticaPrivacy and ethics

Tu cara no sale de la placaYour face never leaves the board

🔒 LocalLocal

Funciona sin internet; ningún dato viaja a la nube.Works offline; no data travels to the cloud.

🔢 Solo númerosNumbers only

Se guardan 23 medidas por fotograma, nunca imágenes ni video.23 measurements per frame are stored, never images or video.

🏷 AnónimoAnonymous

Cada participante se identifica con un código; el nombre solo se muestra en pantalla.Each participant is a code; the name is only shown on screen.

💚 BienestarWell-being

Es un apoyo, no un diagnóstico ni una herramienta de vigilancia.It's a support tool, not a diagnosis or a surveillance tool.

Estado del proyectoProject status

Lo que sigueWhat's next

ListoDone
  • Sistema completo en la placaFull system on the board
  • Modo producto y arranque automáticoProduct mode and auto-start
  • Validación inicial, piloto (11) y post-pilotoInitial validation, pilot (11) and post-pilot
  • Medición de la luzLighting measurement
En cursoIn progress
  • Sesiones con tareas: aritmética y prueba de reacción (PVT-B)Task sessions: arithmetic and reaction test (PVT-B)
  • Relación entre indicadores faciales y rendimientoRelation between facial indicators and performance
  • Estudio de caso de una semana de uso realOne-week real-use case study
FuturoFuture
  • Calibración con sonrisa y ceño guiadosCalibration with guided smile and frown
  • Más participantes y escala de MonkMore participants and the Monk scale
  • Comité de ética y consentimiento en la appEthics committee and in-app consent
  • Impresión del dispositivo «Flor»Printing the "Flor" device