AI Powered Bull**** Detector
by 8BitsAndAByte in Circuits > Raspberry Pi
3062 Views, 20 Favorites, 0 Comments
AI Powered Bull**** Detector
![01.png](/proxy/?url=https://content.instructables.com/FT7/PNH5/K6E4NDT5/FT7PNH5K6E4NDT5.png&filename=01.png)
The one device we all need, an AI Powered Bull**** Detector!
Supplies
- Raspberry Pi
- NeoPixel Ring
- 3D Printer
- TinkerCAD
- Pi Camera
- AIY Kit
- Google Dialogflow
- Python
- Raspian
- Remo.tv
Project Video
![AI Powered Bullsh!t Detector](/proxy/?url=https://content.instructables.com/FS9/5143/K6E4NEMO/FS95143K6E4NEMO.jpg&filename=AI Powered Bullsh!t Detector)
3D Printing
![05.png](/proxy/?url=https://content.instructables.com/F2S/K309/K6E4NDYQ/F2SK309K6E4NDYQ.png&filename=05.png)
![04.png](/proxy/?url=https://content.instructables.com/FGG/0299/K6E4NDYN/FGG0299K6E4NDYN.png&filename=04.png)
![03.png](/proxy/?url=https://content.instructables.com/FAM/WSA0/K6E4NDYH/FAMWSA0K6E4NDYH.png&filename=03.png)
![06.png](/proxy/?url=https://content.instructables.com/FZ4/RIE6/K6E4NE0Y/FZ4RIE6K6E4NE0Y.png&filename=06.png)
![07.png](/proxy/?url=https://content.instructables.com/FWY/RCMD/K6E4NE13/FWYRCMDK6E4NE13.png&filename=07.png)
First things first, we need a container. In this case we chose to 3D print a nice colorful one. You can also use something else, as long as all the electronics fit.
Happy with our box, we can 3D print a poop emoji made by 3DCreatorPurzi. All we have to do is add a hollow space in the bottom to hold our NeoPixel ring.
All the model files are attached.
Electronics
![08.png](/proxy/?url=https://content.instructables.com/F88/YH51/K6E4NEDY/F88YH51K6E4NEDY.png&filename=08.png)
![09.png](/proxy/?url=https://content.instructables.com/FEY/J1SQ/K6E4NEDZ/FEYJ1SQK6E4NEDZ.png&filename=09.png)
![10.png](/proxy/?url=https://content.instructables.com/FCN/LK2Y/K6E4NEFY/FCNLK2YK6E4NEFY.png&filename=10.png)
![12.png](/proxy/?url=https://content.instructables.com/FQ2/RBV2/K6E4NEG0/FQ2RBV2K6E4NEG0.png&filename=12.png)
It all starts with a Raspberry Pi 3B+.
Because we want to use Speech-To-Text we also have to add an AIY VoiceHat and the corresponding microphone. It's all documented right here.
Last but not least, we wire up the NeoPixel ring, here's a great tutorial for just that.
With everything set up we can test out the Speech-To-Text and NeoPixel ring, the test code is attached.
Downloads
Training the AI - Dialogflow
![dialogChart.png](/proxy/?url=https://content.instructables.com/FS0/R81I/K6G6TLJ1/FS0R81IK6G6TLJ1.png&filename=dialogChart.png)
![13.png](/proxy/?url=https://content.instructables.com/F99/4R7A/K6E4NEQY/F994R7AK6E4NEQY.png&filename=13.png)
![14.png](/proxy/?url=https://content.instructables.com/FVP/SRU6/K6E4NER1/FVPSRU6K6E4NER1.png&filename=14.png)
For our AI we are going to use Dialogflow. Originally, it's meant to be used as chatbot software, we can slightly misuse it to train our bull**** detector.
We create two intents, one is our fallback, and the other bull****. Next we add all the content in the training phrases of our bull**** intent. You can really go nuts here.
After saving, our bot will be training to detect bull**** based on the given training phrases. Once done, we can use a bit of python code to connect to our freshly trained AI.
The data flow is as followed:
- The microphone picks up someone speaking and records it.
- This file is sent to the Google Cloud and transformed into text.
- The generated text is sent back to the Raspberry Pi.
- This text is then sent to Dialogflow.
- Dialogflow tries to match the text with the content from our bull**** intent, and depending on the result it will either send back the bull**** intent or the default fallback one.
- On our Pi we check the name of the intent, and if it's 'Default Fallback Intent' we tell the lights to flash green, meaning no bull***. Otherwise we flash red, indicating bull****.
The full code is attached.
Downloads
Remo.tv
![16.jpg](/proxy/?url=https://content.instructables.com/FNQ/5G9D/K6E4NERS/FNQ5G9DK6E4NERS.jpg&filename=16.jpg)
![21.png](/proxy/?url=https://content.instructables.com/FXM/V40Z/K6G6TMCX/FXMV40ZK6G6TMCX.png&filename=21.png)
![15.png](/proxy/?url=https://content.instructables.com/FUB/X4P8/K6E4NERO/FUBX4P8K6E4NERO.png&filename=15.png)
We can't keep something so powerful all to ourselves! So, we are going to make our detector available for everybody. To make this happen we are going to use Remo.tv, a robot streaming platform. All we need to do is attach a Pi Camera and follow their setup instructions.
Once Remo.tv is set up, we will write our own chat handler. Instead of using Speech-To-Text we directly send the chat messages we receive on Remo.tv to Dialogflow. The rest of the logic remains the same. Just add a note in the background to tell visitors what they are looking at, and we're all done.
Downloads
Result!
![20.png](/proxy/?url=https://content.instructables.com/FZO/UL25/K6E4NET1/FZOUL25K6E4NET1.png&filename=20.png)
![19.png](/proxy/?url=https://content.instructables.com/F08/S6AO/K6E4NET0/F08S6AOK6E4NET0.png&filename=19.png)
![18.png](/proxy/?url=https://content.instructables.com/FTG/8WZG/K6E4NESX/FTG8WZGK6E4NESX.png&filename=18.png)
![17.png](/proxy/?url=https://content.instructables.com/FDA/XNXM/K6E4NESS/FDAXNXMK6E4NESS.png&filename=17.png)
We successfully built a AI powered bull**** detector, which can learn from new input!
You can try it out yourself right here.
Now, where can we collect our nobel peace prize?