Grassland Weed detector

I’m not sure what the best way to go in regards to real time sensing or a delayed approach to give the machine time to process the images. I was thinking about stopping the machine for each picture to try and prevent shaking in the images as most farmland is bumpy. Then I though about one of those gimbals that DJI do to stabilise images on drones and even motorbikes/handhelds? Not sure if that would stop motion blur with sharp movements. Do the pics need to be sharp? Could the images be blurred as part of the dataset? I think this might effect accuracy?

If the machine was large with solar panels I think it could take it’s time and stop for each picture. If it’s small and light with just batteries maybe it could spray in real time coming back to home for charging up. In my application taking days to spray a 30 acres field would be just fine.

Today I tested the solenoids I purchased off eBay. The solenoids run on 12v and have standard tap fittings which can connect to standard 13mm irrigation pipe. The nozzle bodies are also designed for 13 internal bore pipe so it’s nice and standardized all the way back to the pump. I have 8 off these in total to spread over a 3m boom. For relay control I went with one of these.

@Gavztheouch I think we could add Gaussian blur (a simple type of blurring techinique) to the data samples, and see how much blur affects the accuracy. Or, we could see what the pictures are like that come from the machine.

EDIT: Instead of writing a new post, I thought I would just add to this one. I am working on building a classifier using the fastai library for your samples. Running into some troubles, but just touching base to let you know I am working on it.

@Gavztheouch: Found the problem, and worked with the data. I was able to get 94.29% accuracy on your validation set. Will clean up the notebook and post it online.

Wow that’s prob genuinely the best broadleaf dock detector in the world. :slight_smile:

I think the validation set is quite small which might cause issues when trying to validate your model with any accuracy. I have added quite a few new examples recently but yet to reupload to kaggle, when I reupload I can afford to add lots more to the validation set.

I have found that this year creeping buttercups have also been quite an issue. The same chemical is also used to remove them so it might be valuable to add them to the model. Maybe next year…

Another feature that might be cool is the ability to add new pictures to the dataset automatically. I’m not sure how you would go about doing that, but I would imagine you could run thousands of pics back through the model and classify them, any pics with a high confidence score could be duplicated into the correct folder. I initially though this would be a good idea to help bulk out the pics of broadleaf docks as each image of the field once broken down into smaller pics typically contains more grass pics than dock pics. If I automatically sort them I can afford to throw out some pics of grass as I did not spend time classifying then myself.


I had a feeling the validation set was small (kept getting a few of the same distinct scores when training). Bulking up more of the dataset would be ideal.

Regarding the Buttercups: This is no problem for the algorithm, and we can even use ideas and techniques from Kaggle to help us as there has been a competition on invasive species detection already.

Regarding automatic additions: Totally agree on how you would do this.

As for your build, are you going to open source the build instructions (part list, CAD files, etc.)?

The plan was to use Fusion 360 for the CAD and post all files on GitHub or similar. Fusion 360 is free to use for hobby projects and is an excellent program. Im keen to be involved in a project like this where a team works together to collaborate on a design. My background is prototype building and product design engineering (Now hay/grass farming).

I have a decent workshop with mig welders, cnc routers/mills, lathes, plasma cutters etc.

Glad to hear the designs will be open-sourced. That’s something I am keen to work on.

Also, when you get the time, it would be great if you could upload the remaining data.

Finally, we should think about setting up a Slack channel or some such, to talk about the project.

Hi, guys!

I’m also very interested in this project. Moreover, I’ve started to collect my own pictures from the ‘land’. Maybe we can change with each other and check our validity and also possibility of transfer learning.

1 Like

Hi all,

so I finally finished the benchmark classifier using the fastai library. I have reached a decent accuracy score of 96.7%, and an ROC score of 0.975. I have uploaded the details to github.

Feel free to critique it and offer suggestions to improve upon it.


Hi just to let everyone know I have updated the kaggle dataset there are now over 1000 dock images and about 3000 not dock images in the training set.

The validation set had been greatly increased so hopefully much more fun to try and hit higher accuracys knowing it means something. Each class has at least 130 images.

Kodiaklabs I had a quick look at your notebook and it looks great. I will try and study it tonight and see if I can fill follow along, maybe try running it on Google colab with the updated dataset if that is possible.

1 Like

Some fantastic work going on here, Im also a farmer similar to Gavin, Im also a mechanical engineer, know a bit of electrical too, and used to program with Matlab a long time ago now, I am based in Ireland.

where do people recommend I get started trying to figure out what is going on, has anyone any recommendations.

This is the project I have dreamed of building.

I guess as a newbie to this, how is it all intended to work, where does the raspberry pie fit in

Hi Aidank, glad to hear there are more people with the same idea to work on this area. I think the first step is to try and hack something together. Find out what works and what doesn’t.

I have about a month of work left with my current project then I’m going to try and spend at least 2 days a week putting some prototypes together.

This flying drone is pretty cool. Purpose built to spray crops. If it could recharge itself with battery and liquids it would be an amazing tool.

Another drone this time from DJI in China I know these guys will make a very nice product. Quite amazing how fast things are moving

Quite an interesting paper !


Quick update.

I have pieced together a chassis to prototype with. Trying not to get too bogged down with making it perfect and instead trying to learn what works first. Gone for one wheel drive that is also the wheel that steers. Next job will be to get the motor mounted and figure out a quick way to get an potentiometer on the steering for measuring steering angle.


fair play, good to see things taking shape.

question- would it not be easier mount the camera on the front of the tractor and a conventional sprayer at the back and then get into the software development.

really cool prototype… from 3rd year PhD student who also have being doing weed detection using deep learning. I am now doing exchange study in computer vision lab at Nottingham.

1 Like