Completing the Self-Driving Car Engineer Nanodegree Program at Udacity, and testing my skills with a real-world application
To apply what I had learned, and to test my knowledge, I chose to develop an AI system for selective spraying; the kind used for pest and weed control in farming.
I am an Automobile Engineer, so this program content was new to me. But I would like to say thanks to the Udacity team: Sebastian Thrun, who is helping to democratise high-end technologies that benefit human beings at large, and project leads David Silver, Ryan Keenan, and Cezanne Camacho, who have designed a course that is simple, and yet includes the most advanced technologies in the autonomous world. They have made it accessible for anyone who wants to enter the AI and Autonomous/Robotics field, without any prior related knowledge required.
I would like to also say thanks to my capstone project partners Anurag Kankanala, Jeremy S. Cohen, Vincent Wiart, and Srikant Mutyala, who worked in sync and collaborated with each other, despite being from different geographic locations and timezones.
I completed the Self-Driving Car Engineer Nanodegree program in April 2018, but I didn’t publish this news at the time, as I was not yet confident about my skills, and about what I learned in the program. So to test my knowledge, I decided to to try and develop an AI system where I could apply what I had learned, and test my knowledge accordingly. I choose to develop an AI system for selective spraying; the kind used for pest and weed control in farming.
AI for Cotton Plant Detection
After some research on neural networks and implementation language, I decided to go with Darknet, as it uses C++, which is faster than Python and good for hardware interface—in my case Raspberry PI 3B+ model. Running a deep learning model on a low-end device like a Raspberry Pi is a challenge when it comes to making it work on a real-life application, due to speed and accuracy constraints.
Below, I would like to share some of the tips which I implemented to overcome these hurdles.
- Use lightweight Distro and uninstall unnecessary programs on your Raspberry Pi.
- Use C++ as your implementation language (Use Darknet NN), Also you can use TensorFlow on Raspberry Pi with quantize weights.
- Optimize open CV. (refer pyimagesearch)
- Darknet optimization for Raspberry Pi processor(ARM) (Use NNPACK)
- Find out time-consuming CONV Layer and tweak model to reduce prediction time.
- Optimize image training to suit your application and number of classes. (Image size, object variation, number of iterations)
- Pursue the best compromise of accuracy and speed.
After all of this optimization and tweaking, I got a very good detection speed (15 FPS) with the required accuracy to use it for a real-life application.
POC for Selective Spraying using Artificial Intelligence
I was not satisfied with what I achieved with the NN implementation on Raspberry PI, but I tried to stretch it further, and decided to make a physical system/machine where I could see the actual working of the neural network and its interface with an electronics/mechanical system. To make POC for selective spraying using NN application with available resources, I dismantled my RO water filter and used parts like pump, tank, pipes, and connectors, as well as some additional other parts that I got online. Please refer below to a list, with links to purchase:
Throughout this program I learned a lot about new technologies in the world of AI. I also explored various methods to optimise networks, as well as interface systems and their implementation on real-life products. For every projects one build, the final result is what matters, so regarding what I achieved with my exercise, I can say that with a bit of fine tuning, we can reduce waste of pesticide/herbicide spray by 80%! This is good news for farmers, as it saves money that would otherwise have to be spent on plant protection, and also it helps to reduce pollution.