Latent tuberculosis infection (LTBI) has become a major source of active tuberculosis (ATB). Although the tuberculin skin test and interferon-gamma release assay can be used to diagnose LTBI, these methods can only differentiate infected individuals from healthy ones but cannot discriminate between LTBI and ATB. Thus, the diagnosis of LTBI faces many challenges, such as the lack of effective biomarkers from Mycobacterium tuberculosis (MTB) for distinguishing LTBI, the low diagnostic efficacy of biomarkers derived from the human host, and the absence of a gold standard to differentiate between LTBI and ATB. Sputum culture, as the gold standard for diagnosing tuberculosis, is time-consuming and cannot distinguish between ATB and LTBI. In this article, we review the pathogenesis of MTB and the immune mechanisms of the host in LTBI, including the innate and adaptive immune responses, multiple immune evasion mechanisms of MTB, and epigenetic regulation. Based on this knowledge, we summarize the current status and challenges in diagnosing LTBI and present the application of machine learning (ML) in LTBI diagnosis, as well as the advantages and limitations of ML in this context. Finally, we discuss the future development directions of ML applied to LTBI diagnosis.