Next Article in Journal
Single-Shot Structured Light Sensor for 3D Dense and Dynamic Reconstruction
Next Article in Special Issue
Autonomous Dam Surveillance Robot System Based on Multi-Sensor Fusion
Previous Article in Journal
A Low-Cost Paper Glucose Sensor with Molecularly Imprinted Polyaniline Electrode
Previous Article in Special Issue
Employing Shadows for Multi-Person Tracking Based on a Single RGB-D Camera
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Towards a Smart Smoking Cessation App: A 1D-CNN Model Predicting Smoking Events

1
Department of Computing and Mathematics, Faculty of Science and Engineering, Manchester Metropolitan University, Manchester M15 6BH, UK
2
Department of Psychology, Manchester Metropolitan University, Manchester M15 6GX, UK
*
Author to whom correspondence should be addressed.
Sensors 2020, 20(4), 1099; https://doi.org/10.3390/s20041099
Submission received: 31 December 2019 / Revised: 10 February 2020 / Accepted: 13 February 2020 / Published: 17 February 2020

Abstract

:
Nicotine consumption is considered a major health problem, where many of those who wish to quit smoking relapse. The problem is that overtime smoking as behaviour is changing into a habit, in which it is connected to internal (e.g., nicotine level, craving) and external (action, time, location) triggers. Smoking cessation apps have proved their efficiency to support smoking who wish to quit smoking. However, still, these applications suffer from several drawbacks, where they are highly relying on the user to initiate the intervention by submitting the factor the causes the urge to smoke. This research describes the creation of a combined Control Theory and deep learning model that can learn the smoker’s daily routine and predict smoking events. The model’s structure combines a Control Theory model of smoking with a 1D-CNN classifier to adapt to individual differences between smokers and predict smoking events based on motion and geolocation values collected using a mobile device. Data were collected from 5 participants in the UK, and analysed and tested on 3 different machine learning model (SVM, Decision tree, and 1D-CNN), 1D-CNN has proved it’s efficiency over the three methods with average overall accuracy 86.6%. The average MSE of forecasting the nicotine level was (0.04) in the weekdays, and (0.03) in the weekends. The model has proved its ability to predict the smoking event accurately when the participant is well engaged with the app.

1. Introduction

Smoking is considered one of the leading causes of deaths internationally. According to a recent NHS report [1], smoking caused the deaths of approximately 7900 people in England alone in 2016. The report further states that smoking is not only harmful to the smokers, but many diseases may be caused by the exposure to passive smoking, especially affecting children who are particularly vulnerable to the effects of passive smoking. This makes reducing cigarette smoking a significant public health priority. To support efficient and timely delivery of intervention for those wishing to quit smoking, it is important to be able to model the smoker’s behaviour, and in order to do that, it needs to target both endogenous stressors (e.g., nicotine effect, craving, etc.)and exogenous stressors (e.g., timing, location, type of activity, etc.) that trigger the smoking events [2].
With advances in technology, new possibilities have emerged for creating efficient cessation programs, particularly through the use of mobile apps. This new technology has many advantages over traditional therapies; it can reach people wherever they are; enhance their experience by opening new channels between the therapist and the smoker; lastly, it offers the possibility to access databases that can provide individual feedbacks on the smokers’ current status [3], Several methods have been used to provide intervention using mobile apps, For example, text messages either in regular or randomized intervals, or by making the user initiate access to the intervention by reporting on indicators that may cause a potential lapse [4,5,6].
Investigations using self-reporting as a method have indicated that the reported predictors can provide a high degree of possibility for predicting potential lapses [4,5]. Schick et al. [6] improved this method by using Hidden Markov Models to set patterns for the timing and places in which individuals are most likely to smoke, and then use these patterns for better delivery of the support messages. This paper did not report any analytical results that are related to Hidden Markov Models, but rather focused on the positive feedback from the participants who used their mobile application.
Recent advances in computation make machine learning a perfect tool for modelling smokers’ behaviour, enabling the implementation of smart mobile apps that have the ability to provide ‘just in time’ intervention. For example Dumortier et al. [7] used machine learning methods to evaluate the urge to smoke based on participant reporting of 41 features (e.g., alcohol consumption, mood status, hunger, location, type of working, etc.) that may trigger an urge to smoke. They compared three different machine learning algorithms (naive Bayes classifier, discriminant analysis classifier, and decision tree learning), and checked the accuracy of the classification based on a number of selected features. Results indicated that machine learning had the ability to estimate the smokers’ urge rating with an accuracy of the classifications up to 86%. However, the models relied on the users reporting a large number of input features. Another study [8] also used decision tree to predict daily smoking behaviour. Here population information from the 2015 China Adult Tobacco Survey Report was used; the research modelled an equation that calculates the probability of smoking time based on gender, age and time and used statistical information from the dataset as well as some additional extracted features as input to the decision tree model. The researchers concluded that the best method of prediction is XGBoost with 84.11% accuracy.
In addition to the issues around self reporting, most existing apps for smoking cessation do not take into consideration the complexity of nicotine dependence treatment or the specific needs of the users [3]. Self-reporting as a method can be inaccurate as it is sensitive to self-biased errors based on how participants define emotional variables (e.g., withdrawal, stress, craving, alcohol use) or environmental variables (e.g., location, the presence of other smokers) [5]. Furthermore, long-term self-reporting is more likely to be affected by the ‘Ostrich problem’ by which people avoid monitoring their behaviour, as it may be unpleasant, tiresome, or lead to unwanted changes in behaviour [9]. Therefore, collecting time information from mobile sensors can reduce the reliance on self-reports, and increase the accuracy of just-in time intervention messages [4].
Actions (including smoking) can be seen as being motivated by the need to maintain stability over time, in the face of a changing environment. This motivation can be interrupted by internal factors, e.g., feelings such as sadness, or external factors such as nicotine level [10]. A closed-loop control model is a common instrumental technique that seeks to maintain stability. It employs a feedback principle, using the output data from the model (feedback signal) as an input to modify the model’s actions, and hence maintain stability [11]. However, modelling addictive behaviour as a closed loop control model is a challenging task. It requires understanding the complexity of humans, as well as determining what elements should be counted to model the addictive behaviour. Moreover, when modelling the addictive behaviour, the goal state represents the fact that the system seeks to obtain a steady state (natural state), rather than to imply that there exists a single fixed value, as is often the case in system engineering [12,13].
Opponent process theory is claimed to be an essential method that can be used to model a person’s emotional state [14]. Solomon [15] described addictive behaviour using the opponent process theory. Within this model, an addict experiences pleasure as soon as a drug is supplied, which is followed by slowly accumulated withdrawal symptoms. As such, during the initial stages of addiction, the pleasure level is high and is accompanied by a low level of withdrawal symptoms. However, as time goes by, the withdrawal symptoms increase leading to a decrease in pleasure caused by using the drug, potentially resulting in a higher quantity of the drug being consumed [12].
Bobashev et al. [16] modelled the behaviour of smokers and employed the opponent process scheme of control theory. The model did not present any complex neurobiological process, only providing a mathematical model with a cascading feedback loop, aimed at presenting the scientific narrative of the opponent process as shown in Figure 1.
The model equations were developed with phenomenological interpretation in mind, and no real biological process was modelled. A set of continuous functions were used, feeding into the cascading functions. The system equations involve five interlinked processes,
P r o c e s s A : d Y 1 d t = e α t b 1 Y 1
P r o c e s s B : d Y 2 d t = a 1 Y 1 b 2 Y 2
P r o c e s s C : d Y 3 d t = a 2 Y 2 b 3 Y 3
P r o c e s s D : d Y 4 d t = a 3 Y 3 b 4 Y 4
P r o c e s s E : d Y 5 d t = a 4 Y 4 b 5 Y 5
where a, b and α are scaling coefficients, and all the Y i initial values are set to zero. Each equation presents a weighted integration of the previous one, causing the processes to lengthen successively. Y 1 represents the effect of nicotine level and is modelled with a pharmacokinetic equation. Y 2 represents the toxicity level and how the body processes the drug. Y 3 is the daily smoking habit. Y 5 is a longer scaling habit, which is scaled in years (rather than minutes/hours/days). While the process Y 4 has not been interpreted, it has been used to add scaling period between Y 3 and Y 5 , which results in a slow change in process Y 5 . To simulate smoking behaviour, a threshold value was defined to prompt self-administration. The threshold
T = ( β 3 Y 3 + β 5 Y 5 ) ( 1 + β 2 Y 2 )
has calibration coefficients β i , and to avoid division by zero one is added to the denominator of the equation. The threshold value is changed based on external stressors to initiate cigarette use
T = T + s t r e s s .
The research also modelled the withdrawal and craving processes; these processes begin immediately following the initial nicotine use and grow over time
W = d 3 Y 3 ( T Y 1 ) ( Y 0 w + Y 1 )
C = d 5 Y 5 ( T Y 1 ) ( Y 0 c + Y 1 )
where d 3 , d 5 , Y 0 w and Y 0 c are calibration coefficients. This control theory model was able to simulate plausible changes in smoking behaviour over time. However, the system was not able to present real-life behaviour, and could not capture individual differences between smokers’ daily habits. Figure 2 shows an example of the differences between the smoking behaviour as presented using the simulated control theory model Figure 2a and real-life data collected from a participant shown in Figure 2b.
Studies show that modelling smoking behaviour is essential, as it can improve the intervention process in the way of helping smokers in their most needed time [17]. While control theory models lack in prediction but provide an explanation, on the other hand, the deep learning (DL) models provide superior prediction without explanation. In order to get better time-series data prediction, it is useful to incorporate a mechanical structure into a phenomenological statistical model [18]. Following this hypothesis, this research proposes a deep-learning model, which when combined with a control theory model of smoking, will be able to adapt to the smoker’s unique behaviour and predict future smoking events. The Bobashev et al. [16] model was chosen due to its ability to capture the nicotine effect using the pharmacokinetic equation. The model can be later employed to develop a smart mobile app that will send automated interventions. Here, we describe the implementation of this control theory model of smoking that is expanded to incorporate other factors affecting smokers’ smoking behaviour (e.g., geolocation and motion).

2. Classification Method: The 1D Convolutional Neural Network

In recent years, deep learning as sub-field of machine learning (ML) has attracted great interest from the scientific community. DL refers to a deep neural network that consists of a massive web of interconnected nodes (whose depth is more than a single hidden layer). The nodes are able to perform complex, non-linear, computation on a set of input features, and give a suggested solution as an output. This new structure has been used to resolve many complex computer science problems such as image and speech recognition, with better accuracy compared to previous approaches of ML [19,20]. Convolutional neural networks (CNN) are a type of feed-forward neural network, which dates back to the 1980s. CNNs are composed of a convolution operation followed by a pooling operation [21,22]. With the increase interest in DL, CNNs have been reintroduced and used in many applications [23]. The main advantage of a CNN is its ability to be applied on parallel methods, and its high ability to learn, ensuring that all stages of the computation are appropriate for the data and for each other. To solve a problem using CNN, one should try experimenting with different variables including the number of layers, kernel size, choice of an activation function, etc. [24]. 1D-CNN performs a convolutional operation on the local region of the input data using different kernels for the individual features. Also, the size of the local region can vary for different features (this is not possible with a 2D CNN). The 1D convolutional operation in layer l,
y j , i l = f ( m n X ( j m , n ) K ( m , n , i ) + b )
where K is the multi-dimensional convolutional kernel, i is the kernel index, b is the bias and X and y are the input and output respectively, performs dot-products across the input [25]. In most models, a Deep CNN will use a rectified linear unit (ReLU) f ( x ) = m a x ( x , 0 ) , instead of a traditional neural network (hyperbolic tangent, logistic sigmoid) activation function. ReLU is more efficient, simpler and allows non upper-bounded output values. Also, in order to improve the performance of the CNN, regularisation techniques may be used, which reduces the generalization error while preserving the training accuracy [26].

3. Data Collection and Processing

A mobile application was developed, that can collect signals from mobile sensors (e.g., movement and environment), as well as participants’ self-report of smoking events. Five smokers (all taking at least 5 cigarettes per day) were recruited, and were asked to report their smoking events for two weeks. In the pre-processing stage of the data, samples for each day were unified to 1440 sample per day (one sample per minute). To do so, three types of events were registered in the dataset: smoking, not-smoking and app-off (representing gaps in the dataset due to, for example, participant’s mobile phone being off). Figure 3a shows the frequency of events for each of the five participants. It is clear from the data that the classes are unbalanced, as there are far fewer smoking compared to non-smoking events. Overall, of the 1440 data samples per day less than 15 per day are smoking events, while the rest are either not smoking or app-off events. To overcome this limitation, the time periods for labelling was changed to include a 30-min window followed the smoking event rather than a 1-min window, hence reducing the ratio of smoking to non-smoking events. Furthermore, it is assumed in the model that app-off is a non-smoking event, to remain cautious. Figure 3b shows the frequency of events for each of the five participants after applying these changes.
The reported smoking events were then used as input to the control theory model of smoking, in order to calculate the nicotine levels and threshold value during the 13 day period (one 24 h period was dropped because it was made of two half-days, one at the start and the other at the end of the data collection period). Calculated data (e.g., nicotine level) along with collected data (e.g., light, GPS Location, activity labels etc.) were combined to form the dataset for each participant. The reported smoking events were the labels for the data set. Figure 4 illustrates the process of data collection.

3.1. Mobile App

Data collection took place using a mobile application developed for Android mobile users, using Android Studio (IDE). The main focus of the User Interface (UI) was to develop a user-friendly interface that provides no feedback to users, as so to avoid influencing their behaviour [27]. The UI was used to label smoking events, relying on participants’ self-reporting. Users could report smoking events either by pressing a button on the main layout of the app, or by pressing a Widget on the home screen of the smartphone as can be seen in Figure 5.
The application was designed to run as a background service, which records data from the phone’s sensors. This service was designed to restart itself whenever terminated (either by the OS or otherwise). This was implemented in order to overcome a new restriction forced by Android on the development of background services that run for long periods. Collected data, along with smoking events were stored on an internal SQLite database.

3.2. Data Collection

For this study, the participants were healthy smoking adultsover 18 years old, with a good level of English literacy. They each owned and regularly use an Android mobile phone. Smokers were defined as those smoking at least 5 cigarettes a day for at least 6 months; they all smoke traditional cigarettes. During the data collection period, the application was installed on the participant’s smartphone for two weeks. No restrictions were been placed on their daily activities, and they were only asked to report their smoking events and keep the GPS on. At this stage of the research data has been collected from 5 participants (3 females: 2 male); all from the UK. The exclusion criteria were being under 18 years or over 55 years; self-reported physical or mental health issues that impact movement; not using an Android phone (e.g., using an iPhone). Although the number of participants appears small, The study by Schick et al. [6] modelled smoking behaviour using 4 participants, hence 5 participants were a sufficient number to model smoking behaviour. In addition, the ML model is trained for each participant separately, where a large volume of data was collected from each participant (approximately more than 1000 smoking events and 18720 samples each participant), making it sufficient for modelling a machine learning problem.
Data were collected from several sensors in order to identify correlations between smoking events and the sensors reading. Table 1 shows the types of collected data. The goal to use the collected data to find the association between smoking events and environmental data, in order to inform the implementation of a machine learning model that can automatically predict smoking events based on the occurrence of internal and external predictors. Following data collection, it emerged that not all sensors are available in all mobile models. Therefore the plan was modified to use only the common sensors that appear in most of the mobiles, i.e., the accelerometer and GPS values.

4. Approach to Model Development

To design a machine learning model for smoking behaviour, the control theory model of smoking was combined with the 1D-CNN. Initially, each part of the model was analysed separately before reaching the final model.

4.1. Control Theory Model of Smoking

While the actual nicotine level cannot be measured without lab oratory testing, that requirement does not accord with the aim of the research (creating a model that can be employed in a smart smoking cession app). The output from the control theory model of smoking is accepted as a description of the behaviour of the endogenous stressors, where the nicotine level is increased with every cigarette taken, then decreases gradually over time untill the next smoking event.
Using the reported smoking events, nicotine concentration was calculated using the control theory model of smoking [16] as shown in Figure 6. Each peak in the figure represents a smoking event, followed by a gradual decrease in the nicotine level until the next smoking event.
Figure 7 shows the threshold values calculated using the control theory model. The peaks represent non-smoking periods, and the threshold value decreases as the number of cigarettes take per day increases. The control theory model also describes withdrawal and craving symptoms, as demonstrated over a 10-day period in Figure 8.

4.2. Classification of Smoker Behavioural Data

Two types of events occur in the collected dataset, which are labelled as smoking (1) and not smoking (0). In order to further verify the effectiveness of the system, three types of ML models were explored; Support Vector Machine (SVM), Decision tree (DT), and 1D-CNN. The three classifiers were implemented and tested using Python. The Scikit-learn library was used to implement SVM and DT, while 1D-CNN was implemented using the Keras neural-network library with Tensorflow-GPU in the background.
The classification methods were tested to see whether the classifier could detect the smoking events based on each smoker’s motion and location factors. The data was trained and tested for each participant individually using an iterative process, where one day was held for testing while the remaining 12 were used for training. This routine was repeated separately for each of the 13 days. Six features (3 raw accelerometer values: x, y and z, and three GPS values: longitude, latitude, and altitude) were used as input to the ML models. First, the classifiers were tested using only 3 accelerometer values Table 2. Then the classifiers were tested using only the GPS values Table 3.
Table 4 shows the classification accuracy based on using motion and location factors which are 3 accelerometer (x, y and z) values and GPS (longitude, latitude, and altitude).
It can be seen from the tables that in general the performance of the 1D-CNN is consistently more accurate than the other two classifiers. The results indicate that in order to model the smoker’s behaviour, the model has to be trained based on the individual behaviour for each person; and that both motion and location are important for predicting smoking events.
The 1D-CNN is implemented such that a sequence of 10 past observations is mapped as input to the model. Each input feature is passed as a 1D input to a separate model in parallel to the others, and at the end the output from these models is combined to get the classification output. The model architecture consists of 6 parallel models, each of 1D-convolutional layer with 64 filters, followed by one max-pooling layer and a flattening layer. These models combine to one dense layer with 30 nodes, the output of which is passed to a sigmoid activation function to produce the final output (see Figure 9).
Figure 10 shows the confusion matrix for each participant; it can be seen that the continuity of the data is an important factor that affects the prediction of smoking events. Despite this, the overall classification accuracy remains high (mean: 0.87, standard deviation: 0.080). The final model predicts nicotine levels that are much closer to the original nicotine levels for all participants, as described in the next section.

5. Results

