원시데이터 수집 시스템
선정목록으로

Efficient water desalination with graphene nanopores obtained using artificial intelligence

간접 관련 필름·전자재료 · (18) VENT(방수통기 부품) (5) 연료전지용 수분제어장치(가습기)(6) PEM(고분자전해질막)(7) MEA(막전극접합체)

기본 정보

저자
  1. Yuyang Wang — Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA, USA
  2. Zhonglin Cao — Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA, USA
  3. Amir Barati Farimani — Department of Chemical Engineering, Carnegie Mellon University, Pittsburgh, PA, USA|||Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA, USA|||Machine Learning Department, Carnegie Mellon University, Pittsburgh, PA, USA
DOI
10.1038/s41699-021-00246-9
저널
npj 2D Materials and Applications
발행년도
2021
발행기관
Nature Portfolio
피인용수
79
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1038/s41699-021-00246-9
토픽
Graphene research and applications
OpenAlex ID
W3125600935

평가 내용

관련도
간접 관련
사업분야
필름·전자재료 · (18) VENT(방수통기 부품)
부 분야
(5) 연료전지용 수분제어장치(가습기), (6) PEM(고분자전해질막), (7) MEA(막전극접합체)
R&D 측면
분석·모델링
확신도
0.70
근거 용어
graphene nanopores, water desalination, artificial intelligence, membrane, water flux
판단 근거
그래핀 나노포어를 이용한 수처리(해수 담수화) 연구로, 코오롱인더스트리의 직접적인 제품은 아니나 분리막(Membrane)의 기공 구조 설계 및 투과 성능 최적화 원리는 수소연료전지용 분리막 및 방수통기용 멤브레인 R&D에 응용 가능합니다.
R&D 활용 포인트
AI 및 머신러닝을 활용한 고분자/나노 소재의 기공 구조 최적화 및 투과 성능(수분/가스) 예측 모델링 기술로 활용 가능함.
평가 입력
본문 49,200자 중 30,032자 발췌

초록

Abstract Two-dimensional nanomaterials, such as graphene, have been extensively studied because of their outstanding physical properties. Structure and topology of nanopores on such materials can be important for their performances in real-world engineering applications, like water desalination. However, discovering the most efficient nanopores often involves a very large number of experiments or simulations that are expensive and time-consuming. In this work, we propose a data-driven artificial intelligence (AI) framework for discovering the most efficient graphene nanopore for water desalination. Via a combination of deep reinforcement learning (DRL) and convolutional neural network (CNN), we are able to rapidly create and screen thousands of graphene nanopores and select the most energy-efficient ones. Molecular dynamics (MD) simulations on promising AI-created graphene nanopores show that they have higher water flux while maintaining rival ion rejection rate compared to the normal circular nanopores. Irregular shape with rough edges geometry of AI-created pores is found to be the key factor for their high water desalination performance. Ultimately, this study shows that AI can be a powerful tool for nanomaterial design and screening.

본문 49,200자

