journal article·2022-01-11Open access

Automated Recognition of Chemical Molecule Images Based on an Improved TNT Model

Yanchi Li, Guanyu Chen, Xiang Li

Applied Sciences· Volume 12· Issue 2

Abstract

The automated recognition of optical chemical structures, with the help of machine learning, could speed up research and development efforts. However, historical sources often have some level of image corruption, which reduces the performance to near zero. To solve this downside, we need a dependable algorithmic program to help chemists to further expand their research. This paper reports the results of research conducted for the Bristol-Myers Squibb-Molecular Translation competition, which was held on Kaggle and which invited participants to convert old chemical images to their underlying chemical structures, annotated as InChI text; we define this work as molecular translation. We proposed a model based on a transformer, which can be utilized in molecular translation. To better capture the details of the chemical structure, the image features we want to extract need to be accurate at the pixel level. TNT is one of the existing transformer models that can meet this requirement. This model was originally used for image classification, and is essentially a transformer-encoder, which cannot be utilized for generation tasks. On the other hand, we believe that TNT cannot integrate the local information of images well, so we improve the core module of TNT—TNT block—and propose a novel module—Deep TNT block—by stacking the module to form an encoder structure, and then use the vanilla transformer-decoder as a decoder, forming a chemical formula generation model based on the encoder–decoder structure. Since molecular translation is an image-captioning task, we named it the Image Captioning Model based on Deep TNT (ICMDT). A comparison with different models shows that our model has benefits in each convergence speed and final description accuracy. We have designed a complete process in the model inference and fusion phase to further enhance the final results.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Multimodal Machine Learning Applications · Advanced Image and Video Retrieval Techniques · Image Retrieval and Classification Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

School of Computer Science, China University of Geosciences, Wuhan 430079, China

Informatization Office, China University of Geosciences, Wuhan 430079, China

References (60)

