1 Introduction

Biochar is the product of biomass pyrolysis such as agricultural waste (Yu et al. 2016), sludge (Nair et al. 2020; Krueger et al. 2020; Rathnayake et al. 2022; Wu et al. 2016), animal manure (Ro 2016; Guo et al. 2019) and forest leaves (Kim et al. 2020) under low or no oxygen conditions. The main element of biochar is carbon, but it also contains oxygen, hydrogen, sulfur, nitrogen and other elements (Xie et al. 2022; Pan et al. 2021; Yang et al. 2020). Due to its large specific surface area, uniformly distributed pore size and rich functional groups, biochar can be applied as an adsorbent for the treatment of pollutants in wastewater (Luo et al. 2022; Liu and Chen 2022; Isaeva et al. 2021; Katiyar et al. 2021). Moreover, thanks to its low cost, biochar is gradually becoming a popular adsorbent (Boraah et al. 2022; Alsawy et al. 2022; Tan et al. 2022). Biochar could be applied to remove many kinds of pollutants, such as organic pollutants represented by antibiotics (Masrura et al. 2022), pesticides (An et al. 2021), dyes (Choudhary et al. 2020; Ortiz-Monsalve et al. 2020) and drugs (Jung et al. 2015) and inorganic pollutants represented by arsenic (Cha et al. 2021), cadmium (Tyagi 2022; Liu et al. 2021b), chromium, lead (Din et al. 2021; Lee et al. 2019), copper and nickel (An et al. 2019).

The adsorption performance of biochar depends on two factors, namely, internal factors and external factors (Zhang et al. 2021b; Tan et al. 2020; Wu et al. 2019). Internal factors refer to the physicochemical properties of biochar itself, while external factors refer to the setting of corresponding adsorption parameters. The physicochemical properties of biochar include specific surface area, pore size distribution,  the type and quantity of surface functional groups, which depend on the source of raw materials, pyrolysis conditions and pyrolysis method (Wu et al. 2022b; Tomczyk et al. 2020). Specially, the source of raw materials and pyrolysis conditions have a significant impact on the specific surface area and pore structure of biochar (Liu et al. 2022c). In detail, different sources of biochar, such as industrial waste and urban organic waste, have important influences on biochar formation. Among various pyrolysis conditions, pyrolysis temperature is a key parameter for biochar formation. The physicochemical properties of biochar can be improved by modifying the surface of biochar with functional groups (Wang et al. 2022b; Yang et al. 2022b; Zuo et al. 2021). Further, the experimental settings of adsorption process, such as adsorbent dosage (Li et al. 2021a), initial concentration of adsorbate (Dalhat et al. 2021; Li et al. 2020c), adsorption time, stirring speed (Jabar and Odusote 2021; Komnitsas et al. 2017), pH, coexisting ions (Tang et al. 2022; Wang et al. 2020a) and temperature (Zeng et al. 2018), have an important impact on adsorption efficiency. The adsorption performance of biochar is closely related to the synthesis and adsorption process of biochar, but there are many influencing factors. It is obviously unrealistic to enumerate through experimental methods.

The development of computational science, especially machine learning (Onyekwena et al. 2022; Ertugrul 2020; Li et al. 2020a), provides a powerful tool to reveal the complex nonlinear relationship in the process of biochar synthesis (Paula et al. 2022; Narde and Remya 2022; Zhu et al. 2019b) and adsorption (Medeiros et al. 2022; Lakshmi et al. 2021). As a new research paradigm, machine learning has been gradually employed in biochar synthesis and adsorption for more efficient pollutant removal. Selvam et al. applied various machine learning algorithms to reveal the influence and interaction of various factors on biochar yield during microwave pyrolysis (Selvam and Balasubramanian 2022). The results exhibited that microwave power was the most important factor affecting the yield and properties of biochar. Zhu et al. trained the adsorption data of biochar for six kinds of heavy metals (lead, cadmium, nickel, arsenic, copper and zinc) with artificial neural network (ANN) and random forest (RF) algorithm, and found that the characteristics of biochar had the greatest impact on adsorption efficiency (Zhu et al. 2022b). Further, Zhu et al. found that the content of oxygen-containing functional groups on the surface of biochar played an important role in Cr (VI) removal by employing machine learning (Zhu et al. 2019a). In a word, machine learning provides a powerful tool for optimizing biomass synthesis and adsorption processes, thus increasing biochar yield and adsorption performance.

In recent years, a number of machine learning applications have emerged for biochar adsorbents (Fig. 1) (Ascher et al. 2022; Yang et al. 2022a; Zhang et al. 2022e; Jeyasubramanian et al. 2021), but there is no comprehensive and systematic review from the perspective of the whole process regulation of biochar adsorbents. Summarizing machine learning of biochar adsorbents from the whole process regulation in time is beneficial to promote the integration of machine learning and biochar adsorbents. This review article comprehensively and systematically summarized the application of machine learning in biochar adsorbents from the perspective of the whole process regulation for the first time, including synthesis optimization of biochar adsorbents and modeling of adsorption process. The workflow of machine learning and the mainstream machine learning algorithms were introduced. Then, the latest progress of machine learning in the optimization of biochar adsorbent synthesis conditions was summarized, including prediction of biochar yield and physicochemical properties, optimal preparation conditions and economic evaluation. The application of machine learning in pollutant adsorption via biochar was reviewed covering prediction of adsorption efficiency, optimization of experimental parameters and revelation of adsorption behavior. General guidelines for optimizing synthesis process and modeling adsorption process of biochar via machine learning were proposed. Finally, the existing problems and future perspectives of machine learning in the research of biochar adsorbents were put forward. We hope that this review can promote the interpretability of machine learning and biochar adsorbents,  and thus light up the industrialization of biochar adsorbents.

Fig. 1
figure 1

a Number of publications and citations of machine learning for synthesis (Left) and pollutant adsorption (Right) of biochar between 2014 and 2021 in Web of Science Core Collection; b The frequency of keywords in machine learning for synthesis (Left) and pollutant adsorption (Right) of biochar; c Some milestone events in machine learning for optimizing pyrolysis process and modeling adsorption process of biochar for pollutant removal (Cao et al. 2016; Chowdhury et al. 2019; Hai et al. 2021; Li et al. 2022a; Li et al. 2022c; Palansooriya et al. 2022; Zhang et al. 2022a)

2 The overview of machine learning

2.1 General concepts of machine learning

