element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
1 Meter of Pi
  • Challenges & Projects
  • Design Challenges
  • 1 Meter of Pi
  • More
  • Cancel
1 Meter of Pi
Blog 2Pi Microgravity Garden Blog 7 | AI Image Recognition with Raspberry Pi and Tensor Flow
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: kurama007
  • Date Created: 10 Dec 2020 4:53 PM Date Created
  • Views 863 views
  • Likes 5 likes
  • Comments 0 comments
  • tensorflow
  • 1meterofpi
  • ai
  • tensorflow lite
Related
Recommended

2Pi Microgravity Garden Blog 7 | AI Image Recognition with Raspberry Pi and Tensor Flow

kurama007
kurama007
10 Dec 2020

Previous Blog Posts ...

Blog #1: 2Pi Microgravity Garden Blog 1 | Getting Started | element14 | 1 Meter of Pi

Blog #2: 2Pi Microgravity Garden Blog 2 | Raspberry Pi s... | element14 | 1 Meter of Pi

Blog #3: 2Pi Microgravity Garden Blog 3 | Hello World wi... | element14 | 1 Meter of Pi

Blog #4: 2Pi Microgravity Garden Blog 4 | Software Envir... | element14 | 1 Meter of Pi

Blog #5: 2Pi Microgravity Garden Blog 5 | Connect to Arduino and how plants get pollinated inside rocket without wind???

Blog #6: 2Pi Microgravity Garden Blog 6 | Water Level Sensor and Bug Catcher inside Rocket !

Blog #7: 2Pi Microgravity Garden Blog 7 | AI Image Recognition with Raspberry Pi and Tensor Flow

 

Blog 7 Task List

  1. Tensor Flow Lite Image Recognition with a Camera
  2. Image Recognition Tests

 

Content

Now, everyone is talking about AI on Internet, TV and everywhere. What AI can bring is very interesting. So, I always wanted to try AI image recognition with Raspberry Pi.

 

The question is what kind of information can be useful for astronauts and anyone who is involved in this work?

image

For this 1 meter of Pi project, what if the Raspberry Pi can do an image recognition? This can help characterize the spread of harmful plant pathogens and discover the origin of fruit diseases even in space! Also, this can tell us when to pick up fruits like strawberries and tomato image

 

We can not built a new machine learning model which can do such a thing in a day or so. Realistically, I am just starting with what is available now and improve it from here for this 1 meter of Pi project !

 

1. Engineering: Add Artificial Intelligence Image Recognition with Raspberry Pi

Hardware Wiring

image

Here is a snapshot of the 1 meter of Pi system now in my garage.

image

 

This week, I added a USB camera to the Raspberry Pi USB port. I tried a raspberry pi camera before, but I didn't like the CSI cable because it is not long enough and gets tangled sometimes. The USB camera with a long cable has been very handy for testing.

 

 

Code

image

I used Tensor Flow Lite (TFLite) object detection model. Here is a list of references that I've followed for the first time.

 

After installation is complete, just a couple of commands to activate the webcam and object detection model.

cd tflite1
source tflite1-env/bin/activate
python3 TFLite_detection_webcam.py --modeldir=Sample_TFLite_model

 

References:

https://www.tensorflow.org/lite/guide/build_rpi

https://github.com/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi/blob/master/Raspberry_Pi…

 

2. Experiment

The Tensor Flow lite model recognized the leafy vegetables on the hydroponics system as "potted plant." This was very amazing image

 

The bug catcher plant (sarracenia) was not recognizable but it sees this plant as a bowl, which is okay, I guess.

image

 

For fun: A few examples

 

(1) Keyboard

image

 

(2) Mouse

image

(3) Recognized duck toy as a person

image

(4) Minion as a sports ball and 62% confidence???

image

 

3. Summary

 

In general, the default image recognition with Tensor Flow Lite pre-trained object detection model can detect plants as "potted plants," which is great.

 

As you can see, this object detection is not perfect at this point. We can improve it by training a new model and add more classifications.

 

During the image recognition process, typical frame per second (FPS) is 4-5 FPS, which is not really great compared to high-end computers. Since most objects don't move in this project, frame per second (FPS) may not be so important.


When this object detection model starts running, the Raspberry Pi chip becomes hot. So, heat sink is recommended.

With the heat sink, the temperature is about 45 oC.

image

 

Personal Website

https://green-scientist.com/

 

Github

https://github.com/kurama007/1MeterOfPi

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube