Grassland Weed detector

(Gavin Armstrong) #42

@aidank A bolt on attachment to a tractor would be easier but Im excited about having a low powered device that I can leave in a field for hours on end guided using only GPS and a laptop.

@jerevon Thanks, how is your project going? Do you have a machine in the fields yet?

(Gavin Armstrong) #43

Deleted video

(Junfeng) #44

it’s going well, we try to shrink deep neural model to speed up prediction. we currently do not have machine in the fields as developing software is our priority.

(Gavin Armstrong) #45

Sounds interesting it’s a great practical problem to be tackling now. If you ever need a rover to mount you software and cameras let me know. :yum:

(Junfeng) #46

that’s really cool. Thanks.

(Gavin Armstrong) #47

Ok things are starting to move along here and the prototype test rig is now just about finished. I am now about to start the programming side of things. Its winter here so I am thinking I can set up a test course inside one of the farm sheds as the fields have sheep on them now and no weeds. I have a space with a nice concrete floor I can scatter some bright objects on the floor like some yellow rubber ducks or painted blocks of wood and build a classifier to detect them against the concrete floor. I’m hoping that the bright colour contrast will mean the ducks will be accurately and easily detected.

Im new to coding so my first challenge is sending data to the Arduino from Python in the form of an array to switch off and on the spray heads. If anyone wants to help please do :slight_smile: I will post what I have on a Github account.


(Gavin Armstrong) #48

Sprayer boom, spray heads and hoses fitted, starting to look like it might be useful.

Each sprayer has its own 12v relay to control the flow of water. I can use python to send a command over the serial port to an Arduino which can turn them on and off using a standard 8 piece relay board you can buy off Ebay, etc.

Now that I have the Arduino serial bridge between python and the real world (spray heads). I need to find a way to run the CNN on a laptop, give me classifications on each section of the field image and then store it in an array. I hope to then pass this array/string of classifications which would look something like a string of 1’s and 0’s to the Arduino. The Arduino would then use the encoder on the wheel to work out where it is in relation to the image it just took and turn the relays off and on when needed. Once its worked its way over the first image it will send a signal back to python to take another image and the process begins again.

The nice thing about the electric motor is the rover can stop and take a break between images to think about its next move and crunch some numbers. Long term this is a slow way to go about things but for prototyping its definitely makes it more achievable in terms of getting a nice sharp image from the camera and classifying weeds on a laptop.

(RobG) #49

I saw this today and thought of your project

(Gavin Armstrong) #50

Docknet v1. I trained a neural network to identify broadleaved docks in grass backgrounds/fields.

A python loop chops the original image into squares of 256 x 256 pixels, a neural network identifies if the image square contains a dock or not dock. Python then inverts the image block colours if it sees a dock. The squares are then stitched back together to form the output. The inverted blocks stand out so we can see where the weeds are. A toy example that shows the effectiveness of neural network for weed identification.

I used fastai on google colab to train and then downloaded the exported pickle file to run the model on my laptop cpu. Fastai has made something difficult so easy. Things are moving so quickly in this field.