Grassland Weed detector


(Gavin Armstrong) #1

Hi I’m looking to train a weed detector to detect specific weeds I would like to spray in my grassland fields. Im a hay farmer and the alternative is to hand spray the weeds over hundreds of acres or spray large ares with a tractor mounted sprayer. Both options are time consuming and the tractor uses significantly more chemical. I have a video of what I have managed so far using Tensorflow.

I retrained this Tensorflow model starting from the ssd_mobilenet_v1_coco_11_06_2017. My training data was pictures I have taken myself of the actual weeds in the actual field I am planning to test the machine on.

I used a tutorial by sentdex on youtube and I was surprised I got it working at all. (cpu training on a iMac)

My problem is the model does not train well I am struggling to get the total loss below 2. I plan to watch the fast ai tutorials and try and improve my detection.

Things I am thinking about.

  1. Choosing a different model to retrain that might transfer to grass field weeds detection better.
  2. Training for much longer I am at about 5000k steps
  3. My bonding boxes take in too much of the grass in the back ground and no enough just weed? Could I use segmentation to only capture the weeds??

If anyone wants to join the project I am calling it opensprayer.com and the end goal is too build a autonomous grassland sprayer for a total materials build cost of £2000. Hopefully we will soon see some small boards in the future like Arduino that can run neural nets cheaply and fast. Other than the cost of the compute I think this may be possible. I would like to see some practical ai projects that don’t cost the world but still do useful work and act on the physical world.

Ideally I would not be training the model but instead maybe just building the hardware and collecting the data. In the meantime I am keen to learn about training the best model I can

Thanks Gavin


(Alex Ragalie) #2

Great idea @Gavztheouch! I would love to help, as much as my beginner-level skills allow…

Do you already have a github for the code?


(Alexandre Cadrin-Chênevert) #3

You could find something useful from the Kernel or the Discussion tabs from this Kaggle competition:

@jamesrequa won this competition and he shared his code here:
https://www.kaggle.com/jamesrequa/keras-k-fold-inception-v3-1st-place-lb-0-99770

IMO, higher resolution was very important to get optimal performance in this competition and probably for your problem.


(Gavin Armstrong) #4

@aragalie it would be great to have your skills on board. I have made a GitHub at www.GitHub.com/opensprayer I have no files uploaded so far I will upload the image dataset if that is possible (200mb)? This would be the first time I have used GitHub.

@alexandrecc this looks great I was trying to find something similar like this. Taking high quality images for the high res will be one of the main challenges as the vehicle moves over bumpy ground.


(Alex Ragalie) #5

@Gavztheouch no worries, same here :slight_smile: google it and i’m sure you’ll figure it out quickly. You could also use dropbox and put the link to it in the readme file…

On the topic of high-res photos: I assume you’ve already considered buying a drone with a high-end camera and using that to survey the plot in high-res? Is it a cost issue or are there other challenges you see in using this method to get the photos?


(Gavin Armstrong) #6

@aragalie Thats a method I have seen being used to great effect. Infact even a basic DJI Phantom 4 can produce great images from height, there is a youtube video of someone doing that for grain crop monitoring. I don’t see why it could not be used as you said to gather data. The only problems I can see would be battery life (Maybe not in near future) and mapping the coordinates of the weed location to match the gps coordinates on the land drone.

By mounting the compute and cameras on the land drone you simplify the location problem, but you got me thinking about the drone as in theory if you had a preplanned spray map made using drone images you could really ramp up the speed of the sprayer drone without worrying about bumps in the field.

Maybe you could tether an air drone to a land drone with a power cable to combine the best of both worlds. :slight_smile:

I have made a gaggle database. IF anyone wants to try and make a detector but finds my pictures are no good please let me know what would work better and I can try and get some more.

Thanks