Linking SVM based habitat model and evolutionary optimisation for managing environmental impacts of hydropower plants

The present study proposes a support vector machine (SVM)‐based habitat model linked with evolutionary optimisation to balance the impacts of generating hydropower on the downstream river habitats. This method was applied in the Rajaei reservoir and Tajan River basin in Iran to mitigate the environmental impacts of hydropower plants. SVM model classified the habitat suitability at downstream river in which a sigmoid function considering different slopes was applied. The Nash–Sutcliffe efficiency coefficient as the evaluation index of the habitat model is 0.8, which implies the SVM model is robust to simulate physical habitats. Hydraulic simulation demonstrated that depth and velocity change from zero to 1.79 m and zero to 1.82 m/s, respectively. Most suitable river flow is 7 m3/s downstream of Rajaei reservoir. Five evolutionary algorithms were used to balance environmental impacts with generating hydropower. Finally, a fuzzy technique for order of preference by similarity to ideal solution (FTOPSIS) selected the best optimal solution in the Rajaei reservoir. Based on optimisation results, The simulated annealing (SA) algorithm was the best optimisation method to balance generating hydropower and downstream ecological impacts, in which average habitat suitability is more than 90% of average habitat suitability in the natural flow, while reliability of generating hydropower is 38%. Moreover, SA is able to minimise the average difference between habitat suitability in the optimal release and the natural flow properly. Using the proposed method is recommendable to mitigate the potential impacts of generating hydropower on the downstream river habitats.


