Weed detection in crops using aerial vehicle and machine learning technique
Agriculture is the largest sector, covering 47.03% of land area of Pakistan and almost 45% of workforce engaged within this sector. Improper management, use of old techniques and technology leads to decrease in crop yield. Weeds growth among crops has great impact on yield. Proper monitoring and man
2025-06-28 16:36:46 - Adil Khan
Weed detection in crops using aerial vehicle and machine learning technique
Project Area of Specialization Electrical/Electronic EngineeringProject SummaryAgriculture is the largest sector, covering 47.03% of land area of Pakistan and almost 45% of workforce engaged within this sector. Improper management, use of old techniques and technology leads to decrease in crop yield. Weeds growth among crops has great impact on yield. Proper monitoring and management of crops will help in improving crop productivity and efficient use of resources. The main objective of our project is to build an autonomous hexa-copter that will be used for detection and removal of weeds among crops using image processing and machine learning technique, which will help in improving crops health. The execution of algorithms is in Python language for efficient and faster processing. The hardware integration of various components are as shown in Fig. 1.

Fig. 1: Layout of project
Project Objectives- Real-time weeds detection in a crop using Machine Learning.
- Hexa-copter with Camera Interface and Laser Weed cutter.
- Autonomous operation
- Weed removal.
Hardware: A hex-copter drone is being designed and tested for flight over a crop field area. After the deployment next step is to set the GPS coordinates of field in code and its execution in RPI terminal. The hexa-copter will start its autonomous operation, flying above crops. On detection of weed, the flight will stop for some time and perform removal operation.
Software: The programming section contains algorithm for weed classification and detection using Python language. Softwares used in project are as follows:
- Raspbian RPI terminal
- Arduino Integrated development Environment (IDE)
- Anaconda Navigator and Python Programming
The machine learning section contains weeds dataset containing images of various weeds under consideration. Different libraries are used such as OpenCV, Drone-kit for implementation of project. In Removal section, a suitable laser is used. The general implementation of project can be visualized through the block diagram as shown in Fig. 2.
Fig. 2 Hardware and software interface
Proposed Algorithm

Fig. 3: Flowchart of Proposed Algorithm

Fig 4: Weed Removal Process
Benefits of the Project- Time efficient.
- Autonomous operation.
- Weed detection and removal.
- Increase in yield.
- Easy deployment.
Laptop and Raspberry pi are connected through Wi-Fi channel without need of Internet. Now the RPI terminal with compiler shows up in laptop, which enables control of Raspberry. Raspberry and Arduino are connected to each other through serial communication. Arduino sends PWM signals to Hexa-copter received by APM flight controller. Outputs of APM controls ESCs which is connected to Motors. On receiving signals from APM the ESC turns the motor ON and Hexa-copter starts flying. Last step is the image processing which starts when drone starts flying autonomously above the crops. After recognizing its target, the Hexa-copter will stop for moment and turn the laser on to burn out weed.
Final Deliverable of the Project Hardware SystemCore Industry AgricultureOther IndustriesCore Technology Artificial Intelligence(AI)Other Technologies OthersSustainable Development Goals Decent Work and Economic Growth, Industry, Innovation and InfrastructureRequired Resources| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 70000 | |||
| Carbon fiber Hexa-copter frame. | Equipment | 1 | 15500 | 15500 |
| Lipo battery. | Equipment | 1 | 3500 | 3500 |
| Imax charger | Equipment | 1 | 2500 | 2500 |
| Raspberry pi 3b+ | Equipment | 1 | 6000 | 6000 |
| APM 2.8 flight controller | Equipment | 1 | 4000 | 4000 |
| Laser diode green | Equipment | 1 | 1100 | 1100 |
| Laser diode blue 5 Watt | Equipment | 1 | 8000 | 8000 |
| Raspberry Pi cam 5 MP | Equipment | 1 | 750 | 750 |
| Raspberry Pi IR camera | Equipment | 1 | 4000 | 4000 |
| Propellers pack | Equipment | 8 | 200 | 1600 |
| BLDC 1000 KV Motors | Equipment | 8 | 800 | 6400 |
| GPS module | Equipment | 1 | 3500 | 3500 |
| GPS stand | Equipment | 1 | 600 | 600 |
| Electronic speed controllers | Equipment | 6 | 750 | 4500 |
| Power bank | Equipment | 1 | 750 | 750 |
| T plugs | Equipment | 12 | 50 | 600 |
| Arduino nano | Equipment | 1 | 400 | 400 |
| MPU6050 Gyroscope | Equipment | 1 | 200 | 200 |
| Logic converter | Equipment | 1 | 250 | 250 |
| N Channel MOSFET | Equipment | 4 | 40 | 160 |
| Telemetry module | Equipment | 1 | 4000 | 4000 |
| Servos metal gear | Equipment | 2 | 750 | 1500 |
| Screwdriver set | Equipment | 1 | 190 | 190 |