Is this the carbon atom you are looking for? -AI to predict CNT’s atomic coordination.

Carbon Nanotubes

a, b Examples of SEM carbon nanotube images. c, d Examples of TEM carbon nanotube images
  • Research has shown that CNTs have the highest reversible capacity of any carbon material for use in lithium-ion batteries. CNTs are outstanding materials for supercapacitor electrodes.
  • Many researchers (see example) and corporations have already developed CNT-based air and water filtration devices. It has been reported that these filters can not only block the smallest particles but also kill most bacteria. This is another area where CNTs have already been commercialized and products are on the market now.
  • Research has shown that CNTs can provide a sizable increase in efficiency, even in their current unoptimized state. Solar cells developed at the New Jersey Institute of Technology use a carbon nanotube complex, formed by a mixture of carbon nanotubes and carbon buckyballs to form snake-like structures.
A Chiral Vector
CNTs geometrical structures

Artificial Neural Networks

A neural network.
A single node.
The stages of Acı and Avcı’s study.

Predicting Atomic Coordinates of CNTs

1-Import Libraries and Dataset

import numpy as np, pandas as pd, seaborn as sns, matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import mean_squared_error, r2_score, accuracy_score
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Input, Dense
from tensorflow.keras.optimizers import Adam
import datetime
now = datetime.datetime.now
#filter warnings
import warnings
warnings.filterwarnings("ignore")

%matplotlib inline

filepath = 'the_dataset'

raw_data = pd.read_csv(filepath, sep=';',decimal=',')
data = raw_data.copy()

2-Explore the Data

data.info()
data.describe()
data.head()
#you can use these to understand the datatypes, observe the
#statistical summary or to see an example.
Our data.
data.hist(figsize=(10,10)) #you can take a look at dataset distributions.
The dataset’s distributions.
import plotly.express as px


fig = px.scatter_3d(data,
x="Calculated atomic coordinates u'",
y="Calculated atomic coordinates v'",
z="Calculated atomic coordinates w'",
color='Chiral indice n',
size='Chiral indice m',
hover_data=[],
opacity=0.4)
fig.update_layout(title='Calculated atomic coordinates')

fig.show()
Hovering over the plot.

3-Process the Data

#y data
y_cols = ["Calculated atomic coordinates u'",
"Calculated atomic coordinates v'",
"Calculated atomic coordinates w'"]

#target data
y_data = data[y_cols]

#copy dataset
X_data = data.copy()

#remove target data from X_data
for y_label in y_cols:
X_data = X_data.drop([y_label], axis=1)
scale_cols = [col for col in X_data.columns 
if X_data[col].min() < -1
or X_data[col].max() > 1]

scale_cols
X_data[scale_cols].iloc[:].min()
X_data[scale_cols].iloc[:].max()
from sklearn.preprocessing import MinMaxScaler

mm = MinMaxScaler()

X_data[scale_cols] = mm.fit_transform(X_data[scale_cols])
from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X_data,
y_data,
test_size=0.3,
random_state=42)

4-Build the ANN model

  • Layer 1: 20 hidden nodes, hyperbolic tangent activation
  • Layer 2: 30 hidden nodes, hyperbolic tangent activation
  • Layer 3: 25 hidden nodes, softmax activation
  • The final layer has 3-nodes with no activation
model = Sequential()
model.add(Dense(20, input_shape = (5,), activation='tanh'))
model.add(Dense(30, activation = 'tanh'))
model.add(Dense(25, activation = 'softmax'))
model.add(Dense(3, activation=None))
model.compile(Adam(lr = 0.0015),
'mean_squared_error')
run = model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=320)

5-Observe the Performance

# predictions for train and test 
y_train_pred = model.predict(X_train)
y_test_pred = model.predict(X_test)

# R2 score for train and test
train_score = r2_score(y_train, y_train_pred)
test_score = r2_score(y_test, y_test_pred)

print("_________________________________________________")
print("R2 Score for the training set is:", train_score)
print("R2 Score for the test set is:", test_score)
R2 score

Conclusion

  • Carbon nanotubes (CNTs) are newly discovered nanomaterials that have unique properties.
  • CNT’s properties are influenced by its shape and structure. So modeling and simulating their structure plays an important role for scientists to try new synthesis methods.
  • Simulating the CNTs currently takes a lot of time as mathematical calculations are needed to be done for accurate atomic coordinates.
  • This study uses Artificial Neural Networks to predict atomic coordinates so iterations can be done by the simulation software without the need for mathematical calculations.
  • The model we built by getting inspiration from Acı and Avcı’s study is showing high performance.

--

--

Innovator who wants to make a meaningful impact. https://www.linkedin.com/in/elanu-karakus/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store