Context: The productivity of agriculture is fully depending on the health and nutrient status of the soil. As the global population is increasing, the demand for food is increasing simultaneously. Traditional Farming practices always rely on general recommendation for soil management and crop selections. This may not be sufficient for different soil types and environmental conditions.
Objective: In this paper, we used the concept of the oversampling and under sampling techniques to balance the data. By using Machine Learning techniques, We analysed different types of soil nutrients for crops. We collected data on various attributes, like pH, Potassium(K), Rainfall, humidity, labels (different crops like rice, maize, etc.), temperature, etc. We used various Supervised Learning Algorithms in this project to predict the most efficient crop for different types of soil and environments like Decision Tree, Logistic Regression, SVM, Naive Byes, Random Forest, etc.
Method / Materials: We collected data from different sources and IoT sensors, like soil moisture sensors, pH sensors, temperature sensors, EC (Electrical Conductivity) sensors, nutrient sensors, etc). The collected dataset was converted into a .csv file. Further, we sent these data to the cloud over Wi-Fi. After analysing our data, we found that our dataset was unbalanced. So, we applied many data balancing techniques to balance our data for crop prediction. We have applied under sampling (counter) and oversampling (SMOTE) to our dataset.
Result: We have compared both under sampling and oversampling algorithms. After applying each of the algorithms, we obtained the best accuracy for Gaussian Naïve Bayes, which was 99.77% for crop recommendation and soil nutrient analysis. We estimated the performance metrics for all the classifiers and found that an accuracy of GNB 99.77% in comparison to the others.