Summary of the invention
For the problems referred to above, the invention provides a kind of blood pressure Forecasting Methodology based on facial image and mobile phone, can be easy to carry, measure conscious carrying out, can allow user easily and the quick change understanding its blood pressure trend, contribute to user from its life habit of Row sum-equal matrix, and provide this category information to the auxiliary reference of doctor as diagnosis, help to return to normal pressure value.
For achieving the above object, the present invention takes following technical scheme:
Because blood pressure can reflect from the change of face, there is the flushing performance fired in such as most of hyperpietic, and it is normal with emotional lability, passionnate symptom, the existing method being predicted emotion by face at present, so the present invention adopts the pre-measuring blood pressure of facial image, as hypertensive early warning mechanism, reminds patient to go to see a doctor rapidly disconnected.
The present invention is a kind of blood pressure Forecasting Methodology based on facial image, it is characterized in that the method comprises the following steps:
1) facial image is gathered
2) facial image characteristic vector is constructed
3) blood pressure regressive prediction model is utilized to predict the pressure value that this facial image is corresponding
Wherein blood pressure regressive prediction model is obtained by machine learning, comprises the following steps
1) pressure value of N number of facial image and correspondence is gathered
2) characteristic vector of each facial image is constructed
3) construct training data, with facial image characteristic vector for input, the pressure value of its correspondence is output, composing training sample
4) based on training sample set, study least square method supporting vector machine blood pressure forecast model
5) with the optimal parameter of M times of cross validation way selection least square method supporting vector machine blood pressure forecast model, and then corresponding least square method supporting vector machine blood pressure forecast model is obtained.
The invention still further relates to a kind of blood pressure based on facial image prediction mobile phone, it is characterized in that, described mobile phone comprises: a blood pressure standard database; A training sample data base; A blood pressure archive database.Mobile phone also comprises:
Mobile phone camera control module, man face image acquiring module, the characteristic vector constructing module of facial image, blood pressure regression forecasting module, blood pressure display module, SMS transmission module, abnormal blood pressure warning module, blood pressure module for managing files, the study module of blood pressure regressive prediction model.Wherein the output of mobile phone camera control module is connected with the input of man face image acquiring module; The output of man face image acquiring module is connected with the input of the characteristic vector constructing module of facial image; The output of the characteristic vector constructing module of facial image is connected with the input of blood pressure regression forecasting module; The output of blood pressure regressive prediction model study module is connected with the input of blood pressure regression forecasting module; The output of blood pressure regression forecasting module is connected with the input of abnormal blood pressure warning module; The output of abnormal blood pressure warning module is connected with the input of blood pressure display module; The output of blood pressure display module is connected with the input of SMS transmission module; The output of SMS transmission module is connected with the input of blood pressure module for managing files.
Beneficial effect
The present invention, owing to adopting technical scheme as above, has the following advantages:
1) method precision of prediction is good.
2) mobile phone is by gathering the pre-measuring blood pressure of facial image, is simple and easy to use.
3) because often use mobile phone, automatically can gather facial image when user uses mobile phone, pre-measuring blood pressure, and report to the police with regard to abnormal blood pressure, thus prevent from forgetting Measure blood pressure, delay the problem that treatment etc. brings.
4) early warning information of blood pressure can be published to the note case of user and designated mobile phone by mobile phone automatically, such energy reminding user understand user's blood pressure situation at any time, the auxiliary reference of doctor as diagnosis can be supplied information to, do not need user go independent operating program and check result.
Detailed description of the invention
A kind of blood pressure Forecasting Methodology based on facial image that the present invention proposes, is described as follows in conjunction with the accompanying drawings and embodiments.As shown in Figure 1, for a kind of based on the blood pressure Forecasting Methodology of facial image, it is characterized in that the method comprises the following steps:
[1] collection of facial image and detection
[2] extract facial image feature, form the characteristic vector of facial image
[3] blood pressure regressive prediction model is utilized to predict the pressure value that facial image is corresponding
Wherein blood pressure regressive prediction model is obtained by machine learning, comprises the following steps
[1] pressure value of 1000 facial images and correspondence is gathered
[2] characteristic vector of each facial image is extracted
[3] construct training data, with facial image characteristic vector for input, the pressure value of its correspondence is output, composing training sample set
[4] utilize training sample set, training least square method supporting vector machine, obtains blood pressure regressive prediction model
[5] with the suitable parameters of 10 times of cross validation way selection least square method supporting vector machines, and then corresponding least square method supporting vector machine blood pressure regressive prediction model is obtained
In the implementation case, the api function that face image processing adopts Android OpenCV to provide realizes, and AndroidOpenCV is the transplanting version of OpenCV in Android phone.Blood pressure forecast model adopts least square method supporting vector machine.
Face gathers and detection method
First be the collection of facial image, obtained the still image of face by first-class picture catching instrument of making a video recording, then complete Image semantic classification, comprise the size of image and the normalization of gray scale, the rectification of head pose, and the detection etc. of facial image
Face datection algorithm adopts the cascade classifier algorithm of Viola-Jones, and it is a present more outstanding Face datection algorithm.This algorithm uses the cascade classifier strategy based on Haar feature, can find the facial image of many attitude and size fast and effectively.OpenCV has the realization of this algorithm.OpenCV is that Intel increases income computer vision storehouse (Computer Version), is made up of, achieves a lot of general-purpose algorithms of image procossing and computer vision aspect a series of C function and a small amount of C++ class.OpenCV has the cross-platform middle and high layer API comprising more than 300 C function.OpenCV is free to non-commercial applications and business application.OpenCV provides the access to hardware simultaneously, and directly can access photographic head, thus we utilize collection and the detection of OpenCV programming realization facial image, thus obtains facial image.Comprise two steps.1st step is picture pretreatment, obtain a frame (pictures) from photographic head after, first carry out some pretreatment to this pictures: transfer picture to gray-scale map from RGB pattern, then carry out gray-scale map histogram equalization operation, this step realization in OpenCV is very simple.2nd step, detect and labelling human face target, in OpenCV, model for Face datection has been established as an XML file, wherein contain the training result of the grader of Haar feature above-mentioned, we directly use this result, and namely algorithm of target detection facial image to be detected and cascade classifier model together being passed to OpenCV obtains a facial image detected.
The characteristic vector building method of facial image
Conventional characteristics of image has color characteristic, textural characteristics, shape facility, spatial relationship feature etc.The implementation case adopts color characteristic.Suggested a kind of descriptor color layout in international standard MPEG-7, it have expressed the space distribution information of color.In color layout descriptors, the image to split 8 × 8 gets the color average of each block image, forms a color average matrix, then converts with 2-D discrete cosine it, get low frequency component as color characteristic.The concrete extracting method of the implementation case is as follows:
[1] entire image is divided into 8 × 8 pieces, calculates the color average of all pixel RGB tri-Color Channels in each block, and in this, as the representative color (domain color) of this block.
[2] color average of each piece is carried out discrete cosine transform (DCT), obtain DCT coefficient matrix.DCT is a kind of discrete transform, is the basis of international Joint Photographic Experts Group JPEG.Because the high fdrequency component of most of image is less, the coefficient corresponding to image high fdrequency component is often zero, adds that human eye is not too responsive to the distortion of radio-frequency component, so only utilize part DCT coefficient as characteristic vector.
[3] zigzag scanning carried out to DCT coefficient matrix and quantize, obtaining DCT coefficient.
[4] for R, G, B tri-passages, from DCT coefficient, take out 4 low frequency components respectively, form 12 parameters, the common color feature vector forming this image.Finally using the characteristic vector of color feature vector as facial image.
The api function that the implementation case adopts OpenCV to provide is to realize the structure of image feature vector.
Blood pressure regression prediction method
The blood pressure regressive prediction model of the implementation case adopts least square method supporting vector machine (Least Squares Support Vector Machine, LSSVM).Support vector machine (Support Vector Machine, SVM) is a kind of Forecasting Methodology just grown up in recent years. its structure based principle of minimization risk, has good generalization ability.Least square method supporting vector machine is a distortion of standard SVM, SVM is solved quadratic programming problem and converts to and solve system of linear equations by it, avoid insensitive loss function, greatly reduce complexity of the calculation, solving speed is accelerated greatly, and precision of prediction is better, this is that we adopt the reason of LSSVM.
Support vector machine belongs to statistical learning method, be a kind of newly, very potential data category and the instrument of recurrence.First we solve linear regression problem.Assuming that known one group of training set (x
1, y
1) ..., (x
l, y
l), x ∈ R
n, y ∈ R, determines a function based on training set:
f(x)=w·x+b
Approach unknown regression function.Regression estimation problem is defined as the problem of a loss function being carried out to risk minimization, when utilizing SVM to carry out risk minimization, optimum regression function minimizes object function under certain constraints:
Wherein: c is punishment parameter, the one compromise between experience error and model complexity is which determined;
it is slack variable.Normal employing ε insensitive loss function is:
The minimum restriction condition of object function is:
Least square method supporting vector machine utilize SVM construct below minimize object function:
In formula, γ is regularization parameter, the inequality constraints condition of SVM is converted into equality constraint simultaneously:
To least square method supporting vector machine problem, Lagrange function is defined as:
In formula, α
ifor Lagrange multiplier.By ask respectively L (w, b, e, a) to the partial differential of w, b, e, α, can the optimal conditions of Lagrange function
We separate this system of linear equations and try to achieve b and α, and then the regression forecasting function of trying to achieve LSSVM is
For nonlinear problem, by nonlinear transformation, input vector can be mapped to high-dimensional feature space, be converted into similar linear regression problem and solve, method adopts kernel function, and the regression forecasting function of LSSVM is become:
Conventional kernel function has:
Polynomial kernel k (x
i, x
j)=(x
ix
j+ 1)
d
Radial basis kernel function (RBF): k (x
i, x
j)=exp{-||x
i-x
j||
2/ 2 α
2}
Sigmoid kernel function k (x
i, x
j)=tanh [b (x
ix
j)+c] etc.
The implementation case selects Radial basis kernel function RBF as kernel function.The major parameter adopting the least square method supporting vector machine regression forecasting function of Radial basis kernel function is regularization parameter γ and kernel function width G amma, the implementation case take estimated performance as criterion, with the combination of suitable γ and Gamma of 10 times of cross validation way selection, and then obtain corresponding least square method supporting vector machine blood pressure forecast model.
The present invention also proposes a kind of blood pressure based on facial image prediction mobile phone, is described as follows in conjunction with the accompanying drawings and embodiments.As shown in Figure 3, be a kind of prediction of the blood pressure based on facial image mobile phone, it is characterized in that, described mobile phone comprises:
Blood pressure prediction study sample database 310, in order to store the characteristic vector of multiple facial image and corresponding blood pressure data; Standard blood data base 311, contains standard blood scope; User blood pressure archive database 312, in order to store blood pressure file data, wherein each blood pressure data comprises the characteristic vector of face, pressure value, and the time.
Mobile phone also comprises: mobile phone camera control module 301, man face image acquiring and detection module 302, the characteristic vector constructing module 303 of facial image, blood pressure regression forecasting module 305, blood pressure regressive prediction model study module 304, abnormal blood pressure warning module 306, blood pressure display module 307, SMS transmission module 308, blood pressure module for managing files 309.Wherein the output of mobile phone camera control module 301 is connected with the input of man face image acquiring with detection module 302; Man face image acquiring is connected with the input of the output of detection module 302 with the characteristic vector constructing module 303 of facial image; The output of the characteristic vector constructing module 303 of facial image is connected with the input of blood pressure regression forecasting module 305; The output of blood pressure regressive prediction model study module 304 is connected with the input of blood pressure regression forecasting module 305; The output of blood pressure regression forecasting module 305 is connected with the input of abnormal blood pressure warning module 306; The output of abnormal blood pressure warning module 306 is connected with the input of blood pressure display module 307; The output of blood pressure display module 307 is connected with the input of SMS transmission module 308; The output of SMS transmission module 308 is connected with the input of blood pressure module for managing files 309.
1) mobile phone camera control module 301, is taken a picture to face by the photographing unit controlling mobile phone, obtains the facial image gathered.
2) man face image acquiring and detection module 302, carries out pretreatment to the facial image that mobile phone camera control module 301 gathers, and removes background, obtains facial image.
3) the characteristic vector constructing module 303 of facial image, be responsible for the facial image detected to extract feature, the characteristic vector being converted into facial image represents.
4) blood pressure regression forecasting module 305, adopts blood pressure regressive prediction model to carry out blood pressure prediction to the characteristic vector of facial image, obtains the predictive value of blood pressure.
5) blood pressure regressive prediction model study module 304, by the learning sample collection in blood pressure prediction study Sample Storehouse 310, training least square method supporting vector machine forecast model, obtains blood pressure regressive prediction model.
6) abnormal blood pressure warning module 306, according to the pressure value of prediction, reference standard blood pressure data storehouse 311, gives a warning to exceeding normotensive user, and selects suitable content recommendation.Content recommendation source is kept in standard blood data base in advance, prepares suitable content recommendation by domain expert in advance for different blood pressures interval, and such as judge that the blood pressure of user is as extremely hypertensive, content recommendation is gone to see a doctor for during user.
7) blood pressure display module 307, by the pressure value of prediction and content recommendation, and blood pressure curve in the past, be presented on Mobile phone screen.
8) SMS transmission module 308, by the pressure value of prediction and content recommendation, directly writes to the note case of user mobile phone, and is sent to the kith and kin's mobile phone pre-set, so that user reads.
9) blood pressure module for managing files 309, by the pressure value of prediction and content recommendation, the information such as the date of pre-measuring blood pressure are saved in blood pressure archive database 312, and can inquire about the historical record of blood pressure archive database 312.
Mobile phone in the implementation case adopts Android intelligent.Android platform provides application framework, provide SQL database to store for structural data, provide the support to media such as audio frequency, video and pictures, can gather and preserve facial image and characteristic vector data, adopt the SDK of Android to write the photograph program gathering facial image, write blood pressure archive management program by SQL database.The api function that face image processing then adopts Android OpenCV to provide realizes, and Android OpenCV is the transplanting version of OpenCV in Android phone.
Those of ordinary skill in the art should be appreciated that technical scheme of the present invention can be modified, distortion or equivalents, and does not depart from essence and the scope of technical solution of the present invention, all covers among right of the present invention.