On the mesoscopic scale, granular matter is tessellated into contact loops by a contact network. The stability of granular matter is highly dependent on the evolution of contact loops, including the number and area evolutions of contact loops with different geometric shapes (which can reflect the mechanical variables in the macroscale). For the features of numerous loops with complex geometry shapes in contact network images, a contact loop recognition and determination technique was developed in this study. Then, numerical biaxial compression tests were performed by the discrete element method (DEM) to investigate how the meso-structural indexes evolve along with the macro-mechanical indexes. The results show that the proposed Q-Y algorithm is effective in determining the geometric types of contact loops from contact network images. The evolution of contact loops is most active in the hardening stage, during which the number percentages of L3 (loops with three sides) and L6+ (loops with six or more sides) show opposite evolution patterns. For the area percentage, only L6+ increases while others decrease. Considering the meso-structural indexes (number percentage and area percentage of loops) are sensitive to the change of macro-mechanical indexes (deviatoric stress, axial strain, and volumetric strain) in the hardening stage. Multivariate models were established to build a bridge between the meso-structure and the macro-mechanics.