Timely and accurate fault diagnosis of transmission systems is crucial to ensuring the systems’ reliability, safety, and economic viability. However, intelligent fault diagnosis algorithms require a lot of labeled data for training, which may not be available and accessible, especially for many critical devices. This hinders the application of some excellent diagnosis methods in real industry. Digital twin (DT), as an advanced cyber-physical integration method, can be utilized to generate rich fidelity data with virtual models to overcome the dilemma of insufficient data, especially for the small sample problem. We propose the DT library to model the mechanical transmission system with various faults for the data augmentation of the small sample problem. In the library, common components in mechanical transmission systems are modular and digitalized into several differential equations. They can compose a mechanical transmission system digital twin (TSDT) and be injected with various faults to simulate the transmission signal, and even replace the physical experimental platform. The simulation data is used as a pre-training dataset, which can be imported into the transfer learning method for the fault diagnosis. After several verifications, it can be concluded that the simulation data from TSDT is effective in transfer ability and fault feature learning, which significantly improves fault recognition accuracy in the small sample problem.