{"id":13655705,"url":"https://github.com/by256/icsg3d","last_synced_at":"2025-12-30T01:32:50.138Z","repository":{"id":37219720,"uuid":"253050676","full_name":"by256/icsg3d","owner":"by256","description":"3-D Inorganic Crystal Structure Generation and Property Prediction via Representation Learning (JCIM 2020)","archived":false,"fork":false,"pushed_at":"2023-02-15T23:19:42.000Z","size":31817,"stargazers_count":36,"open_issues_count":15,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T04:05:40.555Z","etag":null,"topics":["cheminformatics","computational-chemistry","computational-physics","crystallography","deep-learning","representation-learning"],"latest_commit_sha":null,"homepage":"https://pubs.acs.org/doi/10.1021/acs.jcim.0c00464","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/by256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-04-04T16:50:53.000Z","updated_at":"2024-08-01T04:54:22.000Z","dependencies_parsed_at":"2024-03-04T14:08:47.403Z","dependency_job_id":"ba2831e7-374e-4eff-b1fb-8ef7ef5e1abc","html_url":"https://github.com/by256/icsg3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/by256%2Ficsg3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/by256%2Ficsg3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/by256%2Ficsg3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/by256%2Ficsg3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/by256","download_url":"https://codeload.github.com/by256/icsg3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223931513,"owners_count":17227256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheminformatics","computational-chemistry","computational-physics","crystallography","deep-learning","representation-learning"],"created_at":"2024-08-02T04:00:32.173Z","updated_at":"2025-12-30T01:32:50.113Z","avatar_url":"https://github.com/by256.png","language":"Python","funding_links":[],"categories":["📝 Publications \u003csmall\u003e(11)\u003c/small\u003e"],"sub_categories":[],"readme":"# Inorganic Crystal Structure Generation in 3D (ICSG3D)\n\u003ccenter\u003e\u003cb\u003eA deep learning pipeline for generation of 3D crystal structures and prediction of their properties\u003c/b\u003e\n\u003c/center\u003e\n\n!['TOC'](images/toc.png)\n\n----\n\n\u003cp align=\"center\"\u003e\n\u003cb\u003eAll source code and images are associated with the paper: \u003cbr /\u003e\nC. J. Court, B. Yildirim, A. Jain, J. M. Cole,\u003cbr /\u003e\n\u003ci\u003e\"3-D Inorganic Crystal Structure Generation and Property Prediction via Representation Learning\"\u003c/i\u003e,\u003cbr /\u003e\nJ. Chem. Inf Model. (accepted for publication) (2020). \u003c/b\u003e\u003cbr /\u003e\n\u003ca href=\"https://pubs.acs.org/doi/10.1021/acs.jcim.0c00464\"\u003ePaper HTML\u003c/a\u003e\n\u003c/p\u003e\n\n----\n\n# Examples of generated structures\n![Example crystals generated with our system](images/crystals-1.png)\n\n# Representation learning of crystal structures\n![Latent space embedding](images/latent_annotated-1.png)\n\n\n## Architecture\n\nOur pipeline consists of 3 components.\n\n1. A Conditional Deep Feature Consistent Variational Autoencoder\n2. A UNet semantic segmentation network\n3. A Crystal Graph Neural Network\n\n### VAE\n\n![VAE](images/crystal_vae-1.png)\nEncoder: 4x 3D convolutions, BatchNorm, ReLU and Maxpooling\n\nBottleneck: 3D convolution, LeakyReLU, Dense (256), 2x Dense (256) (\u003cimg src=\"https://render.githubusercontent.com/render/math?math=\\mu\"\u003e and \u003cimg src=\"https://render.githubusercontent.com/render/math?math=\\sigma\"\u003e)\n\nDecoder: 4x 3D convolutions, BatchNorm, ReLU and upsampling\n\n### UNET\n\n![Unet](images/unet.png)\nDownward: 4 x 2 x 3D convolutions, ReLU, BatchNorm, and pooling\n\nBottleneck: 2 x 3D convolutions, ReLU BatchNorm\n\nUpward: 4 x 2 x 3D convolutions, ReLU, BatchNorm and UpSampling\n\n### CGCNN\n\n![CGCNN](images/gnn-1.png)\n\n## Installation\n\n1. Clone the git repository\n    \u003e git clone https://github.com/by256/icsg3d\n2. Install requirements\n    \u003e python3 -m pip install -r requirements.txt\n    \n## Requirements\nTensorflow2.0 is not currently supported, tested with tensorflow-gpu==2.1.0 and Keras==2.3.1\nRequires keras-contrib\n\n\n## Getting Data\n\nThe system works on crystallographic information files (CIFs) to train the deep learning pipeline. In theory these can be from any source, but by default we use the materialsproject API.\n\nFor example, to retrieve all CIFs for cubic perovskites (ABX3):\n\u003e python3 query_matproj.py --anonymous_formula=\"{'A': 1.0, 'B': 1.0, 'C':3.0}\" --system=cubic --name=perovskites\n\nThis will create a data/perovskites folder containing the cifs and a csv with associated properties\n\n## Creating the network inputs\n\nThe various network input matrices can be created by\n\u003e mpiexec -n 4 python3 create_matrices.py --name=perovskites\n\n## Train the UNET\n\nTrain the unet for as many epochs as needed\n\u003e python3 train_unet.py --name perovskites --samples 1000 --epochs 50\n\n## Train the VAE\n\nMake sure you train the VAE second (as it uses the unet as a DFC perceptual model)\n\u003e python3 train_vae.py --name perovskites --samples 1000 --epochs 250\n\n## View some results\n\n![Interpolations](images/interpolate-1.png)\n\n1. Interpolations in vae latent space\n    \u003e python3 interpolate.py --name perovskites\n2. Whole pipeline plots\n    \u003e python3 view_results.py --name perovskites\n3. Evaluate coordinates and lattice params\n    \u003e python3 eval.py --name perovskites\n\n## Generate new samples\n\nAttempt to generate 1000 new samples arund a base compound CeCrO3 with variance 0.5\n\u003e python3 generate.py --name perovskites --nsamples 1000 --base CeCrO3 --var 0.5\n\nThis will create a new directory where you will find Cifs, density matrices, species matrices and properties for all generated compounds.\n![Random Generations](images/rand_gens-1.png)\n\n## Using pre-trained models\nThe pre-trained models in the models directory. To use these, you'll need to move/rename the models to a corresponding directories:\n\n\u003e saved_models/unet/mode/unet_weights_mode.h5 \n\u003e saved_models/unet/mode/class_weights.npy\n\u003e saved_models/vae/mode/vae_weights_mode.hdf5\n\u003e saved_models/cgcnn/\n\nwhere mode is the name of your data directory. \n\n\n## Citation\n\u003cb\u003eC. J. Court, B. Yildirim, A. Jain, J. M. Cole, \u003ci\u003e\"3-D Inorganic Crystal Structure Generation and Property Prediction via Representation Learning\"\u003c/i\u003e, *J. Chem. Inf. Model.* 2020 (accepted for publication).\u003c/b\u003e\n\n## Funding Statement\nThis project was financially supported by the Engineering and Physical Sciences Research Council (EPSRC, EP/L015552/1), Science and Technology Facilities Council (STFC) and the Royal Academy of Engineering (RCSRF1819\\7\\10).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fby256%2Ficsg3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fby256%2Ficsg3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fby256%2Ficsg3d/lists"}