feature article
Subscribe Now

Special Recognition

A Neural Network for Embedded Systems

“OK people, can I have your attention please? I need you all to listen up. All right. Quiet… Now… I want you all to get in a line along that wall there. We’re going to be doing some recognition stuff this morning, so get in line and we’ll get you trained up on what you need to look for. We may not need all of you, but I need you here just in case. And if we need more than you guys, we may have to add another group of youse in another room. We’ll see. Mac, you’re up first, so be ready. Sue you’re on deck after him. The rest of you, just watch when the guy in front of you gets his or her assignment, cuz that means you’re next.

“So, here’s what’s gonna happen. First we’re gonna get trained. I’m gonna put a picture up here with some measurements, and I’m gonna tell you what the thing is. If one of you can already pick it out, then we’re good. But if no one has it, then we need to give that as an assignment to whoever’s next in line. We’re gonna be looking at pets, OK? You know, dogs, cats, rats, fish, stuff like that. Actually, we’re gonna be looking at different breeds of dogs, but I’ll get to that in a minute.

“Here are the things you’re gonna look for – hey, quiet over there, pay attention, this is important. OK, you’re gonna look at the length of the pet, its height, what kind of covering it has, the way its tail works, and whether or not it has legs. For the length measurements, whatever measurement you get as your target, don’t just look for that number exactly, but look for anything within 24” of that, OK? If that causes confusion we may need to cut it down later, but you should never cut it down to less than 6” away from your main target number. I’ll explain it more as we go.

“OK, any questions so far?… No?… All right. Now I’m actually gonna split you into two groups, I really think we have enough of you here, so let’s see… Carol, you and everyone behind you, I need you to move over here to this other wall. You guys are gonna take the items that are identified as dogs, and you’re gonna further refine them into breeds. You’re gonna make your decisions based on the length of fur and the expression on the dog’s face. So when we’re training, any dogs we get, we’ll train you up too. Got it?… Good.

“All right, listen up people, we’re gonna start the training now. You guys at the end of the lines, I know you’re gonna be bored for a bit, but please no talking, or else your noise will screw up those guys getting trained. Thank you. OK, here we go, item number one. This one is 36” long, 24” high, has fur, a wagging tail, and legs; it’s a dog. Mac, that’s you, you got it? Remember, don’t just look for 36” exactly, your length target range is now from 12” to 60”. Good. OK, now for you Carol, you’re first up on the dog breed; the length of the fur on this one is medium, and the expression is a Blissful Drool; this is a Retriever. Got it? Excellent…

“OK, next. Come on, quiet down people. OK. Next up… This pet is 6” long, 1-1/2” high, has scales covering it, has a swishing tail, and no legs; it’s a fish. Anyone have this yet? No? OK, Sue, it’s yours. Got it? OK, next… This is 14” long, 11” high, has fur, a swishing tail, and legs; it’s a cat. Anyone? Yeah, Mac?”

“Well, except for the swishing tail, I’m pretty close to having it, but I’m supposed to look for dogs.”

“OK, so this isn’t a dog, so we need to reinforce the wagging tail thing, and let’s narrow the range of height you’re looking for since you had a much bigger number. This cat is 14” high, so you look for anything bigger than 15”… wait, does that work? Let’s see… that’s 21” away from your target of 36”, so yeah, we can do that since we’re not going closer than 6” away, so your range is now from 15 to 57 inches. And we need somebody new to take the cat, so… who are you? Julie? OK, you got it. Great.

“Next: 12” long, 8” high, fur, wagging tail, legs; dog. Anyone have it? I know, Mac, you’re supposed to have dogs, but this isn’t in your length range anymore, so you don’t got it. Yeah, Julie, it’s in your length range, but it’s a dog, not a cat. OK, so who’s next in line? What’s your name? Jorge? OK, you got the smaller dogs. Julie, be sure to watch the tail type, Jorge, you too.

“All right, this is a bit different… it’s 41” long, 30” high, has fur, wagging tail, and legs. I don’t know what it is, it doesn’t say. But it does say it’s not a dog. Anyone got this? Mac? You got it, and you’ve got dog? OK, that doesn’t work then. We gotta cut you back some more on your length target, to 40” tops, OK?”

[20 minutes later]

“All right, I think we got you guys trained up. We gone through all the training pictures a few times, and it looks like we got no confusion; only one of you responded to each item, and every item got a response. That’s good work, people. But here’s where the real deal comes. Now you’re gonna see some items we don’t know what it is. We need you to figure out what it is based on what you been trained on, okay? You’re probably not gonna see any exact matches to what you already seen, which is why you gotta tell us how close you are to it if you think you got a match. Everybody ready?

