1 Introduction

The advent of the use of Artificial Intelligence (AI) and other intelligent approaches such as machine learning (ML) in membrane applications led to many improvements in environmental engineering problems, especially regarding the membrane fouling in the whole processes. As reported in Fig. 1, it has been discovered that modern methods such as Artificial Neural Networks (ANNs), Fuzzy Logic (FL), genetic programming, and model trees are the modeling techniques employed with success (Bagheri et al. 2019) in several parts of the world.

Fig. 1
figure 1

A classification table of AI and ML techniques useful in the water systems

Continuative research in the fields of AI is continuously leading to the emersion of new engineering innovations and possibilities, with features like high-efficiency standards and a “greener” approach, which are two of the leading contemporary requests to any kind of newborn technologies. With the same importance, looking back to established technologies and appliances, this AI-based approach is a promising, yet concrete, methodology to renew and optimize existing membrane-based plants, like desalination or water treatment units, for more efficient resources and energy management. On the other hand, although Bayes Model Averaging (BMA) has no direct link with any membrane-based processes, it provides a Bayesian probabilistic model to understand the propagation of the uncertainty from various sources of the input data. Unlike the PCA which performs a base change on the data, most of the time using only the main components and sometimes ignoring the rest.

In this article, a membrane fouling control with the aid of a specific AI tool regarding a water treatment industrial plant application is explained and discussed (Fig. 2 shows an increasing trend of number of publications regarding it in the recent years); then, a new prespective of a suistainable and cleaner production of energy is also discussed.

Fig. 2
figure 2

Publications regarding AI applications to wastewater treatment (Zhao et al. 2020)

2 AI in Membrane Applications

Fouling or concentration polarization is preventing the membrane to perform at its best efficiency. It can happen in all membrane-based processes. The main applications of AI in the membrane world essentially regard fouling prevention. For predicting different fouling parameters—such as permeate flux and Transmembrane Pressure (TMP)—different techniques of AI and ML have been used to improve the accuracy compared to mechanistic models and solve all types of calibration problems. In particular, the intelligent models ANNs were the first to predict and more precisely control the membrane fouling, followed by FL which may use to model membrane fouling and develop automated systems to control and manage it automated way. Simultaneously, GP has been used for the prediction and simulation (Zhao et al. 2020) (Arefi-Oskoui et al. 2017) (Badrnezhad and Mirza 2014) (Salahi et al. 2010) (Soleimani et al. 2013) (Yusuf et al. 2017) (Lecun et al. 2015) (Chew et al. 2017) (Gao et al. 2012) (Huyskens et al. 2011) (Ruder 2016) (Kamali et al. 2020) (Netzband and Rohbrecht-Buck 1992) (Zandi et al. 2019) (Pan et al. 2008) (Sarkar et al. 2021) (Pan et al. 2009) of a wastewater process design. Alternatively, Model Trees (MTs) are hierarchical structures with nodes and branches and can be applied too in different fouling prevention mechanisms. The internal nodes contain tests on the input variables; MT identifies a set of subdomains characterized by regression functions. Unlike other models, it could partly explain the hidden relationships between different parametric data of complex water treatment systems.

A typical approach to optimize the fouling is represented by the Genetic Algorithms (GA) and Particle Swarm Optimization (PSO) with intelligent data pre-processing capabilities to mitigate fouling and reduce the cost of the cleaning mechanism. Badrnezhad and Mirza (2014) used GA techniques for optimizing different operating parameters such as TMP, pH, feed temperature, and filtration time to control fouling in ultrafiltration of oily wastewater, on the other hand, Salahi et al. (2010) used GA to find the minimum and maximum values of flux. Soleimani et al. (2013) proposed a GA-based multi-objective optimization for the filtration of oil from industrial wastewater for an efficient predictive system. In a very interesting work, Yusuf et al. (2017) introduced a model-based controller for Submerged Membrane Bio-Reactor (SMBR) filtration process, where the PSO algorithm was used as a real optimizer in updating the model-based controller cost function. Drews et al. (2007) developed an optimization framework that can automatically recognize the current dominant filtration mechanisms.

Moreover, some more hybrid intelligent models exploit intelligent modeling methods and different optimization techniques. For example, Chew et al. (2017) (Coppola et al. 2021) developed a hybrid model composed of a physical model and a Multilayer Perceptron Artificial Neural Network (MLPANN) for predicting the fouling parameters into an ultrafiltration water treatment.

