# Emotion Recognition in Usability Testing: A Framework for Improving Web Application UI Design
## 3 Results
Analyzing user behavior is essential to understanding how visitors interact with the website, what they do, and how their experience can be improved. The integration was carried out by using the tracking script of both applications on the test website. Figure 7: Real-time emotion recognition test results (under normal conditions without the use of special video/lighting equipment): (**a**) Angry; (**b**) Disgusted; (**c**) Fearful; (**d**) Happy; (**e**) Neutral; (**f**) Sad; (**g**) Surprised. The emotion recognition program is activated by sending HTTP requests from the web application in use to the API service. To achieve this, the AWS platform was used by configuring the Lambda function using a Docker image that is located in the AWS ECR (Amazon Elastic Container Registry). Base64 encoded data is decoded during frame capture. The result is a decoded byte object of the frame data. These bytes are then converted to a **numpy** array using an 8-bit unsigned integer type. The resulting array is interpreted as an image array, since each byte corresponds to a pixel value. Finally, the video is decoded using the OpenCV library. The result is an image array that is further used for face detection and emotion recognition. Since the Lambda function is used, the program code requires a Lambda handler to handle events. This method is invoked when the Lambda function is called. The general syntax for a Lambda handler takes two arguments: event and context. Having a working Lambda function requires a trigger, which in this case is an API gateway. The Amazon API Gateway tool is used for API development. Since the RESTful API has a simpler client-server interaction model and the camera in the web application is configured to send HTTP POST requests to the server with fixed face data, this API type was chosen. Two use cases were used to test the framework:  
* Use case #1--logging recognized user emotions, recording and heat mapping user activity;
* Use case #2--detecting specific user actions (e.g., rage click), reviewing the Google Analytics page to determine the relationship between the recognized emotion and the specific user actions on the page. A short user session was performed during the usability test. The test session was performed by five users using the web application that was specially developed by the author of this research. The purpose of the test scenarios is to show how parts of the system prototype--i.e., emotion recognition data, session logs, and interaction registration data--can be adapted and how their inclusion in UI usability testing can provide additional context to the UX. During the session, the users used the web application, browsing various pages, clicking buttons, and testing the functionality of UI. The web application design was improved to have more functionality and variety for usability testing. The home page included different types of blocks: headings, paragraphs, images, quotes, additional content sections, tables, and footnotes. Using the editing capabilities provided by WordPress, an options menu was created with two choices: Posts and About pages. Additionally, previously created blog posts were added to the posts page, and a new post was added to the archives and posts section on the right side of the dashboard. The main task for the users was to use all of the functionality offered by the simple blog-type web application, which had parts of poor UI design intentionally added to it, in order to collect emotion data for comparison with the session record. After the session, the CloudWatch logs are checked by selecting group **/aws/lambda/EmotionRecognitionProject**. By specifying the absolute date, it is possible to select the time period during which the user's test session took place.