After testing the three classification methods, the 1D-CNN was selected as the most suitable classifier to predict smoking events. The classifier predicts either smoking or non-smoking states, with the app off event being treated as non-smoking events. The point of the prediction was to see if the model can accurately forecast the nicotine level (rather than use the originally calculated values) using the combined control theory and 1D-CNN model, and then predict smoking events based on this predicted nicotine value. As the nicotine level is considered a changed value over time. The model uses the comparison between the nicotine level and the threshold value as the first indicator for the need to have a cigarette. The model then makes use of external stressors (accelerometer and GPS) as input to the DL model in order to make the final decision regarding the likelihood of a smoking event. The importance of using the 1D-CNN model as part of the control theory model is to ensure the capture of the endogenous factors which affect the smoker’s behaviour as presented by nicotine level inside the smoker’s body. This approach should ensure that no intervention messages are sent before the nicotine level as derived from Equation (1) decreases to a level that is below the threshold as derived from Equation (6).
The resultant combined model of DL and control theory is shown in Figure 11. Six features were used as input to the DL model (three raw accelerometer values: x, y and z and three GPS values: longitude, latitude, and altitude). Since all these values and their combinations are personalised for each participant, training needs to take place for each participant. Testing the data iteratively enabled us to compare the prediction level for different days of the week. Since the output of the model is forecasting the nicotine effect value over time, Mean Square Error is used as the error criterion to measure the performance of the model. This evaluation matrix has been previously used to evaluate time-series data [28]. The results of the Mean Square Error (MSE), Root Mean Square Error (RMSE), and Normalized Root Mean Square Error (NRMSE), represent the accuracy of predicted nicotine levels during week days (Table 5) and weekends (Table 6). In general, the model has the same performance throughout the week.
Figure 12 shows the predicted nicotine level from a randomly selected day for two participants. All 6 predictors were used as input to the system. The nicotine level was predicted during the closed-loop process; no pre-calculated data was used.
Although some smoking events were missed, the model in general reliably predicts the smoking behaviour of each of the participants. While accuracy of prediction of nicotine level is negatively affected by missed samples in the data set overall accuracy remains high. Figure 13 shows the predicted smoking events for a randomly selected day with a high level of missed samples.
In some cases the participant was cooperative in reporting smoking events in all days accept for one day. The model predicted several smoking events for that day, and we cannot be sure whether these are unreported smoking events or false alarms (Figure 14).
Overall, the model can predict smoking events with 0.2 accuracy in a 15 min window, 0.3 accuracy in a 30 min window, 0.5 in a 1-h window, and 0.8 in a 2-h window. Figure 15 displaysthe ROC curve for all dataset for 15 min, 30 min, 1-h window, and 2-h window. As far as we know, there are relatively few studies which explore the possibility of using machine learning to classify the factors that lead to smoking events, and all the previous research [7,8] rely on self-reporting and surveys, which make it hard to compare with our research since they use different experiment settings and different inputs. Even though this research has accomplished a better overall accuracy equals to 86.6% without relying on self-reporting of predictors.

6. Conclusions

In conclusion, DL was successfully applied to model smokers’ behaviour. The model design combines 1D-CNN with a control theory model of smoking, and the results are promising. Two predictors were used as input to 1D-CNN (motion and geolocation) to predict smoking events. This design was able to adapt to the behaviour of individual smokers, with an average of 87% overall accuracy. This is a preliminary model, with potentials of improvement in the future. It is expected that the accuracy of the system in predicting smoking events will be increased by improving the DL model by adding layers, and by taking advantage of other information such as the indoor smoking ban in the UK. It may also be possible to construct a combined model of individuals’ behaviour, using additional external data such as the addresses of the smoker’s work and home, as well as public information on the location of businesses such as bars and tobacco shops, which are likely to be associated with smoking. These additions to the model are currently under consideration. This model is aimed to be used by smoking cessation app; the app can be integrated in the future into smoking cessation treatments. While all previous work in this area, even if they used ML models, they continue to rely on self-reporting of the predictors. Using DL opens the door to the possibility of automatic predicting the smoker’s behaviour, and that in turn allows sending automated innovations based on the individuals’ behaviour.

Author Contributions

Conceptualization, M.A.-T., N.C., J.D. and Y.B.; software, M.A.-T. and J.D.; validation, M.A.-T.; formal analysis, M.A.-T. data curation, M.A.-T., Y.B. and N.C..; writing–original draft preparation, M.A.-T.; writing–review and editing, Y.B. and N.C.; visualization, M.A.-T. and J.D.; supervision, N.C. and Y.B.; project administration, M.A.-T., N.C. and Y.B.; funding acquisition, M.A.-T., N.C. and Y.B. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding

Acknowledgments