The clustering approach is an ML technique used in the membrane filtration processes to analyze the effects of the temperature impacts on the properties of sludge, the structure of the cake layer, and the fouling in an anaerobic SMBR (Alwatban et al. 2019) (Osman et al. 2019). Moreover, clustering techniques were used to grouping data in different membrane fouling problems. In addition, the image recognition technology was used to control the membrane fouling, particularly in the control of the optimal filtration conditions (Huyskens et al. 2011).

2.1 Water Treatment Plant Monitoring

2.1.1 Neural Networks

Over the last years, significant progresses have been made in several Deep Learning (DL) frameworks such as Deep Dense Neural Network (DDNN), Convolutional Neural Networks (CNN) and Recurrent Neural Networks (RNN). A DNN model consists of an input layer, multiple hidden layers, and an output layer. Each layer is composed of a set of artificial neurons (sometimes called nodes), which are connected with the neurons of the succeeding layer. Figure 3 shows a network with two hidden layers where both the first and the second hidden layer have four neurons.

Fig. 3
figure 3

A neural network with 2 hidden layers

More generally, Deep Learning (DL) is a subset of Machine Learning (ML) which has revolutionized many tasks ranging from computer vision, speak recognition, text processing, molecular and drug analysis. Basically, DL is a representation learning method composed of several representation layers, obtained by composing simple but non-linear modules (Lecun et al. 2015). Using neural networks as the main architecture, DL is able to learn complex functions from new data instead of using handcrafted or more speculative functions, based on domain experts. Even though neural networks are not a recent paradigm, they became more successful in the past decade due to the availability of big training data and of inexpensive, parallel hardware (e.g., GPU).

Figure 4 illustrates the mathematical model of an artificial neuron. Each of these neurons aggregates the connections coming from the neurons in the previous layers and applies an activation function whose selection depends on the kind of modeling data and scale of values (e.g., sigmoid function for binary classification problems). The following equation describes the work of a single neuron, referring to Fig. 4 for the meaning of each symbol:

$$y = \phi \left( {\mathop \sum \limits_{i = 1}^{n} x_{i} \omega_{i} + b} \right)$$
(1)
Fig. 4
figure 4

Mathematical model of an artificial neuron

The strength of neuron connection is determined by the learnable weights w; the higher the weight, the higher the importance of information to be propagated. A Deep Neural Network (DNN) exploits innovative techniques (Momentum, Nesterov Accelerated Gradient AdaGrad, RMSProp, Adam) (Ruder 2016) to overcome the problems that characterize the gradient descent and backpropagation algorithms (explosion/vanishing gradient, overfitting, very long training times). DNN layers are independent of one another, that is, a specific layer can have an arbitrary number of neurons (generally, this is defined as a hyperparameter of the network). A DNN with multiple hidden layers can have the earlier layers learn about simple low-level features and have the later deeper layers detect more complex features.

Convolutional Neural Networks, introduced in 1998, is inspired by the behavior of the human visual cortex. Just like ordinary Neural Networks, Convolutional Neural Networks (CNN) are made up of neurons with learnable weights and biases. However, they deal with the problem that the number of training parameters of a dense neural network can grow very fast as the network becomes bigger. For example, if you have a grayscale image of size 100 × 100 every neuron in a first hidden layer of a regular neural network would have 100 × 100 = 10,000 parameters. For facing this problem CNN’s introduces convolutional layers that use the convolution operation (from signal theory) by applying a filter (or also called kernel) in different positions of the input to extract local features stored in the features map. Each of the neurons of a convolutional layer does not receive all inputs (e.g., all the pixels of the image) as in dense networks, but only those belonging to the area determined by the filter.

Another typical layer of CNNs is the pooling layer that can be considered as a subsampling layer for reducing the size of the input layer. Generally, after stacking convolutional and pooling layers, one or more fully connected layers are added.

Neural networks that allow just “forward” connections, or in which information flows sequentially from layer to layer towards the output, are called feedforward neural networks.

Other types of neural networks with feedback connections are called recurrent neural networks (RNNs). They are specialized in analyzing temporal sequences of data. The output that a recurrent network returns depends on both the current input and the previously processed inputs, which allows the creation of internal memory for the network.

If the sequences to be processed are of considerable length, the state cannot remember the oldest inputs. This phenomenon could represent a problem, for example, in the analysis of a sentence where the first words can have significant importance in determining its meaning. Long short-term memory networks (LSTMs) and Gated Recurrent Unit (GRU) are special kinds of RNN designed to avoid the long-term dependency problem.

