ABSTRACT Terahertz time-domain spectroscopy is a widely used non-contact detection technology with significant potential in the field of non-destructive testing. In this study, the transfer function of the coating system is derived based on the Rouard model and the refractive index of the coating within the transfer function is modelled using the Debye model. The hierarchical thickness of the multilayer composite material is fitted by random optimisation algorithm. Considering the complexity of the objective function and the practical accuracy requirements in engineering problems, the integer genetic algorithm is adopted to find the optimal parameters. The comparison of the ordinary genetic algorithm and the integer genetic algorithm reveals that the integer genetic algorithm requires a significantly smaller population size and computation time than the ordinary genetic algorithm. Furthermore, the predicted thickness obtained by the integer genetic algorithm is more repeatable, has higher computational efficiency, and exhibits smaller errors. Our results indicate that combining the integer genetic algorithm with the Rouard model holds potential applications in thickness measurement of multilayer composite materials.