| INTRODUCTION
The role of hydraulic structures, such as large dams for supply of water and electricity demands has been addressed in the literature.
Due to increasing demands and a changing natural flow regime, river habitats might be threatened (Pastor et al., 2014;Postel, 1998). Given the importance of river ecosystems, the concept of an environmental flow regime has been defined to protect river habitats (Tharme, 2003).
In other words, environmental flow has been defined as the required instream flow, which is able to protect the ecological sustainability of the river habitats. Different approaches have been developed to assess environmental flow regimes (Anderson et al., 2019). Instream flow incremental methodology (IFIM) is a known and popular method to assess environmental flow regime, which has been broadly addressed in the literature (e.g., Operacz et al., 2018;Pastor et al., 2014). A key component of the IFIM is physical habitat simulation developed by PHABSIM software which might be usable to assess environmental flow directly (Choi et al., 2019). Some studies have highlighted the importance of meso-habitats as well (Wegscheider et al., 2020).
The original method of physical habitat simulation is the univariate habitat method, which defines habitat suitability of depth, velocity, and substrate as the main physical factors. Then, it combines suitability indices to compute a composite habitat suitability index (Brown et al., 2000;Vadas Jr & Orth, 2001). However, this method has been criticised due to its drawbacks in stimulating interactions between physical factors in the habitat selection process by a fish (Jorde et al., 2020;Noack et al., 2013). Multivariate physical habitat models have been proposed to improve the accuracy of physical habitat simulation. One of the known multivariate methods is the fuzzy habitat approach that is able to use verbal fuzzy rules to simulate the physical habitat of streams (Schneider et al., 2017). One of the main advantages of this method is the possibility of using experts' knowledge to define the fuzzy habitat rules. Conversely, lack of sufficient ecological knowledge on many species may be a disadvantage for this method. Lack of ecological knowledge may make it impossible to develop the correct fuzzy habitat rules.
Improving physical habitat models is a fresh and required research field in the current condition.
It seems that artificial intelligence methods might be usable for assessing physical habitats (Sedighkia et al., 2022). Machine learning (ML) methods have been developed to promote habitat simulation using advanced computational methods (Recknagel, 2013). Generally, supervised and unsupervised methods might be applicable in the ML models (Ayodele, 2010). Supervised methods have been widely used in ecological engineering, including classification and regression models (e.g., Tabak et al., 2019;Thessen, 2016). Artificial neural networks are one of the strong tools to predict the ecological status of the habitats that have been utilised to model aquatic habitats in the literature (Fukuda et al., 2006;Park et al., 2003). Advantages of an artificial neural network may be remarkable; they however perform as a black box, which might be a serious weakness (Dumitru & Maria, 2013). Hence, combining neural networks with fuzzy inference systems (FISs) was another progressive step to improve ML methods.
One of the popular NFISs is the adaptive neuro fuzzy inference system (ANFIS) that has been applied for forecasting systems (developed by Jang, 1993). ANFIS has been utilised to predict composite physical habitat suitability in the previous studies. Results demonstrated that ML methods such as ANFIS might be robust to simulate the physical habitat of streams Im et al., 2018;Zhao et al., 2013). One of the most important requirements for developing regression methods such as neural networks is the availability of an enriched data bank of microhabitat observations. However, it might not be accessible in many case studies. Support vector machines (SVM) have been developed to handle pattern recognition problems. This method classifies data by mapping data into a higher dimensional input space. In other words, an optimal separating hyperplane is constructed in the space of available data (Noble, 2006). SVM methods have been used in ecological modelling in some cases. For example, it has been introduced as an acceptable method to model the presence of macroinvertebrates in rivers (Hoang et al., 2010). Moreover, it might be a proper tool to predict dissolved oxygen (DO) in the rivers as well as a modelling tool for the ecological niches (Drake et al., 2006;Heddam & Kisi, 2018). Furthermore, it is applicable to prioritise river restoration stages linked with hydrological models, such as the soil and water assessment tool (SWAT) (Fan et al., 2018). Due to the weaknesses of univariate habitat models (discussed by Railsback, 2016), utilising novel methods, such as SVM might be effective in improving the environmental assessment of river habitats.
The large dams are highly important for supplying water and electricity demands (Raso et al., 2020). Hence, the optimal operation of the reservoirs has been highlighted in the literature from several years ago (reviewed by Dobson et al., 2019). Linear programming, non-linear programming, dynamic programming, and evolutionary optimisation have been utilised in the optimal operation for generating hydropower. However, the last method has been recommended as an efficient and applicable method to optimise the operation of reservoirs (Jahandideh-Tehrani et al., 2019). Many previous studies addressed the application of evolutionary optimisation in the operation models of reservoirs (e.g., Kumar & Yadav, 2018). Some previous studies added environmental values to the optimal operation of the hydropower plants or reservoirs (Sedighkia et al., 2021). However, it is needed to apply a wide range of habitat-based methods combined with evolutionary optimisation models for overcoming current environmental challenges in the management of generating hydropower in different case studies.
Due to the highlighted research gap, the present study proposes a novel combined method in which the SVM method for classifying physical habitats of streams and evolutionary optimisation are linked to mitigate the environmental impacts of generating hydropower in large dams. In other words, we developed a physical habitat model based on the observed suitability of microhabitats in a case study.
Then, the generated SVM model was used to develop the ecological impact function. Finally, the ecological impact function was applied to the structure of the generating hydropower optimisation. The proposed method might open new windows for applying the ecological operation of hydropower plants to mitigating the potential impacts on the river ecosystem. This method is highly applicable for cases in which extensive ecological field data is not available.

| Study area
The proposed method was implemented in the Tajan River basin in Iran, in which a large dam is responsible for generating hydropower. This river, which is a valuable aquatic habitat, originates from the upstream mountains of Mazandaran Province. The Rajaei reservoir has been constructed upstream, which is crucially important for generating hydropower in the study area. Figure 1 displays