In general, the challenges of wastewater treatment are many, e.g.: the correct balances of microbes into the activated sludge plant treatments, the optimization of the treatment, the daily or weekly or seasonally variation of the influent hydraulic and organic loads, to remain within the discharge limits, the reduction of the environmental damage and the pollution incidents. In this context, the smart network monitoring of the plant results in a real and actual challenge to improve all aspects of the plant. A topic like AI application for Membrane Bio-Reactor (MBR)-based technologies is increasing drastically and more and more research are going on around us (Kamali et al. 2020). The first report about it was by Netzband and Rohbrecht-Buck (1992), and it talked about an expert system for effluent discharged treatment from degraded material disposal. Recently, Zandi et al. (2019) suggested that MBRs for wastewater treatment get popular since 1990s. Kamali et al. (2020) analyzed different lab-scale and pilot-scale Membrane Bio-Reactor (MBR) applications and the integration with different AI models able to predict the performance of the MBR technologies.

The first decade of the twenty-first century has seen the first approaches of DL methods in the chemical domain (Pan et al. 2008) (Pan et al. 2009), also as regards the water treatment plant monitoring (Singh and Gupta 2012). In the last few years, the growing interest to understand the complexity of chemical data through DL models and its ability to discover connections between input data and output data led to several other fascinating applications.

As a practical example, Jha et al. (2018) presented a deep neural network that captures the physical and chemical interactions and similarities between different elements allowing us to predict the properties of the material.

It is a dense DNN on which the authors have performed in-depth research on the architecture and hyper-parameters (see Fig. 5) noting a decrease in the error as the depth of the neural network increases.

Fig. 5
figure 5

Performance of DL models of different depths in the model architecture. The reference model is ElemNet: a the mean absolute error (MAE) on the test dataset. b The MFA for different depths of DL model architectures. (Jha et al. 2018)

The research was performed starting from the two-layer architecture and increasing the depth incrementally to improve the learning capabilities of the model up to a saturation point. Specifically, although the research continued up to 24 layers, the authors refer to “ElemNet” as the best predictive model, therefore the one with the architecture with 17 layers and with the hyperparameter tuning (performed with particular attention to the value of the learning rate and dropout). This method has demonstrated that even with only a few thousand training samples, using a DL approach we can bypass manual feature engineering.

2.1.2 Water Desalination

The availability of conventional water sources is decreasing more and more every day (Rodrigues et al. 2018) (Dikshit et al. 2020). Thus, the new technologies for the water supply and its ever-increasing efficiency play a fundamental role in this world emergency analyzed through a computational method how the graphene nanometer-scale pores can filter the NaCl into the water, modeling a series of graphene nanopores with different functionalization and diameters (Cohen-Tanugi 2012). The pore sizes varied within the range of 1.5–55 Å2. The study was made on pores passivated with hydroxyl groups—commonly hydrophilic to examine the effect of the pores’ chemistry on desalination dynamics. This research established that desalination performance is more sensitive to pore chemistry and size. Hydrogenated pores' hydrophobic character reduces the water flow by imposing additional order to the system. However, the limited-hydrogen bond allows a higher salt rejection compared to the pores hydroxylated.

Alwatban et al. (2019) conducted a computational fluid dynamic simulation to study the effects of the membrane properties and the system performance’s operational parameters: the membrane porosity, the membrane thickness, the pore size feed flow rate, and the feed temperature. The net spacers were used to mitigate the polarization, and a laminar model was used to characterize the weather, the velocity, and the concentration range in the empty channels. The simulation results underline that the pore size and the porosity are increased, while the intensity of temperature, the permeation flux, and the concentration of polarization increase as the thickness decreases. The spacers’ presence increases the membrane flux’s performance more significantly than 50% and attenuates polarization by 30%. On the other hand, Osman et al. (2019) compared the experimental results about the treatment for the water and salt recovery through Reverse Osmosis (RO) from the wastewater of the petrochemical industries in South Africa, and the simulated results of a transition predictive model which solved through a mathematical algorithm developed into the MATLAB code. The model was able to predict well the water flux values and thus, it could be used as a potential process design tool.

