Smoke detection technology is of great significance in the field of fire safety, aiming at the timely detection of smoke released from fires or other combustion events to safeguard people's lives and properties. In this paper, a smart smoke alarm device is developed based on AI algorithm using UCL open source dataset, which is processed by AI recognition after collecting data through IoT to achieve accurate judgement of smoke situation. The dataset is divided by 6:4 ratio, and the training set confusion matrix shows that all 1159 smoke alarm tests are correctly predicted, of which 445 times predict no smoke and 714 times predict smoke, with an accuracy rate of 100%. The test set confusion matrix shows that only 1 out of 1158 tests was incorrectly predicted, of which 184 predicted no smoke, 312 predicted smoke, and 1 was misjudged as no smoke even though it should have been smoke, with an accuracy rate of 99.7%. The successful application of this technology provides a reliable guarantee for fire warning and demonstrates the great potential of AI in the field of security.