본문 펼치기
/ pj ARTICLE OPEN # Efficient water desalination with graphene nanopores obtained using artificial intelligence [1,2,3](http://orcid.org/0000-0002-2952-8576) ✉ Yuyang Wang [1,4,](http://orcid.org/0000-0003-0723-6246) Zhonglin Cao [1,4](http://orcid.org/0000-0003-2096-1178) and Amir Barati Farimani Two-dimensional nanomaterials, such as graphene, have been extensively studied because of their outstanding physical properties. Structure and topology of nanopores on such materials can be important for their performances in real-world engineering applications, like water desalination. However, discovering the most efficient nanopores often involves a very large number of experiments or simulations that are expensive and time-consuming. In this work, we propose a data-driven artificial intelligence (AI) framework for discovering the most efficient graphene nanopore for water desalination. Via a combination of deep reinforcement learning (DRL) and convolutional neural network (CNN), we are able to rapidly create and screen thousands of graphene nanopores and select the most energy-efficient ones. Molecular dynamics (MD) simulations on promising AI-created graphene nanopores show that they have higher water flux while maintaining rival ion rejection rate compared to the normal circular nanopores. Irregular shape with rough edges geometry of AI-created pores is found to be the key factor for their high water desalination <mark>performance.</mark> <mark>Ultimately,</mark> <mark>this</mark> <mark>study</mark> <mark>shows</mark> <mark>that</mark> <mark>AI</mark> <mark>can</mark> <mark>be</mark> <mark>a</mark> <mark>powerful</mark> <mark>tool</mark> <mark>for</mark> <mark>nanomaterial</mark> <mark>design</mark> <mark>and</mark> <mark>screening.</mark> npj 2D Materials and Applications <mark>(2021)5:66</mark> <mark>;</mark> <mark>[https://doi.org/10.1038/s41699-021-00246-9](https://doi.org/10.1038/s41699-021-00246-9)</mark> INTRODUCTION Single-layer graphene, as an iconic two-dimensional (2D) material, has drawn much scientific attention in recent decades. Because of its ultrathin thickness and outstanding mechanical properties, graphene with artificial pores has been demonstrated to have great potentials in many engineering applications, such as effective hydrogen gas separator <sup>1–3</sup>, next-generation energy storage or supercapacitor building <sup>4,5</sup>, and high-resolution DNA sequencing <sup>6–8</sup> . Given the potential imminent global water scarcity crisis, another important application for nanoporous graphene is energy-efficient water desalination <sup>9,10</sup> . Equipped with nanoporous 2D material membranes like graphene, the reverse osmosis (RO) water desalination process can expect 2–3 orders improvement in water flux compared with traditional polymeric membranes <sup>9–14</sup> . In RO, the geometry of nanopores in 2D materials plays a determinant role in water desalination performance <sup>9,11</sup> . In general, a large pore that allows high water flux is likely to perform poorly in rejecting ions; a small pore that rejects 100% undesired ions, on the other hand, usually have limited water flux. Thus, an optimal nanopore for water desalination is expected to allow as high water flux as possible while maintaining a high ion rejection rate. However, finding the optimal nanopore geometry on graphene can be challenging due to high computational and experimental cost associated with extensive experiments, i.e., there are countless possible shapes for a pore on a 4 nm × 4 nm graphene membrane, but evaluating the water flux and ion rejection of a single pore using 10 ns MD simulation takes roughly 36 h on a 56core CPU cluster. Given this time benchmark, evaluating the water desalination performance of 1000 graphene nanopores can take more than 4 years. Therefore, to discover the optimal graphene nanopore for water desalination, an efficient nanopore screening method with a fast nanopore water desalination performance predictor (performance predictor in short) is needed. Inspired by the recent success of deep learning <sup>15</sup> and reinforcement learning (RL) <sup>16</sup>, we create an AI framework consists of the combination of the state-of-art deep reinforcement learning (DRL) algorithm with a convolutional neural network (CNN) to solve this challenge. The main idea of RL <sup>17</sup> is to train an agent to find an optimal policy that maximizes the expected return in the future through actively interacting with the environment to achieve a goal. Recently, DRL <sup>16,18</sup>, which models the RL agent with artificial neural networks, has proven to be an efficient tool in material-related engineering fields, such as material design <sup>19–21</sup> and molecule optimization <sup>22</sup> . In this work, we designed and implemented an artificial intelligence framework consisting of DRL, which is capable of creating a nanopore on a single-layer graphene membrane to reach optimal water desalination performance. By a series of decisions on whether or not to remove carbon atoms and which atom to be removed, the DRL agent can eventually create a pore that allows the highest water flux while maintaining ion rejection rate above an acceptable threshold. Such precisely controlled atom-by-atom removal nanopore synthesis can be conducted by electrochemical reaction <sup>23,24</sup> . Perforation technologies can also offer the opportunities to control the formation of pores, gaps, and bridges with nano-meter dimensions on 2D materials such as graphene experimentally <sup>25–28</sup> . During training, the DRL agent learns from the feedback based on the water desalination performance (e.g. reward for high water flux and penalty for lower ion rejection). However, conventional methods to calculate desalination performance, like MD simulation, are too time-consuming to be implemented in our DRL model. To evaluate DRL-designed nanopores fast and accurately, we implemented a CNN-based <sup>29–32</sup> model that uses the geometry of porous graphene membrane to directly predict the water flux and ion rejection rate under certain external pressure. To this end, a ResNet <sup>32</sup> model is trained on the dataset we collected through MD simulation of water desalination using various graphene nanopores. With the CNN-accelerated desalination performance prediction, the DRL model can rapidly discover the optimal graphene nanopore for water desalination. MD simulations on 1Department of Mechanical Engineering, Carnegie Mellon University, Pittsburgh, PA, USA. 2Department of Chemical Engineering, Carnegie Mellon University, Pittsburgh, PA, USA. 3Machine Learning Department, Carnegie Mellon University, Pittsburgh, PA, USA. 4These authors contributed equally: Yuyang Wang, Zhonglin Cao. ✉email: [barati@cmu.edu](mailto:barati@cmu.edu) 2 Y. Wang et al. top-performing DRL-created graphene nanopores prove that they have higher water flux while maintaining a similar ion rejection rate compared to the circular nanopores. Further investigation of molecular trajectories reveals the reason that DRL-created nanopores outperform the conventional circular nanopores and provides insights for energy-efficient water desalination. Lastly, our AI-driven framework can be potentially applied to various application areas <sup>33</sup> of 2D materials besides water desalination, such as gas permeation and separation, battery and supercapacitor applications, and biomolecular translocation <sup>34,35</sup> . RESULTS AI framework The framework (Fig. 1) of water desalination for efficient water desalination consists of a DRL agent and a CNN-based performance predictor network. At each timestep, the DRL agent generates a updated nanopore by removing at most one atom from the graphene, and the CNN-based performance predictor network predicts the water flux/ion rejection rate of the nanopore, such that the DRL agent can get instantaneous feedback on its action. Given the featurized information of the nanoporous graphene sheet (Morgan fingerprint, Cartesian coordinates of each atom, and geometrical features of graphene membrane from the CNN model) and predicted water flux and ion rejection, the DRL agent (details of DRL agent shown in Supplementary Fig. 1) was trained to create a pore on graphene sheet with the goal to maximize its performance in the water desalination process. The dataset used to train CNN performance predictor is generated by MD simulations of various graphene nanopores for water desalination. Graphene nanopore dataset We consider the graphene nanopore system as illustrated in Fig. 2a, which consists of four different sections: a graphene piston that applies constant external pressure; a saline water section Candidate atoms (shown in red) Argmax Deep Q network (, ) State Reward Desalina�on predictor Ac�on Reward Desalina�on predictor Water flux CNN Reward Ion rejec�on CNN Geometrical features Fingerprint Atom coordinates State Graphene Gaussian kernelized graphene Atom to remove Graphene Fig. 1 Overview of AI creating nanopores for efficient water desalination via the integration of CNN and DRL. The whole framework runs by removing atoms sequentially. At each timestep t, at most one candidate atom (colored as red) is removed from the current graphene nanopore gt to generate a updated nanopore gt+1. Any dangling atoms caused by the removal of candidate atom are also removed from gt. gt+1 is fed into a CNN-based performance predictor to predict water flux ft+1 and ion rejection rate it+1. Meanwhile, the geometrical feature is extracted from the CNN. The reward is then calculated from the predicted it+1 and ft+1. The geometrical feature is concatenated with the fingerprint and atom coordinates as the state st+1. Given gt+1, candidate atoms to remove are picked from those located at the edge of the nanopore. The DRL agent constructed upon deep Q-network takes the reward, candidate atoms, and state as input to determine the next atom to remove from the graphene. containing potassium chloride as solute; a single-layer graphene membrane with the pore of different geometries; and a freshwater section which functions as a reservoir of filtered water. The molarity of the saline water in this work is ~2.28 M, which is higher than normal seawater for the sake of computational efficiency. The dimension of the simulation box is approximately 4 nm × 4 nm × 13 nm in x, y, and z-directions, respectively. A periodic boundary condition was applied to all three dimensions. The two major performance indicators of a membrane in water desalination: water flux and ion rejection rate, were calculated by post-processing the MD simulation trajectories. The slope of the fitted least-square regression line on filtered water with respect to the simulation time curve was calculated to be the water flux of each membrane (Fig. 2b). The ion rejection rate of each membrane was calculated by dividing the number of ions in the freshwater section by the total number of ions. The total number of different simulated porous graphene is 185. Since the reward of DRL agent in our model was calculated based on the water flux/ion rejection prediction of performance predictor (Eqs. (1) and (2); Supplementary Fig. 2), highly accurate predictions must be achieved to ensure the quality of DRL training. A much larger training dataset was necessary for the optimization of CNN model. The method employed in our study to substantially increase the size of the dataset was data augmentation <sup>36,37</sup> . Given that the water desalination performance of a graphene pore depended on its size and geometry, we could assume that a flipped or translated pore on the same graphene membrane would demonstrate identical water flux/ion rejection rate of the original pore (proven by MD simulations in Supplementary Fig. 3). Therefore, copies of original pores were created by being flipped along x- or y-axis and/or translating in −4 to 4 Å in x and y directions (Fig. 2c). The water desalination performance of pore copies is a random variable of normal distribution (μ = original pore performance, σ = 1% of original pore performance). In order to improve CNN’s prediction accuracy on the performance of pores created by the DRL agent, we augmented DRL-generated pores 32 times. Among the other pores, the ones with zero water flux (too small to allow water transport) were augmented 6 times, and the rest of the pores were augmented 24 times. The final dataset used for CNN training contains 3937 samples (Fig. 2d). A reverse sigmoid function was fitted to the distribution of samples to show the general relationship between the water flux and ion rejection rates. Water desalination performance prediction To facilitate the efficient estimation of water desalination performance in our AI-driven framework, a CNN model was trained to make an instantaneous prediction of water flux and ion rejection rates given a specific graphene nanopore. CNN is widely known as a universal feature extractor. Given that the water desalination performance of a graphene nanopore depends on its geometrical features, CNN can be the most suitable model to recognize geometrical features and make predictions based on them. The CNN models were implemented based on VGG <sup>31</sup> and ResNet <sup>32</sup>, and a multi-layer perceptron (MLP) was built on top of the convolutional layers to project the CNN-extracted features to the predicted water desalination performance (i.e., flux and ion rejection rate). We compared the performance of CNN-based deep learning models with XGBoost <sup>38</sup>, a widely used shallow machine learning model, which was also trained to predict the water flux/ion rejection rate. The advantage of XGBoost model is that it requires much less time for training compared to CNN. Before the training of the XGBoost model, the graphene membrane was featurized into a one-hot-encoded Morgan fingerprint <sup>39</sup> vector of dimension 1024 using RDKit package <sup>40</sup>, with a cutoff distance of 5 Å. The Morgan fingerprint vector was then fed in the XGBoost regression 3 (a) Y. Wang et al. Piston Saline water Membrane Fresh water (b) (c) (d) Original Flip Translate Flip+Translate Fig. 2 Dataset generation using MD simulation and data processing. a Graphene nanoporous membrane water desalination system in MD simulation. b Number of filtered water molecules with respect to simulation time for pores with a different number of atoms removed. The slope of the least-squared regression line of each curve is the water flux. c Two data augmentation techniques: flip and translation. d Water flux and ion rejection rate distribution of the final training dataset for predictive CNN model. The blue dashed line represents a reverse sigmoid curve fitted in terms of water flux and ion rejection rate. Table 1. Performance of different models for graphene property prediction. Model Flux MSE Flux R <sup>2</sup> Ion rejection MSE Ion rejection R <sup>2</sup> XGBoost 0.011 0.988 0.008 0.992 VGG16 0.0448 0.957 0.0156 0.985 ResNet18 0.0024 0.998 0.0039 0.996 ResNet50 0.0022 0.998 0.0038 0.996 Values based on standardized water flux/ion rejection. model as input. A random search was conducted on the hyperparameter grid (Supplementary Tables 2 and 3) for model optimization. The mean squared error (MSE) and coefficient of determination (R <sup>2</sup> ) are used as metrics to evaluate the performance predictions of models. The water flux and ion rejection labels are standardized before fed into the property prediction models. Thus the metrics tabulated are based on standardized water flux or ion rejection rate (Table 1). Since the accuracy of performance predictor directly influence how accurately the DRL agent is rewarded/penalized during training, the model with the least MSE and highest R <sup>2</sup> values was chosen to be used for reward estimation. ResNet <sup>32</sup> significantly outperformed other models on both metrics, and the fined-tuned ResNet50 model reaches the highest accuracy in predicting both water flux and ion rejection rate. Therefore, a ResNet50 (retrained using the whole dataset) is used to predict the water desalination performance of various graphene nanopores to accelerate the DRL training. DRL for discovering the optimal graphene nanopores Our goal was to design the optimal geometry of graphene nanopore for energy-efficient water desalination, which simultaneously demanded high flux and high ion rejection under certain external pressure. In order to optimize the nanopore, an agent was expected to remove atoms sequentially until the desired pore geometry was developed. To this end, the agent was set to interact with graphene nanopores in a sequence of actions at, states st, and rewards rt within an episode of length T. The goal of the agent was to select the action such that it could maximize the future discounted return Rt ¼ PT t¼1 <sup>γt�1rt</sup> <sup>in</sup> <sup>the</sup> <sup>finite</sup> <sup>Markov</sup> <sup>decision</sup> <sup>process</sup> <sup>(MDP)</sup> <sup>setting.</sup> <sup>In</sup> our case, we set the discount factor γ to be 1. At timestep t, given the graphene nanopore Gt, the agent observed the state st, which was composed of Morgan fingerprint <sup>39</sup>, coordinates of all the atoms, along with CNN-extracted graphene geometrical features. The graphene geometry g <sup>0</sup> t <sup>was</sup> fed into the flux and ion rejection predictor, respectively. The geometrical features were the concatenation of last layer before output of the performance predictors. Once an atom was removed, its coordinate was set to the origin since MLP required a homogeneous input dimension. The predicted flux ft and ion rejection it were leveraged to compute the reward signal rt for the agent, as given in Eqs. (1) and (2): rt ¼ αf t þ σðitÞ � σð1Þ; (2) where σ(⋅) is the generalized logistic function <sup>41</sup> and α is the coefficient for flux term. In our setting, α was set to be 0.01, and A = −15, K = 0, B = 13, Q = 100, ν = 0.01, C = 1 for the logistic function. A linear term of flux reward encouraged the agent to expand nanopores, which would allow higher water flux. Since low ion rejection rate was not favored in water desalination, a generalized logistic function σ(⋅) was leveraged to penalize ion rejection term. When it was high, σ(it) was close to zero, allowing the growth of the nanopores. However, when it was low, σ(it) fiercely penalized the agent by outputing a large negative value (Supplementary Fig. 2). Besides, an extra 0.05 reward was given to the agent when it chose to remove an atom at timestep t to encourage pore growth at an early stage. Given state st and reward rt, the agent intended to choose the action at for next step. However, due to the high dimensionality of possible action space (all the atoms in the graphene fragment), it was computationally expensive for the agent to efficiently and thoroughly explore the possible actions and to learn an optimal design. Therefore, only a subset of M atoms was selected as candidates ct. Atoms on the <u>K</u> <u>�</u> <u>A</u> σðxÞ ¼ A þ ðC þ Qe <sup>�Bx</sup> Þ <u>1ν</u> <sup>;</sup> (1) 4 Y. Wang et al. Fig. 3 Training results for 10 DRL agents. a Summation of reward in each timestep vs. episode, where the red line is the running average of the reward with window size 21 and the blue shadow represents the standard deviation. b Summation of reward in each timestep vs. timestep. c Number of removed atoms vs. timestep. d Predicted water flux vs. timestep. e Predicted ion rejection vs. timestep. b–e show the results of DRL agents after trained for 2000 episodes, where the red line indicates the mean and the blue shadow is the standard deviation. f Evolution of a graphene nanopore designed by DRL agent. edge of pore were picked based on the rank of their proximity to the pore center, if the number exceeds M, only the first M atoms closest to the center of pore were selected. However, when the number of edge atoms was less than M, non-edge atoms closest to the center of pore were selected as possible candidates to maintain the size of ct. Given the state st, reward rt, and candidate ct, the agent learned to pick the action aiming to maximize future rewards. We optimized the DRL agent via deep Q-learning <sup>16</sup> with experience replay with 10 random seeds to generate various graphene nanopores. In the DRL agent training processes with different random seeds (Fig. 3), the red curves indicate mean Y. Wang et al. Fig. 4 Visualization of 2D t-SNE embedding of CNN features. a 2D t-SNE embedding of features extracted from water flux prediction CNN model, where each point is colored by its predicted water flux. b 2D t-SNE embedding of features extracted from ion rejection rate prediction CNN model, where each point is colored by its predicted ion rejection. Each axis represents a dimension of the t-SNE embedding. Dot and Xmarks represent graphene nanopores from DRL and the training dataset, respectively. Several graphene nanopores from the training dataset are shown in black and DRL-created membranes are shown in blue. 5 values and the blue shadows represent standard deviations. The accumulated reward for each episode increases during training the DRL agent (Fig. 3a). Initially, the policy is noisy and the accumulated rewards are low because the DRL agent has not yet learned to stop expanding the pore before receiving an enormous penalty for a low ion rejection rate. During the training, the DRL agent gradually learns a stable policy through maximizing the rewards (balancing the trade-off between water flux and ion rejection rate). The performance of DRL agent after 2000 episodes of training is demonstrated in Fig. 3b–e. The DRL agent generates the nanopore which brings a positive reward at each timestep, and the agent also automatically learns to stop enlarging the nanopore to avoid a low ion rejection rate (Fig. 3b, c). For example, the evolution of a DRL-created pore (Fig. 3f, animated in Supplementary Movie) shows that DRL stops removing atom from the edge of graphene nanopore after 50th timestep because it determines that higher water flux reward brought by further removing atoms is not worth the penalty for low ion rejection rate. Based on the prediction of the performance predictor, the DRLcreated graphene nanopores have averaged ~40 # ns <sup>−1</sup> water flux and ~96% ion rejection rate (Fig. 3d, e). Investigation on DRL-created graphene nanopores The collection of both DRL-created graphene nanopores (7999 samples) and nanopores in the training dataset (3937 samples) is visualized using t-SNE <sup>42</sup> algorithm (Fig. 4). t-SNE maps the high-dimensional features (1000 dimension) extracted from trained CNN models to the low-dimensional domain while preserving the similarity between data points as the relative distance in 2D. In other words, CNN features that are more similar to each other will have a higher tendency of being clustered. In this work, using CNN-extracted features from each graphene membrane, t-SNE successfully clusters samples with similar water flux or ion rejection. Also, as illustrated in Fig. 4, graphenes with different nanoporous structures are far from each other in the plot while those with similar structures are shown close. The results indicate that our CNN model successfully learns to extract features that strongly correlate the water desalination performance (i.e., water flux and ion rejection) with the geometry of the nanopores. The water desalination performances of all nanopores, including DRL-created and those in the training dataset, are compared in Fig. 5a. Comparison between permeation rate of nanopores (Supplementary Fig. 4) shows the water flux different normalized of the external pressure. It is worth noting that the process of generating 7999 nanopores using DRL and predicting their water flux/ion rejection rate takes less than a single week; however, evaluating the performance of the same amount of nanopores using MD simulation will take ~33 years (average 36 hrs on each sample, using one 56-core CPU node). Among the nanopores with the same level of ion rejection rate, some nanopores discovered by DRL allow much higher water flux. One common feature shared by those high-performance nanopores is the semi-oval geometry with rough edges. We set 90% ion rejection rate as the threshold to determine if a nanopore can effectively reject ions. The water flux histogram (Fig. 5b) shows that given the baseline ion rejection rate as 90%, DRL can extrapolate from the training dataset and discover graphene nanopores that generally allow higher water flux. Further MD simulations are conducted with DRL-created graphene nanopores that show high predicted performances to evaluate how the DRL helps in discovering the optimal graphene nanopore for water desalination (simulation process recorded in Supplementary Movie). Although DRL-created pores generally have lower water flux compared with circular pores with the same area, they have a much higher ion rejection rate (Fig. 5c, 90% threshold of ion rejection rate is marked by a red dashed line). For example, when the pore area is 113 Å <sup>2</sup>, DRL-created nanopore maintained over 90% ion rejection rate while the circular pore rejects only approximately 65% of ions. A pore with high water flux but a very low ion rejection rate is not desirable in water desalination application. Moreover, the comparison between 113 Å <sup>2</sup> DRL-created nanopore with 88 Å <sup>2</sup> circular pore shows that DRL-created pore can reject more ions when achieving the same water flux: they both have approximately 125 # ns <sup>−1</sup> water flux while 113 Å <sup>2</sup> DRL-created pore can reject approximately 7% more ions. The comparison between simulation results proves that DRL tends to prioritize the ion rejection rate over water flux, which makes it capable of maximizing the water flux of nanopores while maintaining a valid ion rejection rate. Nanopores with a larger area result in higher pore density on the graphene membrane. The pore density of the graphene membranes with the abovementioned nanopores are tabulated in Supplementary Table 4. In real-world experiments or applications, the graphene 6 Y. Wang et al. ## (a) (b) (c) (d) Circular, 88 Å <sup>2</sup> DRL, 113 Å <sup>2</sup> ## (e) Fig. 5 Analysis of DRL-created graphene nanopores. a Predicted water flux (ns <sup>−1</sup> ) and ion rejection rate (%) of all graphene nanopores (7999 DRL-created + 3937 in training dataset). Zoom-in window shows the geometries of high-performance nanopores. b Histogram of water flux of nanopores with >90% ion rejection rate. c Comparison of water desalination performance (under 100 MPa pressure) of circular and DRLcreated graphene nanopores. Each data point is obtained by averaging the ion rejection and water flux of 4 MD simulations. The error bars represent one standard deviation. d Distribution of water molecules (aqua blue) and ions (red) when they are inside of the nanopores (left: circular, area = 88 Å <sup>2</sup> ; right: DRL-created, area = 113 Å <sup>2</sup> ). e Schematic showing how ions are blocked by DRL-created pore due to the steric effect. Ions with their hydration shell (blue dashed circle) are too large to pass through the corner area (red dashed circle) in the DRL-created pore, thus rendering that area an ion-free zone. nanopores can be stabilized by adding passivation such as hydrogen to the edge of the pore <sup>43</sup> . To gain a deeper understanding of the reason behind the high ion rejection rate of DRL-created pores, distribution of water molecules and ions inside of 113 Å <sup>2</sup> DRL-created pore and 88 Å <sup>2</sup> circular pore have been visualized (Fig. 5d). From the ion distribution (marked by red dots), we can observe that ions can traverse the circular pore evenly through the entire central area of the pore. The distributions of water molecules (marked by aqua blue color) and ions in the circular pore are in a homogeneous pattern. However, the corners inside of DRL-created nanopore are small enough to block the passage of ions while being large enough to accommodate the transport of water molecules. With the knowledge that ions are covered by hydration shell during the 7 transport through the nanopore, it can be seen that ion-free zones (corners) inside of DRL-created nanopore obstruct the traversing of ions with hydration shell by steric effect (Fig. 5e). The perimeter/area ratio can be used as a shape parameter to quantitatively evaluate the influence of geometry on the water desalination performance of nanopores. Due to the rough edges, the comparison of the perimeter/area ratio of DRL-created and circular pores (Supplementary Fig. 6) shows that DRL-created pore generally have higher perimeter/area ratio (Supplementary Table 4). Higher perimeter/area ratio enables DRL-created pores to achieve higher ion rejection rate compared with circular pores with similar water flux or permeation rate. This is the reason why high-performance nanopores (zoom-in Fig. 5a, more highperformance DRL-created pores shown in Supplementary Fig. 7) all have rough edges. Discovers and utilizes this special geometry, DRL identifies nanopores that can reject most ions while allowing high water transport. DISCUSSION In this work, we propose an AI framework that combines the DRL and CNN performance predictor to discover the optimal graphene nanopore for water desalination. The DRL agent takes the current graphene geometrical features and the candidate atoms as inputs to determine which atom to remove at each timestep. Trained with the DQN algorithm, the agent learns to generate nanopores that allow high water flux while maintaining high ion rejection. ResNet50, a widely used CNN model, is trained on a graphene nanopore dataset to instantly predict the water flux and ion rejection rate under certain pressure. Such prediction by the ResNet50 enables the real-time interaction between the DRL agent with the graphene nanopores, as well as the online optimization of the DRL agent. CNN-accelerated DRL training significantly expedites the exploration of graphene nanopores: 7999 different nanopores are created and evaluated for water desalination performance during 1-week training of DRL. Evaluating the same amount of graphene nanopores using MD simulation can take approximately 33 years with a 56-cores CPU cluster. When we set the baseline ion rejection rate to be 90%, DRL shows the capability of extrapolating from the existing training dataset to discover nanopore with higher water flux. Further MD simulations confirm that DRL-created nanopores outperform circular nanopores in terms of ion rejection rate when they have approximately the same water flux. The better water desalination performance of DRL-created pores can be attributed to DRL’s utilization of rough edges and small corners to increase the perimeter/area ratio of pores and to block ions with the hydration shell. In conclusion, DRL shows the capability of discovering optimal graphene nanopores for water desalination. Moreover, with only minor modifications, this framework can be directly extended to many other fields concerning nanomaterial design. With a well-trained machine learning property predictor, the DRL can automatically learn to discover the optimal material structure effectively and efficiently. METHODS MD simulations MD simulations were conducted using LAMMPS package <sup>44</sup>, where porous graphene membranes simulated were either created using Visual Molecular Dynamics <sup>45</sup> or automatically generated by DRL agent (samples from the early stage of training). All water molecules in this work were simulated using SPC/E model <sup>46</sup>, with SHAKE <sup>47</sup> algorithm to constrain the bond length and angles. Lennard–Jones (LJ) potentials (Supplementary Table 1) along with long-range Coulombic electrostatic potentials were adopted as interatomic potentials in the MD simulation. The cutoff for the interatomic potentials was set to be 12 Å. Lorentz–Berthelot rules were employed for the calculation of LJ potentials between different kinds of Y. Wang et al. atoms. Particle-particle particle-mesh (PPPM) Ewald sovler <sup>48</sup> with 0.005 root-mean-squared error was used for long-range Coulombic potential correction. The porous graphene membrane and piston were each regarded as an entity during the simulation (internal interatomic potentials were not calculated) in order to reduce the computational cost. In the first stage of each individual simulation, the internal energy of the system was minimized for 1000 iterations. The system then ran for 5 ps under the NPT (isothermal–isobaric) ensemble at 300 K after the velocities of molecules were initialized based on Gaussian distribution. After the equilibrating, the system under NPT ensemble, the system was switched to NVT (canonical) ensemble to run for another 10 ns. The temperature was maintained at 300 K by Nosé–Hoover thermostat <sup>49,50</sup> with a time constant of 0.5 ps. At this stage, a z-direction constant external pressure of 100 MPa was applied on saline water by the piston to mimic the RO process in water desalination. Since the relationship between water flux and external pressure in the RO process was generally linear <sup>9,11–13</sup>, the performance of pores under 100 MPa could be extrapolated to lower pressures. Therefore, we chose to run simulations under 100 MPa external pressure to rapidly collect meaningful data. Molecular trajectories of each simulation were collected every 5 ps for data processing. Data augmentation was conducted using the Atomic Simulation Environment (ASE) package <sup>51</sup> . Area and perimeter of the graphene nanopores are calculated using computer vision methods (details in Supplementary Fig. 5). CNN water desalination performance predictor There were two steps in the CNN modeling, including extracting features from the geometry of graphene nanopore and making predictions through an MLP regression model. First of all, the geometrical features of a graphene nanopore were extracted to a 380 × 380 pixels representation. Color was applied on top of each atom, and all geometrical features were resized to the dimension of 224 × 224 pixels. The processed geometrical features were then fed into a CNN. Multiple CNN models, including ResNet18, ResNet50 (ref. <sup>32</sup> ), and VGG16 (ref. <sup>31</sup> ) with batch normalization, were benchmarked based on the MSE and R <sup>2</sup> of their resulting water flux/ ion rejection rate predictions. An extracted feature vector with the dimension of 1000 was output from the CNN model. Finally, given the feature vector, the MLP was able to make predictions of flux and ion rejection rates. The MLP used in this work consisted of two layers with 256 and 64 neurons in the first and second layers, respectively. A residual block <sup>32</sup> and ReLU <sup>52</sup> activation function were added after each layer of MLP. Two CNN models were trained: one for the prediction of water flux and the other for ion rejection rate. The CNN models, including VGG <sup>31</sup> and ResNet <sup>32</sup>, were implemented based on PyTorch library <sup>53</sup> and pre-trained on the ImageNet dataset <sup>54</sup> to learn the robust CNN feature extractor. A random-initialized MLP was built on top of the convolutional layers to project the CNN-extracted features to the predicted water desalination performance (i.e., flux and ion rejection rate). In training the deep learning models on our graphene dataset, we used gradient-based Adam optimizer <sup>55</sup> with the learning rate 0.0001 and 0.001 for pre-trained convolutional layers and the MLPs, respectively. The whole graphene dataset was split into a training set and a test set with the ratio of 4:1, and the models were trained only on the training set for 600 epochs and evaluate on the test set. The model which reached the best performance (i.e., lowest MSE in predicting the flux/ion rejection rate) on the test set was selected as the water desalination performance predictor in the DRL framework. These strategies in CNN training maintains the robust and informative CNN feature extractors in the pre-trained CNN models and avoided the model from overfitting the graphene dataset. DRL agent To train the agent, deep Q-learning 16 with experience replay was implemented. Our task only considered deterministic environment, namely given the pair (s, c) and the action a, ðs <sup>0</sup> ; c <sup>0</sup> Þ at the next timestep was determined. Based on Bellman equation <sup>17</sup>, the optimal action-value function Q <sup>*</sup> (s, c) in the deterministic environment was defined as Q <sup>�</sup> ðs; cÞ ¼ r þ γ max Q <sup>�</sup> ðs <sup>0</sup> ; c <sup>0</sup> Þ (3) c <sup>0</sup> To model the Q function, the Q-network parameterized by θ and target network parameterized by θ <sup>0</sup>, two fully connected networks with identical architecture were built. During training, only the parameters θ in the Qnetwork were updated through backpropagation from the loss function. The parameters θ <sup>0</sup> in the target network were updated with θ every 10 steps and are kept fixed otherwise. The input to the network was the 8 Y. Wang et al. pair of graphene state and action candidates, (s, c), and the output was the Q values of all the actions in the candidate. The agent then picked the action with the highest Q value. In addition, the agent’s experience ðs; c; r; s <sup>0</sup> Þ in the episodes were stored to a replay buffer D <sup>16</sup>, such that the experience can be leveraged to update the network parameters multiple times. During training, a mini-batch of samples was drawn uniformly at random from the replay buffer ðs; c; a; r; s <sup>0</sup> Þ � UðDÞ. The loss function (Eq. (4)) measured the difference between the target Q value Q <sup>�</sup> ðs <sup>0</sup> ; c <sup>0</sup> ; θ <sup>0</sup> i <sup>Þ</sup> and the prediction of current Q-network Q(s, c; θi): max Qðs <sup>0</sup> ; c <sup>0</sup> ; θ <sup>0</sup> i a <sup>0</sup> 22. Zhou, Z., Kearnes, S., Li, L., Zare, R. N. & Riley, P. Optimization of molecules via deep reinforcement learning. Sci. Rep. 9, 1–10 (2019). 23. Russo, C. J. & Golovchenko, J. A. Atom-by-atom nucleation and growth of graphene nanopores. Proc. Natl. Acad. Sci. USA 109, 5953–5957 (2012). 24. Feng, J. et al. Electrochemical reaction in single layer mos2: nanopores opened atom by atom. Nano Lett. 15, 3431–3438 (2015). 25. Fischbein, M. D. & Drndić, M. Electron beam nanosculpting of suspended graphene sheets. Appl. Phys. Lett. 93, 113107 (2008). 26. Wang, L. et al. Fundamental transport mechanisms, fabrication and potential applications of nanoporous atomically thin membranes. Nat. Nanotechnol. 12, 509 (2017). 27. Moreno, C. et al. Bottom-up synthesis of multifunctional nanoporous graphene. Science 360, 199–203 (2018). 28. Guirguis, A. et al. Perforation routes towards practical nano-porous graphene and analogous materials engineering. Carbon 155, 660–673 (2019). 29. LeCun, Y., Bottou, L., Bengio, Y. & Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 86, 2278–2324 (1998). 30. Krizhevsky, A., Sutskever, I. & Hinton, G. E. Imagenet classification with deep convolutional neural networks. Commun. ACM 60, 84–90 (2017). 31. Simonyan, K. & Zisserman, A. Very deep convolutional networks for large-scale image recognition. Preprint at [https://arxiv.org/abs/1409.1556](https://arxiv.org/abs/1409.1556) (2014). 32. He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 770–778 (IEEE, 2016). 33. Guirguis, A. et al. Applications of nano-porous graphene materials—critical review on performance and challenges. Mater. Horiz. 7, 1218–1245 (2020). 34. Farimani, A. B., Heiranian, M. & Aluru, N. R. Electromechanical signatures for dna sequencing through a mechanosensitive nanopore. J. Phys. Chem. Lett. 6, 650–657 (2015). 35. Farimani, A. B., Heiranian, M. & Aluru, N. R. Identification of amino acids with sensitive nanoporous mos 2: towards machine learning-based prediction. NPJ 2D Mater. Appl. 2, 1–9 (2018). 36. Perez, L. & Wang, J. The effectiveness of data augmentation in image classification using deep learning. Preprint at [https://arxiv.org/abs/1712.04621](https://arxiv.org/abs/1712.04621) (2017). 37. Van Dyk, D. A. & Meng, X.-L. The art of data augmentation. J. Comput. Graph. Stat. 10, 1–50 (2001). 38. Chen, T. & Guestrin, C. Xgboost: a scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 785–794 (ACM, 2016). 39. Rogers, D. & Hahn, M. Extended-connectivity fingerprints. J. Chem. Inf. Model. 50, 742–754 (2010). 40. Landrum, G. Rdkit: open-source cheminformatics software. GitHub and SourceForge Vol. 10, 3592822 (2016). 41. Richards, F. A flexible growth function for empirical use. J. Exp. Bot. 10, 290–301 (1959). 42. Maaten, Lvd & Hinton, G. Visualizing data using t-sne. J. Mach. Learn. Res. 9, 2579–2605 (2008). 43. Lee, J. et al. Stabilization of graphene nanopore. Proc. Natl. Acad. Sci. USA 111, 7522–7526 (2014). 44. Plimpton, S. Fast Parallel Algorithms for Short-Range Molecular Dynamics. Tech. Rep. (Sandia National Labs., Albuquerque, NM, 1993). 45. Humphrey, W., Dalke, A. & Schulten, K. et al. Vmd: visual molecular dynamics. J. Mol. Graph. 14, 33–38 (1996). 46. Mark, P. & Nilsson, L. Structure and dynamics of the tip3p, spc, and spc/e water models at 298 k. J. Phys. Chem. A 105, 9954–9960 (2001). 47. Ryckaert, J.-P., Ciccotti, G. & Berendsen, H. J. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of nalkanes. J. Comput. Phys. 23, 327–341 (1977). 48. Plimpton, S., Pollock, R. & Stevens, M. Particle-mesh Ewald and rRESPA for parallel molecular dynamics simulations. In Proc. Eighth SIAM Conference on Parallel Processing for Scientific Computing (SIAM, 1997). 49. Nosé, S. A unified formulation of the constant temperature molecular dynamics methods. J. Chem. Phys. 81, 511–519 (1984). 50. Hoover, W. G. Canonical dynamics: equilibrium phase-space distributions. Phys. Rev. A 31, 1695 (1985). 51. Larsen, A. H. et al. The atomic simulation environment-a python library for working with atoms. J. Phys. Condens. Matter 29, 273002 (2017). 52. Nair, V. & Hinton, G. E. Rectified linear units improve restricted boltzmann machines. In International Conference on Machine Learning (PMLR, 2010). 53. Paszke, A. et al. Pytorch: An imperative style, high-performance deep learning library. In Wallach, H. et al. (eds.) Advances in Neural Information Processing Systems 32, 8024–8035 (Curran Associates, Inc., 2019). 54. Deng, J. et al. Imagenet: a large-scale hierarchical image database. In Proc. IEEE Conference on Computer Vision and Pattern Recognition, 248–255 (2009). LiðθiÞ ¼ Eðs;c;r;s0Þ�UðDÞ½ðr þ γ max <sup>0</sup> i <sup>Þ �</sup> <sup>Qðs; c; θiÞÞ2�</sup> (4) In our setting, we use an Adam optimizer <sup>55</sup> with learning rate 0.001. The replay buffer is of capacity 10,000 and batch size is set to 128. DATA AVAILABILITY The graphene nanopore desalination performance dataset generated during the current study are available in the Github repository [(https://github.com/BaratiLab/](https://github.com/BaratiLab/Graphene-RL/tree/main/data) [Graphene-RL/tree/main/data).](https://github.com/BaratiLab/Graphene-RL/tree/main/data) CODE AVAILABILITY The code accompanying this work can be found at [https://github.com/BaratiLab/](https://github.com/BaratiLab/Graphene-RL) [Graphene-RL.](https://github.com/BaratiLab/Graphene-RL) Received: 17 March 2021; Accepted: 22 June 2021; REFERENCES 1. Jiang, D.-E., Cooper, V. R. & Dai, S. Porous graphene as the ultimate membrane for gas separation. Nano Lett. 9, 4019–4024 (2009). 2. Li, H. et al. Ultrathin, molecular-sieving graphene oxide membranes for selective hydrogen separation. Science 342, 95–98 (2013). 3. Kim, H. W. et al. Selective gas transport through few-layered graphene and graphene oxide membranes. Science 342, 91–95 (2013). 4. Wang, Y. et al. Supercapacitor devices based on graphene materials. J. Phys. Chem. C 113, 13103–13107 (2009). 5. Liu, C., Yu, Z., Neff, D., Zhamu, A. & Jang, B. Z. Graphene-based supercapacitor with an ultrahigh energy density. Nano Lett. 10, 4863–4868 (2010). 6. Farimani, A. B., Min, K. & Aluru, N. R. DNA base detection using a single-layer mos2. ACS Nano 8, 7914–7922 (2014). 7. Barati Farimani, A., Dibaeinia, P. & Aluru, N. R. DNA origami–graphene hybrid nanopore for DNA detection. ACS Appl. Mater. Interfaces 9, 92–100 (2017). 8. Schneider, G. F. et al. DNA translocation through graphene nanopores. Nano Lett. 10, 3163–3167 (2010). 9. Cohen-Tanugi, D. & Grossman, J. C. Water desalination across nanoporous graphene. Nano Lett. 12, 3602–3608 (2012). 10. Surwade, S. P. et al. Water desalination using nanoporous single-layer graphene. Nat. Nanotechnol. 10, 459–464 (2015). 11. Heiranian, M., Farimani, A. B. & Aluru, N. R. Water desalination with a single-layer mos 2 nanopore. Nat. Commun. 6, 1–6 (2015). 12. Cao, Z., Liu, V. & Barati Farimani, A. Water desalination with two-dimensional metal–organic framework membranes. Nano Lett. 19, 8638–8643 (2019). 13. Cao, Z., Liu, V. & Barati Farimani, A. Why single-layer mos2 is a more energy efficient membrane for water desalination?. ACS Energy Lett. 5, 2217–2222 (2020). 14. Meidani, K., Cao, Z. & Barati Farimani, A. Titanium carbide mxene for water desalination: a molecular dynamics study. ACS Appl. Nano Mater. 4, 6145–6151 (2021). 15. LeCun, Y., Bengio, Y. & Hinton, G. Deep learning. Nature 521, 436–444 (2015). 16. Mnih, V. et al. Human-level control through deep reinforcement learning. Nature 518, 529–533 (2015). 17. Sutton, R. S., Barto, A. G. et al. Introduction to Reinforcement Learning Vol. 135 (MIT Press, Cambridge, 1998). 18. [Mnih, V. et al. Playing atari with deep reinforcement learning. Preprint at https://](https://arxiv.org/abs/1312.5602) [arxiv.org/abs/1312.5602](https://arxiv.org/abs/1312.5602) (2013). 19. Popova, M., Isayev, O. & Tropsha, A. Deep reinforcement learning for de novo drug design. Sci. Adv. 4, eaap7885 (2018). 20. Karamad, M. et al. Orbital graph convolutional neural network for material property prediction. Phys. Rev. Mater. 4, 093801 (2020). 21. Yao, Z. et al. Inverse design of nanoporous crystalline reticular materials with deep generative models. Nat. Mach. Intell. 3, 76–86 (2021). 9 55. Kingma, D. P. & Ba, J. Adam: A method for stochastic optimization. Preprint at [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980) (2014). ACKNOWLEDGEMENTS The authors thank the supercomputing resource Arjuna provided by the Pittsburgh Supercomputing Center (PSC). This work is supported by the start-up fund provided by CMU Mechanical Engineering. AUTHOR CONTRIBUTIONS A.B.F. conceived the project, Y.W. and Z.C. designed and coded the DRL architecture, Y.W. coded the CNN performance predictor, Z.C. performed the MD simulations, all authors wrote the manuscript. Y.W. and Z.C. contributed equally to this work and are considered co-first authors. COMPETING INTERESTS The authors declare no competing interests. ADDITIONAL INFORMATION Supplementary information The online version contains supplementary material available at [https://doi.org/10.1038/s41699-021-00246-9.](https://doi.org/10.1038/s41699-021-00246-9) Y. Wang et al. Correspondence and requests for materials should be addressed to A.B.F. Reprints and permission information is available at [http://www.nature.com/](http://www.nature.com/reprints) [reprints](http://www.nature.com/reprints) Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly [from the copyright holder. To view a copy of this license, visit http://creativecommons.](http://creativecommons.org/licenses/by/4.0/) [org/licenses/by/4.0/.](http://creativecommons.org/licenses/by/4.0/) © The Author(s) 2021

