In smart cities, fire can have disastrous effects, destroying property and putting residents' lives in danger, making it difficult to identify fire in real time because of the accuracy and speed constraints of traditional fire detection techniques. To address this issue, an accurate and cost-effective system that can be used in almost any fire detection scenario was developed. A CNN was used to analyze live video from a fire monitoring system to identify fire. An object identification model for deep learning called You Only Look Once (YOLOv8) was used to detect fire. To identify and alert videos from CCTV footage, a dataset of video frames with flames is used. After pre-processing the data, CNN is used to build a Machine Learning (ML) model. The methodology adopted in this study demonstrated the ability to adjust to various situations.