How compatible are Indian farms to Deep Learning?

Shubham Chitnis
Feb 26 · 4 min read

Ever since I started exploring this vast field of Machine Learning, I’ve been fascinated by the various applications of these solutions in different domains, be it health, security, or agriculture. But whenever I came across such interesting applications, one thing that would bother me was how little of those were directed to or would be applicable in the Indian market. Consider self-driving cars as an example, something like that to be successfully developed for Indian roads is indeed a herculean task.

Now let’s focus on the agricultural sector in India. Traditional farming methods have always been pre-dominant with very little implementation of automation as compared to many western countries. ML has a lot of potential here and would certainly revolutionize this field but we still don’t see a lot of examples where such techniques were successfully adopted. I often used to think to myself, what are we doing wrong? Is there an issue with data gathering? Are the Indian companies not as supportive of these approaches?

Working as a Data Science intern at Carnot Technologies gave me an opportunity to answer some of these queries. The task was to accurately detect farm patches using satellite images. Now a typical choice would be to train a binary image segmentation deep learning model which classifies each pixel of the image into whether it is a farm patch or not. Here comes the first hurdle, getting appropriate data. We had to make sure that the plots on which we train our model are not very different from the farm patches of the clients. But a comprehensive segmentation data on Indian farms was not available, reason being that a typical Indian agricultural plot is not regular. There is a wide range of sizes, shapes, and textures. Also, a farm might be lush green or barren based upon whether the crops were harvested or not. Now to train a segmentation model this robust doesn’t seem very plausible unless we have rich data. We did some experiments using a public dataset but the results weren’t satisfactory.

Example patches on which the image segmentation model was trained. As you can see patch boundaries are distinctly visible to the naked eye
Results of our model on the above patches (Here white pixels denote farm area). The model is quite successful in excluding the areas with buildings in them (rightmost pic) but got confused with the green part in the bottom right part of the leftmost image

Let us briefly look at how deep learning models function and how is this relevant to the issue at hand. We feed satellite images of 256x256 resolution in our U-net model network and the image goes through multiple non-linear transformations to give us the output. When we train our model on various images, we teach it which features of the image are necessary and which ones should be ignored. These features can range from anything as simple as horizontal or vertical edges to complex or abstract patterns.

Improved UNet architecture. Conv is a convolutional layer (convolution kernel is 3 × 3 and padding is 1), BN is batch normalization, Relu is the activation layer, Maxpool is the maximum pooling layer, UpConv is the transposed convolution. Source mentioned in references below.

Now if our test data is diverse in the sense that the features aren’t as concrete, our model might find it difficult to confidently make deductions which is exactly what was happening in our case.

These are some of the client patches. As it can be seen, individual plots are harder to distinguish as the borders are not very clearly demarcated
This results in poor predictions as our model confuses these plots as one big unit (leftmost image). Also, green farms lead to bad output in some cases as the model thinks that these are some densely scattered trees (this can be seen in the middle image)

Nevertheless, we ended up tackling this problem by using a hybrid pipeline that was based upon but not only composed of the deep learning elements. The approach used would be further explained by my co-intern in a different article. I finally got clarity as to why the pace of advancements in AI is not as quick as some western countries. However, the silver lining of this is that if we build models robust enough to work in Indian markets, they are bound to do good on cleaner and more standard data. Thus, Indian markets add further challenges to the problem statement, making it even more exciting.

References and Further Reading

[2] U-Net: Convolutional Networks for Biomedical Image Segmentation

[3] UNet architecture image taken from here

Enjoyed this article? Then be on the lookout for another two weeks later. Till then, for any data-related discussions, feel free to drop us a line at datalabs@carnot.co.in. And don’t forget to follow Data Kisaan on Medium.

Data Kisaan

Ploughing the truth

Data Kisaan

The external world’s window to Carnot DataLabs, which aims to modernize the agricultural ecosystem in India by using data-driven insights to impact tractor sales, marketing and financing.

Shubham Chitnis

Written by

Undergraduate @ Indian Institute of Technology, Bombay

Data Kisaan

The external world’s window to Carnot DataLabs, which aims to modernize the agricultural ecosystem in India by using data-driven insights to impact tractor sales, marketing and financing.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store