Abstract
The pursuit of autonomous chemical transformations with single-bond precision represents a central challenge in molecular nanoscience. While scanning tunneling microscopy (STM) enables site-specific reactions by directly engaging individual atoms and bonds, conventional approaches rely on expert intervention and lack reproducibility and scalability. Here we introduce a deep learning-based strategy that autonomously executes multi-step, bond-selective transformations. Our system integrates computer vision for molecular recognition, neural networks for bond-state classification, and deep reinforcement learning for closed-loop optimization of activation parameters. As a proof of concept, we demonstrate the selective dissociation of C-Br bonds in a tetra-brominated porphyrin on Au(111). Importantly, the approach extends beyond single-bond events, enabling programmed multi-step sequences including four distinct pathways with high fidelity. By advancing from isolated, human-directed manipulations to fully autonomous, data-driven reaction control, this platform establishes a paradigm for intelligent single-molecule chemistry. It provides a generalizable framework for on-surface synthesis, where adaptive agents orchestrate molecular transformations with a level of precision and scalability unattainable by manual approaches.
Data availability
The data that support the findings of this study are available from the corresponding author upon request. Source data are provided with this paper.
Code availability
The source codes of the deep learning models are available on GitHub at https://github.com/gggg0034/Nanonis_AutoSTM_C-Br_bond_selectivity.
References
Ji, S., Jun, C., Chen, Y. & Wang, D. Precise synthesis at the atomic scale. Precis. Chem. 1, 199–225 (2023).
Clair, S. & De Oteyza, D. G. Controlling a chemical coupling reaction on a surface: tools and strategies for on-surface synthesis. Chem. Rev. 119, 4717–4776 (2019).
Sun, Q., Zhang, R., Qiu, J., Liu, R. & Xu, W. On-surface synthesis of carbon nanostructures. Adv. Mater. 30, 1705630 (2018).
Patera, L. L., Fatayer, S., Repp, J. & Gross, L. Probing molecular properties at atomic length scale using charge-state control. Chem. Rev. 125, 5830–5847 (2025).
Gao, Y. et al. On-surface synthesis of a doubly anti-aromatic carbon allotrope. Nature 623, 977–981 (2023).
Sun, L. et al. On-surface synthesis of aromatic cyclo[10]carbon and cyclo[14]carbon. Nature 623, 972–976 (2023).
Pérez-Elvira, E. et al. Generating antiaromaticity in polycyclic conjugated hydrocarbons by thermally selective skeletal rearrangements at interfaces. Nat. Synth. 2, 1159–1170 (2023).
Song, S. et al. Janus graphene nanoribbons with localized states on a single zigzag edge. Nature 637, 580–586 (2025).
Li, X. et al. Recent progress on surface chemistry II: property and characterization. Chin. Chem. Lett. 36, 110100 (2025).
Qie, B. et al. Synthesis and characterization of low-dimensional N-heterocyclic carbene lattices. Science 384, 895–901 (2024).
Cao, N. et al. The role of aromaticity in the cyclization and polymerization of alkyne-substituted porphyrins on Au(111). Nat. Chem. 15, 1765–1772 (2023).
Zhan, G. et al. Observing polymerization in 2D dynamic covalent polymers. Nature 603, 835–840 (2022).
Liu, J.-W. et al. Two-dimensional crystal transition from radialene to cumulene on ag(111) via retro-[2 + 1] cycloaddition. J. Am. Chem. Soc. 145, 13048–13058 (2023).
Jiang, H. et al. Exploring selective photochemistry on metal surfaces through wavelength-dependent light excitation. Nano Lett. 25, 9597–9604 (2025).
Jiang, H. et al. Unraveling the mechanisms of on-surface photoinduced reaction with polarized light excitations. ACS Nano 18, 1118–1125 (2024).
Ruan, Z. et al. On-surface synthesis and characterization of pentadecacene and its gold complexes. J. Am. Chem. Soc. 147, 4862–4870 (2025).
Ko, W., Ma, C., Nguyen, G. D., Kolmer, M. & Li, A. Atomic-scale manipulation and in situ characterization with scanning tunneling microscopy. Adv. Funct. Mater. 29, 1903770 (2019).
Piquero-Zulaica, I. et al. Engineering interfacial quantum states and electronic landscapes by molecular nanoarchitectures. Rev. Mod. Phys. 94, 045008 (2022).
Han, X. et al. Atomic manipulation of the emergent quasi-2D superconductivity and pair density wave in a kagome metal. Nat. Nanotechnol. 20, 1017–1025 (2025).
Sierda, E. et al. Quantum simulator to emulate lower-dimensional molecular structure. Science 380, 1048–1052 (2023).
Khajetoorians, A. A., Wegner, D., Otte, A. F. & Swart, I. Creating designer quantum states of matter atom-by-atom. Nat. Rev. Phys. 1, 703–715 (2019).
Zhao, C. et al. Spin excitations in nanographene-based antiferromagnetic spin-1/2 Heisenberg chains. Nat. Mater. 24, 722–727 (2025).
Zhao, C. et al. Tailoring magnetism of graphene nanoflakes via tip-controlled dehydrogenation. Phys. Rev. Lett. 132, 046201 (2024).
Böckmann, H. et al. Direct observation of photoinduced tautomerization in single molecules at a metal surface. Nano Lett. 16, 1034–1041 (2016).
Ladenthin, J. N. et al. Force-induced tautomerization in a single molecule. Nat. Chem. 8, 935–940 (2016).
Sun, Q. et al. Inducing open-shell character in porphyrins through surface-assisted phenalenyl π-extension. J. Am. Chem. Soc. 142, 18109–18117 (2020).
Hla, S.-W., Bartels, L., Meyer, G. & Rieder, K.-H. Inducing all steps of a chemical reaction with the scanning tunneling microscope tip: towards single molecule engineering. Phys. Rev. Lett. 85, 2777–2780 (2000).
Zhong, Q. et al. Constructing covalent organic nanoarchitectures molecule by molecule via scanning probe manipulation. Nat. Chem. 13, 1133–1139 (2021).
Albrecht, F. et al. Selectivity in single-molecule reactions by tip-induced redox chemistry. Science 377, 298–301 (2022).
Shiotari, A. et al. Strain-induced skeletal rearrangement of a polycyclic aromatic hydrocarbon on a copper surface. Nat. Commun. 8, 16089 (2017).
Zhu, Z. et al. A deep-learning framework for the automated recognition of molecules in scanning-probe-microscopy images. Angew. Chem. Int Ed. 61, e202213503 (2022).
Li, J. et al. Machine vision automated chiral molecule detection and classification in molecular imaging. J. Am. Chem. Soc. 143, 10177–10188 (2021).
Priante, F. et al. Structure discovery in atomic force microscopy imaging of ice. ACS Nano 18, 5546–5555 (2024).
Seifert, T. J. et al. Chirality detection in scanning tunneling microscopy data using artificial intelligence. Small Methods 8, 2400549 (2024).
Zhu, Z. et al. Autonomous scanning tunneling microscopy imaging via deep learning. J. Am. Chem. Soc. 146, 29199–29206 (2024).
Diao, Z. et al. AI-equipped scanning probe microscopy for autonomous site-specific atomic-level characterization at room temperature. Small Methods 9, 2400813 (2025).
Wang, S., Zhu, J., Blackwell, R. & Fischer, F. R. Automated tip conditioning for scanning tunneling spectroscopy. J. Phys. Chem. A 125, 1384–1390 (2021).
Rashidi, M. & Wolkow, R. A. Autonomous scanning probe microscopy in situ tip conditioning through machine learning. ACS Nano 12, 5185–5189 (2018).
Li, Y. et al. Self-driving laboratory for accelerated on-surface synthesis under ultrahigh vacuum. Nano Lett. 25, 11609–11617 (2025).
Su, J. et al. Intelligent synthesis of magnetic nanographenes via chemist-intuited atomic robotic probe. Nat. Synth. 3, 466–476 (2024).
Wu, N. et al. Precise large-scale chemical transformations on surfaces: deep learning meets scanning probe microscopy with interpretability. J. Am. Chem. Soc. 147, 1240–1250 (2025).
Ramsauer, B. et al. Autonomous single-molecule manipulation based on reinforcement learning. J. Phys. Chem. A 127, 2041–2050 (2023).
Grill, L. et al. Nano-architectures by covalent assembly of molecular building blocks. Nat. Nanotechnol. 2, 687–691 (2007).
Yuan, S. et al. Applying a deep-learning-based keypoint detection in analyzing surface nanostructures. Molecules 28, 5387 (2023).
Ronneberger, O., Fischer, P. & Brox, T. U-Net: Convolutional networks for biomedical image segmentation. In MICCAI (eds Navab, N., Hornegger, J., Wells, W. M. & Frangi, A. F.) 234–241 (Springer International Publishing, Cham, 2015).
Haarnoja, T. et al. Soft actor-critic algorithms and applications. Preprint at http://arxiv.org/abs/1812.05905 (2019).
Civita, D., Timm, M., Schwarz, J., Hecht, S. & Grill, L. Bond dissociation dynamics of single molecules on a metal surface. ACS Nano 19, 10255–10262 (2025).
Wang, J. & Uchibe, E. Reward-punishment reinforcement learning with maximum entropy. In 2024 International Joint Conference on Neural Networks (IJCNN) 1–7 (eds Hirose, A. & Ishibuch, H.) (IEEE, 2024).
Lin, Y. et al. Invariant transform experience replay: data augmentation for deep reinforcement learning. IEEE Robot. Autom. Lett. 5, 6615–6622 (2020).
Su, X. et al. Fabrication of spin-1/2 Heisenberg antiferromagnetic chains via combined on-surface synthesis and reduction for spinon detection. Nat. Synth. 4, 694–701 (2025).
Yuan, Z. et al. Fractional spinon quasiparticles in open-shell triangulene spin-1/2 chains. J. Am. Chem. Soc. 147, 5004–5013 (2025).
Tenorio, M. et al. Coordinative self-assembly of π-electron magnetic porphyrins. Angew. Chem. Int. Ed. 64, e202420572 (2025).
Kalff, F. E. et al. A kilobyte rewritable atomic memory. Nat. Nanotechnol. 11, 926–929 (2016).
Acknowledgements
This work was supported by the National Natural Science Foundation of China (Nos. 22072086 and 22302120).
Author information
Authors and Affiliations
Contributions
Q.S. conceived and supervised the project. Z.Z. and H.J. prepared the samples, and Z.Z., Q.H., T.Y., and H.J. performed the measurements. Z.Z. developed the customized STM control code. The machine vision models were constructed and trained by Z.Z., S.Y., and J.X. Figures were prepared, and the manuscript was drafted by Z.Z., Q.S., and L.C., with all authors contributing to the discussion and revision of the final version.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Communications thanks Oliver Hofmann, Bernhard Ramsauer, and the other, anonymous, reviewers for their contribution to the peer review of this work. A peer review file is available.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Source data
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, 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 licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence 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 licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Zhu, Z., Huang, Q., Yang, T. et al. Deep learning drives autonomous molecular reactions with single-bond selectivity in tetra-brominated porphyrins on Au(111). Nat Commun (2026). https://doi.org/10.1038/s41467-026-69080-1
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41467-026-69080-1