With the rapid development and maturity of the smart industry, smart home security systems are becoming popular. However, problems such as poor optimization under face recognition integration and high latency of smart home gesture recognition control still exist. In this paper, in response to the problems raised above, the more mature CNN algorithm and OT prime tracking algorithm are used for face recognition, and the Euclidean distance is introduced as the adjustable threshold for face recognition, and its recognition response time is 29-30ms; in gesture recognition, the mathematical model of finger angle recognition is used for gesture recognition, based on the Mediapipe open source framework, and in the experiment, its recognition time tends to be 60-100 frames, with an average response time of 61.75ms. These advances in facial and gesture recognition in home security systems provide faster and more accurate recognition, thereby enhancing the owner 's safety measures. The results of this study provide relevant insights into the development of smart home security systems and their implementation in real-world scenarios.