Esfandiari et al. (2019) studied a 2D computational fluid dynamic modeling of water desalination with a low-energy continuous Direct Contact Membrane Distillation (DCMD) system. This model contains all phenomena equations (momentum, energy, and mass transfer) and could predict the freshwater amount produced by the considered system. The phenomena equations were written in three domains, that are membrane, cold and hot channels. MATLAB software was used to discretize the domains with the finite volume methods and to solve the system. Moreover, the impact of different parameters was also studied and so, temperature and velocity of the input currents influence the performance of the system.

Essentially, all these applications listed above are about the use of Computational Fluid Dynamic (CFD), without the use of an AI tool, even if some studies deepened this novel aspect into the membrane applications. Yusuf et al. (2020) described some emerging trends in sustainable membrane water treatment, and also some benefits from the use of the Molecular Dynamic Simulation (MDS) and AI tools, which have been employed in Decision Support Systems (DSS), ANNs, FL, and GA. MDS and AI tools manage to solve real problems more than deterministic solutions. Thus, both approaches should be developed into 3D, but at this moment this research is limited. The 3D approach could improve the performance indicators, as the membrane selectivity. In addition, in membrane-based desalination such as into all water treatment processes—the AI application is at a primary stage, but in the future could be improved to manage the water resource. A DSS is essentially a framework that helps the user to find the best solutions through the analysis of a large amount of data coming from the water plant.

ANN results are the most used AI tool, particularly for pollutant removal and the prevention of membranes and also for membrane performance. Regarding desalination processes, ANN was used to predict and optimize the sodium chloride removal and also for the disinfection of by-products through chlorination or membrane distillation or Reverse Osmosis (RO). In "Wastewater and Sewage Treatments", an example of this application will be treated in detail.

2.1.3 Wastewater and Sewage Treatments

The wastewater treatment system is a highly non-linear, uncertain, and time-varying industrial process control system. In recent years, the number of published articles attempting to apply AI approaches to the wastewater treatment problem has increased significantly (Zhao et al. 2020).

Chen et al. (2003) used a neural network model to assess the reuse potential of wastewater. The neural network was specifically designed to provide accurate predictions of the nitrogen content in treated tributaries to be used for groundwater recharge.

As shown in Fig. 6, the authors used a partial recurrent neural network (PRNN) with an input layer of 14 normalized parameters, and with a single hidden layer, demonstrating that a simple well-trained neural network model can be useful in evaluating wastewater remediation practices.

Fig. 6
figure 6

Partial recurrent neural network model as proposed by Chen et al. (2003)

A more recent approach for wastewater treatment plants (WWTPs) has been proposed by Mamandipoor et al. Specifically, it is a deep LSTM neural network designed to process time data from the various sensors used to control energy consumption and the quality of the discharge (Mamandipoor et al. 2020) (Fig. 7).

Fig. 7
figure 7

Architecture of the method proposed by Mamandipoor et al. (2020)

The authors compared their method (LSTM) with traditional Machine Learning (SVM / PCA) and statistical analysis (Variance) methods, demonstrating the best performance of LSTM compared to the other methods considered, under its ability to model complex dependencies between time-varying data (in this case coming from sensors).

Wang et al. propose the management of energy and material savings through the use of Deep Learning techniques for WWTP. Specifically, a hybrid neural network model called PCA-CNN-LSTM (principal component analysis–convolutional neural network–long-short-term memory neural network) was used, trained with historical data from the WWTP domain, and used to predict the parameters of the effluents (Fig. 8). Besides, the genetic algorithm (GA) was also introduced to optimize energy and material consumption with multi-target effluent parameters. The authors estimated that the model reduces the total cost of energy and materials by 10–15% (Wang et al. 2020).

Fig. 8
figure 8

Hybrid neural network model proposed by Wang et al. (2020)

Tryland et al. (2015) described the online monitoring of Escherichia coli in raw water into the Oset Drinking Water Treatment Plant in Oslo (Norway) through the installation of a wholly automized Colifast ALARM™. Unlike the weekly or monthly traditional monitoring of the hygienic quality on the raw water sample used for drinking water production, this monitoring system was for daily monitoring, and it was fully automated. It consisted of pumps and valves for accurate management of the liquid, an incubator/reaction cell connected to a detector, and control/interfacing units. This monitoring system supported the hypothesis that warmer winters with shorter periods with ice cover on the lakes can be a consequence of climate changes and can reduce the sanitary barrier efficiency in deep lakes used as sources of drinking water. The daily fully automated monitoring could be partly offset by lower costs for manual sampling and water analysis.