Machine learning refers to the prediction or judgment of another part of the data after computer obtains the corresponding knowledge and rules by learning part of the data (Masood and Ahmad 2021; Nandy et al. 2021; Schleder et al. 2019; Da et al. 2022). According to the structure of data, machine learning is divided into supervised, unsupervised, semi-supervised and reinforcement learning (Zhang et al. 2022d; Tran and Ha 2022). The characteristic of supervised learning is that training data has corresponded labels (Lian et al. 2019; Zhang et al. 2018). According to the learning strategy, supervised learning is divided into generative method and discriminant method. Supervised learning is usually used for classification or regression. The dilemma of supervised learning is that it is expensive to acquire training data with target value, or even impossible to obtain training data with corresponding target value (Liu et al. 2022b; Wang et al. 2021). The characteristic of unsupervised learning lies in that there is no corresponding target value for training data (Cheng et al. 2021; Sohail and Arif 2020; Li et al. 2020b). Therefore, unsupervised learning is widely applied in clustering analysis and dimensionality reduction (Mizikovsky et al. 2022; Rovira et al. 2022; Wu et al. 2022a). The challenge of unsupervised learning is that model performance could not be well evaluated. Semi-supervised learning could be applied to these situations with a large amount of unlabeled data and a small amount of labeled data (Song et al. 2022; Ligthart et al. 2021; Tseng et al. 2020; Li and Liang 2019). Reinforcement learning realizes the interaction between model and environment, and can select the next action according to the current state and signal of environment (Padakandla 2021; Yau et al. 2017). The goal of reinforcement learning is to achieve dynamic adjustment of parameters, obtain knowledge from environment, and improve model behavior to achieve the maximum reinforcement signal. To facilitate reader understanding, the general workflow of machine learning is  summarized in Fig. 2a. Feature engineering refers to selecting appropriate descriptors as model inputs to accurately predict model outputs (Zhang et al. 2022b, 2022c). The employed descriptors usually include pyrolysis conditions, adsorption conditions, and physicochemical properties of biochar (Fig. 2b). The commonly employed machine learning algorithms for optimizing synthetic conditions and modeling adsorption processes of biochar   are presented in Fig. 2c. Further, the application of machine learning in the modeling and optimization of biochar pyrolysis and adsorption processes   is shown in Fig. 3.

Fig. 2
figure 2

a General workflow of machine learning for optimizing synthesis and pollutant adsorption processes of biochar; b The variety of descriptors for optimizing biochar pyrolysis (Left) and adsorption (Right) processes; c Mainstream algorithms for optimizing synthesis and adsorption processes of biochar for pollutant removal

Fig. 3
figure 3

Application of machine learning in optimizing pyrolysis process and modeling adsorption process of biochar for pollutant removal

2.2 Evaluation metrics for machine learning

For machine learning, error is the difference between the predicted value of the model and the true value of the sample data. According to the difference in sample data, error is divided into training error and test error. Among them, training error is called empirical error and testing error is called generalization error (Tanaka 2015). Training error reflects the learning difficulty of a given problem, and test error reflects the prediction performance of the model for unknown data sets. Over-fitting and under-fitting are common fitting problems for model training (Dahan and Keller 2021; Graham et al. 2020; Yuan et al. 2020). Over-fitting takes the local features of training data set as the whole features, and the reason is that too many parameters of model make the training error small and the test error large (Yildirim and Ozkale 2021; Avrutskiy 2020). When under-fitting occurs, the learning ability of model is weak and the basic features of training data set cannot be learned (Handelman et al. 2019; Ahmed and Isa 2017; Van Calster and Vickers 2015). In general, the relationship between test error and model complexity is parabolic. Cross-validation is commonly employed to evaluate test error (Liu et al. 2022d; Yan et al. 2020; Pardakhti et al. 2017). Generally, the scale of adsorption data set is relatively small. In order to make accurate and reliable   predictions, cross-validation is necessary, and the common cross-validation method is k-fold cross-validation (Xia et al. 2020; Yang et al. 2019). In addition, for the regression problem, the evaluation indexes of the model include:   coefficient of determination (R2) (Uddin et al. 2022; Suvarna et al. 2022), mean absolute error (MAE) (Zhang et al. 2021a; Lamoureux et al. 2021; Chang and Medford 2021), mean square error (MSE), root mean square error (RMSE) (Wei et al. 2022; Kim et al. 2021) and mean absolute percentage error (MAPE) (Mir et al. 2022; Ke et al. 2021b; Bhagat et al. 2021). For classification problems, the evaluation indicators of the model are accuracy (Liu et al. 2022d), error rate, recall rate (Somarowthu et al. 2011), balanced F score (F1 score) (Avakyan et al. 2022; Findlay et al. 2018), receiver operating characteristic (ROC) curve (Xu et al. 2022; Razavi-Termeh et al. 2021) and the area under ROC curve (AUROC or AUC) (Wan et al. 2022; Ding et al. 2022; Cashman et al. 2017).

3 Synthesis optimization of biochar

The physicochemical properties of biochar depend on synthetic conditions, which   play a key role on adsorption performance. However, due to many influencing factors involved, it is expensive and unacceptable to optimize synthetic conditions through trial and error method. Machine learning can quickly and efficiently accelerate experimental screening, so it is widely applied in the modeling and optimization of biochar synthesis. Because there are many products in the low oxygen or anaerobic pyrolysis of biomass (Egbosiuba 2022; Liu et al. 2021a; Thiruvengadam et al. 2021), covering biochar, bio-oil and biogas, accurate prediction of biochar production is the key. Secondly, the specific surface area, pore size distribution and the type and number of surface functional groups of biochar are determined by the composition of raw materials, pyrolysis temperature and pyrolysis mode. Effective optimization of synthetic parameters is the prerequisite for the preparation of biochar with excellent adsorption properties.

The synthesis process of biochar is a high-dimensional, complex and nonlinear system, thus making  machine learning applicable. Employing machine learning can quickly determine the core factors of the synthesis process of biochar and provide a useful reference for the preparation of biochar adsorbents. Taking the raw material source, carbon content, oxygen concentration, process temperature and other variables related to synthesis process as the inputs of model training, the mapping relationship between the synthetic conditions and the physicochemical properties of biochar adsorbents can be quickly constructed. In addition, in the industrialization of biochar, life cycle and economy must be considered (Azzi et al. 2022; Zhu et al. 2022c). By employing machine learning, the life cycle and economic costs of different types of biochar can be effectively evaluated. To get an intuitive understanding, successful cases of machine learning applied to optimize the pyrolysis process of biochar   are summarized in Additional file 1: Table S1, and a specific case of machine learning used to understand the pyrolysis process of biochar was presented (Fig. 4).

Fig. 4
figure 4

(Reproduced with permission from ref Dong et al. 2022). Copyright Elsevier 2022

A specific case of machine learning used to understand the pyrolysis process of biochar

3.1 Prediction of biochar yield

When discussing the synthetic conditions of biochar, some key input variables cover pyrolysis temperature, pyrolysis time, oxygen concentration, carbon content, ratio of carbon to hydrogen, ratio of carbon to nitrogen, and ash content. Compared with the existing models, the advantage of machine learning algorithm model is that it does not exclude non numerical parameters (Shima et al. 2022), and can construct a variety of solutions for input variables. Commonly employed machine learning algorithms include multiple regression, extreme gradient boosting (XGBoost), support vector machine (SVM), RF, and ANN. ANN has been widely applied because of its powerful ability to establish nonlinear mapping in high dimensional space (Harrington et al. 2022). However, RF and SVM are more cost-effective when considering data size, model convergence speed. Modeling and predicting the pyrolysis process of biochar has attracted extensive attention, which promotes the large-scale synthesis of biochar.

Generally, the performance of ANN algorithm is better than that of simple algorithm, such as multiple linear regression (MLR) and multiple nonlinear regression (MnLR). For example, multiple-input single output-ANN (MISO-ANN) and MLR were employed simultaneously to predict the mass yield of biochar, and the models were evaluated by employing R2, MAE and mean deviation error (MBE) (Abdulsalam et al. 2020). The performance of MISO-ANN model was satisfactory, while MLR model exhibited unacceptable prediction ability (Additional file 1: Fig. S1). MnLR and ANN were applied to predict the yield of biochar (Li et al. 2021b). The R2 of the optimized MnLR model was only 0.5579, while the optimized ANN model possessed higher accuracy, with R2 reaching 0.785. In order to accurately predict biochar yield, the optimal feedforward ANN (FANN) model was developed (Tee et al. 2022). The FANN model was trained employing data mined from literature. The correlation coefficient (R) of the model was greater than 0.96, R2 was greater than 0.92, and MAE, MAPE and RMSE were low, suggesting that the FANN model possessed excellent prediction performance. Merdun et al. employed two different ANN algorithms, feedforward network (FFN) and cascaded feedforward network (CFN), to predict the yield of biochar. Generally speaking, FFN and CFN exhibited similar performance, and both possessed excellent prediction ability (Merdun and Sezgin 2018). A response surface approach (RSM) and an ANN were employed to model the biochar preparation process (Gupta et al. 2022). For ANN model, R2 was close to 1 and MSE value was low, indicating that ANN achieved accurate prediction of biochar production. Interestingly, ANN was superior to RSM model in predicting biochar yield.