| Field studies and data collection
The field studies include two stages. At the first stage, the fish observations in microhabitats have been carried out through long-term field observation in the study area. Different methods are usable to observe the fish in river habitats, classified as direct and indirect methods. Direct methods observe a fish in the actual habitat, such as video telemetry method. In contrast, indirect methods might carry out sampling of the fish with different instruments. One of the known indirect methods is electrofishing, which is able to collect samples in different river habitats (Harby et al., 2004). Each method might have advantages and drawbacks that should be considered before making a choice. We selected electrofishing in the present study due to higher turbidity in some streams, which means using a direct method, such as video telemetry was not possible. We reduced the voltage for the recovery of the aquatic species. Based on recommendations from the previous studies, 80% of data was used to train the SVM model, and 20% was applied to test the reliability and robustness of the habitat model. Moreover, velocity and depth were measured by a propeller and a metal ruler in the sampling process simultaneously (Harby et al., 2004). It should be noted that the downstream river was walkable. Hence, all the measurements were possible. In the present study, the SVM model was developed based on the presence method which means if the target species was observed in a sample, it could be considered as the suitable habitat and vice versa. The second stage of the field studies was the surveying process of the cross-sections in the downstream representative reach and the measurement of depth, velocity, and discharge in different cross sections to calibrate and validate the two-dimensional hydraulic model. Data types and sources, collection period, and detailed procedure for collecting or measuring data should be clearly explained, which is helpful for using the proposed method in future research works. We used two main data types in the present study including hydrological data and ecological data. Ecological data was collected based on field measurements using the described method in the previous paragraph.
We applied the electrofishing method to sample the selected target species, of which two categories were defined. These categories were considered the criteria for defining habitat suitability. If the target species (adult) was available in the sample, it would be defined as suitable habitats. In contrast, if the number of target species was zero in the sample, the habitat would be unsuitable.
Moreover, physical parameters such as depth and velocity were measured in each sampling point. Field measurement was carried out at 637 points in the Tajan River of which some points (less than 15%) were deleted due to low water quality. In fact, we measured water quality by considering DO as the main water quality index at each point as well. The purpose of this study is to focus on physical habitat suitability, which means the suitability of water quality should be the same at all sampled points. Hence, we removed points in which DO F I G U R E 2 Flowchart of support vector machine habitat model. [Color figure can be viewed at wileyonlinelibrary.com] was less than the required threshold for living the target species. Rest of points were applied to develop the SVM habitat model, of which 80% and 20% of the points were used for the training and testing process of the habitat model respectively. It should be noted that using 80% for the training process is a recommended method to develop ML models. Thus, we utilised this method in this study as well. Ecological data (i.e., sampling points of fish habitat) was carried out in four seasons for considering potential effects of changing seasons on the habitat suitability. In other words, many fish habitats were sampled in a year in four different months (1 month in each season).
Another type of used data is hydrological data. The main required hydrological data in this study was the inflow of the reservoir. Due to the availability of a hydrometric station upstream of Rajaei reservoir, long-term data for 20 years was collected from the hydrometric station. Then, the inflow of the average year was generated by averaging daily flow. In other words, we applied a daily scale to the optimisation of reservoir operation, in which 365 days were simulated as an average year of long-term recorded inflows. Other required data, such as hydropower plant features, was obtained from available technical reports of the regional water authority.

