Multi-criteria Agriculture Recommendation System using Machine Learning for Crop and Fertilizesrs Prediction.

Agriculture plays an essential role in the economies of developing countries such as India and contributes significantly to the gross domestic product (GDP). The escalation in population has led to an upsurge in food demand. Numerous challenges such as the selection of crops, fertilizers, and pesticides without considering the various parameters like types of soil, water requirement, temperature conditions, and profitability analysis of crops for a particular region may lead to degradation in the quality of crop, yield and profitability. With the advancement of Computational technologies, researchers are working on recommending crops according to soil condition, water requirement, and market profitability along with fertilizers recommendation, disease identification, and pesticide recommendation. Through this research, we propose a machine learning-based crop and fertilizer recommendation algorithm called AgriRec. We have utilized soil properties, water level, farm size, and minimum support price of crop and design a machine learning model which predicts crops for different seasons. Further, we propose another mechanism that processes the properties/ details of soil, crop, and fertilizer to envisage a combination of fertilizer(s) for a given pair of soil and crop. Our algorithm is tested for 5000 land samples of Gujarat region with 24 different crop and it successfully recommends crops with 95.85% accuracy and fertilizer with 92.11% accuracy with 4 times better performance as compared to existing benchmark recommendation approaches.


Introduction
Agriculture is the backbone of every countries economy. Traditionally, farmers learn from experiences and feedback from other farmers, but often they are unable to grow crops successfully and can lead to a loss of income. In order to fulfill the food needs of any country, we need to change the conventional way of farming, which does not tell exactly what the soil properties are, what the exact water requirement for is given crop, how much profit they can earn from the crops and which crops and fertilizers are best suited to the given land. 1 Technology is just like a breakthrough in agricultural research and development. Various technologies such as digital image processing, machine learning, deep learning and big data are very useful in agricultural research. 2 Nowadays, we have various types of data collection and analysis techniques available such as digital image processing, recommendation systems and machine learning algorithms. 3,4 There is indeed a broad application of recommendation system technology like e-commerce, health care, movie recommendation, etc. 3 Also, Machine learning is a computational technology that generates a model that can learn on its own and use the model to predict new things. 5,6 Machine learning is rapidly evolving technology and could be implemented year by year in a range of applications, such as medicine, 7,8 e-commerce, 4 robotics and automation, 9 agriculture, 6 climatology, 10 etc. Machine Learning can able to increase the efficiency and accuracy of recommendation systems. Digital Image Processing is a technique which can capture, regenerate and interpret agricultural data such as images of land, crops to identify various crop diseases, measure soil minerals, calculate total area covered by crops etc. 11 With the availability of these technologies; the growth of the agriculture sector could be improved by recommending suitable crops, fertilizers and pesticides. 6 Before 20 th century, very few studies were performed on the use of technology in agriculture. With the advent of technology such as data mining, big data and machine learning, many researchers have started working in agriculture to solve current problems. 1,6 the implementation of modern technologies will help to manage large data efficiently and process that data in order to optimize crop yield, to identify / specify crops and recommends fertilizers. 1 From our study, we have identified three major problems in conventional agriculture: 1) Problem in the selection of suitable crops which maximize the yield and profit; 2) Problem in the selection of fertilizer based on crop and soil conditions, with its exact proportions; 3) Problem in the identification of crop diseases and prescription for its treatment.
Many researchers are working on issues related to conventional agriculture systems and are developing algorithms. Selecting the most appropriate crop for a given land depends on various factors/criteria such as soil conditions, weather, climate conditions, availability of water, land area, market demand etc. Authors are predicts corn crop yield using a neural network and also evaluate the effect of climate change on crop yield. 12 Recommending crops to farmers based on market analysis using an apriori algorithm is presented. 13 Another demand-based algorithm using a logistic regression technique is proposed. 14 Improving crop productivity using various classifiers such as support vector machine (SVM), decision tree and logistic regression given. 15 In our study, we have found that most of the researchers are focusing on soil properties and types to recommend crops. However, There are other variables too that we need to remember like soil type, soil properties, water and temperature need, land area, market value of crop when forecasting crop yields for a given land in order to increase crop productivity.
Moreover, all the nutrients that we consume from food come from the soil of the land. To grow healthy crops, we ensure that all necessary minerals are available in the soil. Sometime the soil quality may compromise due to a variety of reasons and we need to apply minerals externally to the soil in the form of fertilizers. The selection of suitable fertilizers depends on the soil condition and the crop to be cultivated. Researchers developed a classification-based algorithm that analyses soil fertility and recommends soil-based fertilizers. 16 Further, the job of farming is very difficult and there is a need for continuous monitoring of plant growth because there could be some organisms (pests and diseases) that can degrade crop growth. Different crops have different types of pests and diseases. Daily treatment of crops is required to protect crops from diseases and pests. Authors suggest crop treatment by identifying disease and measuring the similarity between the disease and the treatment provided for it. 17 Classification techniques such as support vector machine (SVM), decision tree and logistic regression are used to classify pests in crops and to propose treatment solutions. 16 The researchers built a simple ontological approach to the detection and treatment of pests in crops. 18 Support vector machine (SVM) to classify diseases and to propose solution is given. 19 Despite of all these contribution given by various researchers, there may still be a need for some more advanced mechanism(s) to automate the farming process and support farmers by reducing their efforts, growing crop yields and maximizing their profit by using multiple criteria for crop recommendation. From above survey, one may observe that the techniques of machine learning, deep learning, and digital image processing have not been effectively utilized to predict fertilizer and pesticides. Machine learning has made significant progress in various areas of life, and agriculture is no exception. It has revolutionized farming by providing intelligent recommendations for efficient use of resources while improving crop yield. Hence, in our research we are developing agriculture recommendation system using machine learning. Objective of our system is to improve crop yield, improve quality of crops, utilize less resource and increase farmer's profit. In our previous research we had developed crop recommendation algorithm and land recommendation algorithm using soil properties. 20 And by continuing our research in field of crop recommendation through this research paper, we are proposing a novel machine learning based recommendation approach called AgriRec, in which we have proposed the idea of automating the farming process by recommending a crop for both seasons (kharif (autumn) and rabi (spring)) along with the necessary fertilizers with their proportions based on multi-criteria. For that we have utilized type of soil, soil properties, water condition and crop water requirement, land area and market value of crop using machine learning base recommendation systems. In the next section, we're discussing our AgriRec algorithm with all its components and a detailed explanation of each of them.

