The trichome trait is one of the important phenotypes for variety classification and breeding improvement of Chinese cabbage (Brassica campestris L. syn. B. rapa). However, obtaining the number of trichomes per unit area on leaves is a time-consuming and laborious detection work, especially when hundreds of germplasm resources need to be evaluated. Therefore, this study constructed the first diverse Chinese cabbage trichome dataset called CCTD with10,955 RGB images and proposed a deep learning model for trichome detection called TRI-YOLOv8. By adding the RepVGG module in the Backbone, adding a new detection layer in the Neck and replacing the loss function with Normalized Gaussian Wasserstein Distance Loss, the detection performance of the model for small trichomes was effectively improved. At the same time, Ghost convolution was used to reduce memory consumption and speed up inference. The experimental results showed that TRI-YOLOv8 outperformed other classical detection models. AP50 was as high as 94.4%, which was 3.8% higher than YOLOv8n. Furthermore, the number of trichomes per unit area was obtained by TRI-YOLOv8 and combined with genome-wide association study and selective sweep analysis, the candidate gene BraA03g029740.3.5C (STP7) was screened out. Overall, this study achieved the accurate detection and counting of trichomes, and provided a feasible plan for breeders to digitally analyze phenotypes, automatically identify and screen Chinese cabbage germplasm resources.