Because ANN algorithm is complex and its interpretability is not high, some relatively simple algorithms with high interpretability are applied to predict biochar yield. Li et al. discussed the co-pyrolysis of biochar and bio-oil via machine learning (Alabdrabalnabi et al. 2022). The hyperparameters of XGBoost were determined and optimized by grid search and cross-validation. It was found that XGBoost could accurately predict biochar yield, with RMSE of 1.77 and R2 of 0.96. Furthermore, RF algorithm can also be employed to predict the yield of biochar (Zhou et al. 2022). Zhu et al. proved that RF can respond to biomass characteristics and pyrolysis conditions, and then accurately predict biochar production (Zhu et al. 2019b).

Some relatively simple machine learning algorithms sometimes even show better model performance than ANN algorithm. Cao et al. compared the traditional ANN model with the least squares support vector machine (LS-SVM) model in order to predict the biochar generated from cow manure pyrolysis, employing laboratory-scale fixed bed adsorption data as samples (Cao et al. 2016). ANN and LS-SVM both could be applied to predict biochar production, but the prediction performance and robustness of LS-SVM model were superior to those of ANN model. However, LS-SVM algorithm may fall into local optimization. In order to overcome these shortcomings, an adaptive neuro fuzzy inference system (ANFIS-SSO) employing social-spider optimization algorithm was designed to predict biochar production (Ewees et al. 2017). Compared with classical ANFIS, particle swarm optimization (PSO), artificial bee colony and LS-SVM, ANFIS-SSO model possessed better prediction performance. The hybrid model integrating ANFIS and Grey Wolf optimization algorithm can also avoid falling into local optimum (Ewees and Elaziz 2018).

Ensemble learning, especially when combined with optimization algorithms, may possess  significantly better model accuracy than other algorithms including ANN. Haq et al. developed a series of machine learning models combining genetic algorithm (GA) and PSO to evaluate biochar yield (Haq et al. 2022). Specifically, GA and PSO algorithms were coupled with ensemble learning, decision tree, SVM and ANN respectively. The results exhibited that the integrated learning tree (ELT-PSO) model was superior to all other models, with R2 of 0.99 and RMSE of 2.33, achieving the successful prediction of biochar yield. A user-friendly software based on ELT-PSO model was developed, which is beneficial to avoid a lot of expensive experiments. The integration of Taguchi method into ANN can maximize the prediction of biochar yield in pyrolysis reaction (Albalasmeh et al. 2020). Taguchi method was applied to set multi-factor and horizontal experimental parameters as input variables, and the improved ANN exhibited satisfactory performance in predicting the maximum yield of biochar, indicating that the ANN combined with fast propagation algorithm is an appropriate method to predict the yield of biochar. It should be pointed out that metaheuristic algorithm was reported to be integrated into ANN models, significantly improving prediction accuracy (Khan et al. 2022). Further,  combining the ANFIS-SSO and PSO algorithm, the prediction performance of model could be improved (Abd El Aziz et al. 2017). The optimized ANFIS-SSO took pyrolysis temperature, heating rate, holding time, water content and sample quality as input parameters, and achieved satisfactory prediction performance of biochar quality and yield.

3.2 Intelligent design of biochar surface structures

Machine learning can not only predict the yield of biochar, but also be used for intelligent design of the surface properties of biochar, such as element composition, specific surface area, surface functional groups, etc. A 2 × 5 × 1 ANN was developed to predict the pyrolysis behavior of groundnut shell at heating rates of 5, 10 and 20 °C min−1 (Hai et al. 2021). The values predicted by ANN were highly consistent with the experimental values (R2 > 0.999), accurately fitting the pyrolysis behavior of GNS. Tee et al. developed a FANN model to predict the BET surface area of biochar (Tee et al. 2022). It was found that the relative importance of variables affecting BET specific surface area was the ratio of C and H, ash content, residence time, heating rate, pyrolysis temperature, O, fixed carbon, volatile matter, moisture content and N. It could be stated that ultimate analysis had the most significant impact on BET specific surface area, followed by pyrolysis conditions and proximate analysis. The ultimate analysis significantly affected the structure of biochar. For example, the removal of hydrogen and oxygen at a pyrolysis temperature of  > 500 °C promoted the aromatization and carbonization of the biochar structure (Kwiatkowski and Kalderis 2020). Pyrolysis conditions possessed important effects on BET specific surface area. For example, the rise of pyrolysis temperature led to the decomposition of organic substances in biomass raw materials, thus effectively removing volatile substances, producing more pores and increasing specific surface area. The heating rate also affected the BET specific surface area of biochar (This expression is a bit puzzling here.). The specific surface area first increased and then decreased with the increase of residence time. However, it should be noted that ash content may cause the reduction of BET specific surface area, because the tiny ash content may occupy the pores and voids on the surface of biochar. Liao et al. developed a multi-layer FANN model to predict the surface area of biochar (Liao et al. 2019). The trained ANN showed excellent model accuracy (R2 > 0.9) and was highly consistent with independent experimental data. Contribution analysis was carried out to understand the effects of different technological factors on the surface area of biochar. Liew et al. constructed a FANN with heating rate, residence time, pyrolysis temperature, ultimate and proximate analysis as descriptors. The FANN with backpropagation algorithm was trained to simulate the pyrolysis process of biomass and successfully predict the element ratio and surface area of various biochar types (Liew et al. 2022). In addition to ANN algorithm  that could be used for predicting the physicochemical properties of biochar, some simple algorithms are also applicable. For example, Wani et al. successfully employed a k-nearest neighbor (kNN) algorithm to predict the surface area, hydrogen-carbon ratio, and oxygen-carbon ratio of different types of biochar from volatile matter content, pyrolysis conditions, and pH (Wani et al. 2020). It was found that BET surface area increased with increasing pH or temperature, but decreased with increasing volatile substance content. Volatile substance content was the most important parameter affecting hydrogen-carbon ratio, and adsorption was the most important parameter affecting oxygen-carbon ratio.

3.3 Optimization of process parameters

In the preparation of biochar, the selection of raw materials and process parameters is the core step. In particular, to obtain biochar with high adsorption performance, the large specific surface area and abundant surface functional groups are essential. The key factors affecting biomass pyrolysis to biochar include the elemental composition, structural composition, particle size and pyrolysis conditions of biomass (Lakshmi et al. 2021). The elemental composition includes the elemental proportion of C, N, O and H. The structural composition refers to the content of moisture and ash, and the relative content of lignin, hemicellulose and cellulose. The pyrolysis conditions are determined by pyrolysis rate, heating temperature and residence time. Machine learning algorithm could quickly determine the importance of raw materials and process parameters to the yield and properties of biochar, which is conducive to the purposeful production of high-yield biochar with excellent adsorption performance. Linear regression, RF, SVM, ANN and improved ANN are the mainstream algorithms employed to analyze the preparation process of biochar, and provide meaningful references for the preparation of biochar.

