• Propose a deep learning-based method Transformers Enhanced Segmentation Network. • Adopt multi-stage architecture to provide high-quality target detection. • Introduce Transformer into the mask head to provide high-quality segmentation. • Proposed method is fully automated and provides humanoid particle size measurement. • Provide a solution for nanoparticle size measurement under complex situations. The size of nanoparticles has a great influence on the properties of nanomaterials. Transmission electron microscope (TEM) is the most reliable and intuitive way to observe the size of nanoparticles but is only suitable for separated particles under existing traditional algorithms and deep learning methods. Therefore, we proposed a Transformers Enhanced Segmentation Network (TESN) to accurately segment nanoparticles. Based on Mask R-CNN, TESN introduces the multi-stage architecture and adopts hybrid CNN-Transformers architecture as the mask head. TESN shows excellent performance in the segmentation even under complex situations such as multiple nanoparticles overlap or nanoparticle edge fuzzy, the AP 50:5:95 reaches 0.910 on the test set. We applied TESN to the size measurement of nanospheres and compared with other measurement methods. The results of TESN are closest to the manual annotation, the error of size measurement for the four gold nanospheres with different sizes ranges from 0.38% to 3.52%.