We thank the Manchester Metropolitan University intern students Olivia Faye Salmon and Alex Barrett-Chapman, employed under the funding program from the faculty of Health, Psychology and Social Care UKRIS and the Faculty of Science pump funding, who assisted with the data collection for this study, and also the participants who gave up their time and phone battery power for this research.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. NHS. Adult Smoking Habits in the UK: 2016; Office of national statistics: London, UK, 2018.
  2. Abo-Tabik, M.; Costen, N.; Darby, J.; Benn, Y. Decision Tree Model of Smoking Behaviour. In Proceedings of the 2019 IEEE SmartWorld, Ubiquitous Intelligence and Computing, Advanced and Trusted Computing, Scalable Computing and Communications, Cloud and Big Data Computing, Internet of People and Smart City Innovation. IEEE, 2019, Leicester, UK, 19–23 August 2019; pp. 1746–1753. [Google Scholar]
  3. McClure, J.B.; Hartzler, A.L.; Catz, S.L. Design considerations for smoking cessation apps: Feedback from nicotine dependence treatment providers and smokers. JMIR mHealth uHealth 2016, 4, e17. [Google Scholar] [CrossRef] [PubMed]
  4. Naughton, F.; Hopewell, S.; Lathia, N.; Schalbroeck, R.; Brown, C.; Mascolo, C.; McEwen, A.; Sutton, S. A context-sensing mobile phone app (Q sense) for smoking cessation: A mixed-methods study. JMIR mHealth uHealth 2016, 4, e106. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  5. Businelle, M.S.; Ma, P.; Kendzor, D.E.; Frank, S.G.; Wetter, D.W.; Vidrine, D.J. Using intensive longitudinal data collected via mobile phone to detect imminent lapse in smokers undergoing a scheduled quit attempt. J. Med. Internet Res. 2016, 18, e275. [Google Scholar] [CrossRef] [PubMed]
  6. Schick, R.S.; Kelsey, T.W.; Marston, J.; Samson, K.; Humphris, G.W. MapMySmoke: Feasibility of a new quit cigarette smoking mobile phone application using integrated geo-positioning technology, and motivational messaging within a primary care setting. Pilot Feasibility Stud. 2018, 4, 19. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  7. Dumortier, A.; Beckjord, E.; Shiffman, S.; Sejdić, E. Classifying smoking urges via machine learning. Comput. Methods Programs Biomed. 2016, 137, 203–213. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Zhang, Y.; Liu, J.; Zhang, Z.; Huang, J. Prediction of Daily Smoking Behavior Based on Decision Tree Machine Learning Algorithm. In Proceedings of the 2019 IEEE 9th International Conference on Electronics Information and Emergency Communication (ICEIEC), Beijing, China, 12–14 July 2019; pp. 330–333. [Google Scholar]
  9. Webb, T.L.; Chang, B.P.; Benn, Y. ‘The Ostrich Problem’: Motivated avoidance or rejection of information about goal progress. Soc. Personal. Psychol. Compass 2013, 7, 794–807. [Google Scholar] [CrossRef]
  10. Fibla, M.S.; Bernardet, U.; Verschure, P.F. Allostatic control for robot behaviour regulation: An extension to path planning. In Proceedings of the Intelligent Robots and Systems (IROS), 2010 IEEE/RSJ International Conference on, Taipei, Taiwan, 18–22 October 2010; pp. 1935–1942. [Google Scholar]
  11. Hughes, J.M. Real World Instrumentation with Python: Automated Data Acquisition and Control Systems; O’Reilly Media, Inc.: Sebastopol, CA, USA, 2010. [Google Scholar]
  12. Gutkin, B.; Ahmed, S.H. Computational Neuroscience of Drug Addiction; Springer Science & Business Media: Berlin, Germany, 2011. [Google Scholar]
  13. Ahmed, S.H.; Bobashev, G.; Gutkin, B.S. The simulation of addiction: Pharmacological and neurocomputational models of drug self-administration. Drug Alcohol Depend. 2007, 90, 304–311. [Google Scholar] [PubMed]
  14. Metin, S.; Sengor, N.S. From occasional choices to inevitable musts: A computational model of nicotine addiction. Comput. Intell. Neurosci. 2012, 2012, 18. [Google Scholar] [CrossRef] [Green Version]
  15. Solomon, R.L. The opponent-process theory of acquired motivation: The costs of pleasure and the benefits of pain. Am. Psychol. 1980, 35, 691. [Google Scholar] [CrossRef]
  16. Bobashev, G.; Holloway, J.; Solano, E.; Gutkin, B. A Control Theory Model of Smoking. Methods Rep. (RTI Press) 2017, 2017. [Google Scholar] [CrossRef]
  17. Timms, K.P.; Rivera, D.E.; Collins, L.M.; Piper, M.E. Control systems engineering for understanding and optimizing smoking cessation interventions. In Proceedings of the 2013 American Control Conference, Washington, DC, USA, 17–19 June 2013; pp. 1964–1969. [Google Scholar]
  18. Bobashev, G.V.; Ellner, S.P.; Nychka, D.W.; Grenfell, B.T. Reconstructing susceptible and recruitment dynamics from measles epidemic data. Math. Population Stud. 2000, 8, 1–29. [Google Scholar] [CrossRef]
  19. Popa, D.; Pop, F.; Serbanescu, C.; Castiglione, A. Deep learning model for home automation and energy reduction in a smart home environment platform. Neural Comput. Appl. 2019, 31, 1317–1337. [Google Scholar] [CrossRef]
  20. Zahid, M.; Ahmed, F.; Javaid, N.; Abbasi, R.A.; Kazmi, Z.; Syeda, H.; Javaid, A.; Bilal, M.; Akbar, M.; Ilahi, M. Electricity price and load forecasting using enhanced convolutional neural network and enhanced support vector regression in smart grids. Electronics 2019, 8, 122. [Google Scholar] [CrossRef] [Green Version]
  21. LeCun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef] [Green Version]
  22. Kalchbrenner, N.; Grefenstette, E.; Blunsom, P. A Convolutional Neural Network for Modelling Sentences. Available online: https://arxiv.org/abs/1404.2188 (accessed on 15 February 2020).
  23. Nguyen, T.H.; Grishman, R. Relation extraction: Perspective from convolutional neural networks. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language Processing, Denver, Colorado, 31 May–5 June 2015; pp. 39–48. [Google Scholar]
  24. Sorokin, M.; Zhdanov, A.; Zhdanov, D. Recovery of Optical Parameters of a Scene Using Fully-Convolutional Neural Networks. Available online: http://ceur-ws.org/Vol-2344/short1.pdf (accessed on 15 February 2020).
  25. Deka, B. Pattern Recognition and Machine Intelligence: 8th International Conference, PReMI 2019, Tezpur, India, December 17–20, 2019, Proceedings, Part I; Springer Nature: Berlin, Germany, 2019. [Google Scholar]
  26. Camps, J.; Sama, A.; Martin, M.; Rodriguez-Martin, D.; Perez-Lopez, C.; Arostegui, J.M.M.; Cabestany, J.; Catala, A.; Alcaine, S.; Mestre, B.; et al. Deep learning for freezing of gait detection in Parkinson’s disease patients in their homes using a waist-worn inertial measurement unit. Knowl. Based Syst. 2018, 139, 119–131. [Google Scholar] [CrossRef]
  27. Michie, S.; Richardson, M.; Johnston, M.; Abraham, C.; Francis, J.; Hardeman, W.; Eccles, M.P.; Cane, J.; Wood, C.E. The behavior change technique taxonomy (v1) of 93 hierarchically clustered techniques: Building an international consensus for the reporting of behavior change interventions. Ann. Behav. Med. 2013, 46, 81–95. [Google Scholar] [CrossRef] [PubMed]
  28. Assaad, M.; Boné, R.; Cardot, H. A new boosting algorithm for improved time-series forecasting with recurrent neural networks. Inf. Fusion 2008, 9, 41–55. [Google Scholar] [CrossRef]