MLR model exhibited that volatile substances, ash content and temperature were significant factors affecting the yield of biochar (Narde and Remya 2022). A machine learning model was established by polynomial regression to predict the pyrolysis product yield of microwave-assisted sawdust (Potnuri et al. 2022). It was found that increasing pyrolysis temperature decreased the production of biogas and bio-oil, and significantly increased the production of biochar. However, the scale of the problem that can be handled by linear regression is small, and the information obtained is limited. Some advanced machine learning algorithms were employed to predict the yield and characteristics of biochar. Through XGBoost, it was found that pyrolysis temperature, N/C, H/C, reaction time and ash content were the core parameters that  determined the yield of algae biochar (Pathy et al. 2020). Pearson correlation coefficient matrix covered the correlation between input variables and biochar production. The analysis of feature importance revealed that pyrolysis temperature was the most important factor determining the yield of biochar. Li et al. constructed a machine learning model to predict the physicochemical properties of biochar employing pyrolysis conditions as input parameters (Li et al. 2019b). The machine learning model was expected to quantitatively evaluate the effects of raw material type and pyrolysis temperature on the yield and properties of biochar. The results showed that although the yield, specific surface area, cation exchange capacity, pH value, volatile and ash content and elemental composition of biochar were limited by many factors, the characteristics of biochar depended largely on the type of raw materials and pyrolysis temperature.

RF algorithm is proved to be an ideal method for evaluating biomass pyrolysis products. Evaluating the yield of pyrolysis products by RF algorithm is beneficial to optimize pyrolysis process. Dong et al. employed RF algorithm to predict the yield of biochar, bio-oil and biogas under co-pyrolysis conditions (Dong et al. 2022). It was found that the most critical factors to predict the yield of pyrolysis products were moisture content, carbon content and final heating temperature, and the characteristics of biomass were more central than pyrolysis conditions. Carbon content had a negative effect on biochar yield, and a positive effect on bio-oil yield. The final temperature possessed a negative effect on biochar yield, and a positive effect on pyrolysis gas yield. RF algorithm also proved that pyrolysis conditions determined the yield of biochar, and the relative contribution was higher than the biomass characteristics represented by element composition and structure information (Zhu et al. 2019b).

ANN could be applied to evaluate the importance of operating parameters in the preparation of biochar, so as to synthesize biochar adsorbents with ideal adsorption properties (Abdulsalam et al. 2020). Model results exhibited that the most important factors affecting the physical and chemical properties of biochar were reaction temperature and retention time. When the temperature  was set to 180 °C and the retention time was determined to be 11.5 h, the adsorption capacity of biochar for Pd2+ reached 89.52 mg g−1. Also, the best operating parameters for pyrolysis of banana peel into biochar were determined by training ANN (Bong et al. 2022). ANN was applied to construct a comprehensive data-driven model based on pyrolysis conditions and biomass raw material composition to predict the preparation process of biochar (Li et al. 2022b). It was found that pyrolysis temperature, nitrogen content and ash content were the core parameters affecting the yield and composition of biochar (Additional file 1: Fig. S2). In addition, pyrolysis conditions also significantly affected the BET surface area of biochar. By testing ANN with 48 different network structures and combining sensitivity analysis, it was found that gas flow rate was the most critical factor in the generation of biochar, followed by holding time and pyrolysis temperature (Altikat and Alma 2022a). The deep artificial neural network (DNN) model showed that the effect of holding time on the yield of biochar and bio-oil was higher than other parameters under co-pyrolysis  conditions (Altikat and Alma 2022b). It should be pointed out that ANN was proved to be able to predict the pyrolysis kinetics of biochar (Mayol et al. 2018).

3.4 Evaluation of economic cost

Although the pyrolysis of biochar has developed into a relatively mature commercial technology (Li et al. 2022a; Shahbaz et al. 2021; Masek et al. 2013), the large-scale production of biochar involves many factors, covering the source of raw materials and pyrolysis conditions, so it is difficult to conduct a comprehensive economic and environmental assessment. In the economic and environmental evaluation of biochar synthesis process, there are two major limitations: (1) Under the premise of a single type of biomass, evaluate the economic and environmental effects of biochar under different pyrolysis conditions; (2) Under the same pyrolysis condition, carry out economic and environmental analysis of pyrolysis for different types of biomass  into biochar. By employing machine learning, the economic, energy and environmental effects of various raw materials under different pyrolysis conditions could be evaluated. Employing the existing experimental data as the training set, the RF model was employed to predict the biochar yield and characteristics of different raw materials under various pyrolysis conditions (Cheng et al. 2020). Further, integrating RF algorithm, economic analysis and life cycle assessment, the net global warming potential (GWP),   energy return on investment (EROI) and minimum product selling price (MPSP) in the process of biochar preparation were obtained (Additional file 1: Fig. S3). The results exhibited that the slow pyrolysis of wood waste and crop residues was an economic and commercial technology. The fluctuation range of MPSP was 774–1256 US dollars ton−1, which is determined by pyrolysis temperature and the type of raw materials. It is necessary to balance the economic effect and environmental impact of biomass. Pyrolysis sludge at low temperature corresponded to the best MPSP, while pyrolysis lignocellulose at high temperature covered the best overall energy and environmental performance. The potential income of biochar from existing pyrolysis plants in the world was evaluated through life cycle analysis (Han et al. 2021). The results exhibited that the net income of the existing 144 pyrolysis plants increases with the increase of plant capacity and biochar price. In Europe and the United States, the potential income from the construction of new pyrolysis plants is optimistic. Inconvenient transportation, poor land and low availability of crop  reduce reduces the potential income brought by biochar.

4 Modeling of pollutant adsorption with biochar

Biochar is an effective material to remove heavy metals and organic pollutants from wastewater. The characteristics and operating conditions of biochar could affect the effectiveness of treatment process. The characteristics of biochar include specific surface area, surface functional groups, pH and element composition of biochar, etc. The operating conditions cover the initial concentration of metal, contact time, temperature and the presence of competitive ions. The adsorption process of pollutants on biochar is a highly complex nonlinear system related to the pyrolysis conditions, physicochemical properties and adsorption conditions of biochar, which naturally makes machine learning applicable. Machine learning has been widely reported to model pollutant adsorption processes on biochar, involving predicting adsorption efficiency, optimizing process parameters, and revealing adsorption mechanism. Furthermore, machine learning is more effective in modeling the adsorption process of pollutants on biochar, compared with the existing kinetic equation and isotherm equation (Reddy et al. 2021). In order to facilitate readers to better deploy machine learning to biochar for modeling and optimizing the adsorption process of pollutants, successful cases of machine learning   are systematically summarized in Additional file 1: Table S2. A special case that clearly describes the design of biochar for pollutant adsorption via machine learning was presented (Additional file 1: Fig. S4).

4.1 Prediction of adsorption efficiency

