All Projects → zoranzhao → DeepThings

zoranzhao / DeepThings

Licence: MIT License
A Portable C Library for Distributed CNN Inference on IoT Edge Clusters

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to DeepThings

MicrosoftCloudWorkshop-Asia
Microsoft Cloud Workshop Asia for Intelligent Cloud / Intelligent Edge
Stars: ✭ 20 (-59.18%)
Mutual labels:  internet-of-things, edge-computing
freeioe
FreeIOE is a framework for building IOE (Internet Of Everything) edge-computing gateway 开源的边缘计算网关框架. 讨论群: 291292378
Stars: ✭ 77 (+57.14%)
Mutual labels:  internet-of-things, edge-computing
Mainflux
Industrial IoT Messaging and Device Management Platform
Stars: ✭ 1,341 (+2636.73%)
Mutual labels:  internet-of-things, edge-computing
home-assistant-notebooks
📓 Sample Jupyter Notebooks to explore Home Assistant data
Stars: ✭ 49 (+0%)
Mutual labels:  internet-of-things
peerjs-python
Python port of PeerJS client
Stars: ✭ 56 (+14.29%)
Mutual labels:  edge-computing
kotori
A flexible data historian based on InfluxDB, Grafana, MQTT and more. Free, open, simple.
Stars: ✭ 73 (+48.98%)
Mutual labels:  internet-of-things
object-flaw-detector-python
Detect various irregularities of a product as it moves along a conveyor belt.
Stars: ✭ 17 (-65.31%)
Mutual labels:  edge-computing
nott
The New OTT Platform - an excuse to discuss and design a simple edge computing platform
Stars: ✭ 46 (-6.12%)
Mutual labels:  edge-computing
Edge2Guard
Code for PerCom Workshop paper title 'Edge2Guard: Botnet Attacks Detecting Offline Models for Resource-Constrained IoT Devices'
Stars: ✭ 16 (-67.35%)
Mutual labels:  edge-computing
IoTCodeRecipes
IoT Code Recipes: RPL, mDNS and REST
Stars: ✭ 19 (-61.22%)
Mutual labels:  internet-of-things
automate-home
Yet another python home automation (iot) project. Because a smart light is more than just on or off.
Stars: ✭ 59 (+20.41%)
Mutual labels:  internet-of-things
IoT-Technical-Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,565 (+5134.69%)
Mutual labels:  internet-of-things
tutorial
Tutorial for using the CampusIoT platform
Stars: ✭ 22 (-55.1%)
Mutual labels:  internet-of-things
Python-Botnet
This is a simple DDoS python botnet script with remote monitoring & management for education purposes.
Stars: ✭ 119 (+142.86%)
Mutual labels:  internet-of-things
pyawair
a very simple python class to access the (private) awair api
Stars: ✭ 24 (-51.02%)
Mutual labels:  internet-of-things
jarvis
Jarvis Home Automation
Stars: ✭ 81 (+65.31%)
Mutual labels:  internet-of-things
keras openvino
How to run Keras model inference x3 times faster with CPU and Intel OpenVINO
Stars: ✭ 32 (-34.69%)
Mutual labels:  edge-computing
ArduinoMqtt
MQTT client for Arduino
Stars: ✭ 58 (+18.37%)
Mutual labels:  internet-of-things
fog05
End-to-End Compute, Storage and Networking Virtualisation.
Stars: ✭ 50 (+2.04%)
Mutual labels:  edge-computing
Deep-Inside
Command line tool that allows you to explore IoT devices by using Shodan API.
Stars: ✭ 22 (-55.1%)
Mutual labels:  internet-of-things

DeepThings

DeepThings is a framework for locally distributed and adaptive CNN inference in resource-constrained IoT edge clusters. DeepThings mainly consists of:

  • A Fused Tile Partitioning (FTP) method for dividing convolutional layers into independently distributable tasks. FTP fuses layers and partitions them vertically in a grid fashion, which largely reduces communication and task migration overhead.
  • A distributed work stealing runtime system for IoT clusters to adaptively distribute FTP partitions in dynamic application scenarios.

For more details of DeepThings, please refer to [1].

Overview of the DeepThings framework.

This repository includes a lightweight, self-contained and portable C implementation of DeepThings. It uses a NNPACK-accelerated Darknet as the default inference engine. More information on porting DeepThings with different inference frameworks and platforms can be found below.

Platforms

The current implementation has been tested on Raspberry Pi 3 Model B running Raspbian.

Building

Edit the configuration file include/configure.h according to your IoT cluster parameters, then run:

make clean_all
make 

This will automatically compile all related libraries and generate the DeepThings executable. If you want to run DeepThings on Raspberry Pi with NNPACK acceleration, you need first follow install NNPACK before running the Makefile commands, and set the options in Makefile as below:

NNPACK=1
ARM_NEON=1

Downloading pre-trained CNN models and input data

In order to perform distributed inference, you need to download pre-trained CNN models and put it in ./models folder. Current implementation is tested with YOLOv2, which can be downloaded from YOLOv2 model and YOLOv2 weights. If the link doesn't work, you can also find the weights here.

For input data, images need to be numbered (starting from 0) and renamed as <#>.jpg, and placed in ./data/input folder.

Running in a IoT cluster

An overview of DeepThings command line options is listed below:

#./deepthings -mode <execution mode: {start, gateway, data_src, non_data_src}> 
#             -total_edge <total edge number: t> 
#             -edge_id <edge device ID: {0, ... t-1}>
#             -n <FTP dimension: N> 
#             -m <FTP dimension: M> 
#             -l <number of fused layers: L>

For example, assuming you have a host machine H, gateway device G, and two edge devices E0 (data source) and E1 (idle), while you want to perform a 5x5 FTP with 16 fused layers, then you need to follow the steps below:

In gateway device G:

./deepthings -mode gateway -total_edge 2 -n 5 -m 5 -l 16

In edge device E0:

./deepthings -mode data_src -edge_id 0 -n 5 -m 5 -l 16

In edge device E1:

./deepthings -mode non_data_src -edge_id 1 -n 5 -m 5 -l 16

Now all the devices will wait for a trigger signal to start. You can simply do that in your host machine H:

./deepthings -mode start

Running in a single device

Many people want to first try the FTP-partitioned inference in a single device. Now you can find a single-device execution example in ./examples folder. To run it:

make clean_all
make
make test

This will first initialize a gateway context and a client context in different local threads. FTP partition inference results will be transferred between queues associated with each context to emulate the inter-device communication.

Porting DeepThings

One just needs to simply modify the corresponding abstraction layer files to port DeepThings. If you want to use a different CNN inference engine, modify:

If you want to port DeepThings onto a different OS (Currently using UNIX pthread), modify:

If you want to use DeepThings with different networking APIs (Currently using UNIX socket), modify:

References:

[1] Z. Zhao, K. Mirzazad and A. Gerstlauer, "DeepThings: Distributed Adaptive Deep Learning Inference on Resource-Constrained IoT Edge Clusters," CODES+ISSS 2018, special issue of IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (TCAD).

Contact:

Zhuoran Zhao, [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].