Chestnut crops are threatened by fungal pathogens such as Gnomoniopsis castaneae, which cause significant degradation of quality. Early detection of such infections is crucial to maintain the quality of chestnuts in the food industry. This study explores the application of Terahertz Time-Domain Hyperspectral Imaging (THz-TDHIS) combined with unsupervised learning techniques to identify fungal infections in chestnuts. Unlike conventional methods that rely on light attenuation, this approach leverages the unique spectral signatures of infected tissues. By employing Principal Component Analysis, K-Means Clustering, and Agglomerative Clustering, we effectively differentiate between healthy and infected portions of chestnuts. Our findings indicate that spectral features, rather than just intensity variations, provide more reliable markers for infection. In addition, we demonstrate that these methods enable the quantification of the degree of infection in chestnuts. The robustness of these unsupervised learning methods in handling large and heterogeneous data sets further underscores their potential in agricultural applications. This integrated THz-TDHIS and machine learning approach presents a promising solution to ensure chestnut quality and safety.