| Physical habitat model
SVM is a computer algorithm that trains a model to label objects. should be noted that all the recorded microhabitats have been sampled in relatively similar bed particle size (gravel bed). Hence, it was possible to ignore the impact of the substrate to classify habitat suitability. Moreover, the representative reach had a gravel bed, which means using the SVM habitat model was reasonable to simulate physical habitats. We applied the kernel function to assess habitats. Different types of kernel functions might be utilisable to develop an SVM model. We utilised the sigmoid function in the following form, as dis- where D and V are variables, c is the intercept, which was considered a constant À1 and g is the slope. developed five SVM habitat models. In fact, five SVM models were developed including (Model 1, g = 0.1), (Model 2, g = 0.2), (Model 3, g = 0.5), (Model 4, g = 0.8), and (Model 5, g = 1). Several programming packages are available for using the SVM method in data classification. Among available packages, MATLAB is one of the popular options due to the availability of many functions in the library and its user-friendly environment, which is available in many universities and consulting engineers for use by scholars. In this study, we imported the outputs of the HEC-RAS two-dimensional (2D) to MATLAB for implementing the SVM method.
The Nash-Sutcliffe efficiency (NSE) coefficient was applied to assess and compare the predictive power of the SVM models (more details on this index by McCuen et al., 2006). Equation (2) displays the definition of NSE in the present study, where MHS is modelled habitat suitability and OHS is observed habitat suitability.
Moreover, we used a 2D hydraulic model to simulate the distribution of depth and velocity in the representative reach. Different hydraulic models are available to simulate hydraulic features. HEC-RAS 2D was applied in the present study as one of the applicable options to simulate the hydraulic characteristics of rivers. Several previous studies corroborated its performance to simulate depth and velocity in the main channel and floodplain of rivers (Horritt & Bates, 2002). This model has been successfully utilised to simulate hydraulic habitats, which demonstrated its efficiency for simulating physical habitats. More details on using HEC-RAS 2D to simulate habitat hydraulic addresses have been in the literature (Papaioannou et al., 2020). However, Figure 3 shows the workflow of HEC-RAS 2D for simulating depth and velocity distribution in this study. It should be noted that a verification process of the outputs of 2D hydraulic models is necessary to generate reliable results. Due to measuring discharge, depth, and velocity at some points during ecological field studies, it was possible to apply these points in the verification process of HEC-RAS 2D as well. In fact, we selected roughness (Manning coefficient) as the calibration parameter of the hydraulic model. Several trial and error steps were carried out to obtain the best results. In the results of the research work, the outcomes of the verification process will be displayed. The outputs of the 2D physical habitat simulation were applied to develop the weighted usable area (WUA) function as described in the literature (Stamou et al., 2018).

| Optimisation model
Equation (3) displays the objective function in which two terms are available, including minimising difference between power production (pp) and installed capacity of generating hydropower (PPC) and minimising the WUA in optimal release for generating hydropower and the natural flow. In other words, this function is able to balance the requirements for generating hydropower and environmental requirements in the downstream river habitats. Natural weighted usable area is natural WUA, and optimal weighted usable area is optimal WUA, which could be computed by the developed WUA function through habitat simulation by the SVM method.
It should be noted that power production is mainly dependent on the discharge and available head in the reservoir. Thus, these two factors were updated in the optimisation at each time step. Adding constraints of the reservoir management, including constraints on storage and release for generating hydropower is necessary as follows: 1. Storage in the reservoir should not be less than the minimum operational storage and should not be more than the maximum possible storage in the reservoir.
2. Downstream release should not be less than the minimum permitted discharge for the power plant. The penalty function method is widely used to convert a constrained optimisation to an unconstrained one, and it has been applied in many studies (e.g., Ehteram et al., 2018). We considered three penalty functions in the optimisation model, including minimum operational storage, maximum possible storage, and minimum permitted flow to downstream, as displayed in Equations (4) functions would increase reservoir operation penalty when constraints are violated.
It is also required to define overflow and update storage in the optimisation model. Thus, Equations (7) and (8) display the overflow and storage in the optimisation model where E t is evaporation, A t is reservoir area, I t is inflow, F t is overflow, R t is the release for demand, R t is the downstream release, and S t is storage in each time step.
Five evolutionary algorithms were applied to optimise the generating hydropower operation, as displayed in Table 1. More details regarding each optimisation algorithm are available in the cited references.
Each optimisation model needs some indices to measure the performance of the model. In the present study, three indices were selected for this purpose as follows: One index was selected to measure how the optimisation model is able to generate hydropower reliably. Moreover, two indices were selected to evaluate the performance of the model in terms of habitat suitability. AVS evaluates the average habitat suitability compared with natural flow, and the RMSE (optimisation model) was selected to evaluate how the optimisation model is able to emulate the natural suitability in the simulated period. It should be noted that an average year based on long-term hydrological analysis was simulated in the case study on a daily scale.