Agrirec Algorithm
Technology is constantly being modified and the implementation of advanced technology in major sectors of the economy is a milestone for all research. We have built a machine learning based recommendation system algorithm named AgriRec that will automate the process of crop and fertilizer selection. AgriRec algorithm comprises two parts: 1) Multi-criteria based Crop Recommendation System (multi-criteria CRS), 2) Fertilizer Recommendation System (FRS). In our proposed algorithm, we have included multiple criteria which can impact quality and quantity of crops. Such criteria are soil properties such as soil types, pH, electrical conductivity (EC), organic carbon (OC), nitrogen (N), phosphorous (P), Sulphur (S), zinc (Zn), boron (B), iron (Fe), manganese (Mn) and copper (Cu), soil type, land area, water level, market value of crop for generating crop and fertilizer recommendation. We have obtained soil type and soil property, land area information from the Indian Government Soil Health Card website (https:/soilhealth.dac. gov.in/). Information about market value of crops called minimum support price (MSP) are obtained from government of India farmers' portal (https:// farmer.gov.in/mspstatements.aspx). The thorough description of each parameter is given in Table 1.
The sample soil health card is shown in Table 2 and  Table 3, which provides descriptions of the owner of the land with the size of the farm and the current values of the soil type, and soil properties. We have utilized these data for our multi-criteria based crop recommendation system (multi-criteria CRS). The crop recommendation system algorithm (Phase 1 of AgriRec) discussed here is the extension of our crop recommendation system (CRS) algorithm which we has been proposed in our paper entitled as "A state-of-the-art survey on recommendation system and prospective extensions". 20 CRS is the crop recommendation algorithm that utilized soil properties to recommend crops. Along with soil properties, Multi-criteria CRS includes land area, minimum support price and water level parameters given as per Table 1.  The entire block diagram of AgriRec Algorithm is shown in Fig 1. This includes the multi-criteria Crop Recommendation System (multi-criteria CRS) and the Fertilizer Recommendation System (FRS). In our AgriRec algorithm we have considered land size in hector and crop yield in quintal. We calculate the profit in Indian rupee. In phase 1 of AgriRec algorithm, we recommend the list of crops along with expected profit for both seasons kharif(autumn) and rabi(spring) based on existing land properties, soil types, land area, water level and MSP specified in Table 1. In the second part, we recommend the combination of fertilizers with proportion per hectare based on crop and soil quality. The input of our algorithm are three matrices: 1) Land Matrix 2) Crop Property Matrix and 3) Fertilizer Matrix, which we collected from Government of India websites as stated above and explained in Table  1

Table 3: Land property detail
In the Multi-Criteria Crop Recommendation System (multi-criteria CRS) phase, we have developed a ranking based machine learning algorithm using multiple parameters such as soil type, soil property, land area, water level, MSP. We have utilized land properties, water level of the region and required crop properties to generate ranking of crops for both seasons (spring and autumn). To calculate profit, we have considered the area of the farm and minimum support price of crop. The detail description of the Multi-Criteria CRS algorithm is given in Table 4. PATEL & PATEL, Curr. Agri. Res., Vol. 11(1) 137-149 (2023)

Fig. 1: Block Diagram of AgriRec
In the second phase of AgriRec, Fertilizer Recommendation System (FRS), all the three matrices discussed earlier are used. Output of this phase is combination of fertilizers along with proportions for given land L and recommended crop C. Algorithm finds deficit properties for given land to cultivate recommended crops using Equation % Deficit for L i =(avg(prc u -pr cl )-pr li )/avg(prc u -prc l ) ×100 .

