Happiness Measurement through Classroom Based on Face Tracking

Muzhir Shaban Al-Ani

Department of Information Technology, University of Human Development, Sulaymaniyah, Iraq

Corresponding author’s e-mail: Muzhir Shaban Al-Ani, Department of Information Technology, University of Human Development, Sulaymaniyah, KRG, Iraq. E-mail: muzhir.al-ani@uhd.edu.iq
Received: 16-10-2018 Accepted: 23-01-2019 Published: 25-01-2019
DOI: 10.21928/uhdjst.v3n1y2019.pp9-18


Increasing the happiness during class room cause exciting the students to improve their ability of learning. This research focused on the evaluation of the learning process through classroom before and after applying the proposed method. One of the big challenges during classroom lesson, the students after a short period of time (about 10-15 min) at the starting of the class, stop learning and remain absolutely out of understanding. Our goal is to revitalize the classroom environment so that you are always attentive to the lecture. The proposed approach aims to track and detect the emotional facial expression and transient from emotional facial expression to raise the happy expression to reach the classroom happiness. Image processing issue is an important part of this approach in which based on face recognition and tracking, then evaluates the students’ happiness according to the proposed mode that located in the class. This approach is implemented using Raspberry Pi device, high-resolution camera, and high definition screen. The implemented approach allowing you to continue of face tracking and rising the happiness parameters. Raising the happiness scale, leading to improve the ability of students in understanding the lecture. This approach is implemented to cover both software and hardware, so, it is acceptable to work in real time. The main contribution of this work is to raise the happiness of students to increase their understanding during the lecture.

Index Terms: Classroom Lecture, Direct Teaching, Electronic Learning, Happiness Measurement, Rising Happiness


Two thousand and five hundred years ago, the philosophy of happiness was started. The issue of happiness was found with Confucius, Socrates, Buddha, and Aristotle. These thinkers were defining some aspects of happiness and who to find the happiness? These great thinkers have almost the same ideas about the happiness that leading to nice future of modern sciences [1], [2].

Past 10 years, there is significant increase in psychological science of happiness. This leading to wide range of works and projects concentrated in this field. Some of these works dealing with scientific impacts and factors those affecting the level of happiness. The direct and excited application of raising the human happiness was shown in clinical psychology [3]-[5].

Many factors are affecting the level of happiness such as social relationship, financial, employment, culture and living environment, media, and networks. In general, human will be happy according to (Fig. 1) [6]-[9]:


Fig. 1. Happiness of people.

  • Fun (Pleasure).

  • Commitment (Engagement).

  • Social relationships.

  • Sense (Meaning).

  • Achievements (Accomplishments).


Many journal and conference papers are published regarding the field of happiness. These papers are treated the happiness filed in many aspects such as health, education, business, and industry. Below some of these papers:

Sekulova and van den Bergh proposed an empirical study that explored the key factors that determine the satisfaction of life in Barcelona. They examined a sample of 840 people and check how changes in income, including reductions in income, related to the current economic situation in Spain, affect subjective well-being. The declines in income from a year ago have a negative effect on happiness when they are specified in logarithmic and positive terms as a fictitious variable. The divergences of the obtained results were discussed and several explanations were presented. However, both effects are temporary and do not stay more than a year, probably for reasons of adaptation and for a downward adjustment of baseline consumption and income levels [10].

Romo-González et al. (2014) developed a psychoeducational intervention by integrating professional learning with happiness and well-being by teaching healthy lifestyles to the students of Veracruzana University. The positive effects of psychoeducational on the work environment of the students were considered important. They described the effects of psychoeducational on students’ academic programs and their duration overtime. In addition, they explained their effects in rising of a positive education. The result indicated positive effects on applying psychoeducational on student happiness. In addition, applying psychoeducational improved the student performance [11].

Booth (2015) explored how nursing students describe the elements of their nursing education through the social networking platform of Twitter. The websites about courses, classes, and nursing courses were compiled in October 2011 and analyzed. A total of 498 tweets were collected during a collective 6-day period and 189 tweets were coded into five thematic presentations. Nursing students analyzed various elements related to their nursing education, including events and situations that they perceived as positive exciting. Messages about stress and discomfort were also mentioned as an important issue expressed by nursing students when describing their studies [12].