섹션 본문 148문단 · 79,999자

(제목 없음)

1Two-dimensional nanomaterials, such as graphene, have been extensively studied because of their outstanding physical properties. Structure and geometry optimization of nanopores on such materials is beneficial for their performances in real-world engineering applications, like water desalination. However, the optimization process often involves very large number of experiments or simulations which are expensive and timeconsuming. In this work, we propose a graphene nanopore optimization framework via the combination of deep reinforcement learning (DRL) and convolutional neural network (CNN) for efficient water desalination. The DRL agent controls the growth of nanopore by determining the atom to be removed at each timestep, while the CNN predicts the performance of nanoporus graphene for water desalination: the water flux and ion rejection at a certain external pressure. With the synchronous feedback from CNN-accelerated desalination performance prediction, our DRL agent can optimize the nanoporous graphene efficiently in an online manner. Molecular dynamics (MD) simulations on promising DRL-designed graphene nanopores show that they have higher water flux while maintaining rival ion rejection rate compared to the normal circular nanopores. Semi-oval shape with rough edges geometry of DRL-designed pores is found to be the key factor for their high water desalination performance. Ultimately, this study shows that DRL can be a powerful tool for material design.

Introduction

2Single-layer graphene, as an iconic two-dimensional (2D) material, has drawn much scientific attention in recent decades. Because of its ultrathin thickness and outstanding mechanical properties, graphene with artificial pores has been demonstrated to have great potentials in many engineering applications such as effective hydrogen gas separator, [1][2][3] next-generation energy storage or supercapacitor building, 4,5 and high-resolution DNA sequencing. [6][7][8] Given the potential imminent global water scarcity crisis, another important application for nanoporus graphene is energy-efficient water desalination. 9,10 Equipped with nanoporous 2D material membranes like graphene, reverse osmosis (RO) water desalination process can expect 2-3 orders improvement in water flux compared with traditional polymeric membranes. [9][10][11][12][13] In RO, the geometry of nanopores in 2D materials plays a determinant role in water desalination performance. 9,11 In general, a large pore that allows high water flux is likely to perform poorly in rejecting ions; a small pore that rejects 100% undesired ions, on the other hand, usually have limited water flux. Thus, an optimal nanopore for water desalination is expected to allow as high water flux as possible while maintaining a high ion rejection rate. However, finding the optimal nanopore geometry on graphene can be challenging due to high computational and experimental cost associated with extensive experiments, i.e., there are millions of possible shapes for a pore on a 4nm × 4nm graphene membrane, but evaluating the water flux and ion rejection of a single pore using 10ns MD simulation takes roughly 36 hours on a 56-core CPU cluster. Given this time benchmark, evaluating the water desalination performance of 1000 graphene nanopores can take more than 4 years. Therefore, to design the optimal nanopore geometry for water desalination, an efficient nanopore optimization method and a fast nanopore water desalination performance predictor (performance predictor in short) are needed. Inspired by the recent success of deep learning 14 and reinforcement learning, 15 we combined the state-of-art deep reinforcement learning (DRL) algorithm with convolutional neural network (CNN) to solve this challenge.

