IBMz Datathon

image

It was a IBMz datathon project. So we have worked on the linuxOne tool to accomplish our project in Jupiter Notebook. And we thanks Shooting Stars for the wonderful oppurtunity to our us. Ref: https://developer.ibm.com/components/ibm-linuxone/

Vedio Submission

https://www.canva.com/design/DAFNHetUpm8/uvhIUYgaeJ4hncM0Vx11ow/view

Inspiration

In the next 25 years, the world population is expected to increase by 1.5 billion people (United Nations, n.d.), with a corresponding increase in food demand. Moreover, it was estimated that 10% of the world population suffered from hunger in 2020 (Relief Web, 2021), an increase from 8.4% in 2019. This demonstrates a booming demand for food, which isn’t being met properly.

Climate change is one of the biggest factors that has further intensified the challenge for food security. It is estimated that food production must increase by 60% to meet the food demand by 2050 (United Nations, 2021).

With this backdrop, this project focuses on the following UN Sustainable Development Goal (“UN SDG”): Goal 2: Zero Hunger - End hunger, achieve food security and improved nutrition and promote sustainable agriculture.

By leveraging on datasets from and outside Amazon Sustainability Data Initiative (ASDI), a dashboard is created to help enhance farmers' agriculture knowledge, which will lead to higher crop yield. The tool also indirectly addresses other UN SDGs:

Arming farming community with knowledge to enhance crop yield, helping populations take steps towards food security (Goal 2: Zero Hunger) Increasing income from enhanced crop yields for rural farming communities that typically have little access to information to make farming more efficient (Goal 1: No Poverty) Tailoring the solution for the Tamilnadu continent. India is amongst the worst hit by climate change (Adepoju, 2021), with 346 million people facing severe food insecurity, a 20% increase from 2021 (Mersie, 2022). Farmtech helps to indirectly address various inequalities such as income and food availability (Goal 10: Reduced Inequalities)

What Farm-Tech does

Farmtech is a tool that is fully available online via desktop or a mobile phone, developed on Streamlit. The key features of the tool are:

To recommend users with optimal crops to plant based on the forecasts of weather and soil conditions over the next few months, as well as user’s target objectives, which include profitability, ease of planting, and least modifications to conditions To provide users with practical tips on achieving optimal conditions for enhanced crop yields Ultimately, the tool aims to help users understand the existing conditions of their land, educate them on optimal conditions for various crops, and give them practical tips to achieve these optimal conditions. This should help to enhance crop yields in the Tamilnadu agriculture community and hopefully alleviate hunger in the region.

Location Selector: On the Settings page, the user is able to navigate and click on their desired location from the map on the left. The selected location is then reflected on the map on the right.

How we built Farm-Tech

Data Extraction and Transformation: We utilised Streamlit to create the Farmtech application. Starting from the settings page, we developed with user experience in mind by reflecting the exact address of their selected location by leveraging the Nominatim Reverse Geocoding open source API for converting the latitude and longitude coordinates into a human readable address. The user is also able to toggle the land size by adjusting the vicinity from that point.

Moving on to the dashboard, the user’s selections are then retrieved from Streamlit’s session state object. From there, the relevant environment and weather data is queried from ASDI and external datasets.

For the iSDAsoil data, the datasets’ S3 links are retrieved from the catalog, before opening with rasterio. Each dataset is then queried and transformed using pyproj and NumPy. As for the geospatial data, the coordinates are retrieved with the help of rasterio and pyproj, then searched through with our breadth-first search algorithm, joining various polygons together with Shapely.

With that, the user will be able to see the following soil properties distribution across the plot selected: Total Nitrogen, Soil Potassium, Soil pH and the Percentage of Land for each FCC constraint. To better illustrate the distribution of the soil properties on the selected plot, users can select their property of interest i.e “Total Nitrogen” from the dropdown and the map will refresh to show in a choropleth map, along with the distribution of the selected property on the map.

Farmtech will also analyze the Fertility Capability Classification (FCC) framework from iSDAsoil’s data and will categorize constraints into “modifiable” and “unmodifiable” constraints, classified based on our qualitative research. Modifiable constraints can be mitigated, for example, with the use of added nutrients or fertilizer. Unmodifiable constraints are constraints which relate more to the environment, for example, high erosion risk, which cannot be easily changed or altered.

Upon classification of the FCC constraints, the percentage of growable land of the selected plot (without any modifications) will be provided. Additionally, the percentage of growable land of the selected plot (with modifications) will be provided so users can evaluate the viability of using that selected plot of land. These KPIs are calculated using Pandas, by counting the number of 30x30 m plots within the selected plot that have no FCC constraints. Farmtech will also return the distribution of FCC constraints in the selected plot, for example, 60% of the selected plot has steep slopes, thus making that area unsuitable for agriculture. This distribution is calculated by finding the percentage of the number of 30x30m plots that have each constraint. Based on the FCC constraints identified, Farmtech will return the suggested modifications that users can implement to improve the environment.

Weather Forecasting: Onto the forecasting, weather conditions such as temperature and rainfall level are crucial for farming decisions. Hence, in order to provide the user with useful insights on the forecasted rainfall levels and temperature for the next year, we leveraged on the Prophet package to perform time-series forecasting. Prophet is a forecasting algorithm developed by Meta based on an additive model that takes into account yearly, weekly and daily seasonality.

Prophet models were developed for each of the 54 countries to generate forecasted monthly temperature and rainfall levels for the year of 2023. The Jupyter notebook used to build these models can be found in the notebooks folder.

These forecasted values were exported into csv files to be utilized in Farmtech. Based on the user’s location selection, Farmtech is able to extract the relevant country-level information from the predictions and display them as interactive line charts for the user to view and explore. The yearly average rainfall and temperature is also compared against the ideal weather conditions for each crop as part of the crop recommendation algorithm.