Thus, a fully automated monitoring of a wastewater plant joined with AI tools could improve both quality of the water and the operating costs. The growing need for high-quality drinking and process water allowed the development of the automated control of water treatment plants; moreover, the growing public awareness of possible contamination also makes monitoring the sewage plant essential. Now, the membrane filtration processes considered safe against organic, inorganic, and microbial contamination, but to guarantee the high quality of the final water and to boost the confidence in the end-user, intensive and continuative monitoring of the water could be a useful instrument to control the quality of the water and also of the membrane used into the treatments.

Figure 9 shows typical monitoring on the sewage treatment plant, which consists of non-continuous measurements. To improve the quality of the entire plant, the monitoring should be done continuously and online.

Fig. 9
figure 9

Monitoring at a typical sewage treatment plant (Richard 2020)

About this, Buysschaert et al. (2018) developed cytometric monitoring in the online flow of the microbial quality of the water in a full-scale water treatment plant, demonstrating that it is possible to observe the quality change of the water with this monitoring, unlike the parameter commonly used. Moreover, they showed that the process conditions influenced the flow cytometric cell counts in the ultrafiltration (UF) states.

Deena and Sureshkumar (2014) showed an AI approach for MBR in sewage water treatment. MBR use has a large amount of uncertainty, for example, regarding the inflow conditions and the limited measurement information. Thus, the development of the controller results is fundamental to structure the uncertainty and attenuate the damages. The framework for the MBR control was developed, such as a model-based predictive controller.

The water quality is always different due to the water provenience and the suffered treatments. Therefore, to obtain clean water is necessary different energy requirements. Of consequence, these systems are a combination of several unitary processes, which have been designed to manage each of these qualities. Thus, there are some cases where the chemical and physical phenomena are insufficient to implement the proper operation and control, increasing the expectation in the AI use. For example, Hitachi developed its technology—called H technology—which provides functions that result and visually represents the correlations from a large amount of numerical data, and actually, it may be used for many different applications and fields (e.g., cancer screening, food waste, shipping, fight cyber bullying into the Japanese schools, financial) (Moriwaki et al. 2016) (Ltd. 2015). In this case for the water, wastewater, and sewage treatment, this smart system can extract the most useful indices for the objective variables and then use them to create specific measures (Embutsu et al. 2016).

This technology was born from the need to control the fouling and to prevent the clogging of the RO membranes used into Intelligent Water System by Hitachi, given by the combination of a classic seawater desalination system and a sewage water reuse process. In the transition to intelligent technology, the company intended the entire water system as the water environment which is characterized by an information flow based on tracing of different water features, e.g.: water volume, water quality, and water pressure.

Thus, the use of Information and Communication technologies led to continuous monitoring and prevention of membrane clogging. In fact, Hitachi’s AI technology is capable of analyzing data from the system controllers, identifying the factors relates to the clogging, and also reducing 6% of the pumping system costs.

Briefly, this technology consisting of four steps, as shown in Fig. 10.

Fig. 10
figure 10

Four-step analysis by Hitachi for H technology regarding the flow analysis for consideration of the control logic

An additional step is a visualization in a network format of the correlation between the extracted influencing factors and the objective variable. Then, thanks to the control logic—deducted from the phenomenological knowledge about fouling–—the benefit due to the fouling suppression was estimated and the feasibility of the system was evaluated.

In particular, regarding the water treatment system in question, was seen that the electrical conductivity of concentrated water of the RO membrane connected to the water flow rate and the inlet pressure. Therefore, controlling the electrical conductivity of the mixed water, the fouling is controlled and the clogging is prevented. Thus, the control method was extracted from the knowledge was obtained from the Hitachi technology. As a summarized in Fig. 11, we are showing the flowchart of this control method.

Fig. 11
figure 11

Control method of flow for the mitigation of fouling of membrane for the H technology by Hitachi

3 Applications for Cleaner Productions

3.1 AI-Driven Biomass Production

The assessments of hotspots analysis within the process optimization and the improved design are essential for cleaner production. This last involves the complex interactions of social and economic performance. Van Fan et al. (2020) provided an overview of cleaner production achievements. Regarding the AI tools, besides the ANNs approach, they also reported an extension of the Analytic Hierarchy Process (AHP) framework, that is the Analytic Network Process (ANP) model.

A cleaner production from the wastewater treatment can also be associated with biomass, and an AI application results be useful in this case because it drives process optimization.

