DIY RASPBERRY NEURAL NETWORK SEES ALL, RECOGNIZES SOME

As a fun project I thought I’d put Google’s Inception-v3 neural network on a Raspberry Pi to see how well it does at recognizing objects first hand. It [turned out to be] not only fun to implement, but also the way I’d implemented it ended up making for loads of fun for everyone I showed it to, mostly folks at hackerspaces and such gatherings. And yes, some of it bordering on pornographic — cheeky hackers.

An added benefit numerous pointed out is that, once installed, no internet access is required. This is state-of-the-art, standalone object recognition with no big brother knowing what you’ve been up to, unlike with that nosey Alexa.

But will it result in widespread helpful AI? If a neural network can recognize every object around it, will that result in human-like skills? পড়তে.

How To Do object Recognition

Inception object recognizer internals
The implementation consists of:

Raspberry Pi 3 model B

amplifier and speaker

PiCamera

momentary swtich

cellphone charger battery for the Pi

The heart of the required software is Google’s Inception neural network which is implemented using their TensorFlow framework. You can download it by following the TensorFlow tutorial for image recognition. The tutorial doesn’t involve any programing so don’t worry if you don’t know Python or TensorFlow. That is, unless you’re going to modify their sample code as I did.

classify_image.py printing that it saw a panda
The sample code takes a fixed named file including a picture of a panda and does object recognition on it. It gives the result by printing out that it saw a panda. But that wasn’t enough fun.

I hunted around for some text-to-speech software and found Festival. Now when it wants to say it saw a panda, I modified the sample code to run festival in a linux shell and tell it to actually say “I saw a panda” to the speaker.

Audio Playerhttps://hackaday.com/wp-content/uploads/2017/06/classify_speak_panda_audio.wav

00:00
00:00
00:00

But that still wasn’t fun enough. I connected a PiCamera to the Raspberry Pi, and had that take a photo and give it to the TensorFlow code to do object recognition. In the vernacular, it now ran inference on my photo.

And lastly, to make it all real easy I connected a momemtary switch to one of the Pi’s GPIO pins and took the photo when the momentary switch was pressed.

Here’s the Python program’s main() function before…

1.
2.
3.
4.
5.
def main(_):
  maybe_download_and_extract()
  image = (FLAGS.image_file if FLAGS.image_file else
           os.path.join(FLAGS.model_dir, ‘cropped_panda.jpg’))
  run_inference_on_image(image)

… এবং তারপর.

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def main(_):
  os.system("echo %s | festival –tts" % "Wait while I prepare my brain…")

  maybe_download_and_extract()
  # creates graph from saved GraphDef.
  create_graph()

  # preparing for the switch
  GPIO.setmode(GPIO.BCM)
  GPIO.setup(17, GPIO.IN)

  camera = PiCamera()

  os.system("echo %s | festival –tts" % "I am ready to see things.")

  while True:
    # loop for the switch
    while (GPIO.input(17) == GPIO.LOW):
      time.sleep(0.01)

    # take and write a snapshot to a file
    image = os.path.join(FLAGS.model_dir, ‘seeing_eye_image.jpg’)
    camera.capture(image)

    os.system("echo %s | festival –tts" % "I am thinking about what you showed me…")
    human_string = run_inference_on_image(image)
    os.system("echo I saw a %s | festival –tts" % human_string)

The calls to os.system() are where I run the festival text-to-speech program to make it say something to the speaker.

maybe_download_and_extract() is where Google’s Inception neural network would be downloaded from the Internet, if it’s not already present. By default, it downloads it to /tmp/imagenet which is on a RAM disk. The first time it did this, I copied it from /tmp/imagenet to /home/inception on the SD card and now run the program using a command line that includes where to find the Inception network.

Running the inception object recognizer
The call to create_graph() was moved from inside the run_inference_on_image() function. create_graph() sets up the neural network, which you need do only once. previously the program was a one-shot deal, but now it has an unlimited while loop which calls run_inference_on_image() each time through the loop. Obviously, setting up the neural network is something you do only once (see our introduction to TensorFlow for much more about graphs) so it had to be moved above the loop.