..(1)
After calculating a list of deficit properties for land L, we have created an FRS model and trained the model using Fertilizer Matrix to find top-N fertilizers which are having match content percentage of given properties. After finding a combination of fertilizers our model will calculate the quantity of each fertilizer. The detail of the FRS algorithm is given in Table 5. In the next section, we will elaborate results and discussion.

Results and Discussion
We have implemented our AgriRec algorithm in R-Programming. R programming is non-structured statistical programming language can perform large-scale computing efficiently. The datasets that we have used here contains 5000 land samples collected from different region of Gujarat, India. As Part of our research single criteria soil property based crop recommendation system (CRS) with experimental study has already discussed in our previous paper. 20 Our AgriRec algorithm successfully recommends a list of Top-N crops for kharif(autumn) and rabi(spring) season with its expected profit and a combination of fertilizers including their quantity. Table 6 shows sample list of recommended top-3 Crops for kharif (autumn) season and top-3 crops for rabi (spring) season with profit for two sample Land.
Here, its survey number as shown below identifies each Land. From the result obtained in Table 6, we can say that crop yield and profit are dependent on soil types, soil properties of land, water level, land area and MSP. For different size of land with same parameter value profit obtain for the same crop is also different. Selection of appropriate crop to maximize yield and profit not only depends on the soil property and soil types but, it is also depends on area of cultivation as well as current market value of crop.

Table 5: Fertilizer recommendation system
Second phase of our algorithm called FRS; recommend a combination of fertilizers with proportion for each land. Table 7 shows the result of our Fertilizer Recommendation (FRS) method. From the output we can conclude that our algorithm successfully recommends list of crops with combination of fertilizers with its proportion per hector of land in order to maximize crop yield and increase the profit of farmers. Use of fertilizer is depending on farm size and crop to be cultivated. Different farm size with same crop may have different proportion of fertilizers.   Figure 2, Figure  3, Figure 4 and Table 8 Respectively. Standard deviation calculates the amount of percentage results of our method deviates from actual results. From the standard deviation graph in Figure 2, we can conclude that our AgriRec system deviates 4.3% for multi-criteria CRS and 6% for FRS as compared to actual data. Similarly, we have also evaluated our methods using standard error parameters, which measure error rate multi-criteria CRS and FRS algorithms. Graph of standard error is shown in Figure 3 from which we can conclude that our AgriRec system gives error 4.15% for multi-criteria CRS and error 7.89% for FRS. Graph of accuracy is also shown in Figure 4. Henceforth, AgriRec algorithm successfully recommends crops and fertilizers for given Land with accuracy of 95.85% for multi-criteria CRS and 92.11% for FRS algorithm which shows considerable improvements over benchmark algorithms Along with the accuracy of AgriRec, we have also checked the performance of our system with increasing sample size. For that, we have measured execution time by increasing the sample size. We have measured the performance of our ranking base machine learning multi-criteria crop recommendation system (multi-criteria CRS) with increasing sample size and compared it with crop recommendation without machine learning. From Figure 5, we have noticed that without machine learning and with the increasing size of sample land, execution time also increases. But with a machine learning model, an increase in a sample size of land can achieve some amount of parallelism. Therefore, the execution of our multi-criteria CRS machine learning-based crop recommendation system cannot depend on sample size. Similarly, we have measured performance of our fertilizer recommendation system (FRS) with sample size explained earlier and selected crop for cultivation for both the cases with our machine learning based FRS and without it. As per the graph shown in Figure 6, we have found that with increasing the sample size will tend to increase processing time for fertilizer recommendation without our FRS machine learning model. When we apply our machine learning based FRS algorithm time required to recommend fertilizers has been reduced.
In most of the cases, increasing size of data always leads to reduction in performance of algorithm and increase computational time. Despite that, from the above results we can say that our AgriRec algorithm performs much better compared to traditional way of recommending crops and fertilizers.

Conclusion and Future Perspective
Machine learning has vast potential to revolutionize the agriculture sector. Crop recommendation systems can help farmers to optimize crop yield, minimize waste, and reduce resource usage. Many recent research which we have discussed in our introduction section shows improvements in current agriculture sector by adopting machine learning technology. However, adoption still presents several challenges. The availability and quality of data, cost, and technical skills are obstacles that need to be addressed for widespread adoption. Hence, through this research, we allows farmers to increase crop yields and in turn, income. It also benefits the ety by enhancing the country's economy. Through this research, we automate the process of crop selection and fertilization for farming. Our Machine Learning recommendation system viz. AgriRec is capable of recommending crops and fertilizers for individual soil with a high accuracy of 95.85% to recommend crops and 92.11% to recommend fertilizers. Moreover, the algorithm outperforms in terms of execution time with an average of 4 times faster compared to traditional crops and fertilizer recommendation methods. Hence, we conclude that our algorithm achieve recognizable improvements as compared to other benchmark algorithms for recommending crops and fertilizers. Also, we have succeed in some way to automate the farming process. For that, we acknowledge the government of India to make soil health card data, which we have utilized during our research. Despite the success of machine learning in crop recommendation systems, very few studies have been conducted on diseases identification in recommended crops and suggesting pest control techniques for predicted crops along with fertilizers. Therefore, in future we wish to work on third phase of our system which is pest control prediction.