Nayak et al. (2018) presented an optimized process that involves integrated events on the sequestration of CO2 of the combustion gases and the use of wastewater to improve the microalgal biomass production more cleanly. They present an ANN model combined with an optimization algorithm GA tool, which was able to predict the optimal conditions of the process to improve the biomass of the green microalgal—Scenedesmus sp.—through the use of the domestic wastewater as a culture medium and coal-fired combustion gases as a carbon source in an integrated chain. This study’s results seem to advance that the environmental factors—such as temperature, pH, photoperiod, and light intensity—have a strong influence on the microalga’s growth and the production of the biomass. Thus, the AI tools’ application could successfully predict the productivity of the biomass for a different range of the critical parameters of the process.

3.2 Blue Energy Generation Overview

The emergency in energy sourcing is one of the main difficulties that need to be faced worldwide by seriously evaluating every new technological advance at our disposal. The main answer to this problem seems to reside in the usage of the most sustainable kinds of energy, therefore, combining both the use of renewable sources and a fine optimization of the efficiency of these sources. Blue energy is one of these sustainable and well promising sources of energy, they are mainly membrane-based technologies that can be finely optimized by the use of AI techniques.

Blue energy is a term mainly related to osmotic power, which is a kind of energy that can be gathered by exploiting the salinity gradient among two different streams of water, for example freshwater and seawater. By these means, it is possible to imagine large amounts of energy harvested from the intersection of rivers and oceans. The two main membrane technologies appliable to recover osmotic energy are pressure-retarded osmosis (PRO) and Reverse Electrodialysis (RED).

The Reverse Osmosis technique exploits hydraulic pressure to control the gradient of osmotic pressure, generated through a semipermeable membrane, thus resulting in a water flow going from a concentrated stream to the permeate side of the membrane. In addition, Pressure-Retarded Osmosis generates hydraulic pressure in the saline concentrated stream. This pressure is low compared to the osmotic pressure gradient, and as a result, a flux of water is generated through the membrane, but this time the water is flowing towards the side of a draw solution.

Therefore, blue energy can be defined as a particular source of energy produced by the environment. This kind of life can be harvested from solar, radiofrequency radiation, piezoelectric, thermal, body motion and water flows sources. The latter resides in water masses’ movement of any head, including ocean tides, rivers and even raindrops.

The conventional energy harvesting from flowing water sources comprises bulky devices where mechanical energy from water is transformed into electrical power (Prudell et al. 2010). As an example of the previously cited Pressure-Retarded Osmosis, a study by Prof. Sidney Loeb (1975) is shown as pressure-retarded osmosis could be used to harvest energy from two aqueous solutions with different saline concentrations, segregated by a semipermeable membrane.

The application of these principles has been illustrated through three main applications methods, in fact, nanogenerators can be divided into sliding droplet, flowing water, and phase change-based devices, all of them are the so-called TENGs (triboelectric energy generators), where the surface charge relocation between two materials in close contact generates a polarization as long as the two are disconnected. At this stage, a repetition of contact-and-release actions produces a current.

Much research has been brought on the topic, and many materials have been investigated, including nanostructures. ZnO is one of the most typical materials used, having outstanding piezoelectric and semiconducting properties (Zhang et al. 2019).

Many types of devices have been studied, including Droplet-based electricity generators (DEGs) (Xu et al. 2020), Reverse Electrodialysis devices (Liu et al. 2018), flowing water devices (Ravelo et al. 2011) (Park et al. 2018), electrical double layer devices (Moon et al. 2013), zinc oxide nanosheets, where PTFE balls are placed as the superhydrophobic bottom of the system. Nanopore devises designs have been studied, including boron nitride nanotubes (BNNTs) and molybdenum disulfide (MoS2) nanopores (Siria et al. 2013) (Feng et al. 2016).

The interest in harvesting ambient energy from sources such as solar, Radio Frequency or Wi-Fi, or even thermal gradients or motion energy by piezoelectric energy harvesting devices have reached good promising steps, but any of these devices have to face the issue of relying on a source that is not stable and constant, this primarily due to their strong dependence to environment influences (Parks et al. 2013). From here, it is necessary to develop systems highly tolerant to power fluctuations, especially for those devices that need to respond to certain computational needs. In addition to that, ambient energy sources often translate to poor conversion efficiencies. As an example, ambient RF power sources are drastically dependent on variables as frequency, source distance, the presence of obstacles, interactions with other electromagnetic sources to mention a few of them (Visser et al. 2008). In Fig. 12, a typical scheme of the structure of a harvesting system is presented, as defined by Ma et al. (2015), where the three main blocks represent the energy harvesting and management section, the digital signal processor and the I/O interface.

