Since the hot spot effect can damage photovoltaic (PV) modules, early detection and resolution of hot spot issues through the detection and measurement of hot spots formed by abnormal temperatures are crucial to ensure the normal operation of PV modules and maximize their power generation efficiency. Aiming at the thermal infrared output characteristics of PV modules caused by abnormal temperatures, this paper proposes an infrared hot spot detection method. Firstly, the output infrared image characteristics of PV modules under the influence of hot spots are analyzed using an equivalent circuit diagram. Secondly, an unmanned aerial vehicle (UAV) - mounted infrared detection device is employed to collect infrared thermal images of PV modules, and the Canny edge detection algorithm is used to extract abnormal features from the images. Finally, a grayscale histogram is constructed to highlight the hot spots on PV modules, and the random forest algorithm is applied to realize hot spot detection for PV modules. Experimental results show that the average hot spot detection error of the proposed method is less than 0.2 mm; the F1 - Score remains above 0.92, the accuracy rate is higher than 95%, and the recall rate is increased to 99%. The proposed method can effectively detect hot spots on PV modules, featuring high accuracy and recall rates, and optimizes the detection performance for hot spots caused by abnormal temperatures on PV modules.