{"id":17596233,"url":"https://github.com/lamm-mit/fieldpredictorgan","last_synced_at":"2025-04-30T04:51:03.362Z","repository":{"id":240764441,"uuid":"629595105","full_name":"lamm-mit/FieldPredictorGAN","owner":"lamm-mit","description":"Deep learning model to predict complex stress and strain fields in hierarchical composites","archived":false,"fork":false,"pushed_at":"2023-04-23T08:23:46.000Z","size":2144,"stargazers_count":26,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T12:41:38.751Z","etag":null,"topics":["composite","deep-learning","design","fracture","materials-by-designs","mechanical","multiscale","multiscale-simulation","nanocomposite"],"latest_commit_sha":null,"homepage":"https://www.science.org/doi/10.1126/sciadv.abd7416","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/lamm-mit.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,"publiccode":null,"codemeta":null}},"created_at":"2023-04-18T16:16:27.000Z","updated_at":"2025-02-22T13:59:08.000Z","dependencies_parsed_at":"2024-05-20T20:08:08.227Z","dependency_job_id":"4ab1229a-da7e-4304-8150-2ac536c44d4f","html_url":"https://github.com/lamm-mit/FieldPredictorGAN","commit_stats":null,"previous_names":["lamm-mit/fieldpredictorgan"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamm-mit%2FFieldPredictorGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamm-mit%2FFieldPredictorGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamm-mit%2FFieldPredictorGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamm-mit%2FFieldPredictorGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamm-mit","download_url":"https://codeload.github.com/lamm-mit/FieldPredictorGAN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644827,"owners_count":21620630,"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":["composite","deep-learning","design","fracture","materials-by-designs","mechanical","multiscale","multiscale-simulation","nanocomposite"],"created_at":"2024-10-22T08:24:29.789Z","updated_at":"2025-04-30T04:51:03.339Z","avatar_url":"https://github.com/lamm-mit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# End-to-end Prediction of Various Mechanical Fields from Hierarchical Composite Geometry using Adverserial Neural Networks\n\nYang, Z., Yu, C. H., \u0026 Buehler, M. J. (2021). Deep learning model to predict complex stress and strain fields in hierarchical composites. Science Advances, 7(15), eabd7416, 2021, https://www.science.org/doi/10.1126/sciadv.abd7416\n\nMaterials-by-design is a paradigm to develop previously unknown high-performance materials. However, finding materials with superior properties is often computationally or experimentally intractable because of the astronomical number of combinations in design space. Here we report an AI-based approach, implemented in a game theory–based conditional generative adversarial neural network (cGAN), to bridge the gap between a material’s microstructure—the design space—and physical performance. Our end-to-end deep learning model predicts physical fields like stress or strain directly from the material microstructure geometry, and reaches an astonishing accuracy not only for predicted field data but also for derivative material property predictions. Furthermore, the proposed approach offers extensibility by predicting complex materials behavior regardless of component shapes, boundary conditions, and geometrical hierarchy, providing perspectives of performing physical modeling and simulations. The method vastly improves the efficiency of evaluating physical properties of hierarchical materials directly from the geometry of its structural makeup.\n\n![Overall workflow](https://github.com/lamm-mit/FieldPredictorGAN/blob/main/flow_chart.png)\n\n**Basic requirements**\n- Python3\n- Tensorflow=2.0.0\n- CUDA 10.0\n- Tensorboard=2.6.0\n- Other requirements can be found at requirement.txt and installation can be done via:\n```\npip install -r requirement.txt\n```\n\n**Image dataset requirements**\n- For both training and testing, geometry image (256, 256) and field image (256, 256) need to be stitched into one image with size (256, 512).\n- If images with size (512, 512) are used, replace the corresponding python codes with codes in \"HIGH_RESO\". \n- Make sure the solid black background is in good proportion in order to match pixes. \n- Make sure they are named in order. e.g. 1.png, 2.png,...\n\n**Before training or testing**\n- Hyperparameters are indicated in \"config.py\".\n- Specify the directory path which contains data set in config.py. e.g. PATH=\"./MISES/\"\n- Split your data set into training set and test set under dataset directory:\n```\n\ncd MISES\nmkdir train ### training set dir\nmkdir test ### test set dir\n## move you data into these two folders (You can also not use two commands below and customize)##\ncp split.sh ./MISES\nbash split.sh\n```\n- Make sure images in training set and test set are named in order separately. e.g. 1.png, 2.png,...\n\n**Training**\n- Specify epochs in \"config.py\". e.g. EPOCHS = 150\n- Start training by typing\n```\npython train.py\n```\n- The training checkpoints will be stored\n- Checking the training status using Tensorboard:\n```\ntensorboard --logdir logs/fit\n```\n\n**Testing/prediction**\n- The models ara stored with training checkpoints during training, all checkpoints of the pretrained models are stored in link:[https://www.dropbox.com/sh/4g8hyh6lbc5tn07/AACDMQZKtsiniZXpz7peyxk-a?dl=0]. Please check \"Dataset availablity\" for available pretrained model\n- Copy training checkpoint(e.g. MISES stress field):\n```\nmkdir training_checkpoints\nmkdir predict\ncp DOWNLOAD_PATH/ckpt/MISES/* training_checkpoints\n```\n- Specify the number of data in test set in test.py. e.g. num_data = 5, so in test set, there will be 5 images: 1.png,...,5.png\n- Run prediction on test set by typing:\n```\npython test.py\n```\n- The predcition will be in folder \"./predict\", stitched image from left to right is geometry, ground truth and prediction\n- To change the checkpoint used for predictions, open \"./training_checkpoints/checkpoint\" to specify the checkpoint\n\n**Dataset availablity**\n- Available dataset in https://www.dropbox.com/sh/ffcks4lm85x440r/AAANq4qYBlTb8KeOTavsJ9jta?dl=0 and training checkpoints in https://www.dropbox.com/sh/4g8hyh6lbc5tn07/AACDMQZKtsiniZXpz7peyxk-a?dl=0:\n\n| field description | shape of units | boundary condition embedded | loading condition | strain magnitude | materials property | ratio of young's modulus | resolution | dataset folder | checkpoints folder |\n| ------------- | ------------- | ------------- | ------------- | ------------- |------------- |------------- |-------------|-------------|-------------|\n| MISES stress  | square | no | uniaxial compression in x | 10% | crushable foam | 4.75 | 8 * 8 | /dataset/MISES | /ckpt/MISES  |\n| S11 | square | no | uniaxial compression in x | 10% | crushable foam | 4.75 | 8 * 8 | /dataset/S11 | /ckpt/S11  |\n| S12 | square | no | uniaxial compression in x | 10% | crushable foam | 4.75 | 8 * 8 | /dataset/S12 | /ckpt/S12  |\n| PE11 | square | no | uniaxial compression in x | 10% | crushable foam | 4.75 | 8 * 8 | /dataset/PE11 | /ckpt/PE11  |\n| PE12 | square | no | uniaxial compression in x | 10% | crushable foam | 4.75 | 8 * 8 | /dataset/PE12 | /ckpt/PE12  |\n| MISES stress | square| yes | uniaxial compression in x and nanoindentation (spherical indentor)| 5% | crushable foam | 4.75 | 8 * 8 | /dataset/BC | /ckpt/BC |\n| MISES stress | hexagon | no | uniaxial compression in x | 10% | crushable foam | 4.75 | 8 * 8 | /dataset/HEXAGON | /ckpt/HEXAGON  |\n| MISES stress | triangle| no | uniaxial compression in x | 5% | crushable foam | 4.75 |  8 * 8 | /dataset/TRIANGLE | /ckpt/TRIANGLE |\n| MISES stress | square | no | uniaxial compression in x | 5% | crushable foam | 4.75 | 32 * 32 | /dataset/HIGH_RESO| /ckpt/HIGH_RESO |\n| S11 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/S11 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/S11 |\n| S12 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/S12 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/S12 |\n| S22 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/S22 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/S22 |\n| S33 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/S33 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/S33 |\n| LE11 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/LE11 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/LE11 |\n| LE12 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/LE12 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/LE12 |\n| LE22 | square | no | uniaxial tensile in x | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/ELASTIC_TENSOR/LE22 | /ckpt/ELASTIC_TENSOR/ELASTIC_TENSOR/LE22 |\n| S11 | square | no | uniaxial tensile in y | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/TENSILE_Y/S11 | /ckpt/ELASTIC_TENSOR/TENSILE_Y/S11_BC |\n| S22 | square | no | uniaxial tensile in y | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/TENSILE_Y/s22 | /ckpt/ELASTIC_TENSOR/TENSILE_Y/S22_BC |\n| S11_ratio (uniform ratio) | square | no | uniaxial tensile | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/UNIFORM_RATIO/S11 | /ckpt/ELASTIC_TENSOR/UNIFORM_RATIO/S11_ratio |\n| S11_hier (hierarchical) | square | no | uniaxial tensile | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/ELASTIC_TENSOR/HIERARCHICAL/S11 | /ckpt/ELASTIC_TENSOR/HIERARCHICAL/8_16_32_3000data|\n| LE11_crack | square | no | uniaxial tensile | 5% | linear elasticity | 100:10:1 | 32 * 32 | /dataset/CRACK/LE11_1_10_100 | /ckpt/CRACK/LE11_1_10_100 |\n| LE11_crack | square | no | uniaxial tensile | 5% | linear elasticity | 100:10:0.1 | 32 * 32 | /dataset/CRACK/LE11_0.1_10_100 | /ckpt/CRACK/LE11_0.1_10_100 |\n| S11_Field2geo | square | no | uniaxial tensile | 10% | linear elasticity | 4.75 | 32 * 32 | /dataset/FIELD2GEO/S11 | /ckpt/FIELD2GEO/S11 |\n\n```\n@article{YangYuBuehlerScienceAdv_2021,\n    title   = {Deep learning model to predict complex stress and strain fields in hierarchical composites},\n    author  = {Z. Yang, C.H. Yu, and M.J. Buehler},\n    journal = {Science Advances},\n    year    = {2021},\n    volume  = {7},\n    pages   = {eabd7416},\n    url     = {https://www.science.org/doi/10.1126/sciadv.abd7416}\n}\n\n@article{YangYuBuehlerJMPS_2022,\n    title   = {End-to-end deep learning method to predict complete strain and stress tensors for complex hierarchical composite microstructures},\n    author  = {Z. Yang, C.H. Yu, K. Guo, and M.J. Buehler},\n    journal = {Journal of the Mechanics and Physics of Solids},\n    year    = {2021},\n    volume  = {154},\n    pages   = {104506},\n    url     = {https://doi.org/10.1016/j.jmps.2021.104506}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamm-mit%2Ffieldpredictorgan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamm-mit%2Ffieldpredictorgan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamm-mit%2Ffieldpredictorgan/lists"}