Pest Management for Cotton Farming

The CottonAce solution guides smallholder cotton farmers on the optimal time to take preventive action and protect their farm against avoidable crop losses due to pests such as the Pink and American bollworm.


CottonAce is an AI-powered early warning system available through an app on Android smartphones. It helps farmers protect their crops by determining the right time to spray pesticides through immediate, localized advice.

The primary user of our solution is a cotton farmer who has installed pest traps and works closely with farmer welfare programs to manage pest infestations – referred to as a ‘Lead Farmer’.

Lead farmers or extension workers will install the CottonAce app and upload a photo of pests collected in commonly-used pheromone traps to the CottonAce app. The AI algorithm identifies and counts the pests in the photo and determines the level of infestation, based on which a set of actionable advisory is given to the farmer. This information is shared with neighbouring ‘cascade’ farmers, for whom no additional tools, including smartphone, are necessary.

The app works on a simple smartphone, and even works offline in places with low network coverage. It is available in 9 languages (English, Hindi, Marathi, Gujarati, Telugu, Kannada, Tamil, Odia, Punjabi).

“Proud to be a part of the Wadhwani AI team where I can contribute my knowledge and experience from research organisations such as CICR|ICR, to now witnessing the next agricultural revolution through AI-based innovations and solutions that will help reduce crop losses through integrated pest management. This is a step towards realising my dream of working on innovative projects in the space of social impact where technical R&D in agriculture meets sustainable development.”

– Sonali Ghike, Agriculture Expert at Wadhwani AI

Along with the app, a web-based dashboard supports program implementation with a real-time (as well as historical) view on the pest occurrences in monitoring plots as well as the village.

Features of the dashboard

  • Ensure that regular monitoring of plots is being carried out and target farms for follow-ups.
  • Track pest infestations at the village level
  • Geospatial overview of the villages or region helps in analysing the spread pattern of pests.
  • Capture images and inference generated by the AI algorithm.

How we use AI

We use AI to detect and count pests on pheromone traps installed in cotton farms. The AI model first detects whether the image is of the appropriate type and quality through an input validation module, then identifies the type of pest and isolates each pest of that type by creating a bounding box around the pest. The model counts the number of bounding boxes and thus estimates the number of pests on the trap, which in turn is used to decide whether or not the count exceeds the Economic Threshold Limit (ETL), i.e., whether or not pesticide spraying is recommended. Since model inference and recommendation is carried out on a basic smartphone used by the farmer, the model’s memory footprint needs to be small. We therefore also use neural net pruning techniques to compress the model to a small size without significantly reducing accuracy. We continue experimenting with new methods to improve overall accuracy and compression.

Illustration of our machine learning model

In order to build the AI model, we collected training data from the field during four previous sowing seasons. This training data consisted of images of pest traps installed in farms across the country, including Karnataka, Maharashtra, Telangana, Tamil Nadu and Gujarat, later annotated by human expert and crowd annotators to identify and isolate pests of interest on the trap.