## 3 Proposed Approach
In these steps, the false detections in identifying facial expressions are minimized and the positions of the eyes and the mouth are accurately determined. Furthermore, through the skin segmentation, the face and non-face images are recognized and then separated. The collected data are used for monitoring the eyes and for detecting the possible yawing phenomenon, and a software (SVM) elaborates these monitored elements, and when the elaboration is done, having an assessment of the sleepiness the SVM gives an alarm or if it does not detect any problem, it continues to capture the face of the worker. The assessment of the sleepiness is made on the image comparison. In particular, the eyes and the mouth are compared to the images present in a database embedded in the software, so the software associates the detected image to a specific image present in the database to which it is, finally, associated with a sleepiness level. The status and the specific region of the eyes are identified in every frame through the correlation coefficient template matching method, and by considering the variations to the connected pixels and the similarity ratio to the eye pixels. In Figure 3, it is reported, for example, the parameters used for the sleepiness assessment about the eyes. Figure 2: Logical framework of the proposed approach. For detecting the yawning phenomenon, instead, the mouth area is identified used K means clustering and tracked using correlation coefficient template matching. In the following figure, we represent what it is recognized as sleepiness and not sleepiness when the software evaluates the yawing and the eyes closing. We chose to classify the outcomes as follows. * Non-Fatigue (NF): the program detects that the subject is not fatigued; both eyes are recognized as open while the mouth is closed (there is no yawn). * Fatigue (F): the program detects fatigue in the subject, detecting poor opening or closing of the eyelids and possibly yawning, both eyes, even if scarcely open, are recognized as closed. * Not Detected (ND): the program cannot identify the subject's face, so it is impossible to extract the images related to eyes and mouth; in the console, the outcome of the last survey carried out remains visible. * False Fatigue (FF): the program recognizes the fatigued subject even when it is not shown by a visual check. This happens when the direction of the gaze changes, especially downwards. In the condition represented in Figure 4 it is possible to see a redundancy of signals given by the yawing and the eyes' closure in the same instant, this condition, for sure, is identified as very dangerous and the software will give the command to start the alarm to avoid any consequence to the sleepiness arising. This program was selected from the possibilities available, as the Matlab(r) computing environment was considered the most versatile and appropriate to the concepts of Machine Learning. It was also  
Figure 4: Face areas identified by the software for an avatar (eyes and mouth). Figure 3: Example of eye-opening ratio calculation. found to be the simplest to use without requiring any specific expertise, a feature that can be considered interesting for possible future use in production contexts where training for the use of these technologies could be expensive. As underlined in the introduction to this paper the problem of the fatigue detection in the production context is a worth issue to be faced to properly face the issues related to the safety and productivity during all the time span of a working shift that can be performed in the morning, in the afternoon and the night. As it is not possible to modify the circadian rhythm of each worker that could lead to a modification of the fatigue curve, this study wants to cover a lack of the actual HRA methods about the fatigue assessment, that are linked, as previously demonstrated to the sleepiness of a person, trying to give a measure of the sleepiness.