Existing models, such as MLR, can only assess adsorption processes at specific equilibrium concentrations or under certain adsorption isotherm models. Compared with MLR, advanced machine learning algorithms possess significantly excellent prediction accuracy and robustness, among which ANN algorithm is widely applied (Chowdhury et al. 2019; Praveen et al. 2021; Yadav and Jagadevan 2021; Kang et al. 2022). For example, as a black box model with strong fitting, ANN can predict the equilibrium concentration of organic compounds on the surface of biochar (Zhang et al. 2020). Hanandeh et al. employed ANN combining several radial basis functions and gradient enhancement algorithms to model multiple input and multiple output processes, and achieved highly accurate prediction (R2 > 0.99) (El Hanandeh et al. 2021). ANN provides the best match with the experimental data, allowing accurate prediction of how the adsorption system responds to changes in operation. Yadav et al. performed an ANN modeling to predict the adsorption removal of copper ions (Yadav et al. 2021). Under optimized conditions, MAE, RMSE and R2 provided by ANN model were 2.63, 4.60 and 0.91, respectively, which well  evaluated the adsorption process of copper ions on biochar surface.

However, the dilemma faced by ANN algorithm is that the size of adsorption data set is generally small, resulting in over-fitting. Moreover, the availability of most ANN models is low. In order to overcome the limitations faced by ANN, some non-ANN algorithms have been applied to predict the adsorption capacity and adsorption efficiency of biochar and the equilibrium concentration of pollutants (Li et al. 2019a). RF, generalized linear models and SVM were proved to be able to accurately predict the performance of vertical flow constructed wetlands using biochar to remove organic wastes, and the R2 and the RMSE of whole fitting data achieved 74.0% and 5.0 mg L−1, 80.0% and 0.3 mg L−1, 90.1% and 2.9 mg L−1, and 48.5% and 0.5 mg L−1 for BOD5_VF1, NH4- N_VF1, BOD5_VF2, and NH4-N_VF2, respectively (Nguyen et al. 2021). With pH, amount of adsorbent, contact time and initial lead concentration as inputs and adsorption capacity as outputs, it was found that SVM could accurately evaluate the adsorption process of lead ions on biochar (Talebkeikhah et al. 2020). Yang et al. developed a data-driven machine learning tool to successfully predict the maximum adsorption capacity (Qm) of 19 pharmaceutical compounds on biochar (Yang et al. 2022a). It was found that k-nearest neighbor (kNN) was the most ideal algorithm, with RMSE of 23.48, followed by RF and cubist, accompanied by RMSE of 26.91 and 29.56, respectively (Additional file 1: Fig. S5).

Some non-ANN algorithms even exhibit better model accuracy than ANN. Based on 353 adsorption experimental data in literature, the ability of RF and ANN to predict the adsorption of six heavy metals (lead, cadmium, nickel, arsenic, copper and zinc) on biochar was compared (Zhu et al. 2019a). Compared with ANN model (R2 = 0.948), RF model possessed better model prediction performance (R2 = 0.973). Further, the generalization ability of RF model was better than that of ANN model. It should be emphasized that RF possesses a higher tolerance for data loss than ANN (Sun et al. 2022). Kriging and multi parameter linear free energy relationship (LFER) models were employed to predict the adsorption capacity of organic pollutants on biochar (Zhao et al. 2022). The prediction accuracy of Kriging-LFER model (R2 up to 0.940 and 0.976, respectively) was 7% and 9.6% higher than that of ANN-LFER model (R2 up to 0.870 and 0.880, respectively).

The advantage of ANFIS lies in the combination of neural network and fuzzy logic (Adedeji et al. 2020; Karaboga and Kaya 2018). In theory, ANFIS may  possess more advantages than ANN in predicting the adsorption of pollutants on biochar, and thus ANFIS is widely applied (Ohale et al. 2022; Bisaria et al. 2022). For example, the adsorption efficiency data of Cu(II) ions on biochar were constructed through laboratory batch studies, and the  model efficiencies of ANFIS, ANN and MLR were compared (Wong et al. 2020). ANFIS model exhibited the best model performance, with the accuracy of 90.24% and 87.06% for training and testing data sets, respectively. ANN model exhibited a weaker predictive performance than ANFIS model. Due to the complex relationship between variables, the MLR model was not applicable. ANFIS, ANN, GA and RSM were employed to evaluate the simultaneous adsorption and removal of chemical oxygen demand (COD) and total organic carbon (TOC) on tea waste biochar (TWBC) (Alhothali et al. 2022). The applied model exhibited the following order of performance: ANFIS > ANN-GA > RSM-GA > RSM. ANFIS also showed better model performance than RSM and ANN for decolorization of activated yellow 81 (RY81) in aqueous solution via biochar (Ravindiran et al. 2022).

The integration of different machine learning algorithms can sometimes overcome the problem of poor prediction accuracy of a single algorithm (Talebkeikhah et al. 2020; Yu et al. 2021). The queue search algorithm (QSA) based on human activities was employed to optimize the parameters of ANN model, which has significantly improved the prediction ability of ANN (Additional file 1: Fig. S6) (Zheng and Nguyen 2022). SVM, RF, ANN, M5Tree and Gaussian process algorithms were employed as key algorithms, and each model was packaged to generate a new integrated model;  thus 20 intelligent models were developed and evaluated (Ke et al. 2021a). Among them, SVM-ANN model possessed the most accurate and reliable prediction performance. The above shows that the integrating multiple models is conducive to improving the prediction accuracy of a single model.

Further, the type of descriptor proved to significantly affect model accuracy. Zhu et al. applied RF algorithm to model the adsorption process of pharmaceuticals and personal care products (PPCP) on biochar (Zhu et al. 2022a). Employed descriptors included PPCP and biochar properties and adsorption conditions. It was found that the RMSE was reduced by 18–24% in the model that employed biochar properties such as surface functionality and hierarchical porous structure as descriptors. Specifically, the use of   functional group information, surface element composition and specific structural properties collected from XPS data as descriptors could significantly improve the accuracy of the model.

It should be pointed out that although the common descriptors applied to predict the adsorption performance of biochar are the physicochemical characteristics of biochar and the operating conditions of adsorption process, however, the experimental parameters of the pyrolysis process of biochar may also be employed to predict the adsorption performance of biochar, because the pyrolysis conditions of biochar are directly related to the characteristics of biochar. For example, Albalasmeh et al. successfully predicted the adsorption capacity of biochar for MB using the operating conditions of biochar pyrolysis (particle size, parent biomass type, pyrolysis temperature) as descriptors and the adsorption capacity of methylene blue (MB) as evaluation indicators (Albalasmeh et al. 2020).

4.2 Optimization of experimental conditions

Establishing the nonlinear relationship between operating conditions and the adsorption performance of biochar for pollutant removalgreatly facilitates the design of adsorption devices with excellent performance, such as adsorption column and adsorption bed. Thanks to the economy, efficiency and strong prediction ability of machine learning, it is possible to optimize the adsorption process of pollutants on biochar. Common algorithms applied to optimize operating parameters for improving the adsorption performance of biochar include RF, SVM, ANN and ANFIS.

Linear regression is a simple machine learning model, which can be applied to optimize the adsorption process of pollutants on biochar. Nguyen et al. employed linear regression to optimize the adsorption of 19 drugs on biochar (Nguyen et al. 2022). It was found that the equilibrium adsorption capacity of biochar was strongly affected by the characteristics of biochar (including pore volume, specific surface area and pore structure), but not by the characteristics of pollutants and experimental conditions except the initial concentration of drugs.

