DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Deep Learning Frameworks Comparison
  • Explainable AI: Making the Black Box Transparent
  • AI-Powered Knowledge Graphs
  • Delivering the Future of Uber-Like Apps With AI and ML

Trending

  • Understanding Git
  • How To Start a Successful Career in DevOps
  • Introduction to ESP32 for Beginners Using the Xedge32 Lua IDE
  • Running Unit Tests in GitHub Actions
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. TensorFlow on the Edge, Part 1 of 5

TensorFlow on the Edge, Part 1 of 5

Running TensorFlow on the Edge is now possible, what, why and how?

Tim Spann user avatar by
Tim Spann
CORE ·
Feb. 06, 17 · Opinion
Like (6)
Save
Tweet
Share
18.41K Views

Join the DZone community and get the full member experience.

Join For Free

Deep Learning is growing in power, scale, availability and frameworks. Open Source tools for Neural networks are everywhere, you have so much choice. Interesting new developments like PaddlePaddle, Keras and Deep Water are showing up and updating frequently. Unfortunately a lot of them take some serious power in GPUs, number of nodes, RAM, disk space, network bandwidth and CPU cores like IM2TXT for TensorFlow. These are very good uses of your 100+ node Hadoop clusters especially ones running on AWS with GPUs. Or if you can get a few of the new NVIDIA Tesla K20s. Sometimes you want to, only have access to or are just learning like I am. So you can start with a $35, swiss army knife of computers, the RPI!

With the power of Raspberry PI 3 Bs you can now run processing at the edge including image processing, text processing, JSON munging, and even deep learning. The Raspberry Pi has a powerful 64bit QuadCore processor with 1 Gigabyte of RAM, that's pretty powerful for running some Python scripts and sending a stream of data to an regional server for additional processing.

Obviously your main Hadoop clusters will have beefy servers with 256G of RAM or more, 32 or more CPU Cores and other impressive specifications for processing petabytes of data. For real-time streaming it's great to push some of the initial processing to the IoT edge nodes that are doing the initial ingest.

A good example of processing at the edge is in my article here.

What are some good uses for these devices?

IoT, Streaming, ML, DL, Big Data Usage Patterns

1.  Ingest data from sensors attached to device (Sense-Hat on RPi), read in Python, send via MQTT to Apache NiFi.

2.  Ingest data from attached Web Cam (PiCamera on RPi), process in Python, run image recognition with TensorFlow and send via sFTP to Apache NiFi.

3.  Ingest data from sensors, logs and devices, quick process with OpenCV, ImageMagick and other tools and send via MiNiFi to Apache NiFi.

4.  Ingest social media streams like Twitter via Python libraries and send them on.   This is easy to do in twitter, but it doesn't hurt to spread out the load.   If you have many regional work sites and they have their own Twitter or Facebook or other social accounts, you can use those to grab more data.

5.  Ingest data from SCADA and Smart Meters that you can connect to from a local Pi either through TCP/IP, wired connection, ZigBee, BLE or any number of protocols.  For security, heat or other reasons there may be no other way to interact with these sensors, devices or machines.

What's amazing is you can now do the initial processing including some Deep Learning on the device before the data is sent on to the next step.   You can run more powerful transformations, machine learning, NLP, Sentiment Analysis, more deep learning on the cloud or regional NiFi server and then send it to a centrally hosted data center or cloud based Hadoop or push to Kafka for further processing Spark, Storm or Flink (or Apache Beam to isolate your choice).

Google has announced more growing support for Raspberry Pi, and they already have example TensorFlow's that work on Raspberry Pi 3 B.

For an example of how fast this is, check out these timings:

root@raspberrypi:/opt/demo/tensorflow-master# tensorflow/contrib/pi_examples/label_image/gen/bin/label_image
2017-01-28 01:46:48: I tensorflow/contrib/pi_examples/label_image/label_image.cc:144] Loaded JPEG: 512x600x3
2017-01-28 01:46:50: W tensorflow/core/framework/op_def_util.cc:332] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().
2017-01-28 01:46:52: I tensorflow/contrib/pi_examples/label_image/label_image.cc:378] Running model succeeded!
2017-01-28 01:46:52: I tensorflow/contrib/pi_examples/label_image/label_image.cc:272] military uniform (866): 0.624294
2017-01-28 01:46:52: I tensorflow/contrib/pi_examples/label_image/label_image.cc:272] suit (794): 0.0473981
2017-01-28 01:46:52: I tensorflow/contrib/pi_examples/label_image/label_image.cc:272] academic gown (896): 0.0280925
2017-01-28 01:46:52: I tensorflow/contrib/pi_examples/label_image/label_image.cc:272] bolo tie (940): 0.0156955
2017-01-28 01:46:52: I tensorflow/contrib/pi_examples/label_image/label_image.cc:272] bearskin (849): 0.0143348

Four seconds is pretty good, with the fast networking on RPI and only using it for capturing an image, process it and send it, you can push close to one image every 5 seconds with a decent SD card and not much else running.

For a future test I am looking at running on Onion, Pine64, Dell Inspiron Cube, Intel Edison, Arduino and some other small devices all of which have their own unique skills and features. I am also looking at running DL4J and PI4J for JVM Deep Learning.

References

  • IoT Capturing Photos and Analyzing the Images with TensorFlow on RPI

  • TensorFlow Image Recognition Tutorial 

  • GoogleNet Inception v3 

  • Tesla K20

Image title

Big data TensorFlow raspberry pi Machine learning Processing Deep learning

Opinions expressed by DZone contributors are their own.

Related

  • Deep Learning Frameworks Comparison
  • Explainable AI: Making the Black Box Transparent
  • AI-Powered Knowledge Graphs
  • Delivering the Future of Uber-Like Apps With AI and ML

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: