AbstractHaugh unit (HU) is an important freshness indicator of eggs. In order to detect HU nondestructively and rapidly, hyperspectral imaging (HSI) technology was employed in this study. A total of 350 newborn pink‐shell eggs were stored at 25°C and were measured every 3 days by HSI system in the spectral range of 401–1,002 nm. A method of combing leverage value with Cook's distance was used to eliminate outlier samples. The feature wavelengths related to HU were mainly between 530 and 800 nm identified by successive projections algorithm (SPA) and bootstrapping soft shrinkage (BOSS). Finally, a harris hawks optimization support vector regression (HHO‐SVR) model was proposed to predict the HU of egg samples, and compared with GA‐SVR, ABC‐SVR, and GWO‐SVR. The results showed that the HHO‐SVR has higher prediction accuracy and stronger robustness, withR2pof 0.9523 and RMSEP of 3.0423. The brown‐shell egg was also taken as the research object to further verify the universality of the proposed methods, and the result indicates that the potential of HSI technology as a nondestructive tool in egg freshness detection.