Due to the inherent limitations of linear regression, such as the low robustness of the model, some advanced machine learning algorithms with high explanatory power are employed to optimize the adsorption process of pollutants on biochar, such as RF, SVM and Kernel extreme learning machine (KELM). For example, RF was used to analyze 559 separate Langmuir adsorption isotherm data covering the adsorption capacity and affinity of biochar for 17 different metals, revealing the effectiveness of several parameters in the preparation process of biochar for the adsorption of heavy metals (Additional file 1: Fig. S7a and b) (Thomas et al. 2020). It was found that the key factor affecting the adsorption capacity and affinity of biochar for metal pollutants was the raw materials used (Additional file 1: Fig. S7c and d). Nutrient intensive raw materials (animal biological waste, sludge and feces) were considered to be the best way to prepare biochar. Beigzadeh et al. believe that RF model is so accurate because it can capture the nonlinear relationship between the input data and its related removal ability (Beigzadeh et al. 2020). In addition, Palansooriya et al. applied RF and SVM to optimize the immobilization efficiency of heavy metals in biochar modified soil (Additional file 1: Fig. S8) (Palansooriya et al. 2022). It was found that the most significant factors affecting the immobilization of heavy metals were the nitrogen content in biochar (0.3–25.9%) and the application rate of biochar. Furthermore, the relative importance order of selected influencing factors was: biochar property > experimental conditions > soil property > heavy metal property. Zhao et al. proposed the KELM and Kriging model for the adsorption of heavy metals on biochar (Zhao et al. 2021). It was found that adsorption efficiency was strongly related to pH and temperature.

ANN is widely applied to optimize the process parameters of pollutant adsorption on biochar (Salawu et al. 2022; Mondal et al. 2016, 2017; Mukherjee et al. 2022). For example, Dalhat et al. employed a FANN coupled with nonlinear regression generalized decay function (GEDF) to optimize the adsorption process of o-cresol and phenol on a fixed bed of biochar (Dalhat et al. 2021). The ANN model combined with contour method, Garson algorithm and performance decomposition was applied to determine the relative importance of operating variables. The operating variables follow the sequence:  initial concentration > flow rate > time > bed depth or activated date palm biochar (DPBC) quality. Specifically, increasing the flow rate resulted in a linear or even exponential increase in the concentration of adsorbate effluents. The higher DPBC bed depth caused a slight linear decrease in the concentration of adsorbate effluents. When the initial concentration was 100 mg L−1, the bed depth was 13.3 cm, and the flow rate was 5 mL min−1, the bed capacity reached the maximum. Further, coupling ANN and other algorithms, such as PSO, can further improve the applicability of ANN for optimizing adsorption conditions (Wang et al. 2022a).

It should be pointed out that there are some disputes about the importance of the chemical and structural characteristics of biochar for the pollutant adsorption performance of biochar. The adsorption of uranium by biochar was optimized, and the results revealed that compared with the chemical characteristics of biochar, the structural characteristics of biochar, such as specific surface area, played a more critical role in uranium adsorption (Da et al. 2022). Furthermore, when the average pore diameter of the adsorbent was 2.5–32.5 times of the maximum diameter of PPCP molecule, the adsorption of PPCP was obviously promoted (Zhu et al. 2022a). On the contrary, Zhu et al. optimized the adsorption of six heavy metals on biochar based on the model output of metal types, environmental conditions (such as temperature and pH), biochar characteristics and the initial concentrations  of heavy metals and biochar (Sun et al. 2022). The characteristics of biochar were considered to be the most important factors  for adsorption efficiency, and the relative importance of the cation exchange capacity (CEC) and pHH2O of biochar even accounted for 66% of the characteristics of biochar while that of   the surface area of biochar was only 2%. The reasons for these inconsistencies need to be further clarified to obtain high adsorption capacity and fast adsorption rate. In general, compared with pollutant concentration and other adsorption parameters, the adsorption capacity of biochar is strongly controlled by the physicochemical properties of biochar, including surface properties, pore structure, pore volume and specific surface area. Furthermore, the model built by detailed biochar properties (such as surface functionality and graded porous structure) was more accurate than that built by general information (such as volume element composition and total pore volume) (i.e., RMSE was reduced by 18–4%) (Zhu et al. 2022a). In the prediction of adsorption capacity, the order of relative importance of surface carbon functional groups was C–O bond > C–O bond > nonpolar carbon. This  indicates that the surface properties of biochar may be crucial in the adsorption capacity.

4.3 Revelation of adsorption mechanism

The adsorptive removal of pollutants in wastewater on the surface of biochar follows many mechanisms, such as ion exchange, precipitation, cation-π interaction, complexation and electrostatic interaction, which is a highly complex system (Goswami et al. 2022; Kabir et al. 2022). As a new research method, machine learning is a powerful tool to reveal the adsorption mechanism of biochar for pollutant removal. Liu et al. systematically revealed the adsorption mechanism of antibiotics on biochar (Liu et al. 2022a). It was found that increasing the concentration of antibiotics was conducive to enhancing the adsorption of antibiotics on biochar. The higher the initial concentration of antibiotics, the stronger the adsorption capacity, which may be due to the traction effect caused by concentration gradient. In addition, the larger specific surface area provided more adsorption sites for antibiotics. When specific surface area was less than 300 m2 g−1, increasing specific surface area  meant promoting adsorption. When specific surface area exceeded 1500 m2 g−1, it exhibited an inhibition trend, which may be due to the fact that the increase of specific surface area hindered other physicochemical properties of biochar, thereby reducing the overall adsorption capacity of biochar to antibiotics. Furthermore, the pH of the solution (pH solution) affected adsorption process by the surface charges of biochar and antibiotics. When the pH of the solution was lower than zero charge point, the surface of biochar was negatively charged. With the increase of pH, the dependence of adsorption on solution pH first increased, then became constant, and finally decreased, due to the electrostatic interaction between biochar and antibiotics. The influence of EtOH on As(III) adsorption mechanism was quantitatively elucidated by machine learning (Zafar et al. 2017). EtOH (concentration 40 μg L−1) could enhance the adsorption of As(III) on biochar through ligand–metal binding complexation mechanism. When the pH increased from 2 to 7, it was observed that the adsorption capacity of As(III) increased first and then decreased, due to the electrostatic repulsion between the main univalent non-ionic species of As(II) and the surface negative charge of biochar. The partial dependence graph of Cr(VI) removal rate on the physicochemical properties of biochar was applied to reveal the adsorption mechanism of Cr(VI) (Additional file 1: Fig. S9) (Zhu et al. 2022b). It was found that the adsorption process of Cr(VI) on iron modified biochar composite was divided into three stages (Additional file 1: Fig. S9b). In the first stage, the Cr(VI) removal capacity of iron modified biochar composite reached a local peak, which may be attributed to the carbon defect of electron donor on the condensed polyaryl carbon matrix. In the second stage, Cr(VI) could be effectively adsorbed through direct complexation, electron donor and indirect electron mediation. In the third stage, increasing the O/C ratio reduced the adsorption capacity of iron modified biochar composite, which may be attributed to the poor structure of biochar and the active adsorption sites on the surface of biochar that were difficult to access.

Generally, there is a linear dependence between reaction barrier and adsorption energy, that is, the Bronsted Evans Polanyi (BEP) relationship (Cao 2022). On the one hand, reaction barrier can be applied as an evaluation index of adsorption energy. On the other hand, lowering reaction barrier may be conducive to the weak adsorption of pollutants, which facilitates the subsequent disposal of pollutants. However, it should be pointed out that there is a lack of deployment of machine learning  in predicting the adsorption energy of biochar for different pollutants and the related scaling relationship, which needs to be strengthened for a more comprehensive picture of pollutant adsorption on biochar.

