Artificial intelligence for crop prediction
Online Master. First Edition. 2021 Crop yields are not exempt from suffering from the multiple harmful effects for which climate change is responsible. Extreme weather is more common now than it was centuries ago,…
A learning project shared by the community. The article documents its team, methods and results; it does not establish that the prototype is ready for real-world use.

This archive includes automatic translations. Audio, video and text inside images remain in their original language.
Production trend from 1940 to 2020
Máster Online. First Edition. 2021
Crop yields are not exempt from suffering the multiple harmful effects for which climate change is responsible. Extreme weather is more common now than it was centuries ago, which is why droughts, floods, high and low temperatures, among others, require modeling such behavior.
The initial hypothesis of the project focused on the prediction of harvests over a region within Spain. After making sure of the little information about the harvests that is currently available and the non-existent standardization in the data format, it was decided to choose Illinois as the location for our project.
To put the project in context, it is essential to first know several aspects about the state of Illinois: This state is characterized by its generally uneven terrain, and by its unstable climate as well as by several climate catastrophes that have occurred in recent years. Agriculture is an important source of income for Illinois, especially corn and soybean production.
It can be seen in the graph shown that the yield of corn production has increased over the years, at the same time we can see that there have been drops in production caused by extreme weather events.
This very particular context of the production trend in Illinois helped us understand that carrying out a project based on the understanding and categorization of the data as well as the subsequent treatment of the same with a prediction model would result in the possibility of predicting the distribution of production in Illinois in the future and with this we could help the entire territory to prevent and counteract low production peaks caused by climatic catastrophes or other climatic factors.
Project steps
To achieve the prediction of crop yields, we have prioritized the most optimal data cleaning and management. The two main historical data series with which we have worked have been: the temperature at 2m from the ground and the EVI Vegetation Index. The next step to analyze the yield time series is to isolate the random component, applying regular differentiation to obtain a new series, with one less data than the original, in which the trend has been eliminated.
The next step is the alignment of the samples since the temperature and vegetation index samples were not carried out on the same day. To align both information captures we interpolate the EVI series in this way we generate a new set of captures so that both series coincide.
After carrying out all these steps, essential to be able to create the prediction model, we have managed to have the data now clean to proceed with it. At this point we have explored several linear models (LinearRegression, Lasso, Ridge) and the result has not been what we expected since we have encountered a lot of overfitting. In the end we have selected a RandomForestRegressor because we considered that it was the most appropriate model for this case, finally for the selection of the hyperparameters we use the RandomizedSearchCV.
Conclusion
This project is a starting point for monitoring, evolving and improving the production performance of corn crops in Illinois. We are pleased to have found some interesting insights from the data sets provided: a relationship between crop yield and time, temperature and EVI value.
As a result of the predictive model, we can observe that a model error (variance) is independent of the magnitude of the production and that the greater the production, the less noticeable the model's prediction error is. According to this result we understand that by adding more variables such as precipitation, composition of the terrain, degree of frost or climatic catastrophes we could achieve a lower percentage of error.


As a point of improvement of the project we could highlight the optimization in the interpolation calculation to improve the code processing speed. It is an example that with optimal data and variables, useful prediction models can be developed for geographically equivalent locations.
Finally, we would like to thank Saturdays AI for giving us the opportunity to do this project and meet other people involved in the field of AI, as well as test our skills in ML and expand our horizons on new topics previously unknown to us.
Members
- Paco Murcia
- Luis Muñoz
- Fernando Romera
- Marta Mateu
Project presentation: DemoDay
More Artificial Intelligence!
The mission of Saturdays.ai is to make artificial intelligence more accessible (#ai4all) through intensive courses and programs where projects for good are carried out (#ai4good).
If you want to learn more about artificial intelligence join our community at community.saturdays.ai or visit us on our website www.saturdays.ai Join us!
A history of the Saturdays.AI community. Originally published on March 9, 2022.
← More community stories


