Software apps and online services
Making Friends with Arduino 101
This is the third Arduino in my collection of boards, so the unboxing and getting started with Arduino example sketches is now getting familiar. I was pleased with the BLE and accelerometer aspects of Arduino 101. I dowloaded a pdf for the Curie module and skimmed through it and then I saw something to get excited about!
A quote from the curie module pdf:
1.3.6 Pattern matching engine
• Parallel data recognition engine
• 128 parallel arithmetic units (Processing Element or PE) with 8-bit features per PE
• Two pattern matching algorithms:— K nearest neighbors (KNN)— Radial Basis Function (RBF)
• Two distance matching formulas:— Lsup— L1
• Constant recognition time
• Vector data: up to 128 bytes
• Classification status:— ID - identified, only one category matches— UNC - uncertain, more than one category matches— UNK- unknown, no match
• Support for up to 32,768 categories
• Supervised learning
• Save and restore network knowledge
• Three main operations supported:— Recognize a vector— Save the knowledge base from the network— Load the knowledge base to the network
I still had to do some internet searching to find more information about the pattern matching module.
I found this article which had some very useful links.
The most interesting link in the article:
This leads you to a free Arduino library for CurieNeurons. There is a "Pro" version of it for $19, but I will get started with the free version first.
Why Neural Networks?
I will cite a YouTube video, that probably answer the question better than I could any time real soon.
Why Neural Networks and Drones?
So Dr Randal Koene at the very end of the video suggests that we can build drones with help from neural networks.
So what sorts of problems are specially suited to solutions with neural networks?
Autonomous search and rescue drones , finding a clear path.
Simpler Problems for this project
I am going to work on far more simple problem - A Landing Zone Orientation Detector
Not quite as bold as the vision problem mentioned in the link but I need to start on simpler pattern recognition problems.
Get the CurieNeurons Library found at the following link.
Landing Zone Oreintation Detector
The CurieNeurons will be used to detect the orientation of the drone over the landing pad. A complete implementation of this system would take far longer than the contest time period. So this work is a demonstration, or a proof of concept.
The need that motivates this detect the orientation of a drone landing pad is developed in a project proposal regarding the environmental problems caused by hazardous algae blooms (HABs).
The basic idea:
A unique pattern is chosen for the landing pad for the drone. In this demonstration I will use a smiley face. The length of a vector in the CurieNeuron is 128 bytes. So I am compressing the image from a camera to an 11 bit by 11 bit pattern which will be fed to the CurieNeurons for recognition.
In a more complete implementation there would be a whole system dedicated to finding the smiley face in a picture and converting it to the 11 bit by 11 bit pattern, but since that is complicated and also outside of the available development time I am having to skip that part. So I will use manually generated test patterns.
Some of you may be saying , he is skipping all the difficult parts of the system and only showing the CurieNeurons operating in their strength ( doing what they like to do ) . For those having such thoughts, the author salutes you as being wise and astute.
Here the smiley is twisted by 45 degrees. The gray pixels represent uncertain pixels. In the loading of the neuron vector black will be represented by 255. Uncertain pixels will be represented by 128. White pixels will be represented by 0.
I have really simplified things to fit the whole smiley face into the 128 byte CurieNeuron vector, In a more practical example a feature like the smile would be trained into the neurons at various angles. The eyes would be separately trained also. A "map" built up of the recognized much smaller features would be "read" by a higher level program that would determine the spatial orientation of the smiley face.
General Vision has chips with much larger counts of neurons than the Curie SoC which has 128 CurieNeurons . The more you work with the CurieNeurons the projects you design will probably cause you to use the larger chips to build your systems. But for now, we will simplify our design problem as needed to make do with 128 CurieNeurons available to use on Arduino 101.
So the CurieNeurons will be loader with eight patterns representing the smiley face in 8 orientations. Some experiments will be run where noise is injected into the test cases to see how much noise the system can tolerate.
I will load the CurieNeurons vectors by scanning the image left to right, from the top to the bottom of the bitmap. This is arbitrary and the CurieNeurons would work the same regardless of how the bitmap was scanned in.
I will modify one of the CurieNeuron demo programs to use the smiley bitmaps .
Here is output from the program.
Fading the image
The image will be faded on a pixel by pixel basis to gray. 100% fading would make all the pixels gray and stop the recognitions. We will see how much fading can occur before recognition stops.
So the original smiley with no twist can be faded 9% before recognition stops working. A 45 degree twisted smiley can be faded 14% before recognition stops. The really good news in all of this is that no false recognition of wrong orientation smileys occurred. That make a neural network person very happy!
The archives are included for both Arduino Sketches. I have also include the source for the Fading the Image test, so you can look at the source and hopefully see how easy it is to get started with CurieNeurons on the Arduino101. Have fun with the code!