3The main idea of reinforcement learning (RL) 16 is to train an agent to find an optimal 2 policy which maximizes the expected return in the future through actively interacting with the environment to achieve a goal. Recently, DRL, 15,17 which models the RL agent with artificial neural networks, has proven to be an efficient tool in material-related engineering fields, such as material design [18][19][20] and molecule optimization. 21 In this work, we designed and implemented an artificial intelligence framework consisting of DRL, which is capable of designing the nanopore on a single-layer graphene membrane to reach optimal water desalination performance. By a series of decisions on whether or not to remove carbon atoms and which atom to be removed, the DRL agent can eventually create a pore that allows the highest water flux while maintaining ion rejection rate above an acceptable threshold.

4Such precisely controlled atom-by-atom removal nanopore synthesis can be conducted by electrochemical reaction (ECR). 22,23 During training, the DRL agent updates the neural network weights through back-propagation from the reward given by the water desalination performance. In our case, the evaluation of desalination performance is the water flux and ion rejection rate of the nanoporus graphene generated by the DRL agent at each timestep. However, conventional methods to calculate desalination performance, like MD simulation, are too time-consuming to be implemented in our DRL model. To evaluate DRL-designed nanopores fast and accurately, we implemented a CNN-based 24-27 model that uses the geometry of porous graphene membrane to directly predict the water flux and ion rejection rate under certain external pressure. To this end, a ResNet 27 model is trained on the dataset we collected through MD simulation of water desalination using various nanoporus graphenes. With the CNN-accelerated desalination performance prediction, the DRL model can rapidly optimize graphene nanopore for water desalination. MD simulations on promising DRL-designed nanoporus graphenes prove that they have higher water flux while maintaining similar ion rejection rate comparing to the circular nanopores. Further investigation of molecular trajectories illustrates why DRL-designed nanopores outperform the conventional nano-structures and provides insights for optimal nanopore design for water desalination.

53 Figure 1: Overview of CNN accelerated DRL nanopore design model. At each timestep, the nanoporous graphene structure is transformed into geometrical features, which is fed into a performance prediction network to predict water flux and ion rejection rate. The reward is then calculated based on the predicted water flux and ion rejection. Also, the geometrical features extracted from the performance predictor are concatenated with the fingerprint and atom coordinates for the current state. Given the current graphene structure, candidate atoms are picked from those locate at the edge of the nanopore. The DRL agent constructed upon Deep Q-network takes the reward, candidate atoms, and state as input to determine the next atom to remove from the graphene.

6The graphene nanopore optimization framework for water desalination consists of a DRL agent incorporated with a CNN-based water desalination performance predictor ( Fig. 1).

7At each timestep, the DRL agent generates a new nanopore by removing one atom from the graphene sheet, and the CNN model poredicts the water flux/ion rejection rate of the nanopore, such that the DRL agent can get instantaneous feedback on its action. Given the featurized information of the nanoporous graphene sheet (Morgan fingerprint, Cartesian coordinates of each atom, and geometrical features of graphene membrane from the CNN 4 model) and predicted water flux and ion rejection, the DRL agent was trained to create a pore on graphene sheet with the goal to maximize its performance in the water desalination process. The dataset used to train CNN performance predictor is generated by MD simulations of various nanoporus graphenes for water desalination.

Molecular Dynamic Simulation

8MD simulations were conducted using LAMMPS package, 28 where porous graphene membranes simulated were either created using Visual Molecular Dynamics 29 or automatically generated by deep reinforcement agent (samples from early stage of training). A regular simulation system consists of four different sections: a graphene piston that applied constant external pressure; a saline water section containing potassium chloride as solute; a singlelayer graphene membrane with the pore of different geometries; and a freshwater section which functioned as a reservoir of filtered water (Fig. 2a). The molarity of the saline water in this work is ∼2.28 M, which is higher than normal seawater for the sake of computational efficiency. The dimension of the simulation box is approximately 4 nm × 4 nm × 13 nm in x, y, and z direction, respectively. A periodic boundary condition was applied to all three dimensions.

9All water molecules in this work were simulated using SPC/E model, 30 with SHAKE 31 algorithm to constrain the bond length and angles. Lennard-Jones (LJ) potentials (Supplementary Information Table S1) along with long-range Coulombic electrostatics potentials were adopted as interatomic potentials in the MD simulation. The cutoff for the interatomic potentials was set to be 12 A. Lorentz-Berthelot rules were employed for the calculation of LJ potentials between different kinds of atoms. Particle-particle particle-Mesh (PPPM) Ewald sovler 32 with 0.005 root-mean-squared error was used for long-range Coulombic potential correction. The porous graphene membrane and piston were each regarded as an entity during the simulation (internal interatomic potentials were not calculated) in order to reduce the computational cost.

5

10In the first stage of each individual simulation, the internal energy of the system was minimized for 1000 iterations. The system then ran for 5 ps under the N P T (isothermal-isobaric) ensemble at 300 K after the velocities of molecules were initialized based on Gaussian distribution. After the equilibrating, the system under N P T ensemble, the system was switched to N V T (canonical) ensemble to run for another 10 ns. The temperature was maintained at 300 K by Nosé-Hoover thermostat 33,34 with a time constant of 0.5 ps. At this stage, a z-direction constant external pressure of 100 MPa was applied on saline water by the piston to mimic the reverse osmosis process in water desalination. Since the relationship between water flux and external pressure in reverse osmosis process was generally linear, 9,11-13 the performance of pores under 100 MPa could be extrapolated to lower pressures. Therefore, we chose to run simulations under 100 MPa external pressure to rapidly collect meaningful data. Molecular trajectories of each simulation were collected every 5 ps for data processing.

Dataset and Data Augmentation

11The two major performance indicators of a membrane in water desalination: water flux, and ion rejection rate, were calculated by post-processing the MD simulation trajectories.

12The slope of the fitted least square regression line on filtered water with respect to the simulation time curve was calculated to be the water flux of each membrane (Fig. 2b). The ion rejection rate of each membrane was calculated by dividing the number of ions in the freshwater section by the total number of ions.

13The total number of different simulated porous graphene is 185. Since the reward of DRL agent in our model was calculated based on the water flux/ion rejection prediction of performance predictor (Eq.1 and 2, Supplementary Information Fig.S2), highly accurate prediction must be achieved to ensure the quality of DRL training. A much larger training dataset was necessary for the optimization of CNN model. The method employed in our study to substantially increase the size of the dataset was data augmentation. 35,36 Given that the water desalination performance of a graphene pore depended on its size and geometry, we could assume that a flipped or translated pore on the same graphene membrane would demonstrate identical water flux/ion rejection rate of the original pore (Proven by MD simulations in Supplementary Information Fig.S3). Therefore, copies of original pores were created by being flipped along x or y axis and/or translating in -4 A to 4 A in x and y directions ( Fig. 2c). The water desalination performance of pore copies are random variable with normal distribution (µ = original pore performance, σ = 1% of original pore performance). In order to improve CNN's prediction accuracy on the performance of pores created by the DRL agent, we augmented DRL-generated pores 32 times. Among the other pores, the ones with zero water flux (too small to allow water transport) were augmented 6 times, and the rest of the pores were augmented 24 times. Data augmentation was conducted using the Atomic Simulation Environment (ASE) package. 37 The final dataset used for CNN training contains 3937 samples (Fig. 2d). A reverse sigmoid function was fitted to the distribution of samples to show the general relationship between the water flux and ion rejection rates.

Water Desalination Performance Predictor

14To facilitate the reward estimation of DRL, a CNN model was trained to make an instantaneous prediction of water flux and ion rejection rates of a specific nanoporous graphene membrane. CNN is widely known as a universal feature extractor. Given that the water desalination performance of a graphene nanopore depends on its geometrical features, CNN

15can be the most suitable model to recognize geometrical features and make predictions based on them. There were 2 steps in the CNN modeling, including extracting features from the geometry of graphene nanoporous membrane and making predictions through a fully-connected multi-layer perceptron (MLP) regression model (Fig.1)

DRL Nanopore Optimization Agent

16Our goal was to design the optimal geometry of graphene nanopore for energy-efficient water desalination, which simultaneously demanded high flux and high ion rejection under certain external pressure. In order to optimize the nanopore, an agent was expected to remove atoms sequentially until a desired pore geometry was developed. To this end, the agent was set to interact with nanoporous graphene in a sequence of actions a t , states s t , and rewards r t within an episode of length T . The goal of the agent was to select the action such that it could maximize the future discounted return R t = T t=1 γ t−1 r t in the finite Markov decision process (MDP) setting. In our case, we set the discount factor γ to be 1.

17At timestep t, given the nanoporous graphene G t , the agent observed the state s t , which was composed of Morgan fingerprint, 40 coordinates of all the atoms, along with CNNextracted graphene geometrical features. The graphene geometry g t was fed into the flux and ion rejection predictor, respectively. The geometrical features were the concatenation of last layer before output of the performance predictors. Once an atom was removed, its coordinate was set to the origin since MLP required a homogeneous input dimension. The predicted flux f t and ion rejection i t were leveraged to compute the reward signal r t for the agent, as given in Eq. 1 and Eq. 2:

18where σ(·) is the generalized logistic function 43 and α is the coefficient for flux term. In our setting, α was set to be 0.01, and A = −15, K = 0, B = 13, Q = 100, ν = 0.01, C = 1 for the logistic function. A linear term of flux reward encouraged the agent to expand nanopores, which would allow higher water flux. Since low ion rejection rate was not favored in water desalination, a generalized logistic function σ(·) was leveraged to penalize ion rejection term. When i t was high, σ(i t ) was close to zero, allowing the growth of the nanopores.

19However, when i t was low, σ(i t ) fiercely penalized the agent by outputting a large negative value( Supplementary Information Fig.S2). Besides, an extra 0.05 reward was given to the agent when it chose to remove an atom at timestep t to encourage pore growth at an early stage. Given state s t and reward r t , the agent intended to choose the action a t for next step. However, due to the high dimensionality of possible action space (all the atoms in the graphene fragment), it was computationally expensive for the agent to efficiently and thoroughly explore the possible actions and to learn an optimal design. Therefore, only a subset of M atoms was selected as candidates c t . Atoms on the edge of pore were picked based on the rank of their proximity to the pore center, if the number exceeds M , only the first M atoms closest to the center of pore were selected. However, when the number of edge atoms was less than M , non-edge atoms closest to the center of pore were selected as possible candidates to maintain the size of c t . Given the state s t , reward r t , and candidate c t , the agent learned to pick the action aiming to maximize future rewards.

20To train the agent, deep Q-learning 15 with experience replay was implemented. Our task only considered deterministic environment, namely given (s, c), the pair (s , c ) at the next time-step was unique. Based on Bellman equation, 16 the optimal action-value function Q * (s, c) in the deterministic environment was defined as:

21To model the Q function, the Q-network parameterized by θ and target network parameter-

22In our setting, we use Adam optimizer 42 with learning rate 0.001. The replay buffer is of capacity 10000 and batch size is set to 128.

Results