Vinichuk and Dolgova (2016) examined the image of happiness in children with different levels of creativity. The results of the survey leading to clarify the differences in attitude toward happiness expressed in images drawn by preschool children. Very creative children interpret happiness as an emotional phenomenon; in addition, the result indicated that the image of happiness is built with social interaction and a focus on others. Non-creative children associate happiness with the satisfaction of their material needs; in addition, the result indicated that the image of happiness is impersonal, concrete and does not focus on others [13].

Salavera et al. (2017) purposed an approach to describe the coping strategies adopted by adolescents in different stressful situations that occur in their daily lives, as well as their perception of happiness. This approach was applied on the first- and fourth-stage students of compulsory secondary education whom attended different high schools; then, these data are analyzed and evaluated. The study sample consisted of 1402 students (711 men and 691 women) from 11 to 18 years old. The results showed differences between the genders and years of schooling in the strategies adopted to deal with stress. In addition, the happiness decreases with age. Coping strategies that treat others and unproductive coping strategies have influenced happiness, in contrast to productive coping strategies [14].

Kamthan et al. (2018) conducted a study among 115 second-stage medical students at Subharti Medical College. The Oxford Happiness Questionnaire model was implemented to collect the data, which was distributed to the second-stage students at that college during the study sessions. The data were analyzed using Chi-square test and descriptive statistics. The distribution of happiness in relation to the basic characteristics showed that 60.8% of the selected medical students were in a happy group. The happiness of male students reaches to 52% while female students reach to 48% [15].


Classroom competition depends on many aspects and manages by many factors [16], [17]. The teacher and the student are the two important issues in the educational process (considering the surrounding environment) [18], [19]. After few minutes of the scientific lesson, this should be stopped to restore the process of understanding [20], [21]. Human competence is defined as competition in which two or more people participate, where generally the winner will be only one or a few participants and others do not win [8], [22]. Some of us have excellent experiences with students’ competition, while others think it is not pleasant [23], [24]. Adults reproduce the ideas of competence as students and then apply these ideas to teach the trainers (students and children) [25], [26].

Some aspects are considered in determining the benefits of competition in the classroom [27].

  • Good results of competition will have more dangerous effects during competition in classroom for symbolic results.

  • The competition has a beneficial effect in short life. The duration of the contest increases their sense of importance and decreases the feeling of intensity and pleasure, both unusual effects.

  • The competency manager should focus on the product process. If victory is the point, students take a single gesture regardless of attitude.


Happiness is an important factor through education and it may take seriously, and below some of the important issue regarding this factor [9], [28].

  • First, happiness in education concentrates on the teacher, students, classroom, and the teaching context. The formal educational methods deal with the whole person then offers other opportunities and experiences [29].

  • Second, happiness in education engages with informal education, dialogical forms of educating and community learning [30].

  • Third, happiness in education covers large areas of national and state curricula and seeking out approaches and subjects that do not alienate [31].

  • Fourth, happiness in education requires the possibility of easy to use and access to needed materials and information so that those who are troubled have a means to come an understanding of themselves and their situation [32].


Face expressions are an important factor to determine the human situation (happy or sad face) [33]. Hence, it is important to study the facial features to analysis the human situation that is the key factors in this subject [34]. In general, human happiness based on facial expression analysis is an effective method which is an important method to recognize the human attitude [35]. Several methods, tools, and techniques are explained and these methods are regarding to a certain criteria [36]. Thus, there is powerful guide for the standard facial expressions of seven emotions: Fear, joy, anger, sadness, contempt, disgust, and surprise [37], [38].

Science of people has a wide range of applications and it is an important part of our life [39]. Face and facile recognition are the most important indicators of human emotions [40]. Emotions are leading to face reading that allowing other people to glimpse into our minds as they read face in the light of changes in key face features such as eyes, eyebrows, eyelids, nose, and lips [41]. To understand the human face and the non-verbal human behavior, it is important to go deep in microexpressions reading [42]. Human microexpression deals with the details of facial expression [43]. In general, there are seven universal human microexpressions based on face expression: Disgust, sadness, anger, fear, happiness, surprise, and contempt [44]. These microexpressions depend on the face details and these microexpressions occur as fast as 40-60 ms [45].

Happiness based on microexpressions depends on many factors as shown in Fig. 2 [46], [47]:


Fig. 2. Happiness microexpression factors.

  • Lips detection and exactly the corners of the lips are drawn back and up.

  • Teeth expose detection in which mouth may or may not be parted.

  • Wrinkle runs detection that runs from outer nose to outer lip.

  • Cheeks detection which is raised.

  • Lower lid detection that may show wrinkles or be tense.

  • Crow’s feet detection that located near the outside of the eyes.


When man advances in age, the attributes and characteristics of the human face change overtime, where wrinkles appear to lead to confusion in the science of discrimination. As a fact, there is a big difference of emotional facial expressions according to human age groups. To solve these things, we decided to apply this approach on a certain group with near or similar age group. The adaptation of this approach based on the ability of understanding and recognizing the emotional effects. Expressions of human face based on the reflected reaction are divided into seven issues. These expressions deal with many human face aspects such as happiness through classroom. The duration of the normal class lecture may be 50-90 min. Hence, it is important to motivate and excite students each 5 or 10 min through interactive face recognition approach of emotional facial expressions.

6.1. Formation of Happiness

Formation of happiness deals with excitation of human face to reflect their emotional attitude as a main part of happiness that can be applied in the following steps (Fig. 3):


Fig. 3. Steps of happiness.

  • Happiness description.

  • Happiness definition.

  • Happiness doing.

  • Happiness building.

This approach aims to transit from one step to other steps, means from description, definition, doing, and building of happiness.

The implementation of this approach is based on reflecting the capture image into color models, in which the color intensity indicates the darkness and lightness of the indicated color. In addition, three types of colors red, green, and blue are used in this approach. These three main colors are divided into three subdivisions, so we have nine color values that indicated nine levels of happiness as shown in Fig. 4.


Fig. 4. Happiness divisions and colors.

Student faces are detected via the implemented system using certain threshold to separate the face from the background based on skin color difference then tracking these faces to generate the decreasing and increasing of happiness level. Face recognition is an important part in this approach to detect the attitude of human faces to get continuous face tracking. These steps leading to initiate the action to start rising the happiness through classroom are shown in Fig. 5.


Fig. 5. Increasing of happiness.

6.1. Hardware Implementation

Educator and learner are the main two aspects of the educational environment through classroom. One of the important aspect in educational environment is How to improve the information received by the learner. Happiness is an important part of education and it requires the possibility of easy access. Flexibility and easy to use are two main issues that must be considered in this approach. Both hardware and software are required in the implementation of this approach. The hardware part of the system is divided into five parts: Digital camera, input interface, processor, output interface, and LCD as shown in Fig. 6.


Fig. 6. Hardware implemented system.

  • Digital camera: Including high-resolution digital camera that fixed in front of students in the classroom.

  • Input interface: Including the interface device that converting the received data to the processor.

  • Processor (Raspberry Pi): This processor is connected through two interfaces one for the input and other for the output.

  • Output interface: Including the interface device that converting the received data to the LCD.

  • LCD: High-resolution LCD screen with a special size (about 50”) fixed above the whiteboard in the classroom.

6.3. Raspberry Pi

Raspberry Pi introduced and released in the UK, in 2012, that was the first generation (Raspberry Pi I) [48]. The second generation (Raspberry Pi II) released in 2015 with increasing RAM [48]. The third generation (Raspberry Pi III) has more advantage that applied WiFi and Bluetooth [49]. The Raspberry Pi is an embedded microcomputer system that designed in the Laboratory of Cambridge University [49]. These microcomputers devices are used to teach of information technology at schools [50]. The Raspberry Pi uses 700 MHz processor [50] and has 512 MB RAM on model B+ whereas 256 MB RAM on model A [51]. Raspberry Pi is an open-source system that leading to wide range of applications. Raspberry Pi has the ability to work in real time that can be managed at this environment such as capturing and tracking according to the implemented system. Furthermore, Raspberry Pi has a flexible platform that helps in simulation of many applications in our life [51].

The hardware circuit diagram of the implemented system is applied using Raspberry Pi. In this system, you can control and interact with the students at real-time work. The main aspect of this system is the merging between hardware and software to be work on flexible environment and fast processing.

6.4. Implemented Software

Emotional face expressions are very important part of the happiness, so this work concentrated on recognition of emotional face expressions. Fig. 7 shows the block diagram of the implemented software procedure that can be covered in the following steps:


Fig. 7. Emotional facial expressions approach

  • Acquisition and detection of face and lips: Including acquisition the human face then detect the image face using certain threshold based on skin color difference, then compare the area of emotional face expression of human face and lips to detect the differences in gray scale.

  • Recognition of face and lips: including recognizing the detected face and lips then extract the important features based on discrete wavelet transform.

  • Tracking of face and lips: Including tracking and monitoring face and lips by a certain colored rectangular based on the orientation of histogram levels.

  • Interaction with faces: Including interaction between the face displayed on the screen and the original human person to excite them.

  • Measuring of happiness: Including divides this section into many measures depends on the implemented criteria, then, these measures mapped into levels according to the related colors.

  • Levels of colors: The main colors are divided into red (R), green (G), and blue (B), then, each level is divided into three sublevels.


Classroom environment is a complex environment and it is difficult to resizing and measuring the happiness value. Many methods and tests are applied to recognize the happiness value during classroom environment. The final decision concentrated on the effective characteristics of faces and emotions to be the main influence in this area. Many factors of teeth exposed can be merged to express some kind of happiness. The happiness level is divided into three parts according to their values; low (blue), middle (green), and high (red). If most of the student does not care what happens, this leading to low level (blue color). If stimulating students at an intermediate level, this will refresh their memory and they will be within the middle level of happiness (green color). Then, if students are shouting and disturb the overall lecture so may they are out of control, this leading to the high level (red color). This research was concentrated on stage four undergraduate students at the Computer Science Department at Anbar University as shown in Fig. 8


Fig. 8. Sad emotion classroom.

The main idea is concentrated on the tracking faces based on digital smart controlled camera. The procedure is started according to detect active faces then tracking these faces continually that can be the good indication of the happiness. The implemented procedure proposed faces and lips image of sizes 46*46 and 16*31 pixels, respectively. This process based on skin color variation. The happiness values of students are measured through certain criteria mentioned in this method based on emotional movement of faces and lips. Figs. 8 and 9 demonstrate the faces of students and the analysis, respectively. These show the tracking of faces and lips in which it is clear these students at the beginning of the lecture they are totally at sad emotion, so the scale of happiness is appointed on blue color based on the scale color levels. Many factors are applied here to demonstrate the happiness value. Some abbreviations are used here to identify different types of images. C_F1 represents the color first face image, G_F1 represents the gray first face image, and so on. C_L1 represents the color first libs image, G_L1 represents the gray first libs image, and so on.


Fig. 9. Tracking of student faces (sad or not happy).

The proposed system depends on monitoring of face images and tracking the changes happen in that face. Hence, the implemented indicator start rising as some movement happened in the class, and then, at the same time, the level of happiness will rise. The happiness is increased gradually regarding to smile of some students in the class, so the scale reaches the green color. Looking carefully on Fig. 10, you can see the histogram is displaced into right side in which indicated the high level of happiness.


Fig. 10. Tracking of student faces (mid happy).

Significant value of happiness was obtained from Fig. 11, in which it is clear from their emotion of faces that most of them are in smile mode. In addition, the histogram is shifted with about 10% to the right side regarding to the number of pixels in each gray scale, this means to the very high values so the scale appointed on red color. Hence, consequently, the student may be so loudly that disturbs the class, and it needs to control the classroom.


Fig. 11. Tracking of student faces (full happy).


Rising of happiness in classroom is an important issue of teaching and learning in real life and there is a direct privacy between students and lecturers. According to classroom situation, the learners or students may decay in receiving of knowledge after a short time such as 10 or 15 min. At that situation, it is important to excite them to be able to receive the knowledge. This is the main issue that affected the educational process to pull students to the actual lesson. Pulling the attention of students to the lecture is a big challenge in classroom. Hence, many methods are used to realize this issue. These methods are focusing on teaching methods and procedure to implement the lecture. Classroom environment reflects the activities between students and lecturers, so, at the beginning of the lecture, students give their attention to the lecturer and what he displays on the board or data show, then after short time they will be on the other world outside of the lesson. The aim of the lecturer is to excite students to go back to the lesson and raise the proportion of happiness.

