Edge AI at the Speed of Light: Integrating Google Coral (Edge TPU) with ASI Biont for On-Device ML Automation

Introduction

In the world of industrial automation, latency is the enemy. Sending every camera frame to the cloud for inference adds seconds — and in quality control on a moving conveyor, that’s too late. Google Coral, powered by the Edge TPU (Tensor Processing Unit), enables neural network inference directly on the device at 4 TOPS (tera-operations per second) while consuming only 2-3 watts. But an Edge TPU alone is just a co-processor; it needs a brain that orchestrates data flow, makes decisions, and triggers actions.

ASI Biont bridges that gap. As an AI agent that connects to any device via code generated on the fly, ASI Biont can read inference results from a Coral device, analyze them, and automate responses — all without human intervention. Instead of writing a full MLOps pipeline, you simply describe your setup in natural language: "Connect to the Coral over SSH, run object detection on the camera feed, and if a defect is found, send an alert to Telegram." The AI writes the Python code, executes it, and the integration is live.

This article is a practical guide to integrating Google Coral (Edge TPU) with ASI Biont. We’ll cover why this combination is powerful, which connection method to use, a concrete use case with real code, and how you can replicate it in minutes.

Why Google Coral + ASI Biont?

Google Coral is not a single device — it’s a family: the USB Accelerator, the Dev Board, the Mini PCIe module, and the System-on-Module (SoM). All share the Edge TPU chip, which runs quantized TensorFlow Lite models at high speed. Typical applications include:
- Real-time object detection (e.g., people counting, defect detection)
- Pose estimation in sports analytics
- Audio classification (keyword spotting, anomaly detection)

But Coral lacks a built-in decision engine. It outputs bounding boxes and class probabilities, but deciding what to do — pause the conveyor, log the defect, alert maintenance — requires external logic. ASI Biont provides exactly that: an AI agent that can process inference results, apply business rules, and execute actions across hundreds of devices.

Feature Without ASI Biont With ASI Biont
Inference on Coral Yes Yes
Decision logic Manual (human watches output) AI-driven, real-time
Actions (alerts, logs, commands) Custom script per action Natural language description → code
Multi-device orchestration Manual integration Single chat conversation

Which Connection Method to Use?

Google Coral devices typically run Linux (Debian-based Mendel system on the Dev Board, or a custom OS on the SoM). The most reliable way to interact with them remotely is SSH — and ASI Biont supports SSH via paramiko inside the execute_python sandbox.

Why SSH and not MQTT or HTTP?
- Coral runs inference locally; we need to trigger Python scripts on the device, copy model files, and read results. SSH provides a shell to do all that.
- MQTT would require an MQTT broker on Coral, which adds overhead. HTTP would need a running web server on Coral, which is not standard.
- SSH is universally supported, secure (key-based), and allows ASI Biont to execute any command or script on the Coral device.

ASI Biont connection flow:
1. You provide the Coral device’s IP address, SSH username, and either password or private key.
2. ASI Biont writes a Python script that uses paramiko to SSH into the device.
3. The script runs a pre-loaded inference script on Coral, captures stdout/stderr, and parses the results.
4. Based on the results (e.g., defect detected), the AI agent takes action: sends a Telegram alert, writes to a database, or triggers another device.

Concrete Use Case: Defect Detection on a Conveyor Belt

Scenario: A factory conveyor moves electronic components. A Coral Dev Board with a USB camera captures frames every 200ms. The Edge TPU runs a MobileNet SSD model (quantized) trained to detect surface defects. When a defect is found, the system must:
1. Log the timestamp, image (base64), and defect class to a PostgreSQL database.
2. Send an alert to a Telegram group.
3. Optionally, send a signal to a PLC (via Modbus/TCP) to reject the part.

Step-by-step integration with ASI Biont:

1. Prepare the Coral

On the Coral Dev Board, install the Edge TPU Python API and your model:

# On Coral (SSH into it manually once to set up)
sudo apt update
sudo apt install python3-pip
pip3 install pycoral tflite-runtime
# Copy your model (e.g., defect_model_edgetpu.tflite) and labels

Create a script infer.py that captures an image from the camera, runs inference, and prints JSON to stdout:

# infer.py on Coral
import cv2
from pycoral.adapters import common, detect
from pycoral.utils.edgetpu import make_interpreter

MODEL = 'defect_model_edgetpu.tflite'
LABELS = 'labels.txt'

interpreter = make_interpreter(MODEL)
interpreter.allocate_tensors()

cap = cv2.VideoCapture(0)
ret, frame = cap.read()
if not ret:
    print('{"error": "no frame"}')
    exit(1)

_, scale = common.set_resized_input(interpreter, (320, 320), lambda size: cv2.resize(frame, size))
interpreter.invoke()
objs = detect.get_objects(interpreter, score_threshold=0.5)