The adsorption mechanism can be intuitively understood by giving the distribution image of pollutants in biochar particles. A 3D in situ visualization method was established to qualitatively and semi quantitatively characterize Pb (II) adsorption distribution in biochar particles (Zhang et al. 2022a). Specifically, the biochar and the biochar adsorbed Pb (II) were imaged by X-ray micro CT (Additional file 1: Fig. S10a). Then, K-means clustering algorithm was employed to segment sample images, and optimal segmentation thresholds were set as 6000 HU, 7,000 HU and 1,300 HU respectively. Finally, rendered images of Pb(II) adsorption distribution in biochar were presented (Additional file 1: Fig. S10b). This in-situ visualization method provides a new method for revealing the adsorption mechanism of pollutants on biochar.

5 Statistical analysis and general guidance for biochar

In order to facilitate the deployment of machine learning to biochar, the application of machine learning in biochar pyrolysis and adsorption for pollutant removal was comprehensively analyzed (Fig. 5). The adsorption data set of biochar for pollutant removal is generally constructed by a top-down method, that is, obtaining first-hand data through batch experiments or extracting published experimental data from literature through data mining technology. The bottom-up method based on (first principal calculation ? or first-principles calculation ?) or molecular dynamics simulation is hardly employed to build the adsorption data set of biochar for pollutant removal, which may be due to the difficulty in establishing a true and accurate calculation model of biochar. In the process of biochar pyrolysis, the top five machine learning algorithms employed frequently include ANN, RF, SVM, XGBoost, and MLR (Fig. 5a). For the adsorption of pollutants on biochar, the situation is somewhat different, and the top five machine learning algorithms applied include ANN, RF, SVM, ANFIS, and GA (Fig. 5b). R2 and MSE are the most frequent model evaluation indexes in biochar pyrolysis and pollutant adsorption (Fig. 5c and d). For the adsorption of pollutants by biochar, heavy metals, PPCPs and dyes are the most concerned types of pollutants, accounting for 73%, 13.5% and 6.8%, respectively (Fig. 5e). Further, according to the frequency of occurrence, the heavy metals employed include Pb(II), Cu(II), As(III), Cd(II),  and Zn(II) (Fig. 5f). For biochar pyrolysis, the commonly employed input variables include pyrolysis parameters, source and physicochemical properties of biochar. The commonly applied output variable is the yield of biochar. For the adsorption of pollutants on biochar, the commonly employed input variables are the physicochemical characteristics of biochar, the valence state, molecular weight, functional group of pollutants, initial concentration, temperature, stirring time, stirring frequency, adsorbent dosage and pH. The pyrolysis parameters of biochar are sometimes employed as input variables for modeling adsorption process. The commonly applied output variables include adsorption capacity, adsorption efficiency and removal efficiency. At present, adsorption energy or Gibbs free energy has not been used as an output variable .

Fig. 5
figure 5

Comprehensive statistics on the applications of machine learning in optimizing biochar pyrolysis and modeling adsorption process of biochar for pollutant removal. a The frequency of algorithms employed in machine learning for biochar pyrolysis; b The frequency of algorithms employed in machine learning for pollutant removal via biochar; c The frequency of model evaluation indexes employed in machine learning for biochar pyrolysis; d The frequency of model evaluation indexes employed in machine learning for pollutant removal via biochar; e The ratio of pollutants in machine learning for adsorption via biochar; f The frequency of heavy metal elements in machine learning for adsorption via biochar

For the modeling of biochar synthesis and adsorption, when focusing on the optimization of process parameters, the highly interpretable algorithms such as kNN, SVM and RF can be employed for prediction and evaluation. The advantages of the kNN algorithm lie in its simplicity, convenience and excellent performance. The principle of SVM algorithm is to minimize structural risk, which is manifested in the minimization of empirical risk and confidence interval, making SVM friendly to small sample data sets. As an integrated algorithm based on decision tree, RF is particularly suitable for analyzing feature importance, even for high-dimensional data sets. However, ANN algorithm may not be suitable for optimizing experimental conditions, because of its inherent shortcomings, namely, it is unable to provide analytical formulas, and the weight value obtained is not a regression coefficient, so it cannot be employed to analyze causality. However, ANN possesses the ability to express any nonlinear relationship, so it is applicable when the yield or adsorption efficiency prediction is concerned. However, attention should be paid to the size of the dataset when selecting ANN. In general, ANN is prone to over-fitting on small-scale data sets, so it is not applicable. In addition, thanks to fuzzy logic, ANFIS may show stronger model accuracy than ANN.

Generally, the optimal machine learning model often shows significantly superior prediction accuracy compared with the original machine learning model. Hyperparameter optimization is an essential step to obtain the optimal machine learning model. Common hyperparameter optimization methods include grid search, random search and Bayesian optimization (Bischl et al. 2023). It should be pointed out that for small data sets, automatic parameter adjustment may be a convenient way, but it depends on the experience of the tester. Further, single machine learning model may not be applicable, especially for some sparse data sets. In order to solve the dilemma faced by single machine learning model, some machine learning technologies have been developed. An integrated learning method is a meta-algorithm that combines multiple machine learning technologies into one machine learning model to achieve bagging, boosting or stacking (Deng et al. 2020; Ye et al. 2021). The prediction performance of integrated learning model is better than that of single machine learning model. In addition, modern machine learning models are extremely complex,   and it is appropriate to optimize models by iteration. Active learning tries to solve the labeling bottleneck of samples, and actively selects the most valuable unlabeled samples for labeling first, so as to achieve excellent model accuracy with as few labeled samples as possible (Faulon and Faure 2021; Sayin et al. 2021). Active learning could overcome the shortcomings of traditional machine learning to some extent. In short, the optimal machine learning model can be obtained through hyperparameter optimization, integrated learning and active learning.

In order to facilitate the rapid deployment of machine learning to biochar, the scope, benefits, and limitations of different machine learning models and descriptors are presented in Additional file 1: Tables S3 and S4. An application guide of machine learning for biochar synthesis optimization and adsorption modeling was proposed (Fig. 6). Before model training, it is necessary to build a data set of pyrolysis process and adsorption process. It is recommended to employ batch experiments or mine useful information in published literature to build data sets for model training. For the pyrolysis process of biochar, it is recommended to use pyrolysis temperature, pyrolysis time, source of biochar, carbon content in feed, oxygen concentration, carbon to hydrogen ratio, carbon to nitrogen ratio and ash content as descriptors. It is recommended to employ biochar yield   as the output variable. It should be pointed out that when co-pyrolysis is considered, the competitive reaction of biochar, bio-oil and biogas may be involved. At this time, appropriate descriptors need to be carefully selected. When biochar is used for pollutant adsorption, it is recommended to employ the physicochemical properties of biochar, the electronic properties and structural properties of pollutants, operating parameters (adsorption time, temperature, stirring rate, pH, adsorbent dosage, pollutant concentration and coexisting competitive ions) as descriptors. Equilibrium concentration, adsorption capacity, adsorption efficiency or removal efficiency are recommended as output variables. Because there is a significant causal relationship between these recommended descriptors and biochar yield or adsorption performance, and clear model expressions can be obtained to improve the interpretability of model. Furthermore, if the data set is successfully constructed by bottom-up method, it is beneficial to understand the pyrolysis and adsorption processes of biochar at the electronic and atomic levels. In particular, the adsorption data set constructed by the bottom-up approach may facilitate the understanding of the nonlinear dependence of adsorption process. For the adsorption data set constructed by the bottom-up method, the electronic properties represented by p-band center, d-band center, orbital electron number, first ionization energy and electronegativity are recommended as descriptors. The recommended output variable is adsorption energy or Gibbs free energy. In order to select an appropriate training model, it is necessary to integrate various factors, including the nature of the problem concerned (regression, classification or clustering), the computing power of existing resources, the method to build a dataset, the accessibility of the number of data points, and the content of the output variables concerned. Considering that the scale of biochar datasets is generally small, the algorithms represented by RF and SVM may be appropriate. Blind employment of ANN algorithm may be inappropriate, especially when the data size is limited. ANN and ANFIS are particularly suitable when the data scale is large and the problem concerned is the yield or adsorption capacity of biochar. When selecting model evaluation indicators, R2 and RMSE are recommended as unified model evaluation indicators for regression problems. When machine learning is applied  to biochar, it is mainly concerned with regression problems, that is, predicting the yield of biochar and its adsorption capacity for pollutants, and interpretability analysis for the pyrolysis and adsorption processes of biochar. Machine learning has rarely been reported for the classification of biochar. However, considering that sometimes the concern is whether the biochar prepared is a superior adsorbent in the larger searchable, several evaluation indexes of machine learning classification problems applicable to the whole process of biochar adsorption were given. For classification problems, it may be appropriate to select accuracy, error rate, recall rate, F1 and AUC.