Show source-provided references
1. (2021, November 01). BMS-Molecular-Translation. Available online: https://www.kaggle.com/c/bms-molecular-translation.
2. Backpropagation Applied to Handwritten Zip Code Recognition10.1162/neco.1989.1.4.541 ↗
3. ImageNet Classification with Deep Convolutional Neural Networks
4. He, K., Zhang, X., Ren, S., and Sun, J. (2016, January 27–30). Deep Residual Learning for Image Recognition. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.10.1109/CVPR.2016.90 ↗
5. Tan, M., and Le, Q. (2019, January 9–15). Efficientnet: Rethinking Model Scaling for Convolutional Neural Networks. Proceedings of the International Conference on Machine Learning, PMLR, Long Beach, CA, USA.
6. Wang, C., Yang, H., Bartz, C., and Meinel, C. (2016, January 15–19). Image Captioning with Deep Bidirectional LSTMs. Proceedings of the 24th ACM International Conference on Multimedia, Amsterdam, The Netherlands.10.1145/2964284.2964299 ↗
7. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, Ł., and Polosukhin, I. (2017, January 4–9). Attention Is All You Need. Proceedings of the 31st Conference on Neural Information Processing Systems (NeurIPS), Long Beach, CA, USA.
8. Devlin, J., Chang, M.W., Lee, K., and Toutanova, K. (2019, January 2–7). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), Minneapolis, MN, USA.
9. Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., and Askell, A. (2020). Language Models are Few-Shot Learners. arXiv.
10. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., and Gelly, S. (2020, January 26–30). An Image is Worth 16 × 16 Words: Transformers for Image Recognition at Scale. Proceedings of the International Conference on Learning Representations, Addis Ababa, Ethiopia.
11. Touvron, H., Cord, M., Douze, M., Massa, F., Sablayrolles, A., and Jégou, H. (2021, January 18–24). Training Data-Efficient Image Transformers & Distillation through Attention. Proceedings of the International Conference on Machine Learning, PMLR, Virtual.
12. Han, K., Xiao, A., Wu, E., Guo, J., Xu, C., and Wang, Y. (2021). Transformer in Transformer. arXiv.
13. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. (2021). Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. arXiv.10.1109/ICCV48922.2021.00986 ↗
14. DeViSE: A Deep Visual-Semantic Embedding Model
15. Mori, Y., Takahashi, H., and Oka, R. (1999, January 30). Image-To-Word Transformation Based on Dividing and Vector Quantizing Images with Words. Proceedings of the MISRM’99 First International Workshop on Multimedia Intelligent Storage and Retrieval Management, Orlando, FL, USA.
16. Kuznetsova, P., Ordonez, V., Berg, A., Berg, T., and Choi, Y. (2012, January 8–14). Collective Generation of Natural Image Descriptions. Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Jeju Island, Korea.
17. Elliott, D., and Keller, F. (2013, January 18–21). Image Description using Visual Dependency Representations. Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, Seattle, WA, USA.
18. Im2Text: Describing Images Using 1 Million Captioned Photographs
19. Object Detection with Discriminatively Trained Part-Based Models10.1109/TPAMI.2009.167 ↗
20. Mason, R., and Charniak, E. (2014, January 22–27). Nonparametric Method for Data-Driven Image Captioning. Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), Baltimore, MD, USA.10.3115/v1/P14-2097 ↗
21. Mao, J., Xu, W., Yang, Y., Wang, J., and Yuille, A.L. (2015, January 7–9). Deep Captioning with Multimodal Recurrent Neural Networks (m-RNN). Proceedings of the ICLR ’15 3rd International Conference on Learning Representations, San Diego, CA, USA.
22. Vinyals, O., Toshev, A., Bengio, S., and Erhan, D. (2015, January 7–12). Show And Tell: A Neural Image Caption Generator. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA.10.1109/CVPR.2015.7298935 ↗
23. Mao, J., Huang, J., Toshev, A., Camburu, O., Yuille, A.L., and Murphy, K. (2016, January 27–30). Generation and Comprehension of Unambiguous Object Descriptions. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.10.1109/CVPR.2016.9 ↗
24. Xu, K., Ba, J., Kiros, R., Cho, K., Courville, A., Salakhudinov, R., Zemel, R., and Bengio, Y. (2015, January 7–9). Show, Attend and Tell: Neural Image Caption Generation with Visual Attention. Proceedings of the International Conference on Machine Learning, PMLR, Lille, France.
25. Anderson, P., He, X., Buehler, C., Teney, D., Johnson, M., Gould, S., and Zhang, L. (2018, January 18–23). Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00636 ↗
26. Attentive Linear Transformation for Image Captioning10.1109/TIP.2018.2855406 ↗
27. Lu, J., Yang, J., Batra, D., and Parikh, D. (2018, January 18–23). Neural Baby Talk. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00754 ↗
28. Guo, L., Liu, J., Zhu, X., Yao, P., Lu, S., and Lu, H. (2020, January 13–19). Normalized and Geometry-Aware Self-Attention Network for Image Captioning. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA.10.1109/CVPR42600.2020.01034 ↗
29. Cornia, M., Stefanini, M., Baraldi, L., and Cucchiara, R. (2020, January 13–19). Meshed-Memory Transformer for Image Captioning. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA.10.1109/CVPR42600.2020.01059 ↗
30. Luo, Y., Ji, J., Sun, X., Cao, L., Wu, Y., Huang, F., Lin, C.W., and Ji, R. (2021, January 2–9). Dual-Level Collaborative Transformer for Image Captioning. Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA.10.1609/aaai.v35i3.16328 ↗
31. Li, L.H., Yatskar, M., Yin, D., Hsieh, C.J., and Chang, K.W. (2019). VisualBERT: A Simple and Performant Baseline for Vision and Language. arXiv.
32. Li, G., Duan, N., Fang, Y., Gong, M., and Jiang, D. (2020, January 2–9). Unicoder-VL: A Universal Encoder for Vision and Language by Cross-Modal Pre-training. Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA.10.1609/aaai.v34i07.6795 ↗
33. Su, W., Zhu, X., Cao, Y., Li, B., Lu, L., Wei, F., and Dai, J. (2020). VL-BERT: Pre-training of Generic Visual-Linguistic Representations. arXiv.
34. Chen, Y.C., Li, L., Yu, L., El Kholy, A., Ahmed, F., Gan, Z., Cheng, Y., and Liu, J. (2020). UNITER: UNiversal Image-TExt Representation Learning. Proceedings of the European Conference on Computer Vision, 16th European Conference, Glasgow, UK, 23–28 August 2020, Springer.10.1007/978-3-030-58577-8_7 ↗
35. Zhou, L., Palangi, H., Zhang, L., Hu, H., Corso, J., and Gao, J. (2020, January 2–9). Unified Vision-Language Pre-Training for Image Captioning and VQA. Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA.10.1609/aaai.v34i07.7005 ↗
36. Lu, J., Batra, D., Parikh, D., and Lee, S. (2019). ViLBERT: Pretraining Task-Agnostic Visiolinguistic Representations for Vision-and-Language Tasks. arXiv.
37. Inui, K., Jiang, J., Ng, V., and Wan, X. (2019). LXMERT: Learning Cross-Modality Encoder Representations from Transformers, Association for Computational Linguistics. EMNLP/IJCNLP (1).
38. Hu, J., Shen, L., and Sun, G. (2018, January 18–23). Squeeze-and-Excitation Networks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00745 ↗
39. Li, X., Wang, W., Hu, X., and Yang, J. (2019, January 18–20). Selective Kernel Networks. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA.10.1109/CVPR.2019.00060 ↗
40. Zhang, H., Wu, C., Zhang, Z., Zhu, Y., Zhang, Z., Lin, H., Sun, Y., He, T., Mueller, J., and Manmatha, R. (2020). ResNeSt: Split-Attention Networks. arXiv.
41. Wang, X., Girshick, R., Gupta, A., and He, K. (2018, January 18–23). Non-Local Neural Networks. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00813 ↗
42. Yin, M., Yao, Z., Cao, Y., Li, X., Zhang, Z., Lin, S., and Hu, H. (2020). Disentangled Non-Local Neural Networks. Proceedings of the European Conference on Computer Vision, 16th European Conference, Glasgow, UK, 23–28 August 2020, Springer.10.1007/978-3-030-58555-6_12 ↗
43. Yuan, Y., Huang, L., Guo, J., Zhang, C., Chen, X., and Wang, J. (2018). OCNet: Object Context Network for Scene Parsing. arXiv.
44. Hu, H., Gu, J., Zhang, Z., Dai, J., and Wei, Y. (2018, January 18–23). Relation Networks for Object Detection. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA.10.1109/CVPR.2018.00378 ↗
45. Beal, J., Kim, E., Tzeng, E., Park, D.H., Zhai, A., and Kislyuk, D. (2020). Toward Transformer-Based Object Detection. arXiv.
46. Zhu, X., Su, W., Lu, L., Li, B., Wang, X., and Dai, J. (2020). Deformable DETR: Deformable Transformers for End-to-End Object Detection. arXiv.
47. Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., and Zagoruyko, S. (2020). End-to-End Object Detection with Transformers. Proceedings of the European Conference on Computer Vision, 16th European Conference, Glasgow, UK, 23–28 August 2020, Springer.10.1007/978-3-030-58452-8_13 ↗
48. Zheng, S., Lu, J., Zhao, H., Zhu, X., Luo, Z., Wang, Y., Fu, Y., Feng, J., Xiang, T., and Torr, P.H. (2021, January 19–25). Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA.10.1109/CVPR46437.2021.00681 ↗
49. Chen, H., Wang, Y., Guo, T., Xu, C., Deng, Y., Liu, Z., Ma, S., Xu, C., Xu, C., and Gao, W. (2021, January 19–25). Pre-Trained Image Processing Transformer. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA.10.1109/CVPR46437.2021.01212 ↗
50. Hendrycks, D., and Gimpel, K. (2016). Gaussian Error Linear Units (GELUs). arXiv.
51. Gehring, J., Auli, M., Grangier, D., Yarats, D., and Dauphin, Y.N. (2017, January 6–11). Convolutional Sequence to Sequence Learning. Proceedings of the International Conference on Machine Learning, PMLR, Sydney, Australia.
52. (2021, November 01). Albumentations. Available online: https://github.com/albumentations-team/albumentations.
53. Zhang, M.R., Lucas, J., Ba, J., and Hinton, G.E. (2019, January 8–14). Lookahead Optimizer: k steps forward, 1 step back. Proceedings of the 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, BC, Canada.
54. Liu, L., Jiang, H., He, P., Chen, W., Liu, X., Gao, J., and Han, J. (2019). On the Variance of the Adaptive Learning Rate and Beyond. arXiv.
55. Raunak, V., Dalmia, S., Gupta, V., and Metze, F. (2020, January 16–20). On Long-Tailed Phenomena in Neural Machine Translation. Proceedings of the EMNLP (Findings), Association for Computational Linguistics, Online.10.18653/v1/2020.findings-emnlp.276 ↗
56. Lin, T.Y., Goyal, P., Girshick, R., He, K., and Dollár, P. (2017, January 22–29). Focal Loss for Dense Object Detection. Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy.10.1109/ICCV.2017.324 ↗
57. Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z. (2016, January 27–30). Rethinking the Inception Architecture for Computer Vision. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.10.1109/CVPR.2016.308 ↗
58. Fixing the Train-Test Resolution Discrepancy
59. (2021, November 01). RDKit. Available online: https://github.com/rdkit/rdkit.
60. Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. (2017). Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour. arXiv.