Ceiling-mounted fire service systems are the most widely used provisions to ensure building fire safety. Current design distribution of fire detectors is based on semi-empirical correlations derived from open-floor fire experiments, but building floorplan affects their activation. This work develops a generative adversarial network (GAN) model to achieve accurate and real-time fire detection analysis for buildings with complex floorplans. A numerical fire database with hundreds of floorplans, fire locations and ceiling heights is established to train the GAN model. The pre-trained model can recognize geometric characteristics and reveal hidden fire dynamics laws. Given any building floorplan and fire detector distribution, the model can predict ceiling temperature, velocity and soot density fields with an accuracy of 88% in a second and detection time with 95% accuracy. The proposed GAN model enables a smart fire detection analysis, reduces the fire engineering design cost, and improves fire safety for complex buildings.