# Efficient Online Engagement Analytics Algorithm Toolkit That Can Run on Edge
## 2 Related Works
### Eye Blink Detection  
Eye blink detection is important in various fields of research, including facial anti-spoofing, physical and mental health assessment, and human-computer interaction. By accurately detecting and analyzing eye blinks, researchers can gain insights into a person's cognitive and emotional states, detect potential security threats, and design more intuitive and user-friendly interfaces. A vision-based human-computer interface that uses eye blinks as control commands on a consumer computer is described in [51]. The detection of Deepfakes using eye blink patterns, as demonstrated in [52; 53], highlights the utility of eye blink detection for proctoring purposes. Research on drowsiness detection [54] and eye fatigue detection [55] show that it is also useful for detecting physical and mental health problems and analyzing attentiveness and behavior. In visual systems, traditional image processing techniques are used to detect eye blink. The proposed interface in [51] only uses image processing techniques, including Haar-like features for face detection and template matching for eye tracking and eye blink detection, to detect and interpret eye blinks. The system requires template images of the user's eyes for initialization unlike deep learning models. The author of [56] utilized deep Convolutional Neural Network (CNN) to detect eye blinks. Apart from a deep learning approach, the authors of [57] used Active Shape Model (ASM) to extract the facial features for eye blink detection. The usage of facial landmarks for eye blink detection can be found in [58; 59; 60]. Among sensor-based approaches, a study [61] developed a system called BlinkListener for detecting eye blinks using acoustic signals (chirps signals from a speaker) in a contact-free manner. The authors of [62; 63] discuss the impact of eye blink artifacts on EEG data and the development of algorithms for detecting and correcting these artifacts. Eye blinking EOG signals were incorporated to improve existing EEG-based biometric authentication [64]. The authors of [65; 66; 67], used EOG sensors to track eye movement and detect eye blinks. These methods sometimes require dedicated hardware in order to detect eye blink and require EOG goggles, which may not suitable for the general public. In this paper, the authors chose the facial landmarks approach for detecting eye blink as it saves computation time since face orientation detection already relies on them. Regarding the eye blink detection using facial landmarks, the authors of [58] proposed a well-known metric, eye aspect ratio (EAR, Equation (2)) computed from six salient landmarks around the eye (as shown in Figure 1) to detect whether a person's eyes are open or closed. \[EAR_{left}=\frac{||L^{160}-L^{144}||_{2}^{2}+||L^{158}-L^{153}||_{2}^{2}}{2||L^ {33}-L^{133}||_{2}^{2}} \tag{2}\]  
\[EAR_{right}=\frac{||L^{385}-L^{380}||_{2}^{2}+||L^{387}-L^{373}||_{2}^{2}}{2||L^ {362}-L^{263}||_{2}^{2}} \tag{3}\]  
An alternative approach, as demonstrated in [57], is that eye blinks can be detected by simply calculating the average of three vertical eyelid distances. The authors of [59] improved the robustness of a single eyelid distance in eye blink detection by smoothing the distance signal with a Savitzky-Golay (SG) filter and taking the duration of the eye blink into consideration. Additionally, according to the experimental results presented in this paper, a single vertical eyelid distance can perform comparably and better in terms of F1 score to the Eye Aspect Ratio (EAR) method (see the results in Section 4.2) in detecting eye blinks if the adaptive threshold of eye blink is calculated from face orientation. As suggested in [68], the head orientation indeed correlates to perceived eye openness and the correlation is statistically proven and explained by a non-linear regression (see Section 3.3). Nonetheless, EAR is a commonly used method when it comes to detecting eye blinks using facial landmarks.