Why Connect Intel Neural Compute Stick to an AI Agent?
The Intel Neural Compute Stick 2 (NCS2) is a USB-powered deep learning inference accelerator that brings neural network processing to edge devices. It’s a tiny device (roughly the size of a USB stick) that can run models like YOLO, MobileNet, or OpenPose directly on a Raspberry Pi, laptop, or industrial PC—without streaming data to the cloud. This means lower latency, better privacy, and offline operation.
But here’s the real challenge: configuring the NCS, writing inference scripts, and integrating results into any automation workflow usually takes hours of manual coding. That’s where ASI Biont comes in. Instead of building a custom dashboard or cron job, you describe what you want in plain English (e.g., “run object detection on the camera feed every 10 seconds and send an alert if a person is detected”), and the AI agent generates the Python code, executes it on your edge device via SSH, and returns the results to your chat. No extra servers, no complex middleware.
How ASI Biont Connects to the Intel Neural Compute Stick
ASI Biont does not connect to the NCS directly—it connects to the computer (Raspberry Pi, laptop, or industrial PC) that the NCS is plugged into. The connection method used is SSH (via paramiko). The AI agent writes a Python script that:
1. Connects to your edge device via SSH using credentials you provide.
2. Copies or generates an inference script that uses OpenVINO™ (Intel’s toolkit for running models on the NCS).
3. Executes the script remotely, captures stdout/stderr, and returns results to your chat.
This approach works for any single-board computer (Raspberry Pi 4/5, Orange Pi, Jetson Nano) or any Linux machine with an active SSH server.
Why SSH? Because the NCS requires the OpenVINO runtime and USB access—both of which are available on the host machine. ASI Biont’s execute_python sandbox runs in the cloud and cannot directly see USB devices; SSH is the secure, reliable bridge.
Real Use Case: Raspberry Pi + NCS2 + Camera → Object Detection Alerts via Telegram
Scenario: You have a Raspberry Pi 4 with a USB camera and an Intel NCS2 plugged in. You want to detect people in the camera feed every 30 seconds, and if someone is detected, send a Telegram message with the photo. All without exposing video to the cloud.
Step 1: Describe Your Setup in ASI Biont Chat
You type:
"Connect to my Raspberry Pi at 192.168.1.100 (user: pi, key: ~/.ssh/id_rsa). Run a Python script that uses OpenVINO with the NCS to detect people in the camera feed every 30 seconds. If a person is detected, save the frame and send the file path to me."
Step 2: AI Generates and Executes the Integration Code
ASI Biont’s AI agent writes a Python script that uses paramiko to execute commands remotely. Here’s a simplified version of what it generates (the actual code is more robust with error handling):
import paramiko
import time
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.100', username='pi', key_filename='/home/user/.ssh/id_rsa')
# Copy inference script to Raspberry Pi
script_content = '''
import cv2
from openvino.inference_engine import IECore
import numpy as np
# Load model (person-detection-retail-0013)
ie = IECore()
net = ie.read_network(model='person-detection.xml', weights='person-detection.bin')
exec_net = ie.load_network(network=net, device_name='MYRIAD') # MYRIAD = NCS
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
if not ret:
break
# Preprocess and infer
input_blob = next(iter(net.input_info))
out_blob = next(iter(net.outputs))
resized = cv2.resize(frame, (544, 320))
input_data = np.expand_dims(np.transpose(resized, (2,0,1)), axis=0).astype(np.float32)
result = exec_net.infer({input_blob: input_data})
# Parse detections
detections = result[out_blob][0][0]
for detection in detections:
if detection[2] > 0.5: # confidence threshold
print("Person detected")
cv2.imwrite('/home/pi/detected.jpg', frame)
print("Saved /home/pi/detected.jpg")
break
time.sleep(30)
cap.release()
'''
# Write script to remote machine
sftp = ssh.open_sftp()
with sftp.open('/home/pi/detect.py', 'w') as f:
f.write(script_content)
sftp.close()
# Run script in background
stdin, stdout, stderr = ssh.exec_command('python3 /home/pi/detect.py &')
time.sleep(5)
print("Script running on Raspberry Pi. Check results in /home/pi/detected.jpg")
ssh.close()
Step 3: AI Returns Results to Chat
The AI agent runs the above script in its sandbox (execute_python). The script connects to the Pi, uploads the inference code, and starts it. The AI then monitors the output and, upon detecting a person, sends you the file path. You can then ask the AI to fetch the image and send it to Telegram using its built-in integration:
"Send the file /home/pi/detected.jpg to my Telegram chat ID 123456789"
The AI uses requests to upload the photo via the Telegram Bot API.
Alternative Connection: Hardware Bridge for Arduino with NCS
If you want to use the NCS with an Arduino (e.g., to process sensor data on a PC and send commands back to the Arduino), you can use ASI Biont’s Hardware Bridge. The bridge runs on your PC (Windows/Linux/macOS), connects to the AI agent via WebSocket, and gives the AI access to COM ports. The AI can then:
- Read sensor data from Arduino (e.g., temperature from DHT22).
- Run inference on that data using the NCS (via OpenVINO on the PC).
- Send commands back to the Arduino (e.g., turn on a relay).
Example command from chat:
"Use Hardware Bridge on COM3 at 115200 baud. Read temperature every 10 seconds. If temperature > 30°C, run a pre-trained anomaly detection model on the NCS and if anomaly score > 0.8, send 'ALERT' to Arduino."
The AI generates a script that runs on your PC (not in the cloud) that orchestrates both the NCS inference and the Arduino communication. This script is delivered to you as a downloadable Python file that you run locally.
Why This Approach Beats Traditional Edge AI Workflows
| Aspect | Traditional Setup | ASI Biont Integration |
|---|---|---|
| Time to first detection | Hours (install OpenVINO, write script, debug) | Minutes (describe in chat, AI writes code, executes) |
| Flexibility | Must manually change code for new models | Just tell AI to switch model—it rewrites the script |
| Data privacy | Streams to cloud for processing | All inference stays on-device (NCS) |
| Automation | Requires separate cron job or MQTT broker | AI can trigger actions (Telegram alerts, database writes) in the same chat |
Common Pitfalls and How to Avoid Them
- OpenVINO version mismatch: The NCS2 works with OpenVINO 2020–2022. If your Raspberry Pi has a newer version, the MYRIAD plugin may not be available. Fix: Use a Docker container with Intel’s official OpenVINO image (e.g.,
intel/openvino:ubuntu20). - USB power: The NCS draws up to 2.5W. On a Raspberry Pi 4, use a powered USB hub to avoid undervoltage warnings.
- SSH key permissions: ASI Biont’s sandbox cannot use password prompts. Use a key-based SSH login with
paramiko.AutoAddPolicy()(shown above). - Model download: The AI agent can automatically download models from Intel’s Open Model Zoo via
omz_downloader. Just ask: “Use the person-detection-retail-0013 model from Intel’s model zoo.”
No Manual Coding Required
The beauty of this integration is that you never write the glue code yourself. Instead of searching for “how to run OpenVINO on Raspberry Pi” and then “how to send Telegram alert,” you simply describe the full pipeline to ASI Biont. The AI agent understands the constraints (NCS device name = “MYRIAD”, SSH connection, file paths) and generates production-ready code that runs immediately.
Whether you’re monitoring a warehouse for intruders, counting products on a conveyor belt, or analyzing wildlife camera traps, the NCS + ASI Biont combination gives you on-device inference with chat-based control.
Get Started Today
Try it yourself: go to asibiont.com, create an account, and in the chat write:
"Connect to my Raspberry Pi at 192.168.1.100 via SSH (user: pi, key: /path/to/key). Install OpenVINO if needed, then run real-time object detection using the Intel Neural Compute Stick and the ssd_mobilenet_v2 model. Send me a Telegram message whenever a car is detected."
ASI Biont will handle the entire integration—no dashboards, no manual coding, just results delivered to your chat.
Comments