The run_inference_on_image() function is where the image is given to the neural network to do the object recognition. It used to just print out whatever it thought was in the image, but I modified it to instead return the text string including what it thinks the object is, “coffee mug” for example. So the last line is where it would say”আমি একটি কফি মগ দেখেছি” এম্প্লিফায়ার এবং স্পিকারকে।

যে সব আপ বক্সিং আমাকে একটি ছোট, স্ট্যান্ডলোন প্যাকেজ দিয়েছেন যা প্রায় বহন করা যেতে পারে এবং কারো দ্বারা চেষ্টা করা যেতে পারে। এখানে এটি একটি ভিডিও কর্মের মধ্যে।

একটি উন্নতির একটি ছোট স্ক্রীন যোগ করা হবে যাতে ব্যবহারকারী ভিডিও ক্যামেরাটি কী দেখেন তা দেখতে পারে, কিন্তু পিকমের একটি বিস্তৃত দেখার কোণ রয়েছে এবং একটি পর্দাটি প্রয়োজনীয় নয়।

তার বস্তুর স্বীকৃতি কত ভাল

একটি tobacconist দেখা শুরু
এটি দেখানো একটি সেল ফোন প্রায়শই এটি একটি সেল ফোন দেখেছি, কিন্তু কিছু ক্ষেত্রে একটি আইপড। যাইহোক, এখন পর্যন্ত এটি জল বোতল এবং কফি mugs প্রতি সময় উপযুক্ত পেয়েছেন।

যাইহোক, এটা মানুষের সাথে ভাল না। আমার অফিসে এটি আমার দিকে নির্দেশ করে এটি বলে যে এটি একটি “তামাক দোকান, টোবাকনিস্ট শপ, টোবাকনিস্ট” দেখেছে, সম্ভবত সরঞ্জামের ছাদ এবং আমার পিছনে অংশগুলির একটি অংশের কারণে। যাইহোক, একটি ফাঁকা প্রাচীরের বিরুদ্ধে দাঁড়িয়ে এটি একটি স্যুইটশার্ট দেখেছে, এটি একটি টি শার্ট দেখেছিল, এটি মুছে ফেলছে, এটি কেবলমাত্র আমার বেয়ার উপরের ধোঁয়া এবং মাথাটি দেখে থাকা সত্ত্বেও “স্নান ট্রাঙ্কগুলি সাঁতার কাটছে”। (আমি আপনাকে ছবিটিকে ছেড়ে দেব।)

Imagenet নমুনা সেলফোন ইমেজ

Imagenet নমুনা কফি মগ ইমেজ

নিউইয়র্ক নেটওয়ার্কটি ২01২ সালের বৃহৎ চাক্ষুষ স্বীকৃতি চ্যালেঞ্জের সংস্করণ নামে একটি ডেটাসেটে প্রশিক্ষিত হয়। ডেটাসেটটি 1000 শ্রেণিতে বিভক্ত চিত্রগুলির একটি বিশাল সংগ্রহের মধ্যে রয়েছে, প্রতিটি শ্রেণির একটি নির্দিষ্ট বস্তুর চিত্র সহ প্রতিটি শ্রেণিতে বিভক্ত। আপনি সেল ফোন ক্লাস থেকে এই ছোট নমুনা থেকে দেখতে পারেন, কিছু ফোন ইমেজ একটু তারিখ। যাইহোক, কফি mugs যেমন বস্তু সময়ের সাথে পরিবর্তন না।

কিন্তু যে সকলকে মজার থেকে খেলেছিল এমন সকলকে থামাতে পারল না, প্রথমবারের মতো এটি পরীক্ষা করার চারপাশে হাঁটতে, যেমন প্রথমবারের মত একটি জাদু wand ফাইন্ডিং এবং এটি প্রায়টি দেখতে পারে তা দেখতে চারপাশে waving।

তুমি যা করতে পার তাই কি উত্তম?

