Voids are unavoidable during the manufacturing of 3D braided composites. This study proposes an unsupervised machine learning method combined with micro-computed tomography (micro-CT) scanning and a progressive damage analysis to analyze defects in these composites at a trans-scale level. The method enables the creation of real multiscale models and the determination of the porosity in both the intra-yarn (1.52 %) and inter-yarn (5.04 %) planes. Here, the unsupervised machine learning method is introduced in a trans-scale damage analysis to reduce calculation dimensions and to visualize the clustering data. A user-defined material subroutine (UMAT) is also developed to implement the trans-scale damage model. The experimental validation of the simulation results demonstrates the effective trans-scale damage analysis, showing the predominant pull-shear damage in the yarns, which is primarily located at the interfaces both between the yarns and between the yarns and the matrix. Finally, based on the scanned geometric data the degradation in modulus and strength of 3D braided composites with porosity is studied.