The implemented approach is concentrated on applying of image processing in classroom environment to excite students and increase their happiness. The implemented system divided into two parts: Hardware and software. Hardware part includes digital camera, Raspberry Pi, and digital screen. Raspberry Pi is suggested to work in real time. Software part includes image processing and analyzing the results to evaluate the happiness level. This system activates students to collaborate through the lecture that increases the happiness level. This system based on analysis of face microexpression (that stay with 40 ms) to run the overall program at real time. The color scale design is an attractive method that raising the happiness through students. The examined approach based on the histogram that deals with number of pixels in each gray scale (gray level). The threshold value is based on the averaging of gray levels to generate the face emotion. The threshold value is based on the averaging of gray levels to generate the face emotion. These levels indicated the changing in the gray intensity (color levels) to compare that with the happiness scale.


[1]. Chilton, J. “Women and water”. Waterlines Journal, vol. 2, no. 110, pp. 2-4, 1992.

[2]. Buchanan. “Ground water quality and quantity assessment”. Journal Ground Water, vol. 7, no. 7, pp. 193-200, 1983.

[3]. Han, Z. S. “Groundwater resources protection and aquifer recovery in China”. Environmental Geology, vol. 44, 106-111, 2003.

[4]. Yang, S. H., F. Liu, X. D. Song, Y. Y. Lu, D. C. Li, Y. G. Zhao and G. L. Zhang. “Mapping topsoil electrical conductivity by a mixed geographically weighted regression kriging:A case study in the Heihe River Basin, Northwest China”. Ecological Indicators, vol. 102, 252-264, 2019.

[5]. Georges, M. “Part 1 of Cahiers du CENTRE de Morphologie Mathématique de Fontainebleau”. Le Krigeage Universel, École Nationale Supérieure des Mines de Paris, 1969.

[6]. Tomislav, H., B. Branislav, B. Dragan, R. I. Hannes. “Geostatistical modeling of topography using auxiliary maps”. Computers and Geosciences, vol. 34, no. (12), pp. 1886-1899, 2008.

[7]. Ye, H., W. Huang, S. Huang, Y. Huang, S. Zhang, Y. Dong and P. Chen. “Effects of different sampling densities on geographically weighted regression kriging for predicting soil organic carbon”. Spatial Statistics, vol. 20, 76-91, 2017.

[8]. Hengl, T., G. B. M. Heuvelink and D. G. Rossiter. “About regression-kriging:From equations to case studies”. Computers and Geosciences, vol. 33, no. (10), pp. 1301-1315, 2007.

[9]. Goovaerts, P. “Geostatistics for Natural Resource Evaluation”. Oxford University Press, New York, 1997.

[10]. Lark, R.M and B. R. Cullis. “Model-based analysis using REML for inference from systematically sampled data on soil”. The European Journal of Soil Science, vol. 55, 799-813, 2004.

[11]. Seheon, K., P. Dongjoo, H. Tae-Young, K. Hyunseung and H. Dahee. “Estimating vehicle miles traveled (VMT) in urban areas using regression kriging”. Journal of Advanced Transportation, vol. 50, 769-785, 2016.

[12]. Webster, R and M. A. Oliver. “Geostatistics for Environmental Scientists”. 2nd ed. Wiley, Chichester, 2007.

[13]. Keskin, H and S. Grunwald. “Regression kriging as a workhorse in the digital soil mapper's toolbox”. Geoderma, vol. 326, 22-41, 2018.

[14]. Cressie, N. “Statistics for Spatial Data”. John Wiley and Sons, Hoboken, NJ, 1993.

[15]. Lloyd, C.D. “Assessing the effect of integrating elevation data into the estimation of monthly precipitation in Great Britain”. Journal of Hydrology, vol. 308, no. 1-4, pp. 128-150, 2005.

[16]. Huang, C. L., H. W. Wang and J. L. Hou. “Estimating Spatial Distribution of Daily Snow Depth with Kriging Methods:Combination of MODIS Snow Cover Area Data and Ground-based Observations”. The Cryosphere Discussion Paper. vol. 9, 4997-5020, 2015.

[17]. McBratney, A., I. Odeh, T. Bishop, M. Dunbar and T. Shatar. “An overview of pedometric techniques of use in soil survey”. Geoderma, vol. 97, 293-327, 2000.

[18]. Bivand, R. S., Pebesma, E. J. and Gómez-Rubio, V. “Applied Spatial Data Analysis with R”. Springer, New York, 2008.

[19]. Ahmed, R. A. “Multivariate Adaptive Regression Spline Model for Predicting New Wells Groundwater in Sulaimani Governorate”. Master Thesis of Statistic Department, College of Administration and Economic. University of Sulaimani, Kurdistan Region, Iraq, 2014.