Fungal infections cause the considerable losses in apple production and quality. Given its ability to perceive external and internal characteristics, hyperspectral imaging (HSI) performs well in detecting fungal infections in apples. However, high cost, time-consuming operation, and complicated processing limit the widespread application of HSI. This study proposes a novel detection method, that uses the hyperspectral transformation (HT) of RGB images, for detecting fungal infection in apples. Wiener estimation, pseudo-inverse and kernel regression (KR) were adopted to perform HT to transform the responses of RGB images into pseudo reflectance spectra (PRS). And the effects of RGB responses, band ranges and spectral resolution were further discussed. KR obtained the optimal HT and the resultant PRS in the range of 400–1000 nm and with a resolution of approximately 2.5 nm were close to the original reflectance spectra of HSI with a mean root mean square error of 0.050, the mean relative error of 12.17 %, and peak signal-to-noise ratio of 72.66. The obtained PRS were then combined with machine learning to classify the category and degree of fungal infection in apple fruit. The best category recognition was obtained by random forest and PRS. The accuracy of the calibration set (ACCC), validation set (ACCV) and prediction set (ACCP) were 93.31 %, 80.95 % and 83.33 %, respectively. The best determinations of degree of infection by Botrytis cinerea and Rhizopus stolonifer were obtained using k-nearest neighbor, convolutional neural network and PRS, resulting in an ACCP of 90 % for each model. The proposed method achieved a convenient, low-cost, and accurate detection of fungal infection types and degree in apple fruit and is expected to be useful for analysing the quality of other agricultural products.