“OK, here’s the first item. It’s about 13” long, 4” high, has scales, a swishing tail, no legs. Who has it? Sue? A fish? Anyone else? No? OK, good, we got a positive ID on that one. Next… let’s see, whoa, this is a pet?? It’s 31” long, 13” high, has scales, a swishing tail, and no legs. You again Julie? OK… another fish… flavor of the week… Next: 27” long, 20” high, fur, wagging tail, legs… Mac? A dog? OK; now, Mac, I want you should hand that to the second group over there; for you guys, the fur is long, and the expression is Intelligent Curiosity… almost looks like he’s trying to tell us something. Anyone? Yeah, Carol, I know, it’s happy, so almost a Blissful Drool, you’re close… what about you two? Anything? Let’s see, you got the German Shepherd; this expression isn’t quite Insecure Neurosis… hmmm… seems a stretch… and you? Oh never mind, you got short fur, not to mention Sadistic Baleful Glare, so yeah, pretty much not a pit bull. OK, I guess we’ll go for Retriever. What? [whispering] Hmph… dude here says something about a ‘Collie,’ but we ain’t been told nothin ’bout no Collies, so as far as I’m concerned, it’s a Retriever.

“All right, next, 15” long, 10” high, fur, swishing tail, legs: OK, Julie? Guess it’s a cat. Next. 8” long, 5” high, I think it’s fur, although it’s so short I’m not actually sure. The tail isn’t doing anything, so hard to tell there, and legs, definitely has legs. OK, who has it? Jorge, OK. Wait, Mike, you got it too? Jorge, you got dog, Mike you say rat. You both pretty sure? Yeah? [whispering] OK, mister smarty over here thinks he knows dogs says something about a cheewawa or something, I don’t know what he’s talkin’ about, so we’re just gonna have to leave this one as ‘either a dog or a rat’ since we don’t have a legit way to break the tie.” [sound of activity fades, picture remains]

We wanted to break into our live coverage here to bring any viewers who have just joined us up to speed on what’s going on. You’re listening to a live broadcast of The Pet Detective, riveting reality TV here on the Neural Network. We’ve brought together a bunch of people that know nothing about pets and trained them up on how to recognize some sort of pet. Each one looks for something different, and if he or she sees it, they “fire” to help identify the pets.

Now hopefully only one fires at a time; that gives a solid ID. But sometimes you get more than one. If one is closer than the others, you can pick that one, but sometimes it’s just a draw. It depends somewhat on how they’re trained, both what training patterns they have to look at and how many times they run through the training series. How they decide what to look for can depend on what order the training patterns come in, so to make it robust, they have to keep running through the training drills, refining the training until each pattern causes exactly one person to fire.

After the training, they get to look at images they haven’t seen before, and, based on how similar they are to what they’ve been trained on, they decide whether it’s close enough to call a match, which is when they fire. What’s interesting about this is that, unlike most such complicated decision processes, this one requires no consultation between the people making the decisions. When people all need to work together to share some larger decision, then they’ve got to have some way to communicate with each other and share information, and given how complicated some of the assignments are, that can get pretty messy and bureaucratic to coordinate. Here, each person makes a decision alone, without talking to anyone else. Some kind of tiebreaker or voting may be needed if more than one person fires, but that’s pretty straightforward and doesn’t take that long. As we’ve seen, there are situations when the training hasn’t been sufficient, and you actually end up with an indeterminate answer. So the quality of the training really is critical.

Now apparently Recognetics has placed this kind of “neural” technology on a chip – they call it a “zero-instruction set chip,” because it doesn’t actually execute any instructions; it simply learns and then works. It has 1024 “neurons,” which are the decision-making entities like the folks we’re listening to today. Each neuron has 256 bytes of memory, which is where their learned patterns are stored and which they compare to a test pattern to see if they should fire. Each neuron is associated with a “category” – for example a pet type – and if it fires, it is declaring that the image appears to fall into its category. A neuron can respond with a decision in 10 µs, which Recognetics says is about a hundred times faster than a DSP for solving these kinds of problems.

You can split the neurons into different groups called “contexts,” like they did today, with one context determining a general category (pet type), and then another context refining that decision to a sub-category (the breed of dog). You can also cascade multiple chips to add more neurons if needed. Any “voting” happens in a fixed time on a bus where any firing neurons grab the bus, but then they let go if they determine they’re not closest.