Crop Recommender: For each of the features (potassium, phosphorus, pH, rainfall and temperature), we calculated the average of each property for the selected plot. Based on the calculated value, we compare it to the data on the ideal conditions for the crop to grow. If the calculated average falls within the range of the ideal conditions of the crop, we add the crop along with the following details to the table. Otherwise, we will check if the feature is too high or too low compared to the optimal range for crop growth.

Crop suitability shows the features where soil conditions were met, and adjustments proposes changes on the controllable features where users can make to the soil to improve the conditions. The table is sorted based on ease of growing the crops (number of suitable features) on the selected plot of land.

Recommended Stores to Purchase Farming Supplies: Based on the country of the selected plot of land, Farmtech returns the list of recommended places to purchase farming supplies. These places are researched and handpicked by the team.

Desirability, Feasibility, and Viability Desirability, feasibility, and viability is the holy trinity for innovation. Ideas should preferably consider and meet the 3 criteria to ensure their longevity and relevancy:

Desirability: One that target users really needs Feasibility: One that your organization’s capabilities are capable of supporting Viability: A profitable and sustainable business model The following summarizes the considerations for each of the criteria, some of which have been mentioned throughout the report:

Desirability:

India is amongst the worst hit by food insecurity, and the information provided by Farmtech could help educate the Tamilnadu farming community to enhance their crop yields The Tamilnadu agriculture sector is one of the least efficient, and having more access to information could help them in becoming more efficient For lower income countries, a larger portion of their income is spent on food. The rising food prices further challenges food security for them. Improved crop yields from using Farmtech could help to keep food prices low for the Tamilnadu community Tamilnadu governments, agricultural ministries, and international aid groups could use the tool to better understand existing and ideal conditions, and provide necessary support to the farmers

Feasibility:

Datasets are accessible from reliable sources such as AWS, Kaggle, FAO, etc. Most of the relevant data sets are kept updated, hence Farmtech can still remain relevant with time The team consists of data scientists, a CX designer, and 2 product managers, who have the relevant skill sets to develop Farmtech Farmtech is accessible on a desktop or mobile phone with access to the internet. No additional equipment (e.g. sensors to get condition information) is required by the users

Viability:

The current data sets used are open source, and no costs are required data source wise As the product expands to include other regions and features, additional free data sources from AWS, Kaggle, United Nations, FAO, etc, can be leveraged on. This keeps the cost zero for data sources

Challenges we ran into

Selecting and Dissecting the ASDI Datasets: There were many datasets available for this hackathon, and the first major hurdle was to analyze all of them, and pick out the relevant ones for our problem statement. Furthermore, extra effort was taken to analyze datasets with formats that the team was not familiar with. Understanding the datasets with the right context is also vital, so as to be able to translate them into actionable and reasonable insights.

Converting Data into Comparable Units: To be able to compare data in the same manner, conversion into a common unit was required. For example, some data was in parts per million, while others were in kg/ha. However, once the initial conversion was discovered and done, subsequent handling was seamless.

Accomplishments that we're proud of

1.Building a solution that can potentially solve a huge global problem, that is also in line with the UN SDGs 2.Reducing the granular geospatial data by merging plots of 30x30m together to improve dashboard performance 3.Understanding more about the physical and environmental constraints on crop farming, and turning other qualitative and quantitative data into insights

What we learned

  1. Geospatial analysis - transforming and converting geospatial data across various formats and data types; for instance, we have to understand the format the iSDAsoil data is stored before extracting and back transforming to the right units
  2. Transforming shapes using Shapely - various plots of land were merged together for faster app performance, but the logic can be complex as various criteria have to be put into consideration (e.g. polygon with holes)
  3. Graph algorithm - coding out the breadth-first search algorithm to merge various 30x30m plots when they are side by side and having the same values
  4. Reverse geocoding with Nominatim - to further personalize the recommendations and joining with weather data, we utilized an open source API, Nominatim, to convert the latitude and longitude into human-readable addresses
  5. Time series forecasting with Prophet - putting ourselves in the shoes of the users, they will use Farmtech for crop planning which predicted weather data will be useful

What's next for FARM-TECH

Farmtech is built with scalability in mind. It can be scaled up in several ways, and most times, the limiting factor is the availability of relevant data.

Expanding Target Region Outside India: As long as relevant datasets for other regions are available, the tool can be expanded to cater to those regions as well. An accompanying feature could be having Farmtech available in different languages as well.

Increasing Number of Variables for Crop Recommendations: Currently, only a few variables are considered in the recommendation of crops. These are:

Temperature Rainfall pH Potassium Phosphorus This could definitely be expanded to include more variables to be considered. We could also further personalize the recommendations from the user’s input such as optimizing for profitability or ease of planting.

Increasing Number of Recommended Crops Currently, the following crops are included in Farmtech:

Maize Lentil Rice Kidney beans Plantain Coffee This can definitely be expanded to include more crops to be recommended.

Provide Forecast on Harvest Yield and Potential Revenue: A future enhancement would be to layer an optimization engine to provide a forecast on yields based on selected crops. This will enable users to make calculated decisions on their crop choice based on multiple factors such as time, quantity, probability and revenue of yield.

Validating Desirability with Users: Primary research could be conducted with the target users that are highlighted in the “Target users” section, to validate user pain points and needs. This could help to refine the proposition and features of Farmtech.

Validating Assumptions with Experts: Several assumptions and generalization were made in the creation of Farmtech, for scoping and knowledge limitation purposes. The accuracy and feasibility of the tool could be improved via primary research with experts in relevant areas, including farming, soil conditions, etc.

Built With

Share this project:

Updates