Fig. 12
figure 12

Typical scheme of the structure of a harvesting system (Ma et al. 2015)

The figure above analyses a generic case where ambient sourced energy is used to feed a typical device. The energy harvesting and management sector are responsible for the power available for the sensor, processor, and transmitter units. The so-called I/O interface can comprise digital devices attached to sensing units, display units or others, or even analog units combined with antennas or electrodes. The whole design of the device is meant to reduce the power needed and, in the meantime, to address the requirements of the system.

Recent works have focused on optimizing energy harvesting systems with AI architectures that can suit different energy sources and applications. Fluctuations in energy harvesting directly translate to devices that frequently switch on and off, so that every computational progress that is not saved in time gets lost. Using non-volatile processors (NVP), every computational progress can be stored in non-volatile memory (NVM). This process, known as checkpointing, assures the device’s recovery at the same state before the switch off due to lack of power. This process has a consistent drawback; this writing process is time and energy consuming, so it needs to be optimized at its best. This problem can be addressed either with hardware than software extents.

Software-side optimization can be reached by both reducing the checkpoint data load and the checkpointing rate of recurrence. The latter can be addressed by the avoidance of unnecessary checkpoints or by the augmentation of the stored energy before the switch on so that the subsequent execution can last longer.

Actions on the hardware side can include reducing the capacitor’s target voltage, where the energy is stored so that the switch on of the device can occur earlier. Consequently, a lower amount of energy results to be harvested, so this can lead to more frequent checkpointing.

As the two optimization methods seem to act in reciprocal contrast, a good trade-off between them must be reached. Pan et al. (2019) proposed an algorithm to reduce the checkpoints data size, in junction with another algorithm to avoid unnecessary checkpoint recurrence. The two were combined to a wake-up procedure to mitigate between the software and hardware side optimizations.

The above-mentioned work proposes three power-saving methods to augment efficiency in energy management in a self-powered Internet of Things (IoT) device. This providing a power supply that is ultra-low-harvesting. A non-volatile processor (NVP)-aware task scheduling (NTS) is proposed to reduce the data size of the checkpointing process. Subsequently, a tentative checkpointing withdrawal (TCW) is provided to eliminate checkpointing which could result as unwanted. As the last step, a dual wake-up procedure (DWP) is added to equalize software and hardware overheads as an additive maximization of energy efficiency. In the work of Khorsand et al. (2020) artificial intelligence is applied on a rotary TENG system, as presented in Fig. 13, to achieve an adequate characterization of its output features under diverse kinematic and geometrical conditions. The mathematical model applied considers variables such as the number of segments, the rotational speed, and the device’s surface spacing.

Fig. 13
figure 13

Scheme of a rotary TENG system (Khorsand et al. 2020)

The proposed algorithm, used to analyze the TENG’s output, is meant to iterate a comparison between all results the best solution, identified with the maximum output power. At the same time, two solvers face all the equations of the modeled system at each loop.

4 Conclusions

Artificial Intelligence nowadays is seriously taken into account to optimize and develop many membrane applications, allowing the most settled ones to be renewed and better optimized to work in more efficient ways.

Conspicuous research in this field seems to unceasingly lead to new promises in a wide area of engineering applications, thus meeting either high-efficiency standards and “green” and low environmental impact criteria, being the two the main features requested to any innovative technology nowadays.

Artificial intelligence or ML-based algorithms are intelligent techniques which is highly advantageous to understand membrane fouling or energy production nowadays. This study demonstrates that the optimization and modeling techniques in combination with other AI and ML algorithms can be utilized to intelligently monitor and control membrane fouling in different wastewater processes as well as during the generation of clean blue energy.

The most innovative and sophisticated ones to gain more significant interest and, consequently, a more consistent place in the world’s industrial appliances. Constant improvements in this research topic can open routes for new application possibilities, extending the present-day membrane device usage in more cost-effective and “green” forms that help society improve their energy resources utilization and management and the quality of life itself. From wastewater management to blue energy production, AI-based implementations lead to better results, lifting engineering processes towards a whole new level of efficiency and sustainability.