আচ্ছা, প্রথম বন্ধ, প্রতিটি স্বীকৃতি একটি রাস্পবেরী পাই 3 এর উপর প্রায় 10 সেকেন্ড সময় লাগে তাই হয় যেগুলি স্পিড আপ বা দ্রুত প্রসেসর ব্যবহার করতে হবে, বিশেষত একটি CUDA-Enabled NVIDIA GPU এর সাথে একটি কারণ বর্তমানে GPU TENSORFlow এর একমাত্র প্রকার সমর্থন করে।

ইনজেকশন নিউরাল নেট শুধুমাত্র এটি প্রশিক্ষিত তথ্য হিসাবে ভাল হিসাবে। সেল ফোনগুলি স্বীকৃতি দেওয়ার বিষয়ে আমি যে ত্রুটিটি উল্লেখ করেছি সেগুলি এবং জনগণের ইমেজেনেট ডেটাসেটের সাথে সমস্যা হয়। মাত্র 3.46% সময়টি তার 5 টি সেরা অনুমানের সমস্ত 5 টি ভুল, যেখানে মানুষ একই পরীক্ষা করছেন তাদের 5 টি সেরা অনুমান 5% এর মধ্যে ভুল। খারাপ না.

আমরা অদ্ভুত স্টাফ সম্পর্কে আমাদের সংক্ষিপ্ত প্রবন্ধে নই, নিউইয়র্ক নেটওয়ার্কগুলি আজ, দীর্ঘ স্বল্পমেয়াদী মেমরি (এলএসটিএম) নিউরাল নেটওয়ার্কগুলি ভিডিওর একক ফ্রেমে যা দেখে তা পরীক্ষা করে দেখাতে পারে, যখন ভিডিওটিতে আগে এসেছে। উদাহরণস্বরূপ, এটি আরও অনেক আস্থা রয়েছে যে এটি একটি ঝুড়ি বলের পরিবর্তে একটি সৈকত বল দেখেছে যদি পূর্ববর্তী দৃশ্যটি একটি সৈকত পার্টির ছিল। যে সূচনা থেকে উদ্ভূত স্নায়বিক নেটওয়ার্ক থেকে আলাদা হয় কেবলমাত্র আপনি যা ছবিটি দেখাতে চান তা কেবলমাত্র।

এই আমাদের কোথায় পেতে পারি?

মানব-মত দক্ষতার সাথে ব্যাপক সহায়ক এআইকে উন্নত বস্তু স্বীকৃতি ফলাফল হবে? চোখের বিবর্তন প্রায়ই 541 মিলিয়ন বছর আগে ক্যামব্রিয়ান বিস্ফোরণ নামে পরিচিত জীবনযাত্রায় বিস্ফোরণের একটি প্রধান কারণ হিসাবে উল্লেখ করা হয়, যদিও সেই কারণটি সম্পর্কে অনেক যুক্তি রয়েছে।

যদিও সেই চোখগুলি বিকাশ হলে, ইতিমধ্যে তাদের ব্যবহার করার জন্য মস্তিষ্কের কিছু ফর্ম ছিল। যে মস্তিষ্ক ইতিমধ্যে স্পর্শ, কম্পন এবং গন্ধ এর ইন্দ্রিয় পরিচালিত। তাই একা উন্নত বস্তু স্বীকৃতি একটি বিপ্লব সৃষ্টি করবে না। মানুষের মত দক্ষতা জন্য আমাদের AIs আরো আরো বুদ্ধিমত্তা প্রয়োজন হবে। আমরা বর্তমানে আমাদের জন্য যা দরকার তা কেবলমাত্র বিট এবং ধারণাগুলির টুকরা রয়েছে।