results = []
for obj in objs:
    results.append({
        'class': obj.id,
        'score': float(obj.score),
        'bbox': obj.bbox
    })
print(json.dumps({'defects': results, 'timestamp': time.time()}))
cap.release()

2. Connect via ASI Biont

In the ASI Biont chat, you describe:

"Connect to the Coral Dev Board at 192.168.1.100 via SSH (user: coral, key in my messages). Run python3 /home/coral/infer.py every 5 seconds. If any defect has score > 0.7, save the result to PostgreSQL and send a Telegram alert."

ASI Biont generates the following integration script (you can inspect it before execution):

# This script runs in the ASI Biont sandbox (execute_python)
import paramiko
import json
import time
import asyncio
from datetime import datetime

# PostgreSQL connection (sandbox has psycopg2)
import psycopg2
conn = psycopg2.connect(host='your-db-host', dbname='factory', user='user', password='pass')
cur = conn.cursor()

# Telegram alert via requests
import requests
TELEGRAM_TOKEN = 'your_token'
CHAT_ID = '-1001234567890'

def send_telegram(text):
    url = f'https://api.telegram.org/bot{TELEGRAM_TOKEN}/sendMessage'
    requests.post(url, json={'chat_id': CHAT_ID, 'text': text})

# SSH connection
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.100', username='coral', key_filename='/tmp/private_key')

while True:
    stdin, stdout, stderr = ssh.exec_command('python3 /home/coral/infer.py')
    output = stdout.read().decode()
    if not output:
        time.sleep(5)
        continue
    try:
        data = json.loads(output)
    except json.JSONDecodeError:
        time.sleep(5)
        continue

    for defect in data.get('defects', []):
        if defect['score'] > 0.7:
            # Log to database
            cur.execute(
                "INSERT INTO defects (timestamp, class, score, image_data) VALUES (%s, %s, %s, %s)",
                (datetime.now(), defect['class'], defect['score'], None)  # image can be added via separate upload
            )
            conn.commit()
            # Send alert
            send_telegram(f"🚨 Defect detected: class {defect['class']}, score {defect['score']:.2f}")
            # Optionally write to PLC via Modbus
            # from pymodbus.client import ModbusTcpClient
            # client = ModbusTcpClient('192.168.1.200')
            # client.write_coil(0, True)  # activate reject actuator
    time.sleep(5)

Important: The sandbox timeout is 30 seconds, so the while True loop above would be stopped. In practice, ASI Biont uses a scheduling approach: the AI sets up a cron-like task (via the industrial_command tool or an external scheduler) that runs the inference every N seconds. Alternatively, AI can write a script that runs once per call and the agent calls it repeatedly via the chat loop.

3. Result

Once the script runs, ASI Biont continuously monitors the conveyor. You can ask: "How many defects were detected in the last hour?" and the AI will query the database. You can say: "Pause the conveyor if more than 5 defects appear in one minute" — and the AI will add that logic to the integration.

Why This Integration Is Revolutionary

  • Zero coding from you. You don’t need to know paramiko, psycopg2, or the Telegram API. You describe the workflow, and ASI Biont writes the glue code.
  • Flexible connection methods. While we used SSH for Coral, ASI Biont supports MQTT, Modbus/TCP, HTTP API, WebSocket, COM port, OPC-UA, and more — all through the same chat interface.
  • No dashboard required. There are no “Add Device” buttons or configuration panels. Everything happens conversationally. The AI agent adapts to your specific hardware and model.
  • On-device ML + cloud AI. Coral handles low-latency inference; ASI Biont provides the higher-level reasoning, logging, and multi-device orchestration.

How to Get Started

  1. Set up your Coral device (Dev Board or USB Accelerator with a host) with your TFLite model.
  2. Go to asibiont.com and start a chat.
  3. Describe your setup: "I have a Google Coral at 192.168.1.100, SSH user coral, key attached. Run object detection every 3 seconds. If a person is detected, log to MongoDB and turn on a light via MQTT."
  4. The AI will generate, test, and run the integration — all in seconds.

Conclusion

Google Coral brings powerful on-device ML to the edge, but true automation requires an intelligent orchestrator. ASI Biont fills that role by connecting to Coral via SSH, reading inference results, and executing complex workflows — from database logging to multi-channel alerts — without a single line of manual code. Whether you’re inspecting conveyor belts, monitoring wildlife cameras, or analyzing retail foot traffic, the combination of Edge TPU and an AI agent that writes its own drivers is the fastest path to production.

Try it today: visit asibiont.com, describe your Coral integration in plain English, and watch the AI build your pipeline.


References:
- Google Coral official documentation: https://coral.ai/docs/
- ASI Biont connection methods: https://asibiont.com/docs (SSH, MQTT, Modbus, etc.)
- Edge TPU performance benchmarks: https://coral.ai/features/

← All posts

Comments