Fig. 6
figure 6

General guidelines for the application of machine learning in the whole process regulation of biochar from synthesis to adsorption

6 Conclusions and future perspectives

In conclusion, this review comprehensively summarized the latest progress of machine learning for biochar adsorbents from the perspective of the whole process regulation for the first time, covering optimization of pyrolysis process, evaluation of economic costs and modeling of adsorption process. The workflow of machine learning and the frequently employed machine learning algorithms for biochar were systematically summarized. The general guidance of machine learning for optimization of biochar pyrolysis process and adsorption process for pollutant removal was proposed. In order to facilitate the synthesis optimization and adsorption modeling of biochar for pollutant removal via machine learning, the following issues need to be carefully considered:

  1. 1.

    The scale and reliability of data sets are key to the deployment of machine learning into biochar. Because biochar synthesis is a complex system and the DFT calculation of adsorption enthalpy is expensive, the idea of constructing data set from bottom to up by theoretical calculation is not practical. Therefore, a top-down approach is generally required to obtain the corresponding data set. However, there is a lack of corresponding data database. In addition, due to the existence of experimental errors and differences in experimental parameters, there are some anomalies in the data set. Developing automatic experimental instruments that can produce a large amount of field data in a short time and establishing biochar database   are beneficial to the integration of machine learning and biochar. It is debatable whether statistical rules derived from employing machine learning are reliable when data size is small. Because machine learning generally applies to large data sets, and the resulting models are reliable. When training data is extremely scarce and machine learning is carried out rashly, it may get the cognition which is different from the reality or even completely wrong.

  2. 2.

    Natural language processing technology and image recognition technology provide powerful tools for building large-scale data sets. Through natural language processing technology and image recognition technology, the text information and picture information in the literature could be quickly  obtained, such as the synthesis steps, adsorption performance and morphology of biochar. Moreover, by mining valuable information in massive literature, it is conducive to maximizing the effectiveness of published experimental data.

  3. 3.

    At present, almost all the published data are positive data, while some failed and negative data have not been disclosed and shared, which leads to biased and unbalanced biochar data  sets. When the data set is not unbiased, it does not reflect the real situation. Although biased data sets can be dealt with by some technical means, the key to fundamentally  solving the problem of data set distribution lies in encouraging the sharing or publishing of failed experimental data.

  4. 4.

    Appropriate algorithm and its setting of hyperparameters are extremely important for the convergence speed and prediction performance of model. In the biochar data obtained through experiments, the risk of over-fitting is increased due to the small data scale. Therefore, it is recommended to select algorithms with strong robustness and generalization ability when training biochar datasets. In addition, exposing the settings of hyperparameters and implementation code facilitates the reproduction of model. It is important to note that sharing the details of model could avoid unnecessary duplication of effort.

  5. 5.

    The widely applied ANN algorithm model is less explanatory, and the training of the model has great randomness or flexibility, so the model training results may change with some artificial and subjective factors. In order to improve the randomness and interpretability of machine learning model, and break through black box, it is urgent and necessary to develop machine learning algorithms with high interpretability of gray box or white box to promote the acquisition of clear physical and chemical laws.

  6. 6.

    In practice, machine learning may get inconsistent results with reality, especially when data is scarce. In order to solve the above problem, some strategies are proposed. First of all, selecting descriptors that have causal relationship with the predicted value could enhance the interpretability of the model and obtain the predicted data consistent with the experiment as much as possible. In addition, when employing machine learning modeling, it is also applicable to adjust the model parameters in time according to the feedback of experiments. Employing the existing data of the system similar to the object being studied to expand the scarce data set could improve the prediction accuracy of the model. Furthermore, in order to solve the dilemma of small data sets and inconsistency with experiments encountered by machine learning, the most fundamental thing is to obtain a large number of reliable first-hand data and build corresponding databases.

  7. 7.

    The competitive reaction of bio-oil and biogas is often involved in the pyrolysis process of biochar. However, at present, the competitive reaction involved is seldom considered, which may not be conducive to a comprehensive understanding of the pyrolysis reaction of biochar. In future research, the competitive reaction among biochar, bio-oil and biogas needs to be deeply considered to obtain higher yield of target products.

  8. 8.

    Machine learning is expected to further clarify adsorption mechanism, including electrostatic interaction, complexation and adsorption energy. There is a lack of machine learning to understand the nonlinear dependence scaling relationship of pollutants in the adsorption process of biochar surface. The nonlinear dependence scaling relationship is an important part of understanding adsorption pathway. In addition, it is necessary to strengthen the influence of pollutant types, including polarity, solubility, molecular weight and even functional groups, on adsorption process. In addition, applying machine learning and image segmentation technology to reconstruct the adsorption distribution of pollutants in biochar is a new tool to intuitively understand adsorption mechanism.

  9. 9.

    Soil heavy metal pollution has become one of the most serious environmental problems facing China. Biochar is considered to be an effective adsorbent for remediation of metal pollution in soil. However, due to the complex and diverse nature of soil, biochar and heavy metals, it is difficult to accurately measure the remediation efficiency of heavy metals. Machine learning has been widely reported to predict the efficiency of heavy metal immobilization in biochar-modified soil, which is helpful to determine the best conditions for enhancing heavy metal immobilization in biochar-modified soil (Palansooriya et al. 2022; Sun et al. 2022; Zhang et al. 2022e). Further, a database with 930 data sets on biochar improved soil was created, including 74 biochar and 43 soils (Sun et al. 2022). However, as a carbon material with rich pore structure and large specific surface area, the evolution of biochar over time cannot be ignored. After field application, microbial activity, temperature and precipitation could seriously change the physicochemical properties of biochar, and even lead to the fragmentation and dissolution of biochar (Wang et al. 2020b). Machine learning is naturally suitable for simulating and predicting the evolution of biochar-modified soil over time, including the aging of biochar-modified soil, so as to promote the transformation of artificial aging methods from qualitative methods to quantitative methods and provide good evidence for field application.

  10. 10.

    The research of machine learning for biochar is just in its infancy, but the future development trend is bright. On the one hand, the application of machine learning in the optimization of biochar synthesis need to strengthen in order to produce more efficient and economical products. On the other hand, it is necessary to strengthen the modeling of pollutant adsorption process in water phase, solid phase and gas phase based on biochar via machine learning.