23The mean squared error (MSE) and coefficient of determination (R 2 ) are used as metrics to evaluate the performance predictions of models. The water flux and ion rejection labels are standardized before fed into the property prediction models. Thus the metrics tabulated are based on standardized water flux or ion rejection rate( We trained the DRL agent with 10 random seeds to generate various graphene nanopores.

24In the DRL agent training processes with different random seeds (Fig.3), the red curves indicate mean values and the blue shadows represent standard deviations. The accumulated reward for each episode increases during training the DRL agent (Fig. 3a). Initially the policy is noisy and the accumulated rewards are low, because the DRL agent has not yet learned to stop expanding the pore before receiving enormous penalty for low ion rejection rate.

25During the training, the DRL agent gradually learns a stable policy through maximizing the rewards (balancing the trade-off between water flux and ion rejection rate).The performance of DRL agent after 2000 episodes of training is demonstrated in Fig. 3(b)-(e). The DRL

26Step: 0

27Step:10

28Step: 20

29Step: 60

30Step: 70

31Step: 80

32Step: 30

33Step: 40

34Step: 50 (f) agent generates nanopore which brings positive reward at each timestep, and the agent also automatically learns to stop enlarging the nanopore to avoid low ion rejection rate ( Fig. 3b and 3c). For example, the evolution of a DRL generated pore (Fig. 3f, animated in Supplementary Movie) shows that DRL stops removing atom from the edge of graphene nanopore after 50th timestep, because it determines that higher water flux reward brought by further removing atoms is not worth the penalty for low ion rejection rate. Based on the prediction of the performance predictor, the DRL generated nanoporus graphenes have averaged ∼40 #/ns water flux and ∼96% ion rejection rate ( Fig. 3d and 3e). Fig. 4a and 4b). T-SNE is a dimensionality reduction tool that is capable of mapping highdimensional data to lower-dimension form while preserving the similarities between data points. In another words, membranes that are more similar to each other will have a higher tendency of being clustered. In this work, using CNN extracted features from each graphene membrane, T-SNE successfully clustered samples with similar water flux or ion rejection.

35This result indicates that features extracted from CNN models have a strong correlation with the water flux and ion rejection rate.

36The water desalination performances of all nanopores (DRL generated and training dataset) are compared in Fig. 5a. It is worth noting that the process of generating 7999 nanopores using DRL and predicting their water flux/ion rejection rate takes less than a single week; however, evaluating the performance of the same amount of nanopores using MD simulation will take ∼33 years (average 36 hours on each sample, using one 56-core CPU node). Among the nanopores with the same level of ion rejection rate, some nanopores discovered by DRL allow much higher water flux. One common feature shared by those high-performance nanopores is the semi-oval geometry with rough edges. We set 90% ion rejection rate as the threshold to determine if a nanopore can effectively reject ions. The water flux histogram (Fig. 5b) shows that given the baseline ion rejection rate as 90%, DRL can extrapolate from the training dataset and discover graphene nanopores that generally allow higher water flux.

37Further MD simulations are conducted with DRL generated membranes that show high predicted performances to evaluate how the DRL helps in optimizing graphene nanopore for water desalination (Simulation process recorded in Supplementary Movie). Although DRL generated pores generally have lower water flux compared with circular pores with the same area, they have much higher ion rejection rate (Fig. 5c, 90% threshold of ion rejection rate is marked by a red dashed line). For example, when the pore area is 113 A 2 , DRL generated nanopore maintained over 90% ion rejection rate while the circular pore rejects only approximately 65% of ions. A pore with high water flux but a very low ion rejection rate is not desirable in water desalination application. Moreover, the comparison between 113 A 2 DRL generated nanopore with 88 A 2 circular pore shows that DRL generated pore can reject more ions when achieving same water flux: they both have approximately 125 #/ns water flux while 113 A 2 DRL generated pore can reject approximately 7% more ions. The (e) Schematic showing how ions are blocked by DRL generated pore due to the steric effect. Ions with their hydration shell (Blue dashed circle) are too large to pass through the corner area (Red dashed circle) in the DRL generated pore, thus rendering that area an ion-free zone 16

38comparison between simulation results proves that DRL tends to prioritize the ion rejection rate over water flux, which makes it capable of maximizing the water flux of nanopores while maintaining a valid ion rejection rate.

39To gain deeper understanding about the reason behind the high ion rejection rate of DRL generated pores, distribution of water molecules and ions inside of 113 A 2 DRL generated pore and 88 A 2 circular pore have been visualized (Fig. 5d). From the ion distribution (marked by red dots), we can observe that ions can traverse the circular pore evenly through the entire central area of the pore. The distributions of water molecules (marked by aqua blue color) and ions in the circular pore are in a homogeneous pattern. However, the corners inside of DRL generated nanopore are small enough to block the passage of ions while being large enough to accommodate the transport of water molecules. With the knowledge that ions are covered by hydration shell during the transport through nanopore, it can be seen that ionfree zones (corners) inside of DRL generated nanopore obstruct the traversing of ions with hydration shell by steric effect (Fig. 5e). This is the reason why high-performance nanopores (zoom-in Fig. 5a, more high-performance DRL-generated pores shown in Supplementary Information Fig.S5) all have rough edges. Discovers and utilizes this special geometry, DRL designs nanopores that can reject most ions while allowing high water transport.

Conclusion

40In this work, we propose a graphene nanopore optimization framework based on the DRL agent accelerated by the water desalination performance predictor. In particular, we focus on the optimal design of nanoporous graphene for water desalination. With a well-trained machine learning property predictor, the DRL can automatically learn to design the optimal material structure effectively and efficiently.

Lennard-Jones potentials for MD simulations

41The 12-6 Lennard-Jones (LJ) potentials used in MD simulations for generating dataset are tabulated as below. Force field between different types of atoms are calculated using Lorentz-Berthelot rule.

Details of XGBoost Regression Model

42For XGBoost, 39 100 iterations of random search with 5-fold cross validation was applied on the hyperparameter grid tabulated as below. The hyperparameters of best XGBoost models for both water flux and ion rejection rate prediction are also recorded.

Details of DRL agent

43Deep Q network 15,17 is utilized to model the DRL agent, which takes as input the graphene state representation and candidate atoms (Fig. S1) 16 Namely, with probability , the agent will randomly pick an action from the candidates. In our setting, is initially set to 0.9 and decayed to 0.05 linearly after 1000 episodes.

44Also, the generalized logistic function 43 utilized in the reward function for penalizing ion rejection is illustrated in Fig. S2. When the ion rejection is greater than 95%, the function returns a near-zero value. Therefore, given that DRL agent receives positive reward for removing atoms and generating water flux, it tends to aggressively remove atoms at the beginning of each episode. While the ion rejection drops below 90%, the function gives a harsh penalty to the agent. Such reward function strongly discourage the agent from creating a nanoporus graphene with low ion rejection rate, which is inefficient in real-world water desalination. Figure S1: Overview of deep Q network architecture. The numbers below each box illustrates the dimensions. Each data point is calculated by averaging water flux and ion rejection rate of 4 simulations.

45Error bar represent the value of one standard deviation. The water flux difference between the original pore and augmented pore is 3.17 #/ns (approximately 2%) and the ion rejection rate difference is 0.6%. All differences are within the error bar of the result of 4 simulations.

46From this result, we can conclude that the augmentation method implemented in this work is valid. Figure S3: Comparison between the water desalination performance of original humandesigned graphene nanopore (left, blue membrane) and its augmented copy version (right, black membrane). The performance difference between them is minimum and within the error bar.

Pore area calculation

47The area of graphene nanopores mentioned in this work is calculated using computer vision method (OpenCV package 50 ). For each nanoporous graphene membrane, all of its atoms which locate in the area of 0 A ≤ x ≤ 40 A and 0 A ≤ y ≤ 40 A are plotted with radius as σ (3.39 A used in this paper) of carbon (Fig. S4a). The graphene membrane image dimension in pixel is 360 × 360. The OpenCV package is then used to detect the pore from the image (Fig. S4b), and the area of the pore in terms of pixel is calculated. Further, The area of pore in terms of A 2 can be calculated using the ratio: 1 pixel = (40/360) 2 A 2 .

48(a) (b) Figure S4: (a) Plot nanoporous graphene membrane (b) Detecting pore area and calculate its size using computer vision method

49Compilation of DRL generated pores with high predicted performance

50The compilation of 64 DRL generated pores with predicted water flux > 120 #/ns and ion rejection rate > 90% are demonstrated in (Fig. S5). One common trait of those grpahene nanopores is that they tend to have narrow cavities. Those narrow cavities in pore allow the passage of water molecules but are small enough to restrict the transport of ions along with their hydration shell. DRL gradually learned the importance of narrow cavity and applied it during the optimization of graphene nanopores. Figure S5: DRL generated pores with predicted water flux > 120 #/ns and ion rejection rate > 90%. 30

Introduction

51Single-layer graphene, as an iconic two-dimensional (2D) material, has drawn much scientific attention in recent decades. Because of its ultrathin thickness and outstanding mechanical properties, graphene with artificial pores has been demonstrated to have great potentials in many engineering applications such as effective hydrogen gas separator, [1][2][3] next-generation energy storage or supercapacitor building, 4,5 and high-resolution DNA sequencing. [6][7][8] Given the potential imminent global water scarcity crisis, another important application for nanoporus graphene is energy-efficient water desalination. 9,10 Equipped with nanoporous 2D material membranes like graphene, reverse osmosis (RO) water desalination process can expect 2-3 orders improvement in water flux compared with traditional polymeric membranes. [9][10][11][12][13] In RO, the geometry of nanopores in 2D materials plays a determinant role in water desalination performance. 9,11 In general, a large pore that allows high water flux is likely to perform poorly in rejecting ions; a small pore that rejects 100% undesired ions, on the other hand, usually have limited water flux. Thus, an optimal nanopore for water desalination is expected to allow as high water flux as possible while maintaining a high ion rejection rate. However, finding the optimal nanopore geometry on graphene can be challenging due to high computational and experimental cost associated with extensive experiments, i.e., there are millions of possible shapes for a pore on a 4nm × 4nm graphene membrane, but evaluating the water flux and ion rejection of a single pore using 10ns MD simulation takes roughly 36 hours on a 56-core CPU cluster. Given this time benchmark, evaluating the water desalination performance of 1000 graphene nanopores can take more than 4 years. Therefore, to design the optimal nanopore geometry for water desalination, an efficient nanopore optimization method and a fast nanopore water desalination performance predictor (performance predictor in short) are needed. Inspired by the recent success of deep learning 14 and reinforcement learning, 15 we combined the state-of-art deep reinforcement learning (DRL) algorithm with convolutional neural network (CNN) to solve this challenge.

52The main idea of reinforcement learning (RL) 16 is to train an agent to find an optimal 2 policy which maximizes the expected return in the future through actively interacting with the environment to achieve a goal. Recently, DRL, 15,17 which models the RL agent with artificial neural networks, has proven to be an efficient tool in material-related engineering fields, such as material design [18][19][20] and molecule optimization. 21 In this work, we designed and implemented an artificial intelligence framework consisting of DRL, which is capable of designing the nanopore on a single-layer graphene membrane to reach optimal water desalination performance. By a series of decisions on whether or not to remove carbon atoms and which atom to be removed, the DRL agent can eventually create a pore that allows the highest water flux while maintaining ion rejection rate above an acceptable threshold.

53Such precisely controlled atom-by-atom removal nanopore synthesis can be conducted by electrochemical reaction (ECR). 22,23 During training, the DRL agent updates the neural network weights through back-propagation from the reward given by the water desalination performance. In our case, the evaluation of desalination performance is the water flux and ion rejection rate of the nanoporus graphene generated by the DRL agent at each timestep. However, conventional methods to calculate desalination performance, like MD simulation, are too time-consuming to be implemented in our DRL model. To evaluate DRL-designed nanopores fast and accurately, we implemented a CNN-based 24-27 model that uses the geometry of porous graphene membrane to directly predict the water flux and ion rejection rate under certain external pressure. To this end, a ResNet 27 model is trained on the dataset we collected through MD simulation of water desalination using various nanoporus graphenes. With the CNN-accelerated desalination performance prediction, the DRL model can rapidly optimize graphene nanopore for water desalination. MD simulations on promising DRL-designed nanoporus graphenes prove that they have higher water flux while maintaining similar ion rejection rate comparing to the circular nanopores. Further investigation of molecular trajectories illustrates why DRL-designed nanopores outperform the conventional nano-structures and provides insights for optimal nanopore design for water desalination.

543 Figure 1: Overview of CNN accelerated DRL nanopore design model. At each timestep, the nanoporous graphene structure is transformed into geometrical features, which is fed into a performance prediction network to predict water flux and ion rejection rate. The reward is then calculated based on the predicted water flux and ion rejection. Also, the geometrical features extracted from the performance predictor are concatenated with the fingerprint and atom coordinates for the current state. Given the current graphene structure, candidate atoms are picked from those locate at the edge of the nanopore. The DRL agent constructed upon Deep Q-network takes the reward, candidate atoms, and state as input to determine the next atom to remove from the graphene.

55The graphene nanopore optimization framework for water desalination consists of a DRL agent incorporated with a CNN-based water desalination performance predictor ( Fig. 1).

56At each timestep, the DRL agent generates a new nanopore by removing one atom from the graphene sheet, and the CNN model poredicts the water flux/ion rejection rate of the nanopore, such that the DRL agent can get instantaneous feedback on its action. Given the featurized information of the nanoporous graphene sheet (Morgan fingerprint, Cartesian coordinates of each atom, and geometrical features of graphene membrane from the CNN 4 model) and predicted water flux and ion rejection, the DRL agent was trained to create a pore on graphene sheet with the goal to maximize its performance in the water desalination process. The dataset used to train CNN performance predictor is generated by MD simulations of various nanoporus graphenes for water desalination.

Molecular Dynamic Simulation

57MD simulations were conducted using LAMMPS package, 28 where porous graphene membranes simulated were either created using Visual Molecular Dynamics 29 or automatically generated by deep reinforcement agent (samples from early stage of training). A regular simulation system consists of four different sections: a graphene piston that applied constant external pressure; a saline water section containing potassium chloride as solute; a singlelayer graphene membrane with the pore of different geometries; and a freshwater section which functioned as a reservoir of filtered water (Fig. 2a). The molarity of the saline water in this work is ∼2.28 M, which is higher than normal seawater for the sake of computational efficiency. The dimension of the simulation box is approximately 4 nm × 4 nm × 13 nm in x, y, and z direction, respectively. A periodic boundary condition was applied to all three dimensions.

58All water molecules in this work were simulated using SPC/E model, 30 with SHAKE 31 algorithm to constrain the bond length and angles. Lennard-Jones (LJ) potentials (Supplementary Information Table S1) along with long-range Coulombic electrostatics potentials were adopted as interatomic potentials in the MD simulation. The cutoff for the interatomic potentials was set to be 12 A. Lorentz-Berthelot rules were employed for the calculation of LJ potentials between different kinds of atoms. Particle-particle particle-Mesh (PPPM) Ewald sovler 32 with 0.005 root-mean-squared error was used for long-range Coulombic potential correction. The porous graphene membrane and piston were each regarded as an entity during the simulation (internal interatomic potentials were not calculated) in order to reduce the computational cost.

5

59In the first stage of each individual simulation, the internal energy of the system was minimized for 1000 iterations. The system then ran for 5 ps under the N P T (isothermal-isobaric) ensemble at 300 K after the velocities of molecules were initialized based on Gaussian distribution. After the equilibrating, the system under N P T ensemble, the system was switched to N V T (canonical) ensemble to run for another 10 ns. The temperature was maintained at 300 K by Nosé-Hoover thermostat 33,34 with a time constant of 0.5 ps. At this stage, a z-direction constant external pressure of 100 MPa was applied on saline water by the piston to mimic the reverse osmosis process in water desalination. Since the relationship between water flux and external pressure in reverse osmosis process was generally linear, 9,11-13 the performance of pores under 100 MPa could be extrapolated to lower pressures. Therefore, we chose to run simulations under 100 MPa external pressure to rapidly collect meaningful data. Molecular trajectories of each simulation were collected every 5 ps for data processing.

Dataset and Data Augmentation

60The two major performance indicators of a membrane in water desalination: water flux, and ion rejection rate, were calculated by post-processing the MD simulation trajectories.

61The slope of the fitted least square regression line on filtered water with respect to the simulation time curve was calculated to be the water flux of each membrane (Fig. 2b). The ion rejection rate of each membrane was calculated by dividing the number of ions in the freshwater section by the total number of ions.

62The total number of different simulated porous graphene is 185. Since the reward of DRL agent in our model was calculated based on the water flux/ion rejection prediction of performance predictor (Eq.1 and 2, Supplementary Information Fig.S2), highly accurate prediction must be achieved to ensure the quality of DRL training. A much larger training dataset was necessary for the optimization of CNN model. The method employed in our study to substantially increase the size of the dataset was data augmentation. 35,36 Given that the water desalination performance of a graphene pore depended on its size and geometry, we could assume that a flipped or translated pore on the same graphene membrane would demonstrate identical water flux/ion rejection rate of the original pore (Proven by MD simulations in Supplementary Information Fig.S3). Therefore, copies of original pores were created by being flipped along x or y axis and/or translating in -4 A to 4 A in x and y directions ( Fig. 2c). The water desalination performance of pore copies are random variable with normal distribution (µ = original pore performance, σ = 1% of original pore performance). In order to improve CNN's prediction accuracy on the performance of pores created by the DRL agent, we augmented DRL-generated pores 32 times. Among the other pores, the ones with zero water flux (too small to allow water transport) were augmented 6 times, and the rest of the pores were augmented 24 times. Data augmentation was conducted using the Atomic Simulation Environment (ASE) package. 37 The final dataset used for CNN training contains 3937 samples (Fig. 2d). A reverse sigmoid function was fitted to the distribution of samples to show the general relationship between the water flux and ion rejection rates.

Water Desalination Performance Predictor

63To facilitate the reward estimation of DRL, a CNN model was trained to make an instantaneous prediction of water flux and ion rejection rates of a specific nanoporous graphene membrane. CNN is widely known as a universal feature extractor. Given that the water desalination performance of a graphene nanopore depends on its geometrical features, CNN

64can be the most suitable model to recognize geometrical features and make predictions based on them. There were 2 steps in the CNN modeling, including extracting features from the geometry of graphene nanoporous membrane and making predictions through a fully-connected multi-layer perceptron (MLP) regression model (Fig.1)

DRL Nanopore Optimization Agent

65Our goal was to design the optimal geometry of graphene nanopore for energy-efficient water desalination, which simultaneously demanded high flux and high ion rejection under certain external pressure. In order to optimize the nanopore, an agent was expected to remove atoms sequentially until a desired pore geometry was developed. To this end, the agent was set to interact with nanoporous graphene in a sequence of actions a t , states s t , and rewards r t within an episode of length T . The goal of the agent was to select the action such that it could maximize the future discounted return R t = T t=1 γ t−1 r t in the finite Markov decision process (MDP) setting. In our case, we set the discount factor γ to be 1.

66At timestep t, given the nanoporous graphene G t , the agent observed the state s t , which was composed of Morgan fingerprint, 40 coordinates of all the atoms, along with CNNextracted graphene geometrical features. The graphene geometry g t was fed into the flux and ion rejection predictor, respectively. The geometrical features were the concatenation of last layer before output of the performance predictors. Once an atom was removed, its coordinate was set to the origin since MLP required a homogeneous input dimension. The predicted flux f t and ion rejection i t were leveraged to compute the reward signal r t for the agent, as given in Eq. 1 and Eq. 2:

67where σ(·) is the generalized logistic function 43 and α is the coefficient for flux term. In our setting, α was set to be 0.01, and A = −15, K = 0, B = 13, Q = 100, ν = 0.01, C = 1 for the logistic function. A linear term of flux reward encouraged the agent to expand nanopores, which would allow higher water flux. Since low ion rejection rate was not favored in water desalination, a generalized logistic function σ(·) was leveraged to penalize ion rejection term. When i t was high, σ(i t ) was close to zero, allowing the growth of the nanopores.

68However, when i t was low, σ(i t ) fiercely penalized the agent by outputting a large negative value( Supplementary Information Fig.S2). Besides, an extra 0.05 reward was given to the agent when it chose to remove an atom at timestep t to encourage pore growth at an early stage. Given state s t and reward r t , the agent intended to choose the action a t for next step. However, due to the high dimensionality of possible action space (all the atoms in the graphene fragment), it was computationally expensive for the agent to efficiently and thoroughly explore the possible actions and to learn an optimal design. Therefore, only a subset of M atoms was selected as candidates c t . Atoms on the edge of pore were picked based on the rank of their proximity to the pore center, if the number exceeds M , only the first M atoms closest to the center of pore were selected. However, when the number of edge atoms was less than M , non-edge atoms closest to the center of pore were selected as possible candidates to maintain the size of c t . Given the state s t , reward r t , and candidate c t , the agent learned to pick the action aiming to maximize future rewards.

69To train the agent, deep Q-learning 15 with experience replay was implemented. Our task only considered deterministic environment, namely given (s, c), the pair (s , c ) at the next time-step was unique. Based on Bellman equation, 16 the optimal action-value function Q * (s, c) in the deterministic environment was defined as:

70To model the Q function, the Q-network parameterized by θ and target network parameter-

71In our setting, we use Adam optimizer 42 with learning rate 0.001. The replay buffer is of capacity 10000 and batch size is set to 128.

Results

72The mean squared error (MSE) and coefficient of determination (R 2 ) are used as metrics to evaluate the performance predictions of models. The water flux and ion rejection labels are standardized before fed into the property prediction models. Thus the metrics tabulated are based on standardized water flux or ion rejection rate( We trained the DRL agent with 10 random seeds to generate various graphene nanopores.

73In the DRL agent training processes with different random seeds (Fig.3), the red curves indicate mean values and the blue shadows represent standard deviations. The accumulated reward for each episode increases during training the DRL agent (Fig. 3a). Initially the policy is noisy and the accumulated rewards are low, because the DRL agent has not yet learned to stop expanding the pore before receiving enormous penalty for low ion rejection rate.

74During the training, the DRL agent gradually learns a stable policy through maximizing the rewards (balancing the trade-off between water flux and ion rejection rate).The performance of DRL agent after 2000 episodes of training is demonstrated in Fig. 3(b)-(e). The DRL

75Step: 0

76Step:10

77Step: 20

78Step: 60

79Step: 70

80Step: 80

81Step: 30

82Step: 40

83Step: 50 (f) agent generates nanopore which brings positive reward at each timestep, and the agent also automatically learns to stop enlarging the nanopore to avoid low ion rejection rate ( Fig. 3b and 3c). For example, the evolution of a DRL generated pore (Fig. 3f, animated in Supplementary Movie) shows that DRL stops removing atom from the edge of graphene nanopore after 50th timestep, because it determines that higher water flux reward brought by further removing atoms is not worth the penalty for low ion rejection rate. Based on the prediction of the performance predictor, the DRL generated nanoporus graphenes have averaged ∼40 #/ns water flux and ∼96% ion rejection rate ( Fig. 3d and 3e). Fig. 4a and 4b). T-SNE is a dimensionality reduction tool that is capable of mapping highdimensional data to lower-dimension form while preserving the similarities between data points. In another words, membranes that are more similar to each other will have a higher tendency of being clustered. In this work, using CNN extracted features from each graphene membrane, T-SNE successfully clustered samples with similar water flux or ion rejection.

84This result indicates that features extracted from CNN models have a strong correlation with the water flux and ion rejection rate.

85The water desalination performances of all nanopores (DRL generated and training dataset) are compared in Fig. 5a. It is worth noting that the process of generating 7999 nanopores using DRL and predicting their water flux/ion rejection rate takes less than a single week; however, evaluating the performance of the same amount of nanopores using MD simulation will take ∼33 years (average 36 hours on each sample, using one 56-core CPU node). Among the nanopores with the same level of ion rejection rate, some nanopores discovered by DRL allow much higher water flux. One common feature shared by those high-performance nanopores is the semi-oval geometry with rough edges. We set 90% ion rejection rate as the threshold to determine if a nanopore can effectively reject ions. The water flux histogram (Fig. 5b) shows that given the baseline ion rejection rate as 90%, DRL can extrapolate from the training dataset and discover graphene nanopores that generally allow higher water flux.

86Further MD simulations are conducted with DRL generated membranes that show high predicted performances to evaluate how the DRL helps in optimizing graphene nanopore for water desalination (Simulation process recorded in Supplementary Movie). Although DRL generated pores generally have lower water flux compared with circular pores with the same area, they have much higher ion rejection rate (Fig. 5c, 90% threshold of ion rejection rate is marked by a red dashed line). For example, when the pore area is 113 A 2 , DRL generated nanopore maintained over 90% ion rejection rate while the circular pore rejects only approximately 65% of ions. A pore with high water flux but a very low ion rejection rate is not desirable in water desalination application. Moreover, the comparison between 113 A 2 DRL generated nanopore with 88 A 2 circular pore shows that DRL generated pore can reject more ions when achieving same water flux: they both have approximately 125 #/ns water flux while 113 A 2 DRL generated pore can reject approximately 7% more ions. The (e) Schematic showing how ions are blocked by DRL generated pore due to the steric effect. Ions with their hydration shell (Blue dashed circle) are too large to pass through the corner area (Red dashed circle) in the DRL generated pore, thus rendering that area an ion-free zone 16

87comparison between simulation results proves that DRL tends to prioritize the ion rejection rate over water flux, which makes it capable of maximizing the water flux of nanopores while maintaining a valid ion rejection rate.

88To gain deeper understanding about the reason behind the high ion rejection rate of DRL generated pores, distribution of water molecules and ions inside of 113 A 2 DRL generated pore and 88 A 2 circular pore have been visualized (Fig. 5d). From the ion distribution (marked by red dots), we can observe that ions can traverse the circular pore evenly through the entire central area of the pore. The distributions of water molecules (marked by aqua blue color) and ions in the circular pore are in a homogeneous pattern. However, the corners inside of DRL generated nanopore are small enough to block the passage of ions while being large enough to accommodate the transport of water molecules. With the knowledge that ions are covered by hydration shell during the transport through nanopore, it can be seen that ionfree zones (corners) inside of DRL generated nanopore obstruct the traversing of ions with hydration shell by steric effect (Fig. 5e). This is the reason why high-performance nanopores (zoom-in Fig. 5a, more high-performance DRL-generated pores shown in Supplementary Information Fig.S5) all have rough edges. Discovers and utilizes this special geometry, DRL designs nanopores that can reject most ions while allowing high water transport.

Conclusion

89In this work, we propose a graphene nanopore optimization framework based on the DRL agent accelerated by the water desalination performance predictor. In particular, we focus on the optimal design of nanoporous graphene for water desalination. With a well-trained machine learning property predictor, the DRL can automatically learn to design the optimal material structure effectively and efficiently.

Lennard-Jones potentials for MD simulations

90The 12-6 Lennard-Jones (LJ) potentials used in MD simulations for generating dataset are tabulated as below. Force field between different types of atoms are calculated using Lorentz-Berthelot rule.

Details of XGBoost Regression Model

91For XGBoost, 39 100 iterations of random search with 5-fold cross validation was applied on the hyperparameter grid tabulated as below. The hyperparameters of best XGBoost models for both water flux and ion rejection rate prediction are also recorded.

Details of DRL agent

92Deep Q network 15,17 is utilized to model the DRL agent, which takes as input the graphene state representation and candidate atoms (Fig. S1) 16 Namely, with probability , the agent will randomly pick an action from the candidates. In our setting, is initially set to 0.9 and decayed to 0.05 linearly after 1000 episodes.

93Also, the generalized logistic function 43 utilized in the reward function for penalizing ion rejection is illustrated in Fig. S2. When the ion rejection is greater than 95%, the function returns a near-zero value. Therefore, given that DRL agent receives positive reward for removing atoms and generating water flux, it tends to aggressively remove atoms at the beginning of each episode. While the ion rejection drops below 90%, the function gives a harsh penalty to the agent. Such reward function strongly discourage the agent from creating a nanoporus graphene with low ion rejection rate, which is inefficient in real-world water desalination. Figure S1: Overview of deep Q network architecture. The numbers below each box illustrates the dimensions. Each data point is calculated by averaging water flux and ion rejection rate of 4 simulations.

94Error bar represent the value of one standard deviation. The water flux difference between the original pore and augmented pore is 3.17 #/ns (approximately 2%) and the ion rejection rate difference is 0.6%. All differences are within the error bar of the result of 4 simulations.

95From this result, we can conclude that the augmentation method implemented in this work is valid. Figure S3: Comparison between the water desalination performance of original humandesigned graphene nanopore (left, blue membrane) and its augmented copy version (right, black membrane). The performance difference between them is minimum and within the error bar.

Pore area calculation

96The area of graphene nanopores mentioned in this work is calculated using computer vision method (OpenCV package 50 ). For each nanoporous graphene membrane, all of its atoms which locate in the area of 0 A ≤ x ≤ 40 A and 0 A ≤ y ≤ 40 A are plotted with radius as σ (3.39 A used in this paper) of carbon (Fig. S4a). The graphene membrane image dimension in pixel is 360 × 360. The OpenCV package is then used to detect the pore from the image (Fig. S4b), and the area of the pore in terms of pixel is calculated. Further, The area of pore in terms of A 2 can be calculated using the ratio: 1 pixel = (40/360) 2 A 2 .

97(a) (b) Figure S4: (a) Plot nanoporous graphene membrane (b) Detecting pore area and calculate its size using computer vision method

98Compilation of DRL generated pores with high predicted performance

99The compilation of 64 DRL generated pores with predicted water flux > 120 #/ns and ion rejection rate > 90% are demonstrated in (Fig. S5). One common trait of those grpahene nanopores is that they tend to have narrow cavities. Those narrow cavities in pore allow the passage of water molecules but are small enough to restrict the transport of ions along with their hydration shell. DRL gradually learned the importance of narrow cavity and applied it during the optimization of graphene nanopores. Figure S5: DRL generated pores with predicted water flux > 120 #/ns and ion rejection rate > 90%. 30

Introduction

100Single-layer graphene, as an iconic two-dimensional (2D) material, has drawn much scientific attention in recent decades. Because of its ultrathin thickness and outstanding mechanical properties, graphene with artificial pores has been demonstrated to have great potentials in many engineering applications such as effective hydrogen gas separator, [1][2][3] next-generation energy storage or supercapacitor building, 4,5 and high-resolution DNA sequencing. [6][7][8] Given the potential imminent global water scarcity crisis, another important application for nanoporus graphene is energy-efficient water desalination. 9,10 Equipped with nanoporous 2D material membranes like graphene, reverse osmosis (RO) water desalination process can expect 2-3 orders improvement in water flux compared with traditional polymeric membranes. [9][10][11][12][13] In RO, the geometry of nanopores in 2D materials plays a determinant role in water desalination performance. 9,11 In general, a large pore that allows high water flux is likely to perform poorly in rejecting ions; a small pore that rejects 100% undesired ions, on the other hand, usually have limited water flux. Thus, an optimal nanopore for water desalination is expected to allow as high water flux as possible while maintaining a high ion rejection rate. However, finding the optimal nanopore geometry on graphene can be challenging due to high computational and experimental cost associated with extensive experiments, i.e., there are millions of possible shapes for a pore on a 4nm × 4nm graphene membrane, but evaluating the water flux and ion rejection of a single pore using 10ns MD simulation takes roughly 36 hours on a 56-core CPU cluster. Given this time benchmark, evaluating the water desalination performance of 1000 graphene nanopores can take more than 4 years. Therefore, to design the optimal nanopore geometry for water desalination, an efficient nanopore optimization method and a fast nanopore water desalination performance predictor (performance predictor in short) are needed. Inspired by the recent success of deep learning 14 and reinforcement learning, 15 we combined the state-of-art deep reinforcement learning (DRL) algorithm with convolutional neural network (CNN) to solve this challenge.

101The main idea of reinforcement learning (RL) 16 is to train an agent to find an optimal 2 policy which maximizes the expected return in the future through actively interacting with the environment to achieve a goal. Recently, DRL, 15,17 which models the RL agent with artificial neural networks, has proven to be an efficient tool in material-related engineering fields, such as material design [18][19][20] and molecule optimization. 21 In this work, we designed and implemented an artificial intelligence framework consisting of DRL, which is capable of designing the nanopore on a single-layer graphene membrane to reach optimal water desalination performance. By a series of decisions on whether or not to remove carbon atoms and which atom to be removed, the DRL agent can eventually create a pore that allows the highest water flux while maintaining ion rejection rate above an acceptable threshold.

102Such precisely controlled atom-by-atom removal nanopore synthesis can be conducted by electrochemical reaction (ECR). 22,23 During training, the DRL agent updates the neural network weights through back-propagation from the reward given by the water desalination performance. In our case, the evaluation of desalination performance is the water flux and ion rejection rate of the nanoporus graphene generated by the DRL agent at each timestep. However, conventional methods to calculate desalination performance, like MD simulation, are too time-consuming to be implemented in our DRL model. To evaluate DRL-designed nanopores fast and accurately, we implemented a CNN-based 24-27 model that uses the geometry of porous graphene membrane to directly predict the water flux and ion rejection rate under certain external pressure. To this end, a ResNet 27 model is trained on the dataset we collected through MD simulation of water desalination using various nanoporus graphenes. With the CNN-accelerated desalination performance prediction, the DRL model can rapidly optimize graphene nanopore for water desalination. MD simulations on promising DRL-designed nanoporus graphenes prove that they have higher water flux while maintaining similar ion rejection rate comparing to the circular nanopores. Further investigation of molecular trajectories illustrates why DRL-designed nanopores outperform the conventional nano-structures and provides insights for optimal nanopore design for water desalination.

1033 Figure 1: Overview of CNN accelerated DRL nanopore design model. At each timestep, the nanoporous graphene structure is transformed into geometrical features, which is fed into a performance prediction network to predict water flux and ion rejection rate. The reward is then calculated based on the predicted water flux and ion rejection. Also, the geometrical features extracted from the performance predictor are concatenated with the fingerprint and atom coordinates for the current state. Given the current graphene structure, candidate atoms are picked from those locate at the edge of the nanopore. The DRL agent constructed upon Deep Q-network takes the reward, candidate atoms, and state as input to determine the next atom to remove from the graphene.

104The graphene nanopore optimization framework for water desalination consists of a DRL agent incorporated with a CNN-based water desalination performance predictor ( Fig. 1).

105At each timestep, the DRL agent generates a new nanopore by removing one atom from the graphene sheet, and the CNN model poredicts the water flux/ion rejection rate of the nanopore, such that the DRL agent can get instantaneous feedback on its action. Given the featurized information of the nanoporous graphene sheet (Morgan fingerprint, Cartesian coordinates of each atom, and geometrical features of graphene membrane from the CNN 4 model) and predicted water flux and ion rejection, the DRL agent was trained to create a pore on graphene sheet with the goal to maximize its performance in the water desalination process. The dataset used to train CNN performance predictor is generated by MD simulations of various nanoporus graphenes for water desalination.

Molecular Dynamic Simulation

106MD simulations were conducted using LAMMPS package, 28 where porous graphene membranes simulated were either created using Visual Molecular Dynamics 29 or automatically generated by deep reinforcement agent (samples from early stage of training). A regular simulation system consists of four different sections: a graphene piston that applied constant external pressure; a saline water section containing potassium chloride as solute; a singlelayer graphene membrane with the pore of different geometries; and a freshwater section which functioned as a reservoir of filtered water (Fig. 2a). The molarity of the saline water in this work is ∼2.28 M, which is higher than normal seawater for the sake of computational efficiency. The dimension of the simulation box is approximately 4 nm × 4 nm × 13 nm in x, y, and z direction, respectively. A periodic boundary condition was applied to all three dimensions.

107All water molecules in this work were simulated using SPC/E model, 30 with SHAKE 31 algorithm to constrain the bond length and angles. Lennard-Jones (LJ) potentials (Supplementary Information Table S1) along with long-range Coulombic electrostatics potentials were adopted as interatomic potentials in the MD simulation. The cutoff for the interatomic potentials was set to be 12 A. Lorentz-Berthelot rules were employed for the calculation of LJ potentials between different kinds of atoms. Particle-particle particle-Mesh (PPPM) Ewald sovler 32 with 0.005 root-mean-squared error was used for long-range Coulombic potential correction. The porous graphene membrane and piston were each regarded as an entity during the simulation (internal interatomic potentials were not calculated) in order to reduce the computational cost.

5

108In the first stage of each individual simulation, the internal energy of the system was minimized for 1000 iterations. The system then ran for 5 ps under the N P T (isothermal-isobaric) ensemble at 300 K after the velocities of molecules were initialized based on Gaussian distribution. After the equilibrating, the system under N P T ensemble, the system was switched to N V T (canonical) ensemble to run for another 10 ns. The temperature was maintained at 300 K by Nosé-Hoover thermostat 33,34 with a time constant of 0.5 ps. At this stage, a z-direction constant external pressure of 100 MPa was applied on saline water by the piston to mimic the reverse osmosis process in water desalination. Since the relationship between water flux and external pressure in reverse osmosis process was generally linear, 9,11-13 the performance of pores under 100 MPa could be extrapolated to lower pressures. Therefore, we chose to run simulations under 100 MPa external pressure to rapidly collect meaningful data. Molecular trajectories of each simulation were collected every 5 ps for data processing.

Dataset and Data Augmentation

109The two major performance indicators of a membrane in water desalination: water flux, and ion rejection rate, were calculated by post-processing the MD simulation trajectories.

110The slope of the fitted least square regression line on filtered water with respect to the simulation time curve was calculated to be the water flux of each membrane (Fig. 2b). The ion rejection rate of each membrane was calculated by dividing the number of ions in the freshwater section by the total number of ions.

111The total number of different simulated porous graphene is 185. Since the reward of DRL agent in our model was calculated based on the water flux/ion rejection prediction of performance predictor (Eq.1 and 2, Supplementary Information Fig.S2), highly accurate prediction must be achieved to ensure the quality of DRL training. A much larger training dataset was necessary for the optimization of CNN model. The method employed in our study to substantially increase the size of the dataset was data augmentation. 35,36 Given that the water desalination performance of a graphene pore depended on its size and geometry, we could assume that a flipped or translated pore on the same graphene membrane would demonstrate identical water flux/ion rejection rate of the original pore (Proven by MD simulations in Supplementary Information Fig.S3). Therefore, copies of original pores were created by being flipped along x or y axis and/or translating in -4 A to 4 A in x and y directions ( Fig. 2c). The water desalination performance of pore copies are random variable with normal distribution (µ = original pore performance, σ = 1% of original pore performance). In order to improve CNN's prediction accuracy on the performance of pores created by the DRL agent, we augmented DRL-generated pores 32 times. Among the other pores, the ones with zero water flux (too small to allow water transport) were augmented 6 times, and the rest of the pores were augmented 24 times. Data augmentation was conducted using the Atomic Simulation Environment (ASE) package. 37 The final dataset used for CNN training contains 3937 samples (Fig. 2d). A reverse sigmoid function was fitted to the distribution of samples to show the general relationship between the water flux and ion rejection rates.

Water Desalination Performance Predictor

112To facilitate the reward estimation of DRL, a CNN model was trained to make an instantaneous prediction of water flux and ion rejection rates of a specific nanoporous graphene membrane. CNN is widely known as a universal feature extractor. Given that the water desalination performance of a graphene nanopore depends on its geometrical features, CNN

113can be the most suitable model to recognize geometrical features and make predictions based on them. There were 2 steps in the CNN modeling, including extracting features from the geometry of graphene nanoporous membrane and making predictions through a fully-connected multi-layer perceptron (MLP) regression model (Fig.1)

DRL Nanopore Optimization Agent

114Our goal was to design the optimal geometry of graphene nanopore for energy-efficient water desalination, which simultaneously demanded high flux and high ion rejection under certain external pressure. In order to optimize the nanopore, an agent was expected to remove atoms sequentially until a desired pore geometry was developed. To this end, the agent was set to interact with nanoporous graphene in a sequence of actions a t , states s t , and rewards r t within an episode of length T . The goal of the agent was to select the action such that it could maximize the future discounted return R t = T t=1 γ t−1 r t in the finite Markov decision process (MDP) setting. In our case, we set the discount factor γ to be 1.

115At timestep t, given the nanoporous graphene G t , the agent observed the state s t , which was composed of Morgan fingerprint, 40 coordinates of all the atoms, along with CNNextracted graphene geometrical features. The graphene geometry g t was fed into the flux and ion rejection predictor, respectively. The geometrical features were the concatenation of last layer before output of the performance predictors. Once an atom was removed, its coordinate was set to the origin since MLP required a homogeneous input dimension. The predicted flux f t and ion rejection i t were leveraged to compute the reward signal r t for the agent, as given in Eq. 1 and Eq. 2:

116where σ(·) is the generalized logistic function 43 and α is the coefficient for flux term. In our setting, α was set to be 0.01, and A = −15, K = 0, B = 13, Q = 100, ν = 0.01, C = 1 for the logistic function. A linear term of flux reward encouraged the agent to expand nanopores, which would allow higher water flux. Since low ion rejection rate was not favored in water desalination, a generalized logistic function σ(·) was leveraged to penalize ion rejection term. When i t was high, σ(i t ) was close to zero, allowing the growth of the nanopores.

117However, when i t was low, σ(i t ) fiercely penalized the agent by outputting a large negative value( Supplementary Information Fig.S2). Besides, an extra 0.05 reward was given to the agent when it chose to remove an atom at timestep t to encourage pore growth at an early stage. Given state s t and reward r t , the agent intended to choose the action a t for next step. However, due to the high dimensionality of possible action space (all the atoms in the graphene fragment), it was computationally expensive for the agent to efficiently and thoroughly explore the possible actions and to learn an optimal design. Therefore, only a subset of M atoms was selected as candidates c t . Atoms on the edge of pore were picked based on the rank of their proximity to the pore center, if the number exceeds M , only the first M atoms closest to the center of pore were selected. However, when the number of edge atoms was less than M , non-edge atoms closest to the center of pore were selected as possible candidates to maintain the size of c t . Given the state s t , reward r t , and candidate c t , the agent learned to pick the action aiming to maximize future rewards.

118To train the agent, deep Q-learning 15 with experience replay was implemented. Our task only considered deterministic environment, namely given (s, c), the pair (s , c ) at the next time-step was unique. Based on Bellman equation, 16 the optimal action-value function Q * (s, c) in the deterministic environment was defined as:

119To model the Q function, the Q-network parameterized by θ and target network parameter-

120In our setting, we use Adam optimizer 42 with learning rate 0.001. The replay buffer is of capacity 10000 and batch size is set to 128.

Results

121The mean squared error (MSE) and coefficient of determination (R 2 ) are used as metrics to evaluate the performance predictions of models. The water flux and ion rejection labels are standardized before fed into the property prediction models. Thus the metrics tabulated are based on standardized water flux or ion rejection rate( We trained the DRL agent with 10 random seeds to generate various graphene nanopores.

122In the DRL agent training processes with different random seeds (Fig.3), the red curves indicate mean values and the blue shadows represent standard deviations. The accumulated reward for each episode increases during training the DRL agent (Fig. 3a). Initially the policy is noisy and the accumulated rewards are low, because the DRL agent has not yet learned to stop expanding the pore before receiving enormous penalty for low ion rejection rate.

123During the training, the DRL agent gradually learns a stable policy through maximizing the rewards (balancing the trade-off between water flux and ion rejection rate).The performance of DRL agent after 2000 episodes of training is demonstrated in Fig. 3(b)-(e). The DRL

124Step: 0

125Step:10

126Step: 20

127Step: 60

128Step: 70

129Step: 80

130Step: 30

131Step: 40

132Step: 50 (f) agent generates nanopore which brings positive reward at each timestep, and the agent also automatically learns to stop enlarging the nanopore to avoid low ion rejection rate ( Fig. 3b and 3c). For example, the evolution of a DRL generated pore (Fig. 3f, animated in Supplementary Movie) shows that DRL stops removing atom from the edge of graphene nanopore after 50th timestep, because it determines that higher water flux reward brought by further removing atoms is not worth the penalty for low ion rejection rate. Based on the prediction of the performance predictor, the DRL generated nanoporus graphenes have averaged ∼40 #/ns water flux and ∼96% ion rejection rate ( Fig. 3d and 3e). Fig. 4a and 4b). T-SNE is a dimensionality reduction tool that is capable of mapping highdimensional data to lower-dimension form while preserving the similarities between data points. In another words, membranes that are more similar to each other will have a higher tendency of being clustered. In this work, using CNN extracted features from each graphene membrane, T-SNE successfully clustered samples with similar water flux or ion rejection.

133This result indicates that features extracted from CNN models have a strong correlation with the water flux and ion rejection rate.

134The water desalination performances of all nanopores (DRL generated and training dataset) are compared in Fig. 5a. It is worth noting that the process of generating 7999 nanopores using DRL and predicting their water flux/ion rejection rate takes less than a single week; however, evaluating the performance of the same amount of nanopores using MD simulation will take ∼33 years (average 36 hours on each sample, using one 56-core CPU node). Among the nanopores with the same level of ion rejection rate, some nanopores discovered by DRL allow much higher water flux. One common feature shared by those high-performance nanopores is the semi-oval geometry with rough edges. We set 90% ion rejection rate as the threshold to determine if a nanopore can effectively reject ions. The water flux histogram (Fig. 5b) shows that given the baseline ion rejection rate as 90%, DRL can extrapolate from the training dataset and discover graphene nanopores that generally allow higher water flux.

135Further MD simulations are conducted with DRL generated membranes that show high predicted performances to evaluate how the DRL helps in optimizing graphene nanopore for water desalination (Simulation process recorded in Supplementary Movie). Although DRL generated pores generally have lower water flux compared with circular pores with the same area, they have much higher ion rejection rate (Fig. 5c, 90% threshold of ion rejection rate is marked by a red dashed line). For example, when the pore area is 113 A 2 , DRL generated nanopore maintained over 90% ion rejection rate while the circular pore rejects only approximately 65% of ions. A pore with high water flux but a very low ion rejection rate is not desirable in water desalination application. Moreover, the comparison between 113 A 2 DRL generated nanopore with 88 A 2 circular pore shows that DRL generated pore can reject more ions when achieving same water flux: they both have approximately 125 #/ns water flux while 113 A 2 DRL generated pore can reject approximately 7% more ions. The (e) Schematic showing how ions are blocked by DRL generated pore due to the steric effect. Ions with their hydration shell (Blue dashed circle) are too large to pass through the corner area (Red dashed circle) in the DRL generated pore, thus rendering that area an ion-free zone 16

136comparison between simulation results proves that DRL tends to prioritize the ion rejection rate over water flux, which makes it capable of maximizing the water flux of nanopores while maintaining a valid ion rejection rate.

137To gain deeper understanding about the reason behind the high ion rejection rate of DRL generated pores, distribution of water molecules and ions inside of 113 A 2 DRL generated pore and 88 A 2 circular pore have been visualized (Fig. 5d). From the ion distribution (marked by red dots), we can observe that ions can traverse the circular pore evenly through the entire central area of the pore. The distributions of water molecules (marked by aqua blue color) and ions in the circular pore are in a homogeneous pattern. However, the corners inside of DRL generated nanopore are small enough to block the passage of ions while being large enough to accommodate the transport of water molecules. With the knowledge that ions are covered by hydration shell during the transport through nanopore, it can be seen that ionfree zones (corners) inside of DRL generated nanopore obstruct the traversing of ions with hydration shell by steric effect (Fig. 5e). This is the reason why high-performance nanopores (zoom-in Fig. 5a, more high-performance DRL-generated pores shown in Supplementary Information Fig.S5) all have rough edges. Discovers and utilizes this special geometry, DRL designs nanopores that can reject most ions while allowing high water transport.

Conclusion

138In this work, we propose a graphene nanopore optimization framework based on the DRL agent accelerated by the water desalination performance predictor. In particular, we focus on the optimal design of nanoporous graphene for water desalination. With a well-trained machine learning property predictor, the DRL can automatically learn to design the optimal material structure effectively and efficiently.

Lennard-Jones potentials for MD simulations

139The 12-6 Lennard-Jones (LJ) potentials used in MD simulations for generating dataset are tabulated as below. Force field between different types of atoms are calculated using Lorentz-Berthelot rule.

Details of XGBoost Regression Model

140For XGBoost, 39 100 iterations of random search with 5-fold cross validation was applied on the hyperparameter grid tabulated as below. The hyperparameters of best XGBoost models for both water flux and ion rejection rate prediction are also recorded.

Details of DRL agent

141Deep Q network 15,17 is utilized to model the DRL agent, which takes as input the graphene state representation and candidate atoms (Fig. S1) 16 Namely, with probability , the agent will randomly pick an action from the candidates. In our setting, is initially set to 0.9 and decayed to 0.05 linearly after 1000 episodes.

142Also, the generalized logistic function 43 utilized in the reward function for penalizing ion rejection is illustrated in Fig. S2. When the ion rejection is greater than 95%, the function returns a near-zero value. Therefore, given that DRL agent receives positive reward for removing atoms and generating water flux, it tends to aggressively remove atoms at the beginning of each episode. While the ion rejection drops below 90%, the function gives a harsh penalty to the agent. Such reward function strongly discourage the agent from creating a nanoporus graphene with low ion rejection rate, which is inefficient in real-world water desalination. Figure S1: Overview of deep Q network architecture. The numbers below each box illustrates the dimensions. Each data point is calculated by averaging water flux and ion rejection rate of 4 simulations.

143Error bar represent the value of one standard deviation. The water flux difference between the original pore and augmented pore is 3.17 #/ns (approximately 2%) and the ion rejection rate difference is 0.6%. All differences are within the error bar of the result of 4 simulations.

144From this result, we can conclude that the augmentation method implemented in this work is valid. Figure S3: Comparison between the water desalination performance of original humandesigned graphene nanopore (left, blue membrane) and its augmented copy version (right, black membrane). The performance difference between them is minimum and within the error bar.

Pore area calculation

145The area of graphene nanopores mentioned in this work is calculated using computer vision method (OpenCV package 50 ). For each nanoporous graphene membrane, all of its atoms which locate in the area of 0 A ≤ x ≤ 40 A and 0 A ≤ y ≤ 40 A are plotted with radius as σ (3.39 A used in this paper) of carbon (Fig. S4a). The graphene membrane image dimension in pixel is 360 × 360. The OpenCV package is then used to detect the pore from the image (Fig. S4b), and the area of the pore in terms of pixel is calculated. Further, The area of pore in terms of A 2 can be calculated using the ratio: 1 pixel = (40/360) 2 A 2 .

146(a) (b) Figure S4: (a) Plot nanoporous graphene membrane (b) Detecting pore area and calculate its size using computer vision method

147Compilation of DRL generated pores with high predicted performance

148The compilation of 64 DRL generated pores with predicted water flux > 120 #/ns and ion rejection rate > 90% are demonstrated in (Fig. S5). One common trait of those grpahene nanopores is that they tend to have narrow cavities. Those narrow cavities in pore allow the passage of water molecules but are small enough to restrict the transport of ions along with their hydration shell. DRL gradually learned the importance of narrow cavity and applied it during the optimization of graphene nanopores. Figure S5: DRL generated pores with predicted water flux > 120 #/ns and ion rejection rate > 90%. 30

참고문헌 66건

  1. Particle-Mesh Ewald and rRESPA for Parallel Molecular Dynamics Simulations. PPSC · 1997
  2. Introduction to Reinforcement Learning MIT Press eBooks · MIT Press · 1998
  3. Rectified Linear Units Improve Restricted Boltzmann Machines International Conference on Machine Learning · 2010
  4. Very Deep Convolutional Networks for Large-Scale Image Recognition Computer Vision and Pattern Recognition · 2014
  5. Playing Atari with Deep Reinforcement Learning arXiv (Cornell University) · Cornell University · 2013
  6. Porous Graphene as the Ultimate Membrane for Gas Separation Nano Letters · American Chemical Society · 2009 10.1021/nl9021946
  7. Determination of Alkali and Halide Monovalent Ion Parameters for Use in Explicitly Solvated Biomolecular Simulations The Journal of Physical Chemistry B · American Chemical Society · 2008 10.1021/jp8001614
  8. DNA Translocation through Graphene Nanopores Nano Letters · American Chemical Society · 2010 10.1021/nl102069z
  9. Extended-Connectivity Fingerprints Journal of Chemical Information and Modeling · American Chemical Society · 2010 10.1021/ci100050t
  10. Atom-by-atom nucleation and growth of graphene nanopores Proceedings of the National Academy of Sciences · National Academy of Sciences · 2012 10.1073/pnas.1119827109
  11. Selective Gas Transport Through Few-Layered Graphene and Graphene Oxide Membranes Science · American Association for the Advancement of Science · 2013 10.1126/science.1236098
  12. Canonical dynamics: Equilibrium phase-space distributions Physical review. A, General physics · American Institute of Physics · 1985 10.1103/physreva.31.1695
  13. Graphene-Based Supercapacitor with an Ultrahigh Energy Density Nano Letters · American Chemical Society · 2010 10.1021/nl102661q
  14. Stabilization of graphene nanopore Proceedings of the National Academy of Sciences · National Academy of Sciences · 2014 10.1073/pnas.1400767111
  15. A unified formulation of the constant temperature molecular dynamics methods The Journal of Chemical Physics · American Institute of Physics · 1984 10.1063/1.447334
  16. Supercapacitor Devices Based on Graphene Materials The Journal of Physical Chemistry C · American Chemical Society · 2009 10.1021/jp902214f
  17. The Art of Data Augmentation Journal of Computational and Graphical Statistics · Taylor & Francis · 2001 10.1198/10618600152418584
  18. Electromechanical Signatures for DNA Sequencing through a Mechanosensitive Nanopore The Journal of Physical Chemistry Letters · American Chemical Society · 2015 10.1021/jz5025417
  19. VMD: Visual molecular dynamics Journal of Molecular Graphics · Elsevier BV · 1996 10.1016/0263-7855(96)00018-5
  20. Structure and Dynamics of the TIP3P, SPC, and SPC/E Water Models at 298 K The Journal of Physical Chemistry A · American Chemical Society · 2001 10.1021/jp003020w
  21. Electrochemical Reaction in Single Layer MoS<sub>2</sub>: Nanopores Opened Atom by Atom Nano Letters · American Chemical Society · 2015 10.1021/acs.nanolett.5b00768
  22. Water Desalination across Nanoporous Graphene Nano Letters · American Chemical Society · 2012 10.1021/nl3012853
  23. Water desalination using nanoporous single-layer graphene Nature Nanotechnology · Nature Portfolio · 2015 10.1038/nnano.2015.37
  24. Electron beam nanosculpting of suspended graphene sheets Applied Physics Letters · American Institute of Physics · 2008 10.1063/1.2980518
  25. Ultrathin, Molecular-Sieving Graphene Oxide Membranes for Selective Hydrogen Separation Science · American Association for the Advancement of Science · 2013 10.1126/science.1236686
  26. Numerical integration of the cartesian equations of motion of a system with constraints: molecular dynamics of n-alkanes Journal of Computational Physics · Elsevier BV · 1977 10.1016/0021-9991(77)90098-5
  27. ImageNet: A large-scale hierarchical image database 2009 IEEE Conference on Computer Vision and Pattern Recognition · 2009 10.1109/cvpr.2009.5206848
  28. Gradient-based learning applied to document recognition Proceedings of the IEEE · Institute of Electrical and Electronics Engineers · 1998 10.1109/5.726791
  29. A Flexible Growth Function for Empirical Use Journal of Experimental Botany · Oxford University Press · 1959 10.1093/jxb/10.2.290
  30. Human-level control through deep reinforcement learning Nature · Nature Portfolio · 2015 10.1038/nature14236
  31. Visualizing Data using t-SNE Journal of Machine Learning Research · The MIT Press · 2008
  32. Deep Residual Learning for Image Recognition 2016 10.1109/cvpr.2016.90
  33. Reinforcement Learning in Large Discrete Action Spaces. arXiv (Cornell University) · Cornell University · 2015
  34. Water desalination with a single-layer MoS2 nanopore Nature Communications · Nature Portfolio · 2015 10.1038/ncomms9616
  35. XGBoost 2016 10.1145/2939672.2939785
  36. Calcium decorated and doped phosphorene for gas adsorption Applied Surface Science · Elsevier BV · 2016 10.1016/j.apsusc.2016.03.119
  37. DNA Base Detection Using a Single-Layer MoS<sub>2</sub> ACS Nano · American Chemical Society · 2014 10.1021/nn5029295
  38. Spatial Diffusion of Water in Carbon Nanotubes: From Fickian to Ballistic Motion The Journal of Physical Chemistry B · American Chemical Society · 2011 10.1021/jp205877b
  39. Conductive MOF electrodes for stable supercapacitors with high areal capacitance Nature Materials · Nature Portfolio · 2016 10.1038/nmat4766
  40. DNA Origami–Graphene Hybrid Nanopore for DNA Detection ACS Applied Materials & Interfaces · American Chemical Society · 2016 10.1021/acsami.6b11001
  41. The atomic simulation environment—a Python library for working with atoms Journal of Physics Condensed Matter · IOP Publishing · 2017 10.1088/1361-648x/aa680e
  42. ImageNet classification with deep convolutional neural networks Communications of the ACM · Association for Computing Machinery · 2017 10.1145/3065386
  43. Fundamental transport mechanisms, fabrication and potential applications of nanoporous atomically thin membranes Nature Nanotechnology · Nature Portfolio · 2017 10.1038/nnano.2017.72
  44. Deep reinforcement learning for de novo drug design Science Advances · American Association for the Advancement of Science · 2018 10.1126/sciadv.aap7885
  45. The Effectiveness of Data Augmentation in Image Classification using Deep Learning arXiv (Cornell University) · Cornell University · 2017 10.48550/arxiv.1712.04621
  46. Substrate engineering of graphene reactivity: towards high-performance graphene-based catalysts npj 2D Materials and Applications · Nature Portfolio · 2018 10.1038/s41699-017-0046-y
  47. Bottom-up synthesis of multifunctional nanoporous graphene Science · American Association for the Advancement of Science · 2018 101126scienceaar2009
  48. Identification of amino acids with sensitive nanoporous MoS2: towards machine learning-based prediction npj 2D Materials and Applications · Nature Portfolio · 2018 10.1038/s41699-018-0060-8
  49. Occurrence of the potent mutagens 2- nitrobenzanthrone and 3-nitrobenzanthrone in fine airborne particles Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-018-37186-2
  50. Deep learning Nature · Nature Portfolio · 2015 10.1038/nature14539
  51. (제목 없음) DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · Schloss Dagstuhl – Leibniz Center for Informatics · 2021 10.4230/lipics.cp.2021.42
  52. PyTorch: An Imperative Style, High-Performance Deep Learning Library arXiv (Cornell University) · Cornell University · 2019
  53. Perforation routes towards practical nano-porous graphene and analogous materials engineering Carbon · Elsevier BV · 2019 10.1016/j.carbon.2019.09.028
  54. Water Desalination with Two-Dimensional Metal–Organic Framework Membranes Nano Letters · American Chemical Society · 2019 10.1021/acs.nanolett.9b03225
  55. Applications of nano-porous graphene materials – critical review on performance and challenges Materials Horizons · Royal Society of Chemistry · 2020 10.1039/c9mh01570a
  56. 298KでのTIP3P,SPC及びSPC/E水モデルの構造及び動力学 The Journal of Physical Chemistry A · American Chemical Society · 2001
  57. Why is Single-Layer MoS<sub>2</sub> a More Energy Efficient Membrane for Water Desalination? ACS Energy Letters · American Chemical Society · 2020 10.1021/acsenergylett.0c00923
  58. Orbital graph convolutional neural network for material property prediction Physical Review Materials · American Physical Society · 2020 10.1103/physrevmaterials.4.093801
  59. Deep reinforcement learning for de novo drug design Science Advances · American Association for the Advancement of Science · 2018 10.1126/sciadv.aap7885
  60. XGBoost 2016 10.1145/2939672.2939785
  61. Bottom-up synthesis of multifunctional nanoporous graphene Science · American Association for the Advancement of Science · 2018 10.1126/science.aar2009
  62. Optimization of Molecules via Deep Reinforcement Learning Scientific Reports · Nature Portfolio · 2019 10.1038/s41598-019-47148-x
  63. Inverse design of nanoporous crystalline reticular materials with deep generative models Nature Machine Intelligence · Nature Portfolio · 2021 10.1038/s42256-020-00271-1
  64. Fast parallel algorithms for short-range molecular dynamics 1993 10.2172/10176421
  65. Titanium Carbide MXene for Water Desalination: A Molecular Dynamics Study ACS Applied Nano Materials · American Chemical Society · 2021 10.1021/acsanm.1c00944
  66. The OpenCV library Medical Entomology and Zoology · Japan Society of Medical Entomology and Zoology · 2000