RI Hydropower
AVS ¼ Average habitat suitability in the optimal release verage habitat suitability in the natural release ð10Þ The fuzzy technique for order of preference by similarity to ideal solution (FTOPSIS) is a known decision making system to rank the available solutions for a problem based on the defined criteria (more details by N ad aban et al., 2016). In the present study, the goal of the process was to select the best algorithm. The criteria include Equations (9)-(11), and the candidates are mentioned algorithms in Hence, the role of the SVM method to classify habitats is remarkable. Figure 5 also shows the assessment of habitat suitability by different habitat models. It should be noted that no model is perfect for classifying the river habitat perfectly. However, the accurate assessment of the performance of the habitat models needs applying to the NSE index. Figure 6 displays the NSE of different models. As a result, Model 3 has the highest NSE compared with other models, which means this model is able to generate the best results, while Model 5 is the weakest model for classifying habitats. The model 1 is not able to classify microhabitats at the boundary of usable and unsuitable habitat properly, while Model 3 has better performance in this regard.
Hence, the Model 3 was selected to develop the WUA function. Several rates of flow based on hydrological analysis were simulated to define the WUA function. A sample of the simulation is shown in Figure 7, in which depth and velocity distributions by the 2D hydraulic model and classified habitats by Model 3 are observable. Figure 8 shows the developed WUA function in the case study, which was applied in the optimisation model of the reservoir.
In the next step, it is required to present the result of the optimisation in the case study. Figure 9 shows the measurement indices for different evolutionary algorithms. It seems that the performance of different algorithms is similar in some aspects. However, their performance is not similar for all the indices. The most reliable method to select the best algorithm for balancing environmental requirements and generating hydropower is to apply a decision-making method as presented in the previous section. Table 2 displays the results of using the FTOPSIS method to select the best algorithm. According to the results, SA is the best method for optimising the generating of hydropower considering environmental degradations downstream.

| DISCUSSION
It is essential to discuss why applying the SVM method should be highlighted in the river habitat analysis. Conventional methods of physical habitat simulation proposed by PHABSIM or other similar packages, such as SEFA (Payne & Jowett, 2013) are not able to simulate physical habitat correctly due to an inability to simulate interactions between parameters. Hence, the univariate method must be excluded for further studies. On the other hand, the Mamdani fuzzy approach is another option for habitat hydraulic simulation. This method is able to generate more accurate results compared with the univariate methods. However, either a lack of sufficient regional

| CONCLUSION
The present study developed a SVM habitat model linked with the optimisation of generating hydropower to mitigate the environmental impacts of the hydropower plants on the downstream river habitats.
The SVM method was used to classify the physical habitats in rivers, in which depth and velocity were the inputs and suitability classes, including usable and unsuitable habitats, were the outputs of the model. The developed ecological impacts function through the SVM habitat model was applied in the structure of the optimisation model of generating hydropower. Several evolutionary algorithms were applied in the optimisation process. Based on the results of the case study, the SVM method is robust for simulating habitats in the river.
Moreover, simulated annealing is the best optimisation algorithm to optimise the operation of the hydropower plant. Limitations and future scope should be highlighted as well. This study focused on physical habitat suitability by SVM method due to the requirements of the case study. However, other parameters, such as water quality, should be added to the model, if low water quality is an environmental challenge. One of the important future scopes is to add all effective abiotic factors to the model to investigate the response of habitats and potential environmental impacts of hydropower plants.

CONFLICT OF INTEREST STATEMENT
The authors declare that there is no conflict of interest.

ACKNOWLEDGMENTS
We appreciate regional experts for helps to provide required data.
Open access publishing facilitated by Australian National University, as part of the Wiley -Australian National University agreement via the Council of Australian University Librarians.

DATA AVAILABILITY STATEMENT
The data that support the findings of this study are available from the corresponding author upon reasonable request.