There are a couple ways these can work. One is simply by being trained with non-overlapping fields and associating any observed test point with the closest trained point for an unambiguous category decision. The other way is to use what they call “influence fields,” such as we’ve seen today. When using influence fields, any trained node takes on the biggest influence field it can –matching not just a point, but also a large region around that point, like they did with the pet length. You decide how large that should be (it was 24” for the length of the pet). Then, if there are conflicts during the training (like we saw when a cat came in within the size range of a dog), sometimes that influence field will be cut back, but you can decide how far it can be cut back. Because it’s usually not cut back to nothing (in today’s show, a 6” distance was the minimum), you may end up with overlapping regions – this is where uncertainty comes in, where two categories may both claim ownership with no real way to resolve it.

You can also reduce a field of influence by training with what they call a “Null category” – this is like when they had the image of the thing that wasn’t a dog. It forced Mac to reduce his field of influence, but because they didn’t know what it was (they just knew what it wasn’t), they didn’t need to add anyone else to recognize that pattern. Now if a training point has its influence field reduced to the minimum, then even the training point might end up being overlapped by two categories, in which case it’s determined to be “degenerate” and will contribute more uncertainty to the results.

Once you’ve completed the training, it is possible to save it to some kind of storage so that you can use it over and over again in deployed systems. This means deployed systems don’t have to be trained each time they power up, and they’ll all have the exact same training information.

And while our show today is merely a demonstration, according to Recognetics, this technology is actually being used on fish inspection lines to separate different species of fish in commercial fisheries.

OK, so with that, let’s return to The Pet Detective, live and in progress, here on the Neural Network.

“All right, ready? You’re doing good, folks, hang in there. Here we go with the next one. This one is about 13” long, 9” high, has fur – lots of long, straight fur, a wagging tail, and… well… I can’t really tell if it has legs. Certainly noisy! Let’s see, looks like it doesn’t have legs, or maybe the fur, which seems to be combed very straight down, is covering the legs, I don’t know… OK, who has it? Anyone? No one? Aw jeez, seriously? Look again. [silence] Nobody?”

“Um, excuse me… I’m not actually part of this particular session, but I was part of another session on modes of transportation, and this sort of matches what I had as ‘hovercraft,’ although it’s a bit small.”

“Well thank you very much, but we’re not looking for boats here. [whispering] Oh, Mister Know-it-all here is saying something about a… what? Dorkie?? No, Yorkie… what the heck… Oh, that’s short for… [more whispering] Yorkshire… pudd… no, terrier. Huh, don’t know nothin bout them neither. So this one’s just a “don’t know” as far as I’m concerned. Yorkshire Terrier, huh? I’ll be damned… I wonder if they can swim, or do they just sorta float on top on a cushion of air…”

Leave a Reply

featured blogs
Nov 22, 2024
We're providing every session and keynote from Works With 2024 on-demand. It's the only place wireless IoT developers can access hands-on training for free....
Nov 22, 2024
I just saw a video on YouTube'”it's a few very funny minutes from a show by an engineer who transitioned into being a comedian...

featured video

Introducing FPGAi – Innovations Unlocked by AI-enabled FPGAs

Sponsored by Intel

Altera Innovators Day presentation by Ilya Ganusov showing the advantages of FPGAs for implementing AI-based Systems. See additional videos on AI and other Altera Innovators Day in Altera’s YouTube channel playlists.

Learn more about FPGAs for Artificial Intelligence here

featured paper

Quantized Neural Networks for FPGA Inference

Sponsored by Intel

Implementing a low precision network in FPGA hardware for efficient inferencing provides numerous advantages when it comes to meeting demanding specifications. The increased flexibility allows optimization of throughput, overall power consumption, resource usage, device size, TOPs/watt, and deterministic latency. These are important benefits where scaling and efficiency are inherent requirements of the application.

Click to read more

featured chalk talk

STM32 Security for IoT
Today’s modern embedded systems face a range of security risks that can stem from a variety of different sources including insecure communication protocols, hardware vulnerabilities, and physical tampering. In this episode of Chalk Talk, Amelia Dalton and Thierry Crespo from STMicroelectronics explore the biggest security challenges facing embedded designers today, the benefits of the STM32 Trust platform, and why the STM32Trust TEE Secure Manager is an IoT security game changer.
Aug 20, 2024
39,810 views