## 1 Introduction  
In human society, a fire is one of the most damaging disasters, and it can originate from natural causes or human activities via climate change. Fires cause loss of life and property and have posed a serious problem for humanity as a whole for centuries. The National Interagency Fire Center provides statistics on wildfires (i.e., the number of fires and the area burned, in acres) in the United States of America in the years 2014-2023. The data show that in 2020, there were 58,950 fires and 10,122,336 acres burned, and in 2017, there were 71,499 fires and 10,026,086 acres burned [1, 2]. Traditional fire alarm systems use multiple sensors for detecting heat, temperature, smoke, etc. [3, 4, 5]. These systems primarily determine the presence of fire based on the signals detected by the sensors, which play an important role in real-time fire detection. However, these sensor-based fire alarm systems can be prone to frequent false alarms due to water vapor, dust, etc. [6]. Such false alarms incur social costs as well as the cost for unnecessary usage of firefighting resources and can make it difficult to respond quickly to actual fires. In particular, sensor-based systems have limitations in detecting fires in the early stages, as they can only detect fires after they have already started. To overcome these limitations, recent research has focused on image-based fire detection systems that utilize computer vision techniques. Computer vision technology can analyze images captured by cameras to visually recognize smoke, flames, or heat; such recognition allows rapid determination of the occurrence of a fire [7], while this technology has the potential to enable more precise detection and provide warnings at an earlier stage of fire compared to traditional sensor-based systems, image-based systems also have limitations, such as the need for a large amount of training data, a lack of infrastructure to handle the data, and data privacy concerns. In particular, large-scale image-based learning requires large amounts of data, which can impose a heavy burden on data processing and storage infrastructure. Further, since these data are mainly collected from closed-circuit television (CCTV) or other imaging devices, there is a possibility of violating individual privacy. To solve these problems, federated learning (FL) methods that can maintain high performance while protecting data privacy in distributed environments have attracted attention [8]. In this paper, we propose a new approach for fire classification, namely, an FL structure using image clustering techniques. In this structure, a vision transformer (ViT) is used to extract important features from images and group the data through clustering to achieve more accurate fire classification. Unlike traditional convolutional neural network (CNN)-based models, the ViT model is a powerful model that can better learn the global features of images by dividing them into image patches and learning the relationships between patches using the transformer structure. ViT models achieve high performance, especially on large-scale data. We utilized these characteristics to build models that can accurately classify images into three classes: fire, smoke, and normal. In this study, we applied the ViT model to an FL environment, which is designed to train the data of each client individually without sending the data to a central server. The core of the system works by allowing each client to train independently on its own dataset and then send only the weights of the resulting model to the server. This allows for collaborative model learning to improve the performance of the global model while protecting data privacy. Initial training is performed on the server using a pretrained model, and the server and client train on that model to extract features from the image effectively. The client passes the weights to the server, and the server updates the global model based on the data it receives from the client and passes the model back to the client, and this process is repeated.