In our system we track the user’s current attention level using a wearable EEG sensor, and track the currently browsed section of the website. These items are then mapped and fed into a database which resides on the device. Alternatively the database could reside on a centralized cloud server. There are two ways to achieve this.

• One way could be by using JavaScript to write a browser extension using JavaScript to capture the data and map the interest level of the user with the area of the webpage currently being browsed. The advantage of using such a JavaScript based approach is that it can be used with any web browser with little or no modifications needed. However the disadvantage is that it could lead to longer delays.

• Another way is to modify the code in the web browser and integrate the tracking of the currently browsed section of the web page and the EEG inputs directly into the browser.

The advantage is that it would be much faster. In this paper we went for the approach of integrating our proposed solution into the web browser code.

A. Components of the system

Our setup consists of the following

• An EEG sensor (such as NeuroSky MindWave) that communicates the data to the mobile device using Bluetooth or similar communication mechanism.

• A tool (such as EEG Analyzer) to record the attention level in real time along with the timestamp.

• A database to store the data. This can reside either on the device or on a central cloud server.

• A background process or script or code integrated in the browser to map the attention level of the user with the part of the website they are currently viewing, using the timestamp as the key. This too can reside either on the device or on a central cloud server.

B. Modified web browser architecture

The modified elements of the web browser code are as follows:

• Application level changes to insert a content script to perform the tracking

• A script to receive inputs from the EEG sensor of the current attention level

• A database on the device to store these mappings

C. Calculating the scroll percentage of the web page

The algorithm used to calculate the scroll percentage has the following steps:

• The user browses a web page in the web browser

• An API is called with value arguments i.e. scroll offsets, content dimensions, viewport dimensions, page scale factors etc. These values are used to get the initial and end scrolling percentage of the browsed page.

• The equation to calculate the average scroll percentage is as follows: Average scroll percentage = ((2* Scroll offset + view port height) / content height) * 100

• These values are used to calculate average percentage of the page scrolled by the user while browsing.

• This calculated scroll percentage is saved along with the current timestamp in the database in the mobile device storage.

• On the basis of the timestamp, we map the scrolling percentage of the page with the attention level obtained using EEG sensor. For this purpose, a custom script is used that runs in the background.

In our system, we track the currently browsed section and map it to the user’s interest level. For the tracking we used the current percentage of the web page browsed. This gives a range, such as 0%-12%, 12%-24% etc. We take the midpoint value of the range (e.g. 18% for the range 12-24%) as our working point, and consider an area within a few hundred pixels of the midpoint value as the user’s current viewing area. This gives us a number value between 0-100 which represents the percentage of the webpage that is currently at the center of the user’s viewing area. As mentioned, we are using a NeuroSky Mindwave EEG sensor.

The attention level value which we get from the EEG sensor is also a value between 0-100. Fig. 3 shows the typical attention, meditation and blink levels received from the Neurosky sensor when reading a news article on a mobile web browser. Fig. 4 shows the logic on the mobile device while receiving EEG inputs from the Neurosky sensor. By synchronizing the timestamps of the NeuroSky EEG sensor and the script in the web browser, we can plot the attention value together with the percentage of the current page scrolled, at a given time. Fig. 5 illustrates the merging of the two tables using the timestamp as the key.

In this setup, we are making a few assumptions. One is that all the web pages are being viewed at standard resolution. We are assuming that the default zoom factor is generally not altered by the user. Also we assume that zooming of the web pages if any will not alter the relative ratio of the webpage being browsed.