BerryNet: Deep Learning Gateway on Raspberry Pi

BerryNet项目将Raspberry Pi 3转变为运行深度学习的智能网关,无需互联网连接,所有操作都在RPi3上本地进行。通过Node.js、MQTT和AI引擎分析图像或视频帧,支持分类和对象检测两种引擎。该网关可以用于监控,例如,通过摄像头分析办公室情况,并计划增加邮件和即时消息通知功能。
摘要由CSDN通过智能技术生成

via: https://github.com/DT42/BerryNet

This project turns Raspberry Pi 3 into an intelligent gateway with deep learning running on it. No internet connection is required, everything is done locally on the Raspberry Pi 3 itself. At DT42, we believe that bringing deep learning to edge devices is the trend towards the future. It not only saves costs of data transmission and storage but also makes devices able to respond according to the events shown in the images or videos without connecting to the cloud.

Figure 1

Figure 1 shows the software architecture of the project, we use Node.js, MQTT and an AI engine to analyze images or video frames with deep learning. So far, there are two supported AI engines, the classification engine and the object detection engine. Figure 2 shows the differences between classification and object detection.

Figure 2

One of the application of this intelligent gateway is to use the camera to monitor the place you care about. For example, Figure 3 shows the analyzed results from the camera hosted in the DT42 office. The frames were captured by the IP camera and they were submitted into the AI engine. The output from the AI engine will be shown in the dashboard. We are working on the Email and IM notification so you can get a notification when there is a dog coming into the meeting area with the next release.

Figure 3

AI Engines

The current supported AI Engines leverage work from the following projects:

The current supported classification model is Inception v3[1] and the detection model is TinyYOLO[2].

Installation

$ git clone https://github.com/DT42/BerryNet.git
$ cd BerryNet
$ ./configure

Start and Stop BerryNet

BerryNet is managed by systemd. You can manage BerryNet via berrynet-manager:

$ berrynet-manager [start | stop | status | log]

Configuration

All the configurations are in config.js.

  • Choose AI Engine.

    • Two types of AI engines currently: object classifier and object detector.
  • Configure IP camera's snapshot access interface.

  • MQTT topics.

Dashboard

Open dashboard on RPi3 (with touch screen)

Open browser and enter the URL:

http://localhost:8080/index.html#source=dashboard.json

The default dashboard configuration file will be loaded.

Open dashboard on browser from any computer

Open browser and enter the URL:

http://<gateway-ip>:8080/index.html#source=dashboard.json

Click the data sources, and change MQTT broker's IP address to the gateway's IP.

For more details about dashboard configuration (e.g. how to add widgets), please refer to freeboard project.

Provide Image Input

To capture an image via configured IP camera

$ mosquitto_pub -h localhost -t berrynet/event/camera -m snapshot_ipcam

To capture an image via board-connected camera (RPi camera or USB webcam)

$ mosquitto_pub -h localhost -t berrynet/event/camera -m snapshot_boardcam

To provide a local image

$ mosquitto_pub -h localhost -t berrynet/event/localImage -m <image_path>

To start and stop streaming from board-connected camera

$ mosquitto_pub -h localhost -t berrynet/event/camera -m stream_boardcam_start
$ mosquitto_pub -h localhost -t berrynet/event/camera -m stream_boardcam_stop

To start and stop streaming from Nest IP camera

$ mosquitto_pub -h localhost -t berrynet/event/camera -m stream_nest_ipcam_start
$ mosquitto_pub -h localhost -t berrynet/event/camera -m stream_nest_ipcam_stop

Enable Data Collector

You might want to store the snapshot and inference results for data analysis.

To enable data collector, you can set the storage directory path in config.js:

config.storageDirPath = '<data-storage-dirpath>';

and restart BerryNet.

Use Your Data To Train

The original instruction of retraining YOLOv2 model see github repository of darknet

In the current of BerryNet, TinyYolo is used instead of YOLOv2.
The major differences are:

  1. Create file yolo-obj.cfg with the same content as in tiny-yolo.cfg
  2. Download pre-trained weights of darknet reference model, darknet.weights.12, for the convolutional layers (6.1MB)
    https://drive.google.com/drive/folders/0B-oZJEwmkAObMzAtc2QzZDhyVGM?usp=sharing

The rest parts are the same as retraining YOLO.

If you use LabelMe to annotate data, utils/xmlTotxt.py can help convert the xml format to the text format that darknet uses.

Discussion

Please refer to the Google Group for questions, suggestions, or any idea discussion.


  1. Inception v3 https://arxiv.org/pdf/1512.00567.pdf

  2. TinyYOLO https://pjreddie.com/media/files/papers/YOLO9000.pdf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值