In this article, a novel optimization-assisted deep learning (OptiA-DL) strategy is proposed to effectively measure the temperature of visible heat sources. Initially, the image is acquired from the heat source and filtered using gelatin paper. The guided co-operative trilateral filter (GCTF) is used for image smoothening and HSV (Hue, Saturation, Value) or RGB (Red, Green, Blue) structure for colour transformation. Then, an improved Gaussian mixture model (IG-MM) is applied to segment the image into various portions. Accordingly, the compact split attention-based convolutional waderhunt autoencoder network (CSAtt-CWAN) is used for temperature prediction. In CSAtt-CWAN, the parameters are tuned using the waderhunt optimization algorithm (WHOA). The proposed OptiA-DL strategy is implemented in the Python platform through the candle flame dataset and assessed the performance in terms of different evaluation measures. Moreover, a proposed OptiA-DL's performance is compared with existing methods to determine its efficiency in temperature measurement. The minimum mean square error (MSE) value obtained by the proposed OptiA-DL strategy is 0.076, which is lower than the existing methods for measuring the temperature of the visible heat source.