কি অনেক একমত যে আমাদের এআই ভবিষ্যদ্বাণী করতে হবে যাতে এটি পরিকল্পনা করতে পারে। এর জন্য এটি পৃথিবীর একটি অভ্যন্তরীণ মডেল বা বোঝার জন্য, সেই পূর্বাভাসের জন্য ভিত্তি হিসাবে ব্যবহার করতে পারে। একটি তারের জন্য একটি soldering পরামর্শ প্রয়োগ করার মানব দক্ষতার জন্য, একটি অভ্যন্তরীণ মডেল পরামর্শটি তৈরি করার সময় কী ঘটবে এবং তার উপর ভিত্তি করে পরিকল্পনাটি ঘটবে তা পূর্বাভাস করবে। যখন পরামর্শটি তারের সাথে যোগাযোগ করে, তবে যদি তা ভবিষ্যদ্বাণী করে না তবে এআই প্রতিক্রিয়া হবে।

জেনারেট্যাটিভ অ্যাডভেটরিয়াল নেটওয়ার্কগুলির সাথে ফেসবুক থেকে সাম্প্রতিক কাজটি এখানে একটি প্রারম্ভিক বিন্দুতে ইঙ্গিত হতে পারে যা এমন একটি মডেল এবং ভবিষ্যদ্বাণীমূলক ক্ষমতা ধারণ করে (যদি আপনি Gans এর সাথে পরিচিত না হন তবে আমরা আপনাকে আবার আমাদের সংক্ষিপ্ত নিবন্ধটি নিউরাল নেটওয়ার্কগুলি সম্পর্কে আমাদের সংক্ষিপ্ত নিবন্ধে উল্লেখ করি আজকে কর)। নামটির “জেনারেটেন্ট” অংশটি বোঝায় যে তারা চিত্র তৈরি করে। কিন্তু আরো বিশেষভাবে, এটি গভীরভাবে সংকীর্ণ গৃহবধূ, অর্থাত্ তারা যে মূর্তিগুলিতে প্রশিক্ষিত হয়েছে তার মধ্যে তারা যা দেখেছে তার বোঝার অন্তর্ভুক্ত রয়েছে। উদাহরণস্বরূপ, তারা জানালা, দরজা এবং টিভি এবং যেখানে তারা কক্ষগুলিতে যায় সে সম্পর্কে তারা জানে।

ADGL ভিডিও পূর্বাভাস
পূর্বাভাস তৈরি সম্পর্কে কি? ফেসবুকের অনেক বেশি কাজ ভিডিও প্রজন্মের সাথে জড়িত। ADVERVERAIARIAL GREDIENT পার্থক্য হ্রাসের পূর্বাভাসগুলি ব্যবহার করে তারা একটি ভিডিওর পরবর্তী দুটি ফ্রেমগুলি কী হতে পারে তা পূর্বাভাস দেয়। একটি বিলিয়ার্ডস গেমের ছবিতে আপনি গ্রাউন দেখতে পারেনডি সত্য, আমি সত্যিই কি ঘটেছে, এবং AGDL নেটওয়ার্ক পূর্বাভাস কি। এটা ভবিষ্যতে খুব দূরে নয় কিন্তু এটি একটি শুরু।

মানুষের মতো দক্ষতার সাথে এক সাদাসিধা বস্তুর স্বীকৃতির পথে তাদের মধ্যে অন্তত ছোট পদক্ষেপ রয়েছে।

বন্ধ

কোথায় আপনি প্রবর্তন নিউরাল নেটওয়ার্ক আগে বস্তু স্বীকৃতি দেখেছেন? আমরা তার গ্যারেজ / কর্মশালায় বস্তুগুলিকে চিনতে একটি আরসি গাড়ীতে এটি ব্যবহার করে [লুকাস বার্ড্ড] আচ্ছাদিত করেছি।

যদিও এটি [সবাইকে ব্যবহার করার জন্য মজার হয়ে গেছে, যেমনটি আপনি এর জন্য অন্য কোনটি ব্যবহার করতে পারেন? আপনি কি সহায়ক অ্যাপ্লিকেশন মনে করতে পারেন? কি যোগ করা যেতে পারে? নীচের মতামত আমাদের জানতে দিন.

Leave a Reply

Your email address will not be published. Required fields are marked *