Advancements in machine learning have been applying deeply and widely in numerous fields. Face recognition is among the most productive image processing applications and has a pivotal role in the technical field. This work leverages machine learning methods and information systems to present a framework for student attendance combining machine learning-based face recognition algorithm and relational databases to store, recognize, and record student attendance. The proposed method is tested on various scenarios and is expected to apply in practical cases. The investigation is done by Histogram of Oriented Gradients (HOG) for face detection and by using cosine distance to recognize faces. The purpose of this study is face recognition in real-time i.e. using a webcam, camera of the mobile device, and from a photograph or from a set of faces tracked in a video. We measured the distance between the landmarks and compared the test image with different known encoded image landmarks in the recognition stage. Face Recognition includes extracting features and then recognizing it, in any case, such as brightness, transformations as translation, rotation, and scale image. HOG algorithm is used to detect faces .