In situ online observation of surface morphology during degradation processes is of paramount importance for exploring the stability of organic photovoltaic materials. In this study, we designed an in situ online characterization system based on hyperspectral and neural network technologies, and observed the degradation processes of P3HT:PCBM thin film materials. The system is capable of collecting hyperspectral image data from 101 channels within the 400–700 nm wavelength range for characterizing detailed surface features of materials. Additionally, to automate the processing of hyperspectral image data, we designed a spectral image segmentation algorithm based on neural networks and proposed a foreground attention mechanism to improve the segmentation accuracy of the algorithm. The experimental results indicate that the system can achieve high spectral characterization of P3HT:PCBM thin film materials and automate image data processing through artificial intelligence algorithms, with an image segmentation accuracy of 99.62 %. Furthermore, owing to the higher spectral resolution of this system and its computer-assisted analysis capabilities for material image data, not only are the in-situ variations in size, density, and formation rate of aggregates formed during the thermal degradation process of P3HT:PCBM thin film materials experimentally analyzed, but also the fluorescence changes at the edges of aggregates during the photodegradation process are revealed. The reliable code can be found at the following link: https://github.com/HyperSystemAndImageProc/IONFMDP-UHHNN.