Figure 1. Control theory model of smoking re-drawn following [16].
Figure 1. Control theory model of smoking re-drawn following [16].
Sensors 20 01099 g001
Figure 2. Smoking frequency; each peak represents a smoking event using smoking events reported from a randomly-selected day from our collected data of one of our participants. [2] (a) a simulated smoking behaviour generated by the control theory model [16], and (b) real smoking behaviour.
Figure 2. Smoking frequency; each peak represents a smoking event using smoking events reported from a randomly-selected day from our collected data of one of our participants. [2] (a) a simulated smoking behaviour generated by the control theory model [16], and (b) real smoking behaviour.
Sensors 20 01099 g002
Figure 3. Data set Preprocessing.
Figure 3. Data set Preprocessing.
Sensors 20 01099 g003
Figure 4. Overview of the study: data collection and processing steps.
Figure 4. Overview of the study: data collection and processing steps.
Sensors 20 01099 g004
Figure 5. Mobile application User Interface (UI) [2].
Figure 5. Mobile application User Interface (UI) [2].
Sensors 20 01099 g005
Figure 6. Examples of 3 days of smoking behaviour by two randomly selected participants, as modelled using control theory to represent nicotine levels [2].
Figure 6. Examples of 3 days of smoking behaviour by two randomly selected participants, as modelled using control theory to represent nicotine levels [2].
Sensors 20 01099 g006
Figure 7. Example of 10 days calculated threshold value using the control theory model of smoking and collected data from one of the participants [2].
Figure 7. Example of 10 days calculated threshold value using the control theory model of smoking and collected data from one of the participants [2].
Sensors 20 01099 g007
Figure 8. Example of 10 days calculated withdrawal and craving values using the control theory model of smoking and collected data from one of the participants [2].
Figure 8. Example of 10 days calculated withdrawal and craving values using the control theory model of smoking and collected data from one of the participants [2].
Sensors 20 01099 g008
Figure 9. One-dimensional convolutional neural network (1D-CNN) model architecture.
Figure 9. One-dimensional convolutional neural network (1D-CNN) model architecture.
Sensors 20 01099 g009
Figure 10. 1D-CNN model confusion matrix.
Figure 10. 1D-CNN model confusion matrix.
Sensors 20 01099 g010aSensors 20 01099 g010b
Figure 11. Smoking behaviour model utilizing machine learning. Data are collected and processed using the steps described in Figure 4. The 2 predictors are used as input to the 1D-CNN model. A classification value of 1 represents a potential smoking event. This value is passed to the CONTROLLER, simulating the taking of a cigarette, and re-initializing the parameters of the control model to zero.
Figure 11. Smoking behaviour model utilizing machine learning. Data are collected and processed using the steps described in Figure 4. The 2 predictors are used as input to the 1D-CNN model. A classification value of 1 represents a potential smoking event. This value is passed to the CONTROLLER, simulating the taking of a cigarette, and re-initializing the parameters of the control model to zero.
Sensors 20 01099 g011
Figure 12. Predicted nicotine level from two participants.
Figure 12. Predicted nicotine level from two participants.
Sensors 20 01099 g012
Figure 13. Predicted nicotine level for participants with a high presence of app-off values.
Figure 13. Predicted nicotine level for participants with a high presence of app-off values.
Sensors 20 01099 g013
Figure 14. Predicted nicotine level for one day from participant 3 with no reported smoking events.
Figure 14. Predicted nicotine level for one day from participant 3 with no reported smoking events.
Sensors 20 01099 g014
Figure 15. The deep learning model of smokers behaviour ROC curve.
Figure 15. The deep learning model of smokers behaviour ROC curve.
Sensors 20 01099 g015
Table 1. The number of labels in each of the three labelling categories.
Table 1. The number of labels in each of the three labelling categories.
Collected Data Group NameDescription
IDThis is unique ID that Identify the user data, it is set by the user at the start of the study.
Timing valueThis is time stamp DD-MMYYYY, HH:MM:SS
Motion sensors dataAccelerometer, Gyroscope, Linear acceleration, Orientation, Rotation vector.
Environmental dataMagnetic field, Light level, Ambient temperature, Relative humidity, GPS location.
Activity labelsGoogle activity recognition API (Still, Running, Walking, Cycling, Tilting, and Driving).
Smoking labelsThis is labelled by the user.
Table 2. The average accuracy based on only 3 GPS values.
Table 2. The average accuracy based on only 3 GPS values.
Calculated Accuracy CategorySVMDT1D-CNN
Participant 1 smoking0.010.400.01
Participant 1 not smoking0.980.701.00
Participant 1 overall0.730.620.74
Participant 2 smoking0.030.510.09
Participant 2 not smoking0.990.950.98
Participant 2 overall0.880.900.87
Participant 3 smoking0.020.080.00
Participant 3 not smoking0.990.911.00
Participant 3 overall0.940.950.95
Participant 4 smoking0.000.240.08
Participant 4 not smoking1.000.811.00
Participant 4 overall0.900.880.90
Participant 5 smoking0.000.250.21
Participant 5 not smoking1.000.970.97
Participant 5 overall0.880.970.88
Table 3. The average accuracy based on only 3 accelerometer values.
Table 3. The average accuracy based on only 3 accelerometer values.
Calculated Accuracy CategorySVMDT1D-CNN
Participant 1 smoking0.260.430.51
Participant 1 not smoking0.740.750.83
Participant 1 overall0.620.670.75
Participant 2 smoking0.190.370.63
Participant 2 not smoking0.880.890.95
Participant 2 overall0.800.830.91
Participant 3 smoking0.060.080.01
Participant 3 not smoking0.950.941.00
Participant 3 overall0.900.890.95
Participant 4 smoking0.210.160.18
Participant 4 not smoking0.910.930.97
Participant 4 overall0.840.850.89
Participant 5 smoking0.120.250.44
Participant 5 not smoking0.950.950.94
Participant 5 overall0.850.860.87
Table 4. The average accuracy based on all 6 featuers accelerometer and GPS values.
Table 4. The average accuracy based on all 6 featuers accelerometer and GPS values.
Calculated Accuracy CategorySVMDT1D-CNN
Participant 1 smoking0.240.410.59
Participant 1 not smoking0.790.770.79
Participant 1 overall0.650.680.73
Participant 2 smoking0.040.500.64
Participant 2 not smoking0.870.920.94
Participant 2 overall0.780.870.89
Participant 3 smoking0.050.110.03
Participant 3 not smoking0.960.930.99
Participant 3 overall0.910.890.94
Participant 4 smoking0.140.280.20
Participant 4 not smoking0.910.870.97
Participant 4 overall0.830.810.89
Participant 5 smoking0.120.260.47
Participant 5 not smoking0.950.950.94
Participant 5 overall0.850.860.88
Table 5. The overall error rate of the proposed model during week days days.
Table 5. The overall error rate of the proposed model during week days days.
MSERMSENRMSE
Participant 1 smoking0.070.260.23
Participant 2 smoking0.050.220.20
Participant 3 smoking0.020.140.15
Participant 4 smoking0.030.180.21
Participant 5 smoking0.030.150.17
Table 6. The overall error rate of the proposed model over the weekends.
Table 6. The overall error rate of the proposed model over the weekends.
MSERMSENRMSE
Participant 1 smoking0.070.270.24
Participant 2 smoking0.030.160.17
Participant 3 smoking0.010.100.11
Participant 4 smoking0.030.160.20
Participant 5 smoking0.010.120.15

Share and Cite

MDPI and ACS Style

Abo-Tabik, M.; Costen, N.; Darby, J.; Benn, Y. Towards a Smart Smoking Cessation App: A 1D-CNN Model Predicting Smoking Events. Sensors 2020, 20, 1099. https://doi.org/10.3390/s20041099

AMA Style

Abo-Tabik M, Costen N, Darby J, Benn Y. Towards a Smart Smoking Cessation App: A 1D-CNN Model Predicting Smoking Events. Sensors. 2020; 20(4):1099. https://doi.org/10.3390/s20041099

Chicago/Turabian Style

Abo-Tabik, Maryam, Nicholas Costen, John Darby, and Yael Benn. 2020. "Towards a Smart Smoking Cessation App: A 1D-CNN Model Predicting Smoking Events" Sensors 20, no. 4: 1099. https://doi.org/10.3390/s20041099

APA Style

Abo-Tabik, M., Costen, N., Darby, J., & Benn, Y. (2020). Towards a Smart Smoking Cessation App: A 1D-CNN Model Predicting Smoking Events. Sensors, 20(4), 1099. https://doi.org/10.3390/s20041099

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop