CN109588781B - Smoking cessation device based on machine learning - Google Patents
Smoking cessation device based on machine learning Download PDFInfo
- Publication number
- CN109588781B CN109588781B CN201811451822.6A CN201811451822A CN109588781B CN 109588781 B CN109588781 B CN 109588781B CN 201811451822 A CN201811451822 A CN 201811451822A CN 109588781 B CN109588781 B CN 109588781B
- Authority
- CN
- China
- Prior art keywords
- smoking
- module
- time
- data
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A24—TOBACCO; CIGARS; CIGARETTES; SIMULATED SMOKING DEVICES; SMOKERS' REQUISITES
- A24F—SMOKERS' REQUISITES; MATCH BOXES; SIMULATED SMOKING DEVICES
- A24F47/00—Smokers' requisites not otherwise provided for
Abstract
The invention provides a smoking cessation device based on machine learning, and relates to the technical field of cigarette cases. The invention comprises a shell part, an information input module, a central processing unit, a display module and a power supply module; the shell part comprises a cigarette case part and a switch part; the cigarette box part is used for carrying cigarettes; the switch part comprises an electronic lock and an opening button and is used for controlling the locking or the loosening of the electronic lock according to the information output by the control module and opening the box cover by the opening button; the information input module is arranged on the outer wall of the cigarette case part and used for inputting data, and the output end of the information input module is connected with the input end of the central processing unit; the output end of the central processing unit is connected with the input end of the switch part; the display module is embedded in the cigarette case part; the power module is used for supplying power to the device. The invention can reduce the dependence of the quitting person on the cigarette to a certain extent when quitting smoking, thereby increasing the success rate of quitting smoking, and has simple and practical structure and convenient operation.
Description
Technical Field
The invention relates to the technical field of cigarette cases, in particular to a smoking cessation device based on machine learning.
Background
The widespread prevalence of tobacco has become a global problem with serious consequences for public health. China is the largest tobacco producing and consuming country in the world, the number of people dying due to tobacco-related diseases is about 100 ten thousand each year, and if the smoking rate is kept unchanged, the number is increased to 220 ten thousand before 2020. The world health organization has clearly pointed out that tobacco dependence is a chronic addictive disease and classified tobacco dependence as a disease into the international classification of diseases, confirming that tobacco is currently the biggest threat to human health. However, the abstaining tobacco users have strong dependence on tobacco, and are often difficult to continue because of insufficient willpower. Therefore, the method must help the smoker enhance the willpower, and the method for enhancing the willpower of the smoker also directly influences the success of smoking cessation to a great extent;
the existing smoking cessation products mainly have the following functions: 1. the user sets a target, and the product repeatedly reminds or forcibly realizes the target 2. the user group is established to mutually supervise and urge to quit smoking. However, in practice there are a number of problems: firstly, the method comprises the following steps: the subjectivity of the target formulated by the user is too large, the target is often unscientific, too easy or too difficult to stand, and a scientific and effective means is lacked, and the method comprises the following steps: the establishment of communities is supervised and urged mutually, which seems to be effective, but in the actual process, more people can be influenced by the real environment, and the cigarette case with the cigarette control function in the prior art is mainly controlled by setting the smoking volume in advance by a smoker, namely, the cigarette case depends on external given information and cannot be perfected by the smoker.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a smoking cessation device based on machine learning aiming at the defects of the prior art; the invention can reduce the dependence of the quitting person on the cigarette to a certain extent when quitting smoking, thereby increasing the success rate of quitting smoking, and has simple and practical structure and convenient operation;
in order to solve the technical problems, the technical scheme adopted by the invention is as follows:
the invention provides a smoking cessation device based on machine learning, which comprises a shell part, an information input module, a central processing unit, a display module and a power supply module, wherein the shell part is provided with a plurality of through holes;
the shell part comprises a cigarette case part and a switch part; the cigarette box part is used for carrying cigarettes; the switch part comprises an electronic lock and an opening button and is used for controlling the electronic lock to be locked or loosened according to the information output by the control module and opening the box cover by the opening button;
the information input module is arranged on the outer wall of the cigarette case part and used for inputting data, and the output end of the information input module is respectively connected with the input end of the display module and the input end of the data preprocessing module;
the central processing unit comprises a data preprocessing module, a smoking behavior prediction module, a smoking cessation intention prediction module and a control module; the data preprocessing module is used for receiving the data output by the information input module, preprocessing the data and outputting the processed data to the smoking behavior prediction module; the smoking behavior prediction module is used for predicting the next smoking time of the user according to the data output by the data preprocessing module, outputting the smoking time to the display module, and outputting the data and the smoking time to the smoking cessation intention prediction module; the smoking cessation intention prediction module is used for calculating smoking cessation intention according to the received information and determining the smoking amount in the next day; the control module is used for controlling the locking or the unlocking of the switch part according to the time output by the smoking behavior prediction module;
the display module is arranged on the outer wall of the cigarette case part and used for displaying the time of opening the switch part next time and the smoking number of the previous day;
the power supply module is embedded in the shell part, is connected with the switch part, the information input module, the central processing unit and the display module and is used for supplying power to the device;
in another aspect, the present invention provides a smoking cessation method based on machine learning, which is implemented by the above smoking cessation device based on machine learning, and includes the following steps:
step 1: after starting up, self-checking to search whether a trained prediction smoking model exists or not; if the model exists, loading the model and executing the step 3, and if the model does not exist, executing the step 2;
step 2: the user inputs sex s, age a and a data set comprising smoking time of the user in seven days through the information input module, the input data is sorted through the data preprocessing module, formats are unified, and data normalization is realized; calculating the interval time delta t of each smoking according to the information;
and step 3: smoking time x for each time for the data setiAs the midpoint, and is in [ x ]i-30,xi+30]Computing over intervalsAs a smoking probability data set, where x represents time and e represents a constant; setting the smoking probability of the user to reach the peak at the smoking time when the smoking probability is high through the smoking probability data set, and calculating the average daily smoking number n1;
And 4, step 4: and (3) according to a cross validation method, enabling the smoking probability data set to be as follows: 1, dividing the training set into a training set and a verification set;
and 5: average daily smoking amount n1Sex s, age a and preset time t as input quantity, and taking smoking probability in training set as outputEstablishing an xgboost model for the output;
step 6: verifying the xgboost model by using a verification set, and if the confidence coefficient is not less than 0.8, selecting the model with the highest confidence coefficient; if the confidence coefficient is less than 0.8, repeating the training for many times until the confidence coefficient is not less than 0.8, and selecting the model with the highest confidence coefficient;
and 7: calculating smoking cessation willingness w1And determining the target daily smoking amount n of the next day2;
And 8: calculating the smoking probability within one day by using the trained xgboost model, sorting the smoking probabilities from high to low, and sequentially selecting the target daily smoking amount n2Point is used as the time point x which can be openedi(i=1,2,3,…,n2) Adjusting the model according to the smoking time of the user on the previous day, wherein the adjustment model is based on the parameters of the existing model, the data in the step 5 is repeated to train the model after the smoking probability on the current day is calculated by using the formula in the step 3;
and step 9: will be opened at time point xiAs a reference point, in [ x ]i-10,xi+10]The user can start the window by pressing the start key of the switch part, and the window cannot be started in other time; said time interval [ xi-10,xi+10]In units of minutes;
step 10: repeating the steps 7 to 9, sequentially calculating the time period of the opening of the switch part and predicting the smoking cessation will w of the next day2;
The method for calculating the smoking cessation willingness comprises the following steps: according to the formulaObtaining a value α of 1, 2; a is0=0.1428,a1=0.1213,a21.2857; wherein t' is the number of days elapsed under the premise of the same target smoking number,representing the difference, n ', of the actual average smoking interval over the day and the average smoking interval derived according to the xgboost model'2The number of actual smoking days;
adopt the produced beneficial effect of above-mentioned technical scheme to lie in: according to the smoking cessation device based on machine learning, the smoking cessation data of the smoking cessation person are collected and correspondingly processed, so that the simple smoking time is converted into the smoking probability, and the smoking cessation state of the smoking cessation person can be better reflected. Then establishing an xgboost model taking four characteristic values as input quantity and smoking probability as output quantity, carrying out repeated training for multiple times by taking seven-day data as a sample, selecting a group of better xgboost models, and then taking the predicted time period as a time period which can be opened so as to control the smoking behavior of the smoker. The invention better fits the psychology of the quitters, can reduce the dependence of the quitters on cigarettes to a certain extent when quitting smoking, thereby increasing the success rate of quitting smoking, and has simple and practical structure and convenient operation.
Drawings
FIG. 1 is a schematic diagram of a smoking cessation device based on machine learning according to an embodiment of the invention;
FIG. 2 is a schematic flow chart of a machine learning-based smoking cessation method according to an embodiment of the invention;
FIG. 3 is a schematic circuit diagram of a display module according to an embodiment of the present invention;
FIG. 4 is a three-dimensional schematic view of a housing portion provided in accordance with an embodiment of the present invention;
fig. 5 is a schematic diagram of an electronic lock according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
As shown in fig. 1, the method of the present embodiment is as follows.
In one aspect, the invention provides a smoking cessation device based on machine learning, comprising a housing portion, an information input module, a central processing unit, a display module, and a power module;
as shown in fig. 4, the housing portion includes a cigarette case portion and a switch portion; the cigarette box part is used for carrying cigarettes; the switch part comprises an electronic lock and an opening button and is used for controlling the electronic lock to be locked or loosened according to the information output by the control module and opening the box cover by the opening button;
the electronic lock is composed of an electromagnet and comprises four pins as shown in figure 5, wherein two pins are respectively connected with a direct current 5V power supply, and the other two pins are connected with GPIO pins of a processor;
the information input module is arranged on the outer wall of the cigarette case part and used for inputting data, and the output end of the information input module is respectively connected with the input end of the display module and the input end of the data preprocessing module;
the central processing unit comprises a data preprocessing module, a smoking behavior prediction module, a smoking cessation intention prediction module and a control module; the data preprocessing module is used for receiving the data output by the information input module, preprocessing the data and outputting the processed data to the smoking behavior prediction module; the smoking behavior prediction module is used for predicting the next smoking time of the user according to the data output by the data preprocessing module, respectively outputting the smoking time to the control module and the display module, and outputting the data and the smoking time to the smoking cessation intention prediction module; the smoking cessation intention prediction module is used for calculating smoking cessation intention according to the received information and determining the smoking amount in the next day; the control module is used for controlling the locking or the unlocking of the switch part according to the time output by the smoking behavior prediction module;
the display module is arranged on the outer wall of the cigarette case part and used for displaying the time of opening the switch part next time and the smoking number of the previous day;
the power supply module is connected with the switch part, the information input module, the central processing unit and the display module and is used for supplying power to the device;
the display module in this embodiment is 0.96 inch oled with SSD1306 as the main chip; the central processing unit is an arm processor of BCM 2835; the power module adopts a 5V lithium battery;
as shown in fig. 3, the display module is an OLED screen and includes four pins, two of which are connected to the power supply, and the other two of which are connected to IIC protocol pins of the processor;
in another aspect, the present invention provides a smoking cessation method based on machine learning, which is implemented by the above smoking cessation device based on machine learning, as shown in fig. 2, and includes the following steps:
step 1: after starting up, self-checking to search whether a trained prediction smoking model exists or not; if the model exists, loading the model and executing the step 3, and if the model does not exist, executing the step 2;
step 2: the user inputs sex s, age a and a data set comprising smoking time of the user in seven days through the information input module, the input data is sorted through the data preprocessing module, formats are unified, and data normalization is realized; calculating the interval time delta t of each smoking according to the information, wherein the delta t is xi+1-xi;
And step 3: smoking time x for each time for the data setiAs the midpoint, and is in [ x ]i-30,xi+30]Computing over intervalsAs a smoking probability data set, where x represents time and e represents a constant; setting the smoking probability of the user to reach the peak at the smoking time when the smoking probability is high through the smoking probability data set, and calculating the average daily smoking number n1,In the formula nmThe smoking amount is the smoking amount per day in seven days;
and 4, step 4: and (3) according to a cross validation method, enabling the smoking probability data set to be as follows: 1, dividing the training set into a training set and a verification set;
and 5: the time t and the average daily smoking amount n1The gender s and the age a are used as input quantities, and the smoking probability is used as an output quantity to establish an xgboost model;
step 6: verifying the xgboost model by using a verification set, and if the confidence coefficient is not less than 0.8, selecting the model with the highest confidence coefficient; if the confidence coefficient is less than 0.8, repeating the training for many times until the confidence coefficient is not less than 0.8, and selecting the model with the highest confidence coefficient;
and 7: calculating smoking cessation willingness w1And determining the target daily smoking amount n of the next day2;
And 8: calculating the smoking probability within one day by using the trained xgboost model, sorting the smoking probabilities from high to low, and sequentially selecting the target daily smoking amount n2Point is used as the time point x which can be openedi(i=1,2,3,…,n2) Adjusting the model according to the smoking time of the user on the previous day, wherein the adjustment model is based on the parameters of the existing model, the data in the step 5 is repeated to train the model after the smoking probability on the current day is calculated by using the formula in the step 3;
and step 9: will be opened at time point xiAs a reference point, in [ x ]i-10,xi+10]The interval [ x ] in which the user presses the start button of the switch part to start and cannot start in the rest of the timei-10,xi+10]In units of minutes;
step 10: repeating the steps 7 to 9, sequentially calculating the time period of the opening of the switch part and predicting the smoking cessation will w of the next day2;
The method for calculating the smoking cessation willingness comprises the following steps: according to the formulaObtaining a value α of 1, 2; a is0=0.1428,a1=0.1213,a21.2857; wherein t' is the number of days elapsed under the premise of the same target smoking number,representing the difference, n ', of the actual average smoking interval over the day and the average smoking interval derived according to the xgboost model'2The number of actual smoking days;
the device on time in this example is shown in table 1:
TABLE 1 device ON-TIME TABLE
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions and scope of the present invention as defined in the appended claims.
Claims (1)
1. A smoking cessation device based on machine learning is characterized in that: the device comprises a shell part, an information input module, a central processing unit, a display module and a power supply module;
the shell part comprises a cigarette case part and a switch part; the cigarette box part is used for carrying cigarettes; the switch part comprises an electronic lock and an opening button and is used for controlling the electronic lock to be locked or loosened according to the information output by the control module and opening the box cover by the opening button;
the information input module is arranged on the outer wall of the cigarette case part and used for inputting data, and the output end of the information input module is respectively connected with the input end of the display module and the input end of the data preprocessing module;
the central processing unit comprises a data preprocessing module, a smoking behavior prediction module, a smoking cessation intention prediction module and a control module; the data preprocessing module is used for receiving the data output by the information input module, preprocessing the data and outputting the processed data to the smoking behavior prediction module; the smoking behavior prediction module is used for predicting the next smoking time of the user according to the data output by the data preprocessing module, outputting the smoking time to the display module, and outputting the data and the smoking time to the smoking cessation intention prediction module; the smoking cessation intention prediction module is used for calculating smoking cessation intention according to the received information and determining the smoking amount in the next day; the control module is used for controlling the locking or the unlocking of the switch part according to the time output by the smoking behavior prediction module;
the display module is arranged on the outer wall of the cigarette case part and used for displaying the time of opening the switch part next time and the smoking number of the previous day;
the power supply module is embedded in the shell part, is connected with the switch part, the information input module, the central processing unit and the display module, and is used for supplying power to the switch part, the information input module, the central processing unit and the display module;
the method for realizing smoking cessation by the smoking cessation device based on machine learning comprises the following steps:
step 1: after starting up, self-checking to search whether a trained prediction smoking model exists or not; if the model exists, loading the model and executing the step 3, and if the model does not exist, executing the step 2;
step 2: the user inputs sex s, age a and a data set comprising smoking time of the user in seven days through the information input module, the input data is sorted through the data preprocessing module, formats are unified, and data normalization is realized; calculating the interval time of each smoking according to the data set of smoking time in seven days of the user;
And step 3: smoking time per time for data setAs a midpoint, and inComputing over intervalsSetting the smoking probability of the smoker at the smoking time to be maximum as a smoking probability data set, wherein x represents time, and e represents a constant; calculating the average daily smoking amount;
And 4, step 4: and (3) according to a cross validation method, enabling the smoking probability data set to be as follows: 1, dividing the training set into a training set and a verification set;
and 5: taking the average daily smoking amount, the gender s, the age a and the preset time t as input quantities, and taking the smoking probability in the training set as an output quantity to establish an xgboost model;
step 6: verifying the xgboost model by using a verification set, and if the confidence coefficient is not less than 0.8, selecting the model with the highest confidence coefficient; if the confidence coefficient is less than 0.8, repeating the training for many times until the confidence coefficient is not less than 0.8, and selecting the model with the highest confidence coefficient;
and 7: calculating willingness to quit smokingAnd determining the target daily smoking amount of the next day;
And 8: calculating the smoking probability within one day by using the trained xgboost model, sorting the smoking probabilities from high to low, and sequentially selecting the smoking amount of the target dayThe point is used as the time point which can be opened,i=1,2,3,…,And adjusted according to the smoking time of the user on the previous dayThe model is adjusted by using the parameters of the existing model as a basis, calculating the smoking probability of the day by using the formula in the step 3, and then repeating the data in the step 5 to train the model;
and step 9: point in time to be openedAs a reference point, inThe user can start the window by pressing the start key of the switch part, and the window cannot be started in other time; time intervalIn units of minutes;
step 10: repeating the steps 7 to 9, sequentially calculating the time period of the opening of the switch part and predicting the smoking cessation intention of the next day;
The method for calculating the smoking cessation willingness is according to a formulaTo obtain a solution of, in the formula,(ii) a Wherein the content of the first and second substances,for the days elapsed on the premise of the same target number of smokes,representing the difference between the actual average smoking interval and the average smoking interval according to the xgboost model over the day,the number of actual daily smoking.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811451822.6A CN109588781B (en) | 2018-11-30 | 2018-11-30 | Smoking cessation device based on machine learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811451822.6A CN109588781B (en) | 2018-11-30 | 2018-11-30 | Smoking cessation device based on machine learning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109588781A CN109588781A (en) | 2019-04-09 |
CN109588781B true CN109588781B (en) | 2021-06-01 |
Family
ID=65959208
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811451822.6A Expired - Fee Related CN109588781B (en) | 2018-11-30 | 2018-11-30 | Smoking cessation device based on machine learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109588781B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111553660B (en) * | 2020-04-28 | 2023-11-14 | 深圳市吉迩科技有限公司 | Smoking management method, device and storage medium |
CN115017975B (en) * | 2022-05-11 | 2023-05-09 | 戒烟科技(广州)有限公司 | Intelligent smoking cessation management and execution method and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4620555A (en) * | 1983-10-11 | 1986-11-04 | Schwarz Eitan D | Cigarette dispenser |
CN101019694A (en) * | 2007-04-05 | 2007-08-22 | 宋志民 | Set for assisting smoker to control smoked amount |
CN201700404U (en) * | 2010-03-02 | 2011-01-12 | 上海天那电器有限公司 | Electronic cigarette case |
CN102934840A (en) * | 2012-11-22 | 2013-02-20 | 深圳市点通数据有限公司 | Intelligent cigarette case with smoking control function and smoking control method based on same |
CN105146756A (en) * | 2015-09-12 | 2015-12-16 | 南京理工大学 | Intelligent electric heating cigarette system |
CN106535673A (en) * | 2013-10-29 | 2017-03-22 | 吸烟观察者公司 | Smoking cessation device |
-
2018
- 2018-11-30 CN CN201811451822.6A patent/CN109588781B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4620555A (en) * | 1983-10-11 | 1986-11-04 | Schwarz Eitan D | Cigarette dispenser |
CN101019694A (en) * | 2007-04-05 | 2007-08-22 | 宋志民 | Set for assisting smoker to control smoked amount |
CN201700404U (en) * | 2010-03-02 | 2011-01-12 | 上海天那电器有限公司 | Electronic cigarette case |
CN102934840A (en) * | 2012-11-22 | 2013-02-20 | 深圳市点通数据有限公司 | Intelligent cigarette case with smoking control function and smoking control method based on same |
CN106535673A (en) * | 2013-10-29 | 2017-03-22 | 吸烟观察者公司 | Smoking cessation device |
CN105146756A (en) * | 2015-09-12 | 2015-12-16 | 南京理工大学 | Intelligent electric heating cigarette system |
Also Published As
Publication number | Publication date |
---|---|
CN109588781A (en) | 2019-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109588781B (en) | Smoking cessation device based on machine learning | |
CN109033408B (en) | Information pushing method and device, computer readable storage medium and electronic equipment | |
CN106790054A (en) | Interactive authentication system and method based on recognition of face and Application on Voiceprint Recognition | |
CN108305636A (en) | A kind of audio file processing method and processing device | |
CN102404278A (en) | Song request system based on voiceprint recognition and application method thereof | |
CN109376304A (en) | A kind of information recommendation method and device | |
WO2021121226A1 (en) | Electrocardiosignal prediction method and device, terminals, and storage medium | |
CN112104642A (en) | Abnormal account number determination method and related device | |
CN109189365A (en) | A kind of audio recognition method, storage medium and terminal device | |
WO2022048319A1 (en) | Switching method and apparatus for multiple user accounts, electronic device, and storage medium | |
CN109993025A (en) | A kind of extraction method of key frame and equipment | |
CN111125429A (en) | Video pushing method and device and computer readable storage medium | |
CN111027419A (en) | Method, device, equipment and medium for detecting video irrelevant content | |
CN110136501A (en) | A kind of English learning machine based on AR and image recognition | |
CN113328867A (en) | Conference summary storage system based on block chain | |
CN109522858A (en) | Plant disease detection method, device and terminal device | |
CN115906160A (en) | Information processing method and system based on artificial intelligence analysis | |
CN106789940A (en) | A kind of family's internet management system and method based on fingerprint recognition | |
CN107095402A (en) | A kind of Intelligent bracelet for being conducive to giving up smoking | |
CN107479723B (en) | Emotion symbol inserting method and device and electronic equipment | |
CN110413770A (en) | Group's message is referred to the method and device of group topic | |
CN114898484A (en) | Method for awakening intelligent door lock, sensor, intelligent door lock and electronic equipment | |
CN109446421A (en) | A kind of method, apparatus and system pushing news information by refrigerator display screen | |
CN113903470A (en) | Intelligent life reminding method and system for patient after hemodialysis | |
CN109783689A (en) | Information processing method, device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20210601 Termination date: 20211130 |