A crucial natural resource that directly affects the ecology is forests. Forest fires have become a noteworthy problem recently as a result of both natural and man-made climatic changes. A smart city application that uses a forest fire discovery technology based on artificial intelligence is provided in order to prevent significant catastrophes. A major danger to the environment, animals, and human lives is posed by forest fires. The early detection and suppression of these fires is crucial. This work offers a thorough method for detecting forest fires using advanced deep learning (DL) algorithms. Preprocessing the forest fire dataset is the initial step in order to improve its relevance and quality. Then, to enable the model to capture the dynamic character of forest fire data, long short-term memory (LSTM) networks are used to extract useful feature from the dataset. In this work, weight optimisation in LSTM is performed using a Modified Firefly Algorithm (MFFA), which enhances the model's performance and convergence. The Variational Autoencoder Generative Adversarial Networks (VAEGAN) model is used to classify the retrieved features. Furthermore, every DL model's success depends heavily on hyperparameter optimisation. The hyperparameters of an VAEGAN model are tuned in this research using the Waterwheel Plant Optimisation Algorithm (WWPA), an optimisation technique inspired by nature. WPPA uses the idea of plant growth to properly tune the VAEGAN's parameters, assuring the network's peak fire detection performance. The outstanding accuracy (ACC) of 97.8%, precision (PR) of 97.7%, recall (RC) of 96.26%, F1-score (F1) of 97.3%, and specificity (SPEC) of 97.5% of the suggested model beats all other existing models, which is probably owing to its improved architecture and training techniques.