Enzyme-aware soil fertility prediction using dual optimization with improved SCSO Authors: Pavithra Mahesh, Rajkumar Soundrapandiyan Published: 2026 ABSTRACT Soil enzyme activity is a key determinant of crop productivity, as it regulates nutrient cycling, organic matter decomposition, and nitrogen transformation. The existing Machine Learning (ML) and Deep Learning (DL) approaches for soil fertility assessment often underutilize biochemical indicators owing to noise, missing data, and complex feature interactions. These models treat Feature Selection (FS) and Hyperparameter Tuning (HPT) as separate process. This limits the overall model performance. Conventional Sand Cat Swarm Optimization (SCO) method suffers from rigid exploration–exploitation transitions and premature convergence. To overcome these limitations, an Improved Sand Cat Swarm Optimization (Improved SCSO) based framework is implemented in this work. The proposed work sequentially performs FS and HPT within a unified optimization process and includes a stochastic escape-from-worst update mechanism. Cosine-modulated search behavior is incorporated in the model to enhance exploration. Exploitation and convergence stability are improved by Time-adaptive best-solution inheritance strategy. Enzyme-related soil attributes were explicitly incorporated into the optimization process, enabling the selection of biologically meaningful features. A correlation-based filtering step was applied to remove redundant features and improve the prediction consistency. The optimized feature subset was evaluated using multiple ML, DL and Hybrid models have also been assessed to understand the predictive performance of proposed framework. The model was evaluated using stratified k-fold cross-validation with Accuracy, Precision, Recall, and F1-score. The experimental results show that the proposed framework consistently outperforms traditional SCO-based methods. Gradient Boost (GB) achieved the highest accuracy of 98.48%, followed by hybrid models such as Decision Tree (DT) + Random Forest (RF) (98.38%) and GB + RF (98.28%) respectively. In addition, a dynamic crop mapping strategy was developed to estimate crop suitability based on predicted fertility levels and enzyme activity, thereby improving its practical application. Overall, the proposed framework improves prediction accuracy and interpretability, providing an effective solution for soil fertility assessment and data-driven crop recommendation. Introduction Soil productivity is essential for sustainable agriculture and environmental conservation, as it directly influences crop yield, nutrient availability, and overall soil quality. In recent years, Machine Learning (ML) and Deep Learning (DL) techniques have been widely applied for soil fertility assessment and prediction. They can also model complex interactions in the soil1–3. Most studies have focused on biological and chemical parameters. However, biochemical factors, such as soil enzyme activity, have not been studied sufficiently. These factors are important for nutrient cycling, organic matter breakdown, and microbial activity4,5. Soil enzyme activity provides important information about biological soil mechanisms and overall ecosystem performance. Enzymes, including urease, dehydrogenase, and phosphatase, are closely linked to nitrogen cycling, carbon transformation, and phosphorus accessibility4. However, integrating enzyme-based attributes into forecasting models is still complex because of high-dimensional data, redundancy, noise, and intricate interrelationships present in soil datasets1,6. Traditional ML and DL models often do not perform well and it’s difficult to understand in biological terms. FS and HPT are important for improving these models. However, many studies handle FS and HPT separately, which can lead to poor results because features and model settings affect each other7–9. Most widely used techniques such as Principal Component Analysis (PCA) and clustering often reduce the interpretability of biological datasets10,11. Metaheuristic optimization techniques are extensively used to handle complex problems by providing flexible and efficient search strategies. Techniques such as Particle Swarm Optimization (PSO), Whale Optimization Algorithm (WOA), Genetic Algorithms (GA), and Sand Cat Swarm Optimization (SCO) have shown good performance in FS and hyperparameter optimization7–9. Enhanced SCO variants exhibit enhanced convergence and solution quality12–15. However, existing SCO methods still face issues such as poor exploration–exploitation balance and premature convergence in high-dimensional spaces12,14. In addition, most SCO-based studies handle FS and parameter optimization separately, whereas enzyme-based soil features are rarely considered in agricultural prediction models16–19. In this study, an advanced framework based on the Improved SCSO was developed to provide a better evaluation of soil fertility. This framework integrates FS and HPT tuning processes through a unified adaptive optimization approach to ensure that both FS and model parameters cooperate optimally. Most existing studies perform FS and HPT independently, which may lead to suboptimal model configurations and increased complexities in computation. In contrast, the proposed framework integrates both processes within a unified Improved SCSO optimization strategy, enabling coordinated adaptation between feature subsets and classifier configurations. This approach differs from traditional SCO-based frameworks by incorporating a cosine-driven method that enhances global search capabilities and helps avoid poor solutions. This study makes another important contribution by explicitly incorporating enzyme-based soil characteristics into the optimization process, which produces biologically relevant patterns that are generally overlooked by traditional approaches. To eliminate redundant variables, a correlation-based redundancy filtering process was incorporated in the proposed study. To evaluate the efficacy of the proposed method, various ML and DL algorithms were considered for experimentation. These include RF, DT, K-Nearest Neighbor (KNN), SVC (Support Vector Classifier), GB, CatBoost, LightGBM, XGBoost, Artificial Neural Network, Convolutional Neural Network (CNN), and Long Short-Term Memory (LSTM) networks. Furthermore, hybrid models have been considered to exploit the complementary advantages offered by various classifiers. In addition, DL architecture were included to provide a broader comparative evaluation of structured soil–enzyme datasets. A comprehensive series of experiments conducted using stratified k-fold cross-validation proved the superiority of the proposed method over existing SCO and baseline methods. To enhance practical applicability, the research introduces a novel approach for dynamically mapping crops. This method integrates predicted soil fertility levels and enzymatic activity to assess crop suitability, effectively bridging the gap between predictive modelling outcomes and real-world agricultural practices. The structure of the paper is divided into four main sections. The first section provides a concise overview of related studies and key findings that have influenced the development of the proposed work, while also outlining its contributions. The second section details the proposed algorithm for predicting crop fertility. The third section focuses on presenting and analysing experimental results. Finally, the discussion and conclusion summarizing the findings and implications of the proposed work are provided in the concluding section. Related work In order to maximise yield, profitability, and sustainability, an efficient crop selection framework seeks to match the right crop to the correct enzyme with fertility levels in the ideal conditions. The framework must incorporate transdisciplinary data, intelligent decision-making models, and stakeholder needs in order to create a reliable and flexible system. The use of enzyme profiles to directly identify crop suitability has not yet been fully established in mainstream agricultural practices, despite the growing recognition of soil enzyme activity as a critical indication of soil health and fertility. Similar to5 and18, direct predictions of crop suitability are rarely given, even when ML is employed to analyze enzyme activities.20 noted that soil characteristics, flora, and terrain all have an impact on microbial communities, which in turn have an impact on enzyme activity. Enzyme profiles are not yet commonly used to assess crop compatibility, though other attempts have been made to use microbial markers to make useful agricultural decisions, such mapping soil fertility or identifying zones using dynamic zone management19. The complete potential of soil enzyme-based decision-support systems is still unknown, despite this being a promising research avenue. Through predictive modeling, classification, and optimisation techniques, ML has become a game-changing tool in modern agriculture, enabling data-driven decision-making. ML is very useful for analysing complex agri-environmental data because of its capacity to represent intricate nonlinear interactions. Applications including agricultural yield prediction, soil fertility classification, nutrient assessment, and microbial dynamics modeling have found it very useful6,21–23.The application of analytical techniques in the agricultural sciences has been enhanced by the development of machine learning. For comprehensive yield prediction, soil categorisation, and nutrient mapping, a number of models are useful, such as RF, SVM, and Neural Networks24–27. For predicting soil organic carbon,24 examined the Support Vector Regressor (SVR), ANN, and RF and discovered that both RF and ensemble models performed better overall. Pejak et al.26 used Sentinel-2 data and ML models to forecast field-scale soybean yields, while12 showed how ML might be used to estimate nutrient status and manage crops on a site-specific basis. The scalability and reproducibility of ML pipelines in agriculture are supported by tools like Scikit-learn28. These evaluations did point out that very few studies have combined fertility indices with soil enzyme dynamics in crop advising systems. The studies presented in16–19 detailed their earlier comparison work on ML performance in fertility classification; however, their interpretability and feature optimisation techniques were simplified. Additionally, it is clear that ML-based advisory systems rarely use dynamic modelling of soil health measures, such as enzyme activity indicators, indicating the need for integrated modeling techniques. In agriculture, at occasions high dimensionality and nonlinear interactions are beyond the capabilities of traditional statistical methods. Metaheuristic algorithms have proven invaluable in solving complicated optimisation problems29. There are many opportunities to investigate the application of metaheuristics30 in agriculture. While31 recognized the efficacy of a hybrid metaheuristic algorithm that combined Atom Search Optimisation and Simulated Annealing to improve FS effectiveness19, looked at how metaheuristic algorithms have been employed to help with land use optimisation. Frameworks for metaheuristic-based multiclass FS were provided by19, which showed that different FS techniques have comparable effects on classification performance. The use of agricultural data in hybrid and adaptable techniques has received more attention in recent research. To assist FS,7 offered an adaptive PSO method with leadership learning. Significant global exploration–exploitation balances were also present in the Sand Cat Swarm Optimisation (SCO) method, as shown by13, which further produced more ideal feature subsets. The convergence time and problem quality were enhanced by the suggested multi-strategy SCO and elite decentralisation SCO15,23. The applicability of metaheuristic algorithms in various sectors has been investigated in a number of studies. The work12 highlighted the Social Cognitive Optimisation (SCO) algorithm’s transferability outside of its initial setting by demonstrating its efficacy in DL-based cybersecurity applications. In agricultural domain14, introduced an inertia-based Cat Swarm Optimization (CSO) method for crop yield prediction. But has not incorporated integration with enzyme-based modelling or a unified soil–crop pipeline. An adaptive PSO approach incorporating leadership learning was proposed by23, significantly improving both the FS and HPT processes. Similarly18, presented a hybrid model combining Atom Search Optimization and Simulated Annealing to enhance the efficiency of FS and hyperparameter configuration. In addition18, provides a comprehensive review of the Whale Optimization Algorithm (WOA) and its various extensions. Notably,9 emphasized that hybrid models integrating FS and HPT tend to outperform traditional models in classification tasks. Although agricultural modelling has been much enhanced by ML and metaheuristic algorithms, there is still little integration of biochemical soil indicators, especially enzyme activity, in optimization-driven crop recommendation systems. Furthermore, the majority of current SCO-based research places a little attention on unified optimisation techniques for soil-crop prediction tasks instead it concentrates on either FS or HPT separately. These drawbacks emphasise the necessity of biologically informed and integrated optimisation frameworks for applications in precision agriculture. Research gaps Despite the advancements in ML-based agricultural modelling, several critical research gaps remain, particularly concerning enzyme activity prediction and optimization pipelines.Limited number of existing ML models consider enzyme activity in crop fertility assessment and suitability.Few studies have used to improve metaheuristic algorithms for enzyme activity classification, and most of the methods treat FS and HPT separately rather than integrating them as a dual optimization strategy within a unified framework.Traditional metaheuristic algorithms still face challenges in FS and HPT owing to rigid exploration–exploitation phase switching and premature convergence issues.Among existing studies a few have implemented hybrid learning approaches, thereby restricting the ability to leverage the complementary strengths of different algorithms and limiting predictive performance and model consistency. Limited number of existing ML models consider enzyme activity in crop fertility assessment and suitability. Limited number of existing ML models consider enzyme activity in crop fertility assessment and suitability. Few studies have used to improve metaheuristic algorithms for enzyme activity classification, and most of the methods treat FS and HPT separately rather than integrating them as a dual optimization strategy within a unified framework. Few studies have used to improve metaheuristic algorithms for enzyme activity classification, and most of the methods treat FS and HPT separately rather than integrating them as a dual optimization strategy within a unified framework. Traditional metaheuristic algorithms still face challenges in FS and HPT owing to rigid exploration–exploitation phase switching and premature convergence issues. Traditional metaheuristic algorithms still face challenges in FS and HPT owing to rigid exploration–exploitation phase switching and premature convergence issues. Among existing studies a few have implemented hybrid learning approaches, thereby restricting the ability to leverage the complementary strengths of different algorithms and limiting predictive performance and model consistency. Among existing studies a few have implemented hybrid learning approaches, thereby restricting the ability to leverage the complementary strengths of different algorithms and limiting predictive performance and model consistency. Main contribution To overcome these limitations, this study proposes a hybrid ML and optimization framework aimed at predicting soil enzyme activities and evaluating crop suitability. The key contributions of this study are outlined below.An Improved SCSO framework is proposed that sequentially performs wrapper-based feature selection and continuous hyperparameter tuning within a unified dual-stage optimization strategy, unlike existing approaches that treat these processes independently.The proposed Improved SCSO introduces a novel adaptive escape-from-worst-position update mechanism combined with cosine-modulated search dynamics and time-adaptive probabilistic best-solution inheritance, which improves the exploration–exploitation balance, preserves population diversity, and enhances convergence stability compared with Traditional SCO and conventional metaheuristic approaches.A biologically informed learning framework and dynamic crop mapping strategy were introduced by integrating enzyme-based soil attributes into the optimization and classification pipeline, enabling agronomically relevant crop suitability prediction, which remains relatively underexplored in existing crop recommendation systems. An Improved SCSO framework is proposed that sequentially performs wrapper-based feature selection and continuous hyperparameter tuning within a unified dual-stage optimization strategy, unlike existing approaches that treat these processes independently. An Improved SCSO framework is proposed that sequentially performs wrapper-based feature selection and continuous hyperparameter tuning within a unified dual-stage optimization strategy, unlike existing approaches that treat these processes independently. The proposed Improved SCSO introduces a novel adaptive escape-from-worst-position update mechanism combined with cosine-modulated search dynamics and time-adaptive probabilistic best-solution inheritance, which improves the exploration–exploitation balance, preserves population diversity, and enhances convergence stability compared with Traditional SCO and conventional metaheuristic approaches. The proposed Improved SCSO introduces a novel adaptive escape-from-worst-position update mechanism combined with cosine-modulated search dynamics and time-adaptive probabilistic best-solution inheritance, which improves the exploration–exploitation balance, preserves population diversity, and enhances convergence stability compared with Traditional SCO and conventional metaheuristic approaches. A biologically informed learning framework and dynamic crop mapping strategy were introduced by integrating enzyme-based soil attributes into the optimization and classification pipeline, enabling agronomically relevant crop suitability prediction, which remains relatively underexplored in existing crop recommendation systems. A biologically informed learning framework and dynamic crop mapping strategy were introduced by integrating enzyme-based soil attributes into the optimization and classification pipeline, enabling agronomically relevant crop suitability prediction, which remains relatively underexplored in existing crop recommendation systems. Overall, the proposed framework improves predictive performance, reduces feature redundancy, enhances model interpretability, and provides a scalable decision-support mechanism for sustainable soil fertility assessment and precision-crop planning. Methodology Dataset description The dataset used in this study was obtained from32 and comprises 969 observations aggregated from approximately 100 published studies until January 2021, covering global intercropping systems. The dataset contains soil-related attributes grouped into three domains: physical, chemical, and organic/biological domains. Physical attributes include clay, silt, sand, bulk density, texture descriptors, soil depth, and climatic variables such as Mean Annual Temperature (MAT), Mean Annual Precipitation (MAP), and agro-climatic zone, together with experimental metadata (e.g., location, author, land-use type, year, journal, and DOI). The chemical attributes included pH, Dissolved Organic Carbon (DOC), Soil Organic Carbon (SOC), Total Nitrogen (TN), and carbon-to-nitrogen ratios. Organic or biological attributes include enzyme type, microbial biomass carbon, extracellular enzyme activity, effect size indicators, and assay-related descriptors. This comprehensive feature set offers a suitable basis for optimization-based FS and predictive modeling. After removing 387 observations with missing target labels, 582 labeled samples were retained for soil fertility classification. Missing values in the predictor variables were subsequently imputed using a Gaussian Mixture Model (GMM) to preserve the statistical distribution of soil physicochemical and enzyme-related features. The target variable comprised three fertility classes: medium (253 samples, 43.47%), low (219 samples, 37.63%), and high (110 samples, 18.90%). Overall work flow Figure 1 illustrates the architecture of the proposed crop recommendation system, which incorporates soil fertility and enzyme activity levels. The input for the proposed framework was a soil dataset comprising soil physiochemical properties and fertility indicators. The dataset was preprocessed to address missing values and feature scaling.Fig. 1Architecture of the proposed crop recommendation with soil fertility level and enzymes. Architecture of the proposed crop recommendation with soil fertility level and enzymes. The pre-processed data were subjected to a two-stage optimization phase using the Improved SCSO, where Stage 1 performed binary FS to obtain an optimal subset of relevant soil and enzyme attributes. Next, a correlation-based redundancy reduction step is applied to the selected features to eliminate highly correlated variables and produce a compact non-redundant feature subset. Finally, Stage 2 performs continuous HPT using the reduced feature subset obtained after correlation filtering to maximize the classification performance. The resulting feature set is compact and ready for training using ML, DL and Hybrid models. During training, a k-fold stratified cross-validation mechanism was employed. Within each fold, FS and HPT using the Improved SCSO were performed exclusively on the training subset, whereas the test subset remained completely unseen, ensuring unbiased performance estimation and preventing data leakage. Then, the associated model performance such as accuracy, precision, recall, and f1 score, was computed. Finally, a dynamic crop mapping module was deployed to estimate the best-suited crops based on the estimated enzyme activity and fertility level. Data preprocessing To guarantee reliable performance in ML models, appropriate data preprocessing is crucial. First, observations with missing target labels that is 387 samples were removed because they could not be used for supervised classification and 582 labeled samples were retained for soil fertility classification. To handle missing values and standardize the data, a preprocessing step was applied to the soil dataset in this investigation, which included both numerical and categorical features30. Missing values in the predictor variables were then handled using Gaussian Mixture Model (GMM)-based imputation for numerical soil physicochemical and enzyme-related attributes. This approach was adopted to preserve the underlying statistical distribution of heterogeneous soil features more effectively than simple mean imputation. The mean of the available observations was used to impute missing numerical values, and the mode of the relevant feature was used to replace missing categorical values. Following imputation, label encoding was used to transform categorical variables into numerical indices. The numerical features were then standardized to guarantee a consistent contribution across classifiers. After that, the pre-processed dataset was separated into the target variable for analysis and input features. Particularly, the target variable comprised three fertility classes: medium (253 samples, 43.47%), low (219 samples, 37.63%), and high (110 samples, 18.90%). Optimization phase In this phase, the proposed framework employs a two-stage hybrid optimization strategy using the Improved SCSO algorithm. Stage 1 performs binary FS, and Stage 2 performs continuous hyperparameter optimization.In the first stage, FS using binary Improved SCSO is applied to identify a critical feature subset that maximizes the classification performance while reducing redundancy.In the second stage, a continuous Improved SCSO variant is applied to optimize the hyperparameters of the selected learning model using the reduced feature set obtained from the first stage. This sequential optimization strategy enables model-specific adaptation and ensures effective tuning for ML, DL and Hybrid models. In the first stage, FS using binary Improved SCSO is applied to identify a critical feature subset that maximizes the classification performance while reducing redundancy. In the first stage, FS using binary Improved SCSO is applied to identify a critical feature subset that maximizes the classification performance while reducing redundancy. In the second stage, a continuous Improved SCSO variant is applied to optimize the hyperparameters of the selected learning model using the reduced feature set obtained from the first stage. This sequential optimization strategy enables model-specific adaptation and ensures effective tuning for ML, DL and Hybrid models. In the second stage, a continuous Improved SCSO variant is applied to optimize the hyperparameters of the selected learning model using the reduced feature set obtained from the first stage. This sequential optimization strategy enables model-specific adaptation and ensures effective tuning for ML, DL and Hybrid models. The overall notations used in the proposed approach is as shown in Table 1.Table 1Details of notations.VariableDefinition\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t}$$\end{document}Position of ith agent at iteration t\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{best}$$\end{document}Best solution in the population\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{worst}$$\end{document}Worst solution in the population\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${D}_{i}^{t}$$\end{document}Escape direction vectorrRandom number in [0,1]\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}$$\end{document}Time-adaptive control parameterΒCosine modulation coefficient\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f\left({X}_{i}\right)$$\end{document}Fitness function (CV accuracy)TMaximum number of iterationsdNumber of features (dimension)αt​Adaptive inheritance rateKt​Stochastic scaling factor\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho}_{t}$$\end{document}Cosine-modulated searchRUniformly distributed random variable in \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left[0,2\right]$$\end{document} used in cosine modulation\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Phi \left(e,c\right)$$\end{document}Overall enzyme suitability score for crop c Table 1Details of notations.VariableDefinition\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t}$$\end{document}Position of ith agent at iteration t\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{best}$$\end{document}Best solution in the population\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{worst}$$\end{document}Worst solution in the population\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${D}_{i}^{t}$$\end{document}Escape direction vectorrRandom number in [0,1]\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}$$\end{document}Time-adaptive control parameterΒCosine modulation coefficient\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f\left({X}_{i}\right)$$\end{document}Fitness function (CV accuracy)TMaximum number of iterationsdNumber of features (dimension)αt​Adaptive inheritance rateKt​Stochastic scaling factor\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho}_{t}$$\end{document}Cosine-modulated searchRUniformly distributed random variable in \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left[0,2\right]$$\end{document} used in cosine modulation\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Phi \left(e,c\right)$$\end{document}Overall enzyme suitability score for crop c Details of notations. Experimental protocol and cross-validation strategy All experiments were carried out utilizing stratified k-fold cross-validation with k = 5 in order to guarantee a trustworthy performance evaluation and prevent data leaking. The class distribution was maintained throughout the division of the dataset into five mutually exclusive folds. Four folds were used for training in each iteration, with one-fold set aside for testing and validation. To avoid information leaking from the validation samples into the optimization process, FS and HPT were only carried out during the training phase of each fold. To find the ideal feature subset, the suggested binary Improved SCSO-based FS was initially applied to the training subset. Only the chosen training features were then used for continual Improved SCSO-based HPT. The unseen validation fold was then used to assess the optimized model. During model creation, this hierarchical optimization approach made sure that FS, redundancy reduction, and HPT were completely segregated from the validation data. As a result, an objective prediction performance under practical evaluation conditions is reflected in the reported performance indicators. The suggested fold-wise optimization strategy made sure that FS and HPT remained completely isolated within each training fold prior to validation, significantly reducing data leakage and optimistic bias even though a strict nested cross-validation framework was not used. Traditional SCO The Traditional SCO algorithm is a recent population-based metaheuristic inspired by the predatory behavior and escape mechanisms of sand cats in arid regions. The algorithm proposed in33 adopts the behavior of sand cats to update individual solutions in a population to manage the trade-off between exploration and exploitation by simulating how sand cats move their position based on the best and worst individuals of the population. Initialization Let the population consist of N agents. Each agent represents a solution vector defined as follows Eq. (1).1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t}=\left[{x}_{i,1}^{t},{x}_{i,2}^{t},\dots \dots \dots .{x}_{i,d}^{t}\right], i=\mathrm{1,2},3,\dots \dots \dots \dots ,N$$\end{document}where d is the dimensionality of the problem i.e. number of features or hyperparameters, t is the iteration number. The population is initialized randomly within the search space follows in Eq. (2).2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${x}_{i,j}^{0}\sim U({lb}_{j },{ub}_{j})$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${lb}_{j } \text{ and } {ub}_{j}$$\end{document} denote lower and upper bounds. Fitness evaluation Each agent is evaluated using the fitness function is mentioned in Eq. (3).3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f\left( {X_{i}^{t} } \right) = Accuracy_{cv} (C, F_{i} )$$\end{document}where C is the classifier and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${F}_{i}$$\end{document} is the feature subset (for FS) or parameter set (for HPT). The best and worst solutions are identified in Eq. (4, 5).4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{best}=argmax f({X}_{i}^{t})$$\end{document}5\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{worst}=argmi f({X}_{i}^{t})$$\end{document} Position update mechanism Agents update their positions based on a balance between exploration and exploitation, controlled by a sensitivity parameter and is given by Eq. (6).6\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${S}_{t}=2\left(1-\frac{t}{T}\right)$$\end{document} Exploration phase When \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left|\mathrm{r}\right|>1$$\end{document}, agents explore the search space as described in Eq. (7).7\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t+1}= {X}_{i}^{t}+r. ({X}_{rand}^{t}-{X}_{i}^{t} )$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r \sim U(-{S}_{t}, {S}_{t})$$\end{document} ,\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{rand}^{t}$$\end{document} is a randomly selected agent. Exploitation phase When \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left|\mathrm{r}\right|\le 1$$\end{document}, agents move toward the best solution, which is defined as Eq. (8).8\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t+1}= {X}^{best}+r. ({X}^{best}-{X}_{i}^{t} )$$\end{document} This phase simulates the sand cat focusing on prey. Boundary control To ensure feasibility be represented by the Eq. (9).9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i,j}^{t+1}= \mathrm{m}\mathrm{i}\mathrm{n}(\mathrm{max}\left({X}_{i,j}^{t+1},{lb}_{j }\right), {Ub}_{j })$$\end{document} Binarization (for feature selection) For FS, the updated position is converted into binary form, as defined in Eq. (10).10\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i,j}^{,t+1}=\left\{\begin{array}{c} 1,~ if ~~ \sigma \left({X}_{i,j}^{,t+1}\right)> \tau \\ 0, ~ otherwise.\end{array}\right.$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left({X}_{i,j}^{,t+1}\right)$$\end{document} is a sigmoid function, τ is a threshold value. Limitations of traditional SCO and motivation for improvement Although Sand Cat Swarm Optimization (SCO) has exhibited efficiency in handling optimization problems, its straightforward application to complicated, multidimensional datasets, such as soil fertility prediction with enzyme-related features, reveals intrinsic constraints. First, conventional SCO deal with a gradually decreasing control parameter to balance exploration and exploitation throughout the optimization process. However, this static strategy often results in an imbalanced search behaviour, causing more exploration during the early iterations and premature convergence in the last stages. This restriction becomes more significant when handling soil and enzyme datasets, as the complex nonlinear relationships and feature interactions require balanced and continuous exploration to improve the discovery of meaningful structures in data. Second, traditional SCO does not have a framework to manage weak solutions efficiently. The lack of method to avoid the least optimal solution reduces solution diversity and restricts the optimization capability to search unvisited areas of the solution space. Furthermore, existing SCO implementations conventionally execute FS and HPT as separate problems, which overlooks the interplay between selected features and model parameters, often leading to poorly tuned settings in ML models, as selected features and parameter settings directly impact each other. These relationships and interaction effects must be explored and balanced continuously to enhance the finding of a meaningful structure. Another aspect is the non-integration of domain-relevant information into the features. Traditional SCO-based FS does not consider domain knowledge-based indicators, such as the levels of soil enzyme activities, as optimization parameters. This implies that domain-specific biochemical features may not be appropriately weighted. Table 2 provides a fleeting comparison between traditional and proposed algorithms. The proposed Improved SCSO overcomes these drawbacks by introducing a continuous adaptive search mechanism based on probabilistic best-solution inheritance, cosine-modulated location updates, and stochastic escape-from-worst learning. The suggested approach improves convergence stability, maintains population diversity, and improves the identification of informative subsets of soil enzyme features by avoiding abrupt exploration–exploitation transitions and dynamically adjusting the search trajectory throughout the optimization, in contrast to traditional SCO variants.Table 2Comparison between traditional SCO and proposed SCSO.AspectTraditional SCOImproved SCSO (proposed)Exploration controlLinearCosine-modulatedDiversity handlingWeakEscape-from-worstConvergenceProne to local optimaAdaptiveFS + HPTSeparateUnifiedEnzyme integrationNoYes Table 2Comparison between traditional SCO and proposed SCSO.AspectTraditional SCOImproved SCSO (proposed)Exploration controlLinearCosine-modulatedDiversity handlingWeakEscape-from-worstConvergenceProne to local optimaAdaptiveFS + HPTSeparateUnifiedEnzyme integrationNoYes Comparison between traditional SCO and proposed SCSO. Improved SCSO: proposed enhancements Improved SCSO framework consists of three major enhancements: the escape-from-worst strategy, cosine-modulated adaptive position update, and probabilistic best-solution inheritance. These mechanisms collectively improve exploration capability, reduce premature convergence, and strengthen the optimizer’s ability to select relevant and non-redundant features. Escape-from-worst strategy To maintain population diversity and avoid stagnation, the proposed method introduces an escape-from-worst mechanism, where each agent updates its position relative to the worst solution as defined in Eq. (11).11\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${D}_{i}^{t}= \frac{{X}_{i}^{t}- {X}^{worst}}{\left| {X}^{worst}-{X}_{i}^{t}\right|+\in }*rand()$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}^{worst}$$\end{document} is the worst performing solution and ∈ is a small constant. This strategy enables agents to move away from poor regions of the search space, thereby enhancing the global exploration. Cosine-modulated search mechanism To overcome the rigid exploration–exploitation transition in Traditional SCO, a cosine-based modulation term is incorporated into the position update is expressed as follow in Eqs. (12) to (14).12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t+1}={X}_{i}^{t}+{K}_{t}*{ D}_{i}^{t}*{\rho}_{t}$$\end{document}13\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${K}_{t}={K}_{0}*rand()$$\end{document}14\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho}_{t}=\mathrm{cos}\left(\pi R\left(1-\frac{t}{T}\right)\right)$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$R\sim U\left(\mathrm{0,2}\right)$$\end{document}, rand() denotes a uniformly distributed random number in the interval [0,1], used to introduce stochastic behavior into the optimization process. Here, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${K}_{t}$$\end{document} represents a stochastic scaling factor, while \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho}_{t}$$\end{document} is a time-adaptive cosine modulation factor that controls the oscillatory search behavior. Parameter R is a uniformly distributed random variable that regulates the nonlinear oscillation during optimization. This formulation introduces a nonlinear oscillatory behavior, enabling the algorithm to dynamically transition between global exploration and local exploitation throughout the optimization process. Time-adaptive best-solution inheritance To improve convergence stability while avoiding excessive dependence on the global best, a probabilistic inheritance mechanism is introduced as follow Eq. (15).15\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X_{{i,j}}^{{t + 1}} = \left\{ {\begin{array}{*{20}l} {X_{j}^{{best}} ,} \hfill & {if~rand() < \alpha _{t} } \hfill \\ {X_{{i,j}}^{{t + 1}} ,} \hfill & {otherwise.} \hfill \\ \end{array} } \right.$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}=$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{0}\left(1-\frac{t}{T}\right)$$\end{document}, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{0}$$\end{document} is the initial adaptive control parameter governing the inheritance strength from the global best solution. The convergence stability of the proposed Improved SCSO has been ensured through the combination of adaptive cosine modulation and probabilistic best-solution inheritance. As the iterations progress, the cosine modulation term gradually reduces the oscillatory exploration behavior, enabling a smoother transition toward exploitation. Simultaneously, probabilistic inheritance from the global best solution reinforces convergence around high-quality candidate regions while maintaining the stochastic diversity within the population. Compared with Traditional SCO, which relies on abrupt phase switching, the proposed method provides a smoother search adaptation and improved convergence stability for high-dimensional soil–enzyme optimization problems. Although a strict mathematical convergence guarantee is difficult to establish for stochastic population-based metaheuristic algorithms, the proposed Improved SCSO is conceptually similar to Particle Swarm Optimization (PSO) in that candidate solutions are guided toward the best solution found so far. However, unlike PSO, the proposed method incorporates an escape-from-worst mechanism that directs solutions away from poor-performing regions to preserve diversity and reduce premature convergence. Therefore, the proposed Improved SCSO was designed to improve practical convergence stability and search efficiency rather than provide a formal deterministic convergence guarantee. Unified FS–HPT optimization Unlike conventional approaches, the proposed framework performs a unified optimization of FS and HPT. This unified strategy ensures that the selected feature subset and model parameters are optimally defined jointly as Eq. (16).16\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${F}^{*}=arg{\mathit{max}}_{F}f(F), {\theta }^{*}=arg{\mathit{max}}_{\theta }f({F}^{*},\theta )$$\end{document} The proposed unified optimization framework jointly adapts feature subsets and classifier hyperparameters, enabling effective interaction between FS and model configuration. This improves the convergence stability, predictive performance, and prediction consistency. Integration of enzyme-based features The proposed method explicitly incorporates the enzyme activity features into the optimization process. This enables the selection of biologically meaningful features and improves interpretability, which is often lacking in traditional ML-based soil analyses. Dual optimization using proposed improved SCSO A unified improved Sand Cat Swarm Optimization (SCSO) strategy is employed to perform FS and HPT in two sequential stages. By operating in both binary and continuous search spaces, the optimizer simultaneously identifies informative enzyme-driven soil features and determines the optimal classifier configuration, thereby improving convergence stability and predictive performance.The overall flow chart of the proposed work is shown in Fig. 2.Fig. 2Flow chart for implementation of improved SCSO algorithm. Flow chart for implementation of improved SCSO algorithm. Feature selection using binary improved SCSO In the first stage, the Improved SCSO is implemented in a binary search space, where each agent represents a candidate subset of features. Let the population consist of N agents, where each agent represents a candidate solution as defined in Eq. (17).17\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t}=\left[{x}_{i,1}^{t},{x}_{i,2}^{t},\dots \dots \dots .{x}_{i,d}^{t}\right], i=\mathrm{1,2},3,\dots \dots \dots \dots ,N$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$i=\mathrm{1,2},\dots ,N$$\end{document} denotes the index of the i-th search agent (candidate solution), d is the dimensionality of the search space (number of features or hyperparameters), and t represents the current iteration number. Binary feature selection using improved SCSO The initial binary position of each search agent is defined as in Eq. (18).18\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$x_{i,j}^{0} \in \left\{ {0,1} \right\}$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${x}_{i,j}^{0}=1$$\end{document} indicates that the jth feature is selected, and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${x}_{i,j}^{0}=0$$\end{document} indicates that the feature is not selected. Fitness function The fitness of each agent is evaluated using stratified k-fold cross-validation is mentioned as in Eq. (19)19\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f\left( {X_{i}^{t} } \right) = Accuracy_{cv} (C, F_{i} )$$\end{document}where C is the classifier and \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${F}_{i}$$\end{document} is the feature subset. Escape-from-worst direction To avoid premature convergence, the escape direction is computed as the Eq. (11). Cosine-modulated position update The position update incorporates stochastic cosine modulation is defined as Eq. (12). Adaptive best-solution inheritance To strengthen convergence, a probabilistic inheritance strategy is applied as the Eq. (15). Binarization The updated continuous values were converted to binary values as defined in Eq. (20).20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X_{{i,j}}^{{t + 1}} = \left\{ {\begin{array}{*{20}l} {1,} \hfill & {if~\sigma \left( {x_{{i,j}}^{{,t + 1}} } \right) > \tau } \hfill \\ {0,} \hfill & {otherwise.} \hfill \\ \end{array} } \right.$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left(x\right)= \frac{1}{1+ {e}^{-x}}$$\end{document} , τ ∊ [0,1]. In this study, the binarization threshold was set to τ = 0.5. This value provides a symmetric decision boundary for the sigmoid function such that features with activation probabilities greater than or equal to 0.5 are selected. It is widely adopted in binary metaheuristic optimization because it offers an unbiased and computationally efficient selection criterion. Correlation-based redundancy reduction After FS, redundant features were removed using Eq. (21).21\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left|corr\left({f}_{i },{f}_{j}\right)\right|> \delta \Rightarrow remove \; one \; of \; {f}_{i }or {f}_{j}$$\end{document}where δ is the correlation threshold. This reduces multicollinearity and prevents overfitting. After FS, redundant features were removed using Eq. (21). The correlation threshold was set to δ = 0.95 to remove only highly redundant features while preserving moderately correlated variables that may contain complementary information. This value is commonly used in FS studies to eliminate near-duplicate predictors without excessively reducing the feature space. Continuous hyperparameter optimization In the second stage, the Improved SCSO is formulated in a continuous search space, where each agent represents a candidate set of normalized classifier hyperparameters. Continuous representation Each agent encodes normalized hyperparameters as defined in Eq. (22).22\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$X_{i}^{t} \in \left[ {0,1} \right]^{d}$$\end{document}which are mapped to actual parameter values as mentioned in Eq. (23).23\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\theta}_{j}= {lb}_{j}+{X}_{i,j}^{t} . ({ub}_{j}-{lb}_{j})$$\end{document} Fitness function The fitness of each agent is evaluated using stratified k-fold cross-validation accuracy, as defined in Eq. (24).24\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$f\left( {X_{i}^{t} } \right) = Accuracy_{cv} (C_{\theta } , F_{final} )$$\end{document} where θ are decoded hyperparameters, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${F}_{final}$$\end{document} is the selected feature set. Position update (continuous) The same update rules apply without binarization using Eqs. (11,12,15). Final model and dynamic crop mapping The final classifier was trained using the following Eq. (25).25\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${C}^{*}=C({F}_{final}, {\theta }^{*})$$\end{document} Predictions are generated as defined in Eq. (26).26\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${y=C}^{*}\left(X\right)$$\end{document} A mapping function assigns crops using the following Eq. (27).27CropMap = g(Crop, Enzyme, y) where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$g\left(\cdot \right)$$\end{document} denotes the crop mapping function combining crop attributes, enzyme activity information, and predicted fertility labels to generate recommendation output, X = selected soil/enzyme features, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${C}^{*}$$\end{document}= trained optimized classifier, and y= predicted fertility label. Model development and evaluation To comprehensively evaluate the effectiveness of the proposed Improved SCSO framework, a diverse set of ML, DL, and hybrid models was employed. The objective is to assess the generalizability of the optimized feature subset and hyperparameters across different learning paradigms, thereby evaluating the consistency of soil fertility prediction. Standalone ML models A combination of classical ML models, advanced ensemble techniques was considered to capture the varying characteristics of the soil–enzyme dataset. Each model was trained independently using the feature subset and hyperparameters optimized by the proposed Improved SCSO framework. The evaluated models include:RF: An ensemble of decision trees trained with bagging to estimate fertility levels by aggregating predictions from multiple decision trees trained on randomly sampled feature subsets, thereby enhancing robustness, generalization, and the ability to model nonlinear relationships34.DT: A single tree classifier using the Gini impurity criterion, derives fertility indicators through hierarchical partitioning of soil features based on impurity minimization, offering high interpretability but with susceptibility to overfitting34.CatBoost: The CatBoost classifier that handles categorical features efficiently and further improves fertility estimation through ordered boosting, which reduces prediction bias and overfitting while efficiently handling complex feature dependencies, making it particularly suitable for heterogeneous soil datasets35.GB: Sequential ensemble of weak learners optimized via Improved SCSO and incrementally builds an ensemble of weak learners in a sequential manner, where each learner corrects the errors of its predecessor, leading to improved classification accuracy and enhanced feature interaction modelling36.XGBoost is an efficient gradient-boosting algorithm that builds decision trees sequentially to minimize prediction errors using regularization37.LightGBM is a fast histogram-based gradient boosting framework that uses leaf-wise tree growth for efficient learning from the datasets38.KNN: Classifies samples based on proximity to neighbors in the optimized feature space and it predicts soil fertility by assigning the dominant fertility class among the nearest soil samples in the feature space, relying on local similarity rather than explicit model training39.SVC: Uses a kernel-based approach to construct an optimal separating hyperplane in a complex feature space, with kernel functions enabling effective modeling of nonlinear fertility patterns40.GB: Sequential ensemble of weak learners optimized via Improved SCSO and incrementally builds an ensemble of weak learners in a sequential manner, where each learner corrects the errors of its predecessor, leading to improved classification accuracy and enhanced feature interaction modelling38. RF: An ensemble of decision trees trained with bagging to estimate fertility levels by aggregating predictions from multiple decision trees trained on randomly sampled feature subsets, thereby enhancing robustness, generalization, and the ability to model nonlinear relationships34. RF: An ensemble of decision trees trained with bagging to estimate fertility levels by aggregating predictions from multiple decision trees trained on randomly sampled feature subsets, thereby enhancing robustness, generalization, and the ability to model nonlinear relationships34. DT: A single tree classifier using the Gini impurity criterion, derives fertility indicators through hierarchical partitioning of soil features based on impurity minimization, offering high interpretability but with susceptibility to overfitting34. DT: A single tree classifier using the Gini impurity criterion, derives fertility indicators through hierarchical partitioning of soil features based on impurity minimization, offering high interpretability but with susceptibility to overfitting34. CatBoost: The CatBoost classifier that handles categorical features efficiently and further improves fertility estimation through ordered boosting, which reduces prediction bias and overfitting while efficiently handling complex feature dependencies, making it particularly suitable for heterogeneous soil datasets35. CatBoost: The CatBoost classifier that handles categorical features efficiently and further improves fertility estimation through ordered boosting, which reduces prediction bias and overfitting while efficiently handling complex feature dependencies, making it particularly suitable for heterogeneous soil datasets35. GB: Sequential ensemble of weak learners optimized via Improved SCSO and incrementally builds an ensemble of weak learners in a sequential manner, where each learner corrects the errors of its predecessor, leading to improved classification accuracy and enhanced feature interaction modelling36. GB: Sequential ensemble of weak learners optimized via Improved SCSO and incrementally builds an ensemble of weak learners in a sequential manner, where each learner corrects the errors of its predecessor, leading to improved classification accuracy and enhanced feature interaction modelling36. XGBoost is an efficient gradient-boosting algorithm that builds decision trees sequentially to minimize prediction errors using regularization37. XGBoost is an efficient gradient-boosting algorithm that builds decision trees sequentially to minimize prediction errors using regularization37. LightGBM is a fast histogram-based gradient boosting framework that uses leaf-wise tree growth for efficient learning from the datasets38. LightGBM is a fast histogram-based gradient boosting framework that uses leaf-wise tree growth for efficient learning from the datasets38. KNN: Classifies samples based on proximity to neighbors in the optimized feature space and it predicts soil fertility by assigning the dominant fertility class among the nearest soil samples in the feature space, relying on local similarity rather than explicit model training39. KNN: Classifies samples based on proximity to neighbors in the optimized feature space and it predicts soil fertility by assigning the dominant fertility class among the nearest soil samples in the feature space, relying on local similarity rather than explicit model training39. SVC: Uses a kernel-based approach to construct an optimal separating hyperplane in a complex feature space, with kernel functions enabling effective modeling of nonlinear fertility patterns40. SVC: Uses a kernel-based approach to construct an optimal separating hyperplane in a complex feature space, with kernel functions enabling effective modeling of nonlinear fertility patterns40. GB: Sequential ensemble of weak learners optimized via Improved SCSO and incrementally builds an ensemble of weak learners in a sequential manner, where each learner corrects the errors of its predecessor, leading to improved classification accuracy and enhanced feature interaction modelling38. GB: Sequential ensemble of weak learners optimized via Improved SCSO and incrementally builds an ensemble of weak learners in a sequential manner, where each learner corrects the errors of its predecessor, leading to improved classification accuracy and enhanced feature interaction modelling38. DL models DL models were trained using the same optimized feature subset and hyperparameters identified using Improved SCSO to ensure fair comparison. The models include:ANN: Fully connected layers with ReLU activation, batch normalization, and dropout regularization41.1D-CNN is employed by arranging the selected soil physiochemical and enzyme features in a fixed, biologically meaningful order and representing them as one-dimensional feature sequence. This structured representation enables convolutional filters to learn local interactions among adjacent variables, and the model is included primarily as a comparative DL baseline for tabular soil data42.LSTM: Captures sequential dependencies and temporal patterns in the feature space43. ANN: Fully connected layers with ReLU activation, batch normalization, and dropout regularization41. ANN: Fully connected layers with ReLU activation, batch normalization, and dropout regularization41. 1D-CNN is employed by arranging the selected soil physiochemical and enzyme features in a fixed, biologically meaningful order and representing them as one-dimensional feature sequence. This structured representation enables convolutional filters to learn local interactions among adjacent variables, and the model is included primarily as a comparative DL baseline for tabular soil data42. 1D-CNN is employed by arranging the selected soil physiochemical and enzyme features in a fixed, biologically meaningful order and representing them as one-dimensional feature sequence. This structured representation enables convolutional filters to learn local interactions among adjacent variables, and the model is included primarily as a comparative DL baseline for tabular soil data42. LSTM: Captures sequential dependencies and temporal patterns in the feature space43. LSTM: Captures sequential dependencies and temporal patterns in the feature space43. Tree-based ensemble models are particularly effective in handling nonlinear relationships and feature interactions, whereas DL models are used to capture higher-order patterns within the dataset. To strengthen the baseline comparison and ensure a fair evaluation, XGBoost and LightGBM were included and optimized using the proposed Improved SCSO-based HPT strategy under the same stratified cross-validation protocol applied to all competing models. Integration with improved SCSO The proposed Improved SCSO framework was integrated into the model development process in two stages:Feature selection stage (FS): The binary Improved SCSO identifies an optimal subset of soil and enzyme-related features, reducing dimensionality and eliminating irrelevant or redundant attributes.Hyperparameter optimization stage (HPT): The continuous Improved SCSO tunes model-specific hyperparameters, ensuring optimal configuration for each classifier. Feature selection stage (FS): The binary Improved SCSO identifies an optimal subset of soil and enzyme-related features, reducing dimensionality and eliminating irrelevant or redundant attributes. Feature selection stage (FS): The binary Improved SCSO identifies an optimal subset of soil and enzyme-related features, reducing dimensionality and eliminating irrelevant or redundant attributes. Hyperparameter optimization stage (HPT): The continuous Improved SCSO tunes model-specific hyperparameters, ensuring optimal configuration for each classifier. Hyperparameter optimization stage (HPT): The continuous Improved SCSO tunes model-specific hyperparameters, ensuring optimal configuration for each classifier. This sequential FS–HPT optimization enables better interaction between feature subsets and model parameters, resulting in improved predictive performance. Validation strategy Stratified k-fold cross-validation was employed to ensure a robust evaluation. This approach preserves the class distribution across the folds and minimizes the bias in the performance estimation. Performance metrics The performance of each classifier was assessed using four standard metrics: Accuracy, Precision, Recall, and F1-score, as mentioned in Eqs. (28–31). Accuracy measures the overall proportion of total correct predictions:28\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Accuracy=\frac{TP+TN}{TP+TN+FP+FN}$$\end{document}Precision quantifies the proportion of correctly predicted positive instances among all predicted positive:29\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Precision=\frac{TP}{TP+FP}$$\end{document}Recall assesses the model’s ability to identify all actual positive cases:30\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Recall=\frac{TP}{TP+FN}$$\end{document}F1-score, the harmonic mean of precision and recall, is given by:31\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$F1-Score=2.\frac{Precision*Recall}{Precision*Recall}$$\end{document} Accuracy measures the overall proportion of total correct predictions:28\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Accuracy=\frac{TP+TN}{TP+TN+FP+FN}$$\end{document} Accuracy measures the overall proportion of total correct predictions:28\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Accuracy=\frac{TP+TN}{TP+TN+FP+FN}$$\end{document} Precision quantifies the proportion of correctly predicted positive instances among all predicted positive:29\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Precision=\frac{TP}{TP+FP}$$\end{document} Precision quantifies the proportion of correctly predicted positive instances among all predicted positive:29\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Precision=\frac{TP}{TP+FP}$$\end{document} Recall assesses the model’s ability to identify all actual positive cases:30\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Recall=\frac{TP}{TP+FN}$$\end{document} Recall assesses the model’s ability to identify all actual positive cases:30\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$Recall=\frac{TP}{TP+FN}$$\end{document} F1-score, the harmonic mean of precision and recall, is given by:31\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$F1-Score=2.\frac{Precision*Recall}{Precision*Recall}$$\end{document} F1-score, the harmonic mean of precision and recall, is given by:31\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$F1-Score=2.\frac{Precision*Recall}{Precision*Recall}$$\end{document} Here, TP: True Positives, TN: True Negatives, FP: False Positives, and FN: False Negatives. This approach guarantees that each class can maintain a proportional role in its overall score across all the splits. All metrics were calculated using stratified k-fold cross-validation to ensure a balanced class distribution split. We calculated the per-enzyme accuracy or test instances based on enzyme groups and then examined the performance of the classification for each enzyme group. Again, to understand biological variation and model behavior across the enzymatic profiles, we calculated the per-enzyme accuracy. Dynamic crop suitability mapping To translate the predicted soil fertility into actionable agricultural recommendations, a dynamic crop suitability mapping module was developed. This module integrates model predictions with enzyme activity indicators to generate probabilistic crop suitability scores, thereby enabling data-driven crop selection. Input representation Let the optimized feature vector for a soil sample be defined as Eq. (32).32\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X= [x}_{1}, {x}_{2}, \dots \dots \dots .,{ x}_{d}]$$\end{document}where X includes selected physicochemical and enzyme-related attributes. The trained classifier produces a fertility prediction, as shown in Eq. (33).33\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$y={C}^{*}(X)$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$y \in \{ y_{1} , y_{2} , \ldots \ldots \ldots ., y_{k} \}$$\end{document} represents fertility classes (eg.: low, medium, high), \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${C}^{*}$$\end{document} is the optimized model. Additionally, let e denote enzyme activity features (e.g., urease, phosphatase) is defined as Eq. (34).34\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\boldsymbol{e}}=[{\boldsymbol{e}}}_{1},{{\boldsymbol{e}}}_{2},\dots \dots \dots .,{{\boldsymbol{e}}}_{{\boldsymbol{m}}}]$$\end{document} Crop suitability score For each candidate \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{c}} \in {\mathrm{C}}$$\end{document} crop, a suitability score is computed as Eq. (35).35\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{S}(\mathrm{c}|\mathrm{X}) = w}_{1} . P\left(y|X\right)+{\mathrm{w}}_{2}. \Phi (e,c)$$\end{document}where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$P\left(y|X\right)$$\end{document} is the predicted probability of fertility class, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\Phi \left(e,c\right)$$\end{document} is an enzyme compatibility function, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{w}}_{1} , {\mathrm{w}}_{2} \in \left[ {0,1} \right]$$\end{document} are weighting coefficients, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm{w}}_{1}+ {\mathrm{w}}_{2}$$\end{document} = 1. Enzyme compatibility function The enzyme compatibility function quantifies how well the soil biochemical conditions match the crop requirements, as defined in Eq. (36).36\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\boldsymbol{\Phi }\left({\boldsymbol{e}},{\boldsymbol{c}}\right)={\sum}_{{\boldsymbol{k}}=1}^{{\boldsymbol{m}}}{\boldsymbol{\Upsilon}}_{{\boldsymbol{k}}}^{\left({\boldsymbol{c}}\right)}.\frac{{{\boldsymbol{e}}}_{{\boldsymbol{k}}}-{{\boldsymbol{e}}}_{{\boldsymbol{k}}}^{{\boldsymbol{m}}{\boldsymbol{i}}{\boldsymbol{n}}}}{{{\boldsymbol{e}}}_{{\boldsymbol{k}}}^{{\boldsymbol{m}}{\boldsymbol{i}}{\boldsymbol{n}}}-{{\boldsymbol{e}}}_{{\boldsymbol{k}}}^{{\boldsymbol{m}}{\boldsymbol{a}}{\boldsymbol{x}}}}$$\end{document}where: \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\Upsilon}_{k}^{\left(c\right)}$$\end{document} is the importance weight of enzyme k for crop c, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${e}_{k}^{min} ~\text{and } {e}_{k}^{max}$$\end{document} are normalization bounds. Probabilistic crop ranking The final crop recommendation is obtained by Eq. (37).37\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$c^{*} \mathop { = {\mathrm{argmaxS}}}\limits_{c \in C} (c|X)$$\end{document} Alternatively, a ranked list is generated in Eq. (38).38\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\{{\boldsymbol{c}}}_{1},{{\boldsymbol{c}}}_{2},\dots \dots \dots ..\}={{\boldsymbol{S}}{\boldsymbol{o}}{\boldsymbol{r}}{\boldsymbol{t}}}_{{\boldsymbol{c}}}({\boldsymbol{S}}({\boldsymbol{c}}|{\boldsymbol{X}}))$$\end{document} This allows multiple crop recommendations with associated confidence scores. Dynamic adaptation mechanism To account for variability in soil conditions, the weights \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${w}_{1}~\mathrm{and}~{ w}_{2}$$\end{document} are dynamically adjusted as Eq. (39).39\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\boldsymbol{w}}_{1} = \user2{ }\frac{{{\boldsymbol{\sigma}}_{{\boldsymbol{y}}} }}{{{\boldsymbol{\sigma}}_{{\boldsymbol{y}}} + {\boldsymbol{\sigma}}_{{\boldsymbol{e}}} }}{\mathrm{and}}\;{\boldsymbol{w}}_{2} = \user2{ }\frac{{{\boldsymbol{\sigma}}_{{\boldsymbol{e}}} }}{{{\boldsymbol{\sigma}}_{{\boldsymbol{e}}} + {\boldsymbol{\sigma}}_{{\boldsymbol{y}}} }}$$\end{document} where \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\boldsymbol{\sigma}}}_{{\boldsymbol{y}}}$$\end{document} = variance in predicted fertility probabilities, \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${{\boldsymbol{\sigma}}}_{{\boldsymbol{e}}}$$\end{document} = variance in enzyme activity. This ensures that the model adaptively prioritizes either fertility prediction or enzyme information, depending on data reliability. The proposed crop mapping framework is considered dynamic because the crop suitability scores are adaptively adjusted according to both the predicted fertility probabilities and enzyme activity variations for each soil sample. Unlike static rule-based recommendation systems, the proposed method continuously updates the weighting contribution of fertility prediction and biochemical enzyme indicators using Eq. (39), enabling flexible adaptation to varying soil conditions. Consequently, crop recommendations may vary for different enzyme activity patterns, even under the same predicted fertility class, thereby improving the biological relevance and practical applicability of precision agriculture. Decision rule A crop is considered suitable if \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\boldsymbol{S}}\left({\boldsymbol{c}}|{\boldsymbol{X}}\right)\ge$$\end{document} η where η is a predefined threshold. Algorithm 1. Dynamic crop suitability mapping. Algorithm 1. Dynamic crop suitability mapping. Experimental analysis This section deals with the systematic evaluation of the proposed framework, which includes a correlation analysis for FS, redundancy reduction, and HPT of various classifiers. The objective is to assess how the Improved SCSO selects the best features along with correlation for redundant feature reduction, which enhances classification accuracy, particularly in comparison to Traditional SCO and the Full Feature Set. In addition to conventional ML models, advanced gradient boosting algorithms, such as XGBoost and LightGBM, were included as strong baselines owing to their proven effectiveness in tabular data classification tasks. All models were evaluated under the same experimental conditions, including an identical cross-validation strategy, preprocessing steps, and optimization framework, ensuring a fair comparison. FS and HPT were performed within each training fold to avoid data leakage, whereas the test fold remained unseen during optimization. Performance was evaluated using accuracy, precision, recall, and f1-score. Correlation matrix analysis Correlation analysis and feature selection To analyze the relationships among the input variables, a correlation matrix of the numerical features was generated (Fig. 3). The matrix revealed several strong positive and negative correlations among soil physiochemical properties, enzyme activity indicators, microbial biomass attributes and yield-related parameters. The presence of highly correlated variables indicates potential redundancy within the dataset, which may negatively affect model generalization and increase computational complexity.Fig. 3Correlation matrix of numerical features. Correlation matrix of numerical features. Several feature pairs exhibit strong positive correlations. For instance yield_lnrr and yield_ler show a high positive correlation of approximately 0.85, avg_mbc_trt and stddev_mbc_ctrl exhibit correlation values greater than 0.75, lnrr_eea and var_lnrr_eea demonstrate a correlation close to 0.80, avg_eea_ctrl and stddev_eea_ctrl also shows significant positive dependency. Similarly, nutrient-related attributes such as av_p, som, and sand exhibited moderate-to-high correlations with other soil variables, indicating overlapping information content. These observations confirm that the direct utilization of all features may introduce multicollinearity and redundant representations, thereby motivating the need for an effective FS mechanism. A correlation threshold of δ =0.95 was used to identify highly redundant features, as values above this level indicated strong multicollinearity. A binary threshold of τ =0.5 was used to convert continuous optimizer positions into feature-selection decisions, such that features with sigmoid activation values greater than or equal to 0.5 were selected. Feature selection analysis The feature subsets chosen by Traditional SCO and the proposed Improved SCSO show distinct differences in redundancy reduction and predictive relevance. As illustrated in Fig. 3, Traditional SCO retained several highly correlated variables including yield_lnrr and yield_ler, avg_mbc_trt and stddev_mbc_ctrl, and lnrr_eea and var_lnrr_eea, indicating limited ability to eliminate overlapping information. These observations suggest that Traditional SCO is more susceptible to premature convergence and may preserve redundant and weakly informative features. In contrast, the proposed Improved SCSO removed highly correlated and low-contributing variables while retaining biologically and agronomically meaningful features such as enz_ec, avg_eea_trt, lnrr_mbc, tot_p, soc, duration, and inter_cat. These variables provide complementary information related to enzyme activity, nutrient availability, soil organic carbon, and temporal interactions. The improved FS performance is primarily attributed to the cosine-modulated exploration strategy, stochastic escape-from-worst updating, improved convergence stability, and correlation-based deduplication. Overall, Improved SCSO produced a more compact and discriminative feature subset that reduced multicollinearity and dimensionality while enhancing interpretability and model generalization. The retention of enzyme-related attributes further confirms the critical role of biochemical indicators in intelligent soil fertility prediction. Model performance with FS and without HPT To evaluate the effectiveness of the proposed FS strategy, both the Traditional SCO and the Improved SCSO were trained using their default parameter settings for all classifiers. Both methods were applied as wrapper-based binary optimizers to identify compact feature subsets, and the selected features were validated using stratified -fold cross-validation accuracy. The results show that the Improved SCSO consistently outperforms both the full feature set and Traditional SCO, indicating a better exploration–exploitation balance and a reduced tendency toward premature convergence in the complex soil–enzyme feature space. This confirms that the proposed improvements in the update mechanism enable a more reliable selection of discriminative fertility indicators. Table 3 shows that the improved SCSO outperforms the Traditional SCO for most ML, DL, and hybrid models in terms of selected features and accuracy. The improved SCSO provides fair accuracy for most models, with the highest performance achieved by CB (0.9546) using only 25 features. Improved SCSO also enhanced the ensemble performance, particularly for RF + CB (0.9536). These findings demonstrate that the Improved SCSO selects more relevant features and improves the classification effectiveness.Table 3Performance comparison of improved SCSO and traditional SCO without HPT.Model nameImproved SCSOTraditional SCONo of selected featuresAccuracyNo of selected featuresAccuracyRF310.9484280.9143KNN320.9092330.8957CB250.9546270.9146XGBoost320.9534310.9321LightGBM310.9475330.9178SVC330.9168270.8978DT240.9505230.9355GB280.9305290.8985CNN240.7709270.7616LSTM260.8133310.7811ANN270.8510130.8132RF + KNN300.8899260.8564RF + SVC310.9003260.8888RF + CB290.9536310.9353DT + RF270.9453230.9043DT + KNN360.8848310.8664GB + RF250.9363230.9143GB + KNN250.8793320.8464 Table 3Performance comparison of improved SCSO and traditional SCO without HPT.Model nameImproved SCSOTraditional SCONo of selected featuresAccuracyNo of selected featuresAccuracyRF310.9484280.9143KNN320.9092330.8957CB250.9546270.9146XGBoost320.9534310.9321LightGBM310.9475330.9178SVC330.9168270.8978DT240.9505230.9355GB280.9305290.8985CNN240.7709270.7616LSTM260.8133310.7811ANN270.8510130.8132RF + KNN300.8899260.8564RF + SVC310.9003260.8888RF + CB290.9536310.9353DT + RF270.9453230.9043DT + KNN360.8848310.8664GB + RF250.9363230.9143GB + KNN250.8793320.8464 Performance comparison of improved SCSO and traditional SCO without HPT. Figure 4 compares the performance of the Improved SCSO, Traditional SCO, and full feature set across standalone and hybrid models using accuracy, precision, recall, and f1-score. Overall, the Improved SCSO consistently delivered superior results, particularly for tree-based classifiers. It achieved the highest accuracies for RF (0.948), CB (0.955), XGBoost (0.953), LightGBM (0.948), and DT (0.951), outperforming both Traditional SCO and the full feature set. The improved SCSO also recorded strong and balanced precision/recall values (RF: 0.952, CB: 0.956, DT: 0.955) and higher F1-scores (RF: 0.945, CB: 0.953, DT: 0.951), indicating stable and reliable prediction. Furthermore, hybrid models reinforce their effectiveness, with RF + CB (0.954 accuracy, 0.952 F1) and DT + RF (0.945 accuracy, 0.942 F1), confirming that the Improved SCSO selects more discriminative features and enhances generalization compared to competing methods.Fig. 4(a)–(d) Performance comparison of Improved SCSO, Traditional SCO, and full feature set across standalone and hybrid classifiers without HPT in terms of (a) Accuracy, (b) Precision, (c) Recall, and (d) F1-score. (a)–(d) Performance comparison of Improved SCSO, Traditional SCO, and full feature set across standalone and hybrid classifiers without HPT in terms of (a) Accuracy, (b) Precision, (c) Recall, and (d) F1-score. Model performance with FS and HPT In the follow-up experiment, both the improved SCSO and traditional SCO metaheuristics were used for FS and hyperparameter optimization of the classifiers. Experiments were conducted to evaluate the effectiveness of the proposed optimization strategy in terms of FS, HPT, classification accuracy, and model robustness. Tables 4 and 5 provide details of the values implemented in the models considered in this study.Table 4Hyperparameter search space for each model.ModelHyperparameterSymbolRangeValuesISCSOSCORandom forest (RF)Number of treesn[50, 200]20200Maximum depthd[5, 30]55Min samples split\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathrm{m}\mathrm{i}\mathrm{n}\_\mathrm{s}\mathrm{a}\mathrm{m}\mathrm{p}\mathrm{l}\mathrm{e}\mathrm{s}\_\mathrm{s}\mathrm{p}\mathrm{l}\mathrm{i}\mathrm{t}$$\end{document}[2, 10]22Min samples leafmin_samples_leaf[1, 5]11Decision tree (DT)Maximum depth\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${d}_{max}$$\end{document}[3, 30]85Min sample leaf\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{min}$$\end{document} or \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{leaf}$$\end{document}[1, 10]55Min samples split\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${s}_{min}$$\end{document}[2, 20]1014KNNNumber of neighboursk[3, 15]33SVCRegularizationC[0.1, 100]1.01.299Kernel–{rbf, poly, sigmoid}rbfrbfGammaϒ[0.001, 1]0.0040.004Gradient boosting (GB)EstimatorsM[20, 48]2020Learning rateΗ[0.005–1.0]1.01.0Max depthd[1, 3]1.01.0CatBoostLearning rateΗ[0.01, 1.0]1.00.4362No. of iterationsN[50–300]5050Depthd[2, 5]22XGBoostNumber of treesn[50–200]5050Maximum depthd[2, 5]22Learning rateΗ[0.01–1.0]0.30.3LightGBMNumber of treesn[50–200]5050Maximum depthd[2, 5]22Learning rateΗ[0.01–1.0]0.30.3ANNLearning rateη[0.0005, 0.01]0.0010.001Hidden units (Neurons)h[16, 128]1616Number of layersL[1, 3]11Batch sizeb[16–64]1616Dropout rated[0.3–0.6]0.60.3EpochsE[5, 48]55CNNFiltersf[16, 128]1616Kernel sizek[2, 5]22Learning rateη[0.0005, 0.01]0.010.01Batch sizeb[16–64]1616EpochsE[5, 48]55Dropout rated[0.3–0.6]0.30.5LSTMUnitsu[16,128]1616Learning rateη[0.0005, 0.01]0.010.01Batch sizeb[16–64]1616EpochsE[5, 48]55Dropout rated[0.3–0.6]0.30.5Table 5Parameters of traditional SCO and improved ISCSO.ParameterSymbolDescriptionTraditional SCOImproved ISCSORangeValueRangeValuePopulation sizeNNumber of search agents20–503020–5030Maximum iterationsTTermination criterion50–1005050–10050Sensitivity parameter\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${S}_{\mathrm{t}}$$\end{document}Controls exploration–exploitation\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2(1-\frac{t}{T})$$\end{document}During iteration\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2(1-\frac{t}{T})$$\end{document}Calculated during iterationAdaptive probability\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}$$\end{document}Controls best-solution inheritance––\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}=$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{0}\left(1-\frac{t}{T}\right)$$\end{document},Calculated during iterationRandom coefficientrControls movement\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$-{ S}_{\mathrm{t}, } { S}_{\mathrm{t}}$$\end{document}Random[0,1]RandomSearch dimensiondNumber of variablesProblem-dependentEqual to Feature Size\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathit{cos}\left(\pi R\left(1-\frac{t}{T}\right)\right)$$\end{document}Calculated during executionEscape direction\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${D}_{i}^{t}$$\end{document}Distance from worst solution––\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t}- {X}^{worst}$$\end{document}Calculated during executionCosine modulation\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho}_{t}$$\end{document}Best solution adoption––[0.1, 0.9] (adaptive)Adopted during iterationSigmoid thresholdτBinary conversion––0.50.5Search space–Continuous/Binary––[0,1] or {0,1}– Table 4Hyperparameter search space for each model.ModelHyperparameterSymbolRangeValuesISCSOSCORandom forest (RF)Number of treesn[50, 200]20200Maximum depthd[5, 30]55Min samples split\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathrm{m}\mathrm{i}\mathrm{n}\_\mathrm{s}\mathrm{a}\mathrm{m}\mathrm{p}\mathrm{l}\mathrm{e}\mathrm{s}\_\mathrm{s}\mathrm{p}\mathrm{l}\mathrm{i}\mathrm{t}$$\end{document}[2, 10]22Min samples leafmin_samples_leaf[1, 5]11Decision tree (DT)Maximum depth\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${d}_{max}$$\end{document}[3, 30]85Min sample leaf\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{min}$$\end{document} or \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${n}_{leaf}$$\end{document}[1, 10]55Min samples split\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${s}_{min}$$\end{document}[2, 20]1014KNNNumber of neighboursk[3, 15]33SVCRegularizationC[0.1, 100]1.01.299Kernel–{rbf, poly, sigmoid}rbfrbfGammaϒ[0.001, 1]0.0040.004Gradient boosting (GB)EstimatorsM[20, 48]2020Learning rateΗ[0.005–1.0]1.01.0Max depthd[1, 3]1.01.0CatBoostLearning rateΗ[0.01, 1.0]1.00.4362No. of iterationsN[50–300]5050Depthd[2, 5]22XGBoostNumber of treesn[50–200]5050Maximum depthd[2, 5]22Learning rateΗ[0.01–1.0]0.30.3LightGBMNumber of treesn[50–200]5050Maximum depthd[2, 5]22Learning rateΗ[0.01–1.0]0.30.3ANNLearning rateη[0.0005, 0.01]0.0010.001Hidden units (Neurons)h[16, 128]1616Number of layersL[1, 3]11Batch sizeb[16–64]1616Dropout rated[0.3–0.6]0.60.3EpochsE[5, 48]55CNNFiltersf[16, 128]1616Kernel sizek[2, 5]22Learning rateη[0.0005, 0.01]0.010.01Batch sizeb[16–64]1616EpochsE[5, 48]55Dropout rated[0.3–0.6]0.30.5LSTMUnitsu[16,128]1616Learning rateη[0.0005, 0.01]0.010.01Batch sizeb[16–64]1616EpochsE[5, 48]55Dropout rated[0.3–0.6]0.30.5 Hyperparameter search space for each model. Table 5Parameters of traditional SCO and improved ISCSO.ParameterSymbolDescriptionTraditional SCOImproved ISCSORangeValueRangeValuePopulation sizeNNumber of search agents20–503020–5030Maximum iterationsTTermination criterion50–1005050–10050Sensitivity parameter\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${S}_{\mathrm{t}}$$\end{document}Controls exploration–exploitation\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2(1-\frac{t}{T})$$\end{document}During iteration\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2(1-\frac{t}{T})$$\end{document}Calculated during iterationAdaptive probability\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}$$\end{document}Controls best-solution inheritance––\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{t}=$$\end{document} \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\alpha}_{0}\left(1-\frac{t}{T}\right)$$\end{document},Calculated during iterationRandom coefficientrControls movement\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$-{ S}_{\mathrm{t}, } { S}_{\mathrm{t}}$$\end{document}Random[0,1]RandomSearch dimensiondNumber of variablesProblem-dependentEqual to Feature Size\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathit{cos}\left(\pi R\left(1-\frac{t}{T}\right)\right)$$\end{document}Calculated during executionEscape direction\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${D}_{i}^{t}$$\end{document}Distance from worst solution––\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${X}_{i}^{t}- {X}^{worst}$$\end{document}Calculated during executionCosine modulation\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\rho}_{t}$$\end{document}Best solution adoption––[0.1, 0.9] (adaptive)Adopted during iterationSigmoid thresholdτBinary conversion––0.50.5Search space–Continuous/Binary––[0,1] or {0,1}– Parameters of traditional SCO and improved ISCSO. Hyperparameter configuration In this study, hyperparameter optimization was performed using the proposed Improved SCSO framework to enhance model performance and generalization capability. The optimization process jointly tunes the model-specific hyperparameters while simultaneously performing FS. For traditional ML models, important hyperparameters such as the number of estimators, maximum tree depth, learning rate, regularization parameters, and neighborhood size are optimized within predefined search ranges. For example, RF and GB models optimize the number of trees and maximum depth, whereas the SVC optimizes the regularization parameter C and kernel coefficient ϒ. Similarly, KNN optimizes the number of neighbors k. For DL models, hyperparameters including learning rate, hidden units, number of filters, kernel size, dropout rate, and batch size, were optimized. The search ranges are selected based on literature recommendations and empirical analysis to balance convergence stability and computational complexity. The proposed framework employs a hybrid search strategy, where binary search space \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\left\{\mathrm{0,1}\right\}$$\end{document} is used for FS and continuous search space \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$[\mathrm{0,1}]$$\end{document} is used for hyperparameter optimization. The optimization parameters for traditional SCO and Improved SCSO, including population size, maximum iterations, adaptive control parameters, and inheritance mechanisms, were selected to maintain an effective exploration–exploitation balance throughout the optimization process. Table 4 summarizes the hyperparameter search ranges and the optimized values obtained by the Improved SCSO and Traditional SCO for all ML and DL models, including ANN, CNN, and LSTM. Table 5 summarizes the parameter settings used for the Traditional SCO and the proposed Improved SCSO, including population size, maximum iterations, adaptive control factors, search dimensions, and other optimization-specific parameters employed during FS and HPT. Table 6 highlights that the Improved SCSO consistently outperforms the Traditional SCO by selecting more informative feature subsets and achieving higher classification accuracy across most models. Significant improvements were observed in ML classifiers such as RF, KNN, XGBoost, and CB, with GB achieving the best standalone accuracy (0.9848). DL models also benefit notably, especially CNN and ANN, showing clear accuracy gains over SCO. Furthermore, hybrid models demonstrate strong enhancement under the Improved SCSO, particularly DT + RF and GB + RF, confirming the proposed method’s effectiveness in boosting prediction performance through optimized FS and HPT.Table 6Performance comparison of improved SCSO and traditional SCO with HPT.Model nameImproved SCSOTraditional SCONo of selected featuresAccuracyNo of selected featuresAccuracyRF320.9629190.9490KNN340.9670320.9433CB320.9786230.9268XGBoost350.9717280.9316LightGBM330.9575310.9358SVC260.9278350.8617DT250.9704140.9601GB310.9848370.9711CNN290.8390300.8287LSTM370.8752280.7606ANN380.9195230.8999RF + KNN230.8958180.8783RF + SVC310.9226190.9030RF + CB250.9659310.9356DT + RF290.9838230.9505DT + KNN310.9206310.8637GB + RF260.9828260.9247GB + KNN290.8814260.8690The bold values indicate the best-performing model for the corresponding evaluation metric among all compared methods. Table 6Performance comparison of improved SCSO and traditional SCO with HPT.Model nameImproved SCSOTraditional SCONo of selected featuresAccuracyNo of selected featuresAccuracyRF320.9629190.9490KNN340.9670320.9433CB320.9786230.9268XGBoost350.9717280.9316LightGBM330.9575310.9358SVC260.9278350.8617DT250.9704140.9601GB310.9848370.9711CNN290.8390300.8287LSTM370.8752280.7606ANN380.9195230.8999RF + KNN230.8958180.8783RF + SVC310.9226190.9030RF + CB250.9659310.9356DT + RF290.9838230.9505DT + KNN310.9206310.8637GB + RF260.9828260.9247GB + KNN290.8814260.8690The bold values indicate the best-performing model for the corresponding evaluation metric among all compared methods. Performance comparison of improved SCSO and traditional SCO with HPT. The bold values indicate the best-performing model for the corresponding evaluation metric among all compared methods. Figure 5 compares the Improved SCSO, Traditional SCO, and full feature set across multiple models using accuracy, precision, recall, and f1-score. Overall, the Improved SCSO consistently achieved the best performance by selecting optimal feature subsets, with top accuracies obtained for GB (0.985), DT + RF (0.984), GB + RF (0.983), CB (0.979), and XGBoost(0.972), clearly outperforming both Traditional SCO and full-feature models. It also improved the results of RF (0.963) and KNN (0.967) compared to the competing methods. Although DL models show comparatively lower accuracy, CNN (0.839) and LSTM (0.875) still demonstrate improvements over SCO and full features. Overall, the findings indicate that the Improved SCSO improves the classification performance across most evaluation metrics under the current experimental setting.Fig. 5(a)–(d) Performance comparison of model Accuracy, Precision, Recall, and F1-score with FS and with hyperparameter Tuning. (a)–(d) Performance comparison of model Accuracy, Precision, Recall, and F1-score with FS and with hyperparameter Tuning. The comparatively lower performance of DL models, such as CNN and LSTM, can be attributed to the moderate dataset size and tabular nature of the soil–enzyme features. CNN and LSTM models are generally more effective when spatial or sequential structures are present, whereas the current dataset mainly consists of structured physicochemical and enzyme attributes. Therefore, tree-based ML and hybrid models are better suited to capture nonlinear feature interactions in this dataset. Comparison of optimization algorithms Table 7 compares the proposed Improved SCSO with GA, PSO, WOA, and BO in terms of selected features and classification accuracy. The results show that a greater reduction in the feature set degrades the accuracy of the classifier performance, whereas the optimal feature subsets selected by the Improved SCSO preserve the informative agronomic and biochemical attributes and eliminate redundant features. Consequently, the Improved SCSO consistently achieves higher accuracy across most models by effectively balancing FS and HPT optimization.Table 7Performance of various ML models adopting feature sets optimized by various algorithms.Model NameImproved SCSOGAPSOWOABONo. of selected featuresAccuracyNo of selected featuresAccuracyNo of selected featuresAccuracyNo of selected featuresAccuracyNo of selected featuresAccuracyRF320.9629280.9357280.9484230.9304230.9432KNN340.9670270.9381220.9405240.9331220.9439CB320.9786300.9338220.9563260.9639310.9539XGBoost350.9717250.9528200.9321300.9600220.9618LightGBM330.9575270.9259250.9389240.9401220.9542SVC260.9278200.8934220.9057260.9184240.8920DT250.9704260.9308250.9443240.9381230.9298GB310.9848240.9690210.9562260.9659250.9638CNN290.8390280.7474260.8150270.7677260.8654LSTM370.8752200.8274210.8754200.8356300.8165ANN380.9195280.8614240.8917230.8956250.8875RF + KNN230.8958220.8691210.8763250.8442230.8677RF + SVC310.9226210.8752220.9247210.8421230.8813RF + CB250.9659220.9608300.9754260.9690230.9401DT + RF290.9838250.9319260.9680200.9721240.9298DT + KNN310.9206200.8390290.9214280.9328240.9153GB + RF260.9828200.9546220.9629280.9742220.9205GB + KNN290.8814200.8629220.8474290.8734220.8608The bold values indicate the best-performing model for the corresponding evaluation metric among all compared methods. Table 7Performance of various ML models adopting feature sets optimized by various algorithms.Model NameImproved SCSOGAPSOWOABONo. of selected featuresAccuracyNo of selected featuresAccuracyNo of selected featuresAccuracyNo of selected featuresAccuracyNo of selected featuresAccuracyRF320.9629280.9357280.9484230.9304230.9432KNN340.9670270.9381220.9405240.9331220.9439CB320.9786300.9338220.9563260.9639310.9539XGBoost350.9717250.9528200.9321300.9600220.9618LightGBM330.9575270.9259250.9389240.9401220.9542SVC260.9278200.8934220.9057260.9184240.8920DT250.9704260.9308250.9443240.9381230.9298GB310.9848240.9690210.9562260.9659250.9638CNN290.8390280.7474260.8150270.7677260.8654LSTM370.8752200.8274210.8754200.8356300.8165ANN380.9195280.8614240.8917230.8956250.8875RF + KNN230.8958220.8691210.8763250.8442230.8677RF + SVC310.9226210.8752220.9247210.8421230.8813RF + CB250.9659220.9608300.9754260.9690230.9401DT + RF290.9838250.9319260.9680200.9721240.9298DT + KNN310.9206200.8390290.9214280.9328240.9153GB + RF260.9828200.9546220.9629280.9742220.9205GB + KNN290.8814200.8629220.8474290.8734220.8608The bold values indicate the best-performing model for the corresponding evaluation metric among all compared methods. Performance of various ML models adopting feature sets optimized by various algorithms. The bold values indicate the best-performing model for the corresponding evaluation metric among all compared methods. It is evident from Table 7 that the GB is best classifier. Therefore, Table 8 highlights that the performance metrics associated with the GB classifier and the Improved SCSO combination for FS are favourable when compared to other optimizers for FS in combination with GB for classification. Table 9 presents the statistical analysis, confirming that the proposed Improved SCSO framework achieves both statistically significant and practically meaningful improvements in soil fertility prediction performance, validating the effectiveness of the proposed optimization strategy.Table 8Performance of gradient boost model adopting feature sets optimized by various algorithms.OptimizerNo of featuresAccuracyPrecisionRecallF1-ScoreImproved SCSO310.98480.97500.98480.9847Traditional SCO370.97110.97250.97110.9707GA240.96900.97000.96910.9690PSO210.95620.95700.95590.9559WOA260.96590.96980.96590.9680BO250.96380.96450.96380.9641Table 9Statistical significance analysis with Wilcoxon test.ComparisonMean Diff95% CIWilcoxon p-valueCohen’s dResultISCSO vs SCO + 0.0338[0.0203, 0.0473]0.0001961.24SignificantISCSO vs Complete feature set + 0.0536[0.0370, 0.0703]0.0001961.60SignificantSCO vs Complete feature set + 0.0199[−0.0021, 0.0418]0.05990.45Not significant Table 8Performance of gradient boost model adopting feature sets optimized by various algorithms.OptimizerNo of featuresAccuracyPrecisionRecallF1-ScoreImproved SCSO310.98480.97500.98480.9847Traditional SCO370.97110.97250.97110.9707GA240.96900.97000.96910.9690PSO210.95620.95700.95590.9559WOA260.96590.96980.96590.9680BO250.96380.96450.96380.9641 Performance of gradient boost model adopting feature sets optimized by various algorithms. Table 9Statistical significance analysis with Wilcoxon test.ComparisonMean Diff95% CIWilcoxon p-valueCohen’s dResultISCSO vs SCO + 0.0338[0.0203, 0.0473]0.0001961.24SignificantISCSO vs Complete feature set + 0.0536[0.0370, 0.0703]0.0001961.60SignificantSCO vs Complete feature set + 0.0199[−0.0021, 0.0418]0.05990.45Not significant Statistical significance analysis with Wilcoxon test. Cross-validation performance analysis Figure 6 shows that the proposed correlation-aware Improved SCSO provides superior predictive stability, improved generalization capability, and more reliable fold-wise performance compared with the traditional SCO and the full feature set.Fig. 6Performance of gradient boost model with optimized and complete feature set. Performance of gradient boost model with optimized and complete feature set. Computational efficiency analysis Figure 7 indicates that an apt tradeoff between exploration and exploitation has led to less execution time and high accuracy for improved SCSO when compared to traditional SCO and full feature set selection method.Fig. 7Execution time taken by gradient boost model with optimized and complete feature set. Execution time taken by gradient boost model with optimized and complete feature set. Per-enzyme accuracy analysis Figure 8 illustrates the comparative classification accuracies of the individual ML models, DL models, and hybrid ensemble approaches for the 17 different enzyme activities. Each group of bars corresponds to one enzyme, and different colours represent the evaluated models.Fig. 8Per-enzyme classification accuracy for various models using the best feature subset selected via Improved SCSO. Per-enzyme classification accuracy for various models using the best feature subset selected via Improved SCSO. Overall, the results show that hybrid models consistently achieve higher and more stable accuracy than individual classifiers for most enzymes, demonstrating the benefit of ensemble fusion in improving generalization and reducing model-specific limitations. Tree-based learners (GB + RF) performed strongly among standalone methods, whereas DL models exhibited comparatively higher variability depending on the enzyme category. Notably, RF-based hybrid combinations frequently attained near-optimal accuracy (approximately 0.95–1.00) across multiple enzymes, confirming that integrating complementary classifiers enhances predictive robustness and supports reliable soil fertility classification under diverse enzyme-driven feature conditions. SHAP-based interpretability analysis The SHAP summary and dependence analyses for the RF model are presented in Fig. 9. The analysis provides insights into the feature contributions to soil fertility prediction. The results demonstrate the influence of feature n_fert_amt with a SHAP value of approximately 0.16, compared to other features with values below 0.08. Nutrient-related attributes, such as av_p and tot_p, contributed SHAP values of nearly 0.05 and 0.04, respectively.Fig. 9SHAP summary and dependence analyses for the Random Forest model. SHAP summary and dependence analyses for the Random Forest model. Texture-related features, including silt, sand, and clay, exhibited moderate impacts in the range of 0.01–0.04. Enzyme-related features, such as avg_eea_ctrl and lnrr_eea, also demonstrated their contributions to validating the integration of biochemical indicators in the proposed framework. The dependence plot further indicates that moderate nitrogen fertilizer levels between 20 and 100 correspond to the highest SHAP contribution (0.14–0.16). In contrast, higher fertilizer levels above 400 reduced the SHAP impact to nearly 0.07. The analysis confirmed that the proposed Improved SCSO framework effectively preserved biologically significant and agronomically relevant features for robust and interpretable soil fertility prediction. Dynamic crop mapping Using the best feature set selected via the Improved SCSO, dynamic crop mapping was generated to link the predicted enzyme activity and fertility levels with crop types, as shown in Fig. 10. Crops such as peanuts and maize were mostly associated with medium fertility and enzymes such as Urease, Invertase. In contrast crops like Maize, Cucumber, Tea, Dolichos, and Amaranth were mapped to low fertility levels with enzymes like Acid phosphatase, Invertase, Dehydrogenase, FDA and Alkaline Phosphatase. This mapping supports precision agriculture by providing fertility-aware and enzyme-specific crop recommendations.Fig. 10Dynamic crop mapping output displaying predicted associations between crop type, enzyme activity, and soil fertility levels using the best feature subset. Dynamic crop mapping output displaying predicted associations between crop type, enzyme activity, and soil fertility levels using the best feature subset. This module bridges ML model predictions to real-world agronomic planning by allowing soil-specific crop targeting, based on biological indicators. The crop mapping output provided a case-based validation of the proposed recommendation module by linking the predicted fertility levels, enzyme activity, and crop types. Although this rule-based mapping improves interpretability and agronomic relevance, further field-level validation is required to confirm its practical efficacy. Discussion The proposed hybrid ML scheme, which uses cosine-based Improved SCSO for both FS and HPT with ensemble classifiers, outperformed traditional and existing methods in soil classification and enzyme activity prediction. Unlike conventional dimensionality reduction techniques, such as PCA and fuzzy clustering10,11 or the early wrapper-based approaches, such as Extreme Learning Machines44, the proposed algorithm identifies a compact and highly informative feature set and significantly decreases the computational cost, improving the accuracy and interpretability. Moreover, by leveraging unbiased boosting with categorical features using CatBoost45, the framework enhances the classification performance in complex soil datasets. Previous studies on Ant Lion Optimization (ALO) and Atom Search Optimization (ASO) for FS have reported the usefulness of metaheuristics for model refinement; however, they have not been integrated with adaptive classifier tuning46,47. The algorithm proposed in this study unified the SCSO approach and optimized both the feature subset and model parameters, yielding superior performance, especially for hybrid models such as KNN + RF, and achieved an accuracy of 97.3%. This standardization is likely comparable to modern methods using metaheuristics, such as the CatBoost-Bayesian hybrid model for soil strength prediction48. Compare with, PSO which uses velocity-based updates49; GA which applies crossover and mutation operators50; WOA which models spiral encircling behavior to the best solution51; and BO which develops surrogate probabilistic models for hyperparameter estimation52, are all well-known optimization techniques. In comparison, the introduced Improved SCSO uses stochastic escape-from-worst learning, cosine-modulated exploration, and probabilistic best-solution inheritance. Most importantly, these strategies not only enhance the diversity of the population but also minimize the risk of early convergence and produce optimization trajectories that are smoother and more stable than those of Traditional SCO. The proposed Improved SCSO method leads to higher predictive accuracy through combined FS and HPT. In addition, it reduces the complexity of the model by eliminating unnecessary soil and enzyme attributes. Therefore, the models that are developed as a result are computationally efficient and can be readily used in agricultural settings that are resource-limited, where the importance of both prediction accuracy and operational efficiency is recognized. The experimental results further revealed that tree-based ML and hybrid ensemble models consistently outperformed DL models for structured soil–enzyme datasets. This behavior can be attributed to the relatively limited dataset size and tabular nature of soil physiochemical and enzyme-related features, which do not possess the strong spatial or sequential dependencies typically required for CNN and LSTM architectures. In contrast, ensemble-based ML models, such as GB, RF, and CatBoost, are more effective for modeling heterogeneous tabular data and nonlinear feature interactions with limited training samples. In addition, the proposed framework extends the analysis by evaluating the model performance at the enzyme level, thereby improving the biological interpretability of soil fertility prediction. For instance5, with the aid of MLR, RF, and ANN models per enzyme prediction for soil enzymes are analyzed comprising cellulase and N-acetyl-glucosaminidase. The proposed approach explicitly addresses predictions at the per-enzyme level, revealing consistent precision for key enzymes, such as β-glucosidase and dehydrogenase. Finally, dynamic crop mapping based on predicted enzyme activity and fertility levels presents a novel paradigm in precision agriculture. Such efforts have been made by53, who used GBRT-DNN for crop suitability but did not incorporate biochemical indicators. By combining biological relevance, model reliability, and actionable crop recommendations, the proposed Improved SCSO-powered hybrid pipeline demonstrates competitive performance in soil and enzyme modeling, with practical applications in sustainable farm management. Ablation study To quantify the contribution of each module in the proposed two-stage Improved SCSO framework, an ablation study was performed by incrementally enabling the optimization stages. First, all classifier models were trained using the full feature set and default hyperparameters only. Next, in Stage 1, binary Improved SCSO-based FS was activated to evaluate the effect of reducing redundant soil and enzyme attributes. In Stage 2, continuous Improved SCSO-based HPT was performed. Finally, the complete pipeline (FS + HPT) was executed, where the hyperparameters were optimized on the reduced feature subset obtained from Stage 1. The results show that both stages individually improve performance, whereas the full Improved SCSO framework achieves the highest classification accuracy, confirming the necessity of both feature reduction and HPT. Conclusion This study used an Improved SCSO strategy to present a framework for soil fertility classification and a dynamic crop recommendation framework based on predicted fertility indicators and enzyme activity. The proposed methodology explicitly integrates soil enzyme activity indicators with physical and chemical soil attributes, addressing the limitation of conventional ML/DL models that often underutilize biochemical features owing to their complexity, redundancy, and noise. To overcome this, a two-stage Improved SCSO optimization pipeline was proposed. In Stage 1, an optimal subset of informative soil attributes was found using wrapper-based binary FS, and in Stage 2, a continuous Improved SCSO variant was applied to tune model hyperparameters on the reduced feature space. The improved convergence behavior of the Improved SCSO is achieved through a cosine-modulated escape-from-worst position update and adaptive inheritance from the global best solution, which effectively balances exploration and exploitation and reduces premature convergence. The proposed Improved SCSO was further improved using Correlation-Based Deduplication. Comprehensive experiments using stratified k-fold cross-validation demonstrated that the proposed Improved SCSO framework consistently improved the classification performance across multiple ML, DL, and hybrid models. Among all the evaluated classifiers, the GB model achieved the highest accuracy and was therefore selected as the final prediction engine. Finally, a dynamic crop mapping module was incorporated to translate fertility class predictions into crop suitability recommendations, thereby enabling adaptive and data-driven agricultural decision support. Overall, the Improved SCSO-based framework improves prediction accuracy, reduces feature dimensionality, improves prediction consistency, and increases agronomic relevance through the incorporation of enzyme-driven biological indicators, making it a reliable framework for intelligent soil fertility assessment and sustainable crop recommendation. Although the proposed framework achieved high classification accuracy, the dataset was relatively small and heterogeneous, as it was collected from various studies. Therefore, the performance obtained could partly reflect the specific characteristics of the dataset used. External validation was performed on independent soil datasets from different geographic regions to comprehensively evaluate the generalization ability and robustness of the proposed framework. Furthermore, future work will focus on incorporating remote sensing and IoT-based real-time monitoring systems to adopt a dynamic crop recommendation suitable for practical agricultural applications. Additionally, advanced structured feature representations, such as tensor-based or rolled feature transformations, can be explored to better align tabular soil variables with convolutional deep learning models.