文档库 最新最全的文档下载
当前位置:文档库 › A driver fatigue recognition model based on information fusion

A driver fatigue recognition model based on information fusion

A driver fatigue recognition model based on information fusion
A driver fatigue recognition model based on information fusion

A driver fatigue recognition model based on information fusion and dynamic Bayesian network

Guosheng Yang b ,Yingzi Lin a,*,Prabir Bhattacharya c

a

Northeastern University,Department of Mechanical and Industrial Engineering,Boston,MA 02115,USA b

Minzu University of China,School of Information Engineering,Beijing 475001,PR China c

University of Cincinnati,Department of Computer Science,Cincinnati,OH 45221-0030,USA

a r t i c l e i n f o Article history:

Received 2August 2008

Received in revised form 3January 2010Accepted 6January 2010

Keywords:

Driver fatigue recognition Dynamic Bayesian network Contextual features Physiological features Information fusion

a b s t r a c t

We propose a driver fatigue recognition model based on the dynamic Bayesian network,information fusion and multiple contextual and physiological features.We include features such as the contact physiological features (e.g.,ECG and EEG),and apply the ?rst-order Hidden Markov Model to compute the dynamics of the Bayesian network at different time slices.The experimental validation shows the effectiveness of the proposed system;also it indicates that the contact physiological features (especially ECG and EEG)are signi?cant factors for inferring the fatigue state of a driver.

ó2010Elsevier Inc.All rights reserved.

1.Introduction

The recent advances in cognitive science,psychology,and related ?elds have indicated that the human emotion (such as anger,fear,stress,distraction,and fatigue)plays a critical role in a person’s behavior [28,21].The behavior of drivers has been an active ?eld of study for decades [23],and it has attracted considerable attention recently [34].The driver fatigue remains to be one of the important factors that contribute to traf?c accidents.The National Highway Traf?c Safety Administration (NHTSA)of USA estimates that there are annually about 100,000crashes in USA that are caused by fatigue and result in more than 1500fatalities and 71,000injuries [15].Some studies have demonstrated that the driver drowsiness accounts for 16%of all crashes and over 20%of the crashes in the highways [8].Thus,the driver fatigue assessment remains to be a big challenge to meet the demands of future intelligent trans-portation systems [3].Developing a system that actively monitors the driver’s fatigue level in real time (and produces alarm signals when necessary),is important for the prevention of accidents,and this is the main motivation of our paper.

One of the key steps towards developing a fatigue monitoring system is to consider the features that could be effectively used for fatigue recognition.We can classify these features into four general categories:(1)causal/contextual features,(2)physiological features,(3)performance features,and (4)multi-features.In the following paragraphs,we discuss these categories.

0020-0255/$-see front matter ó2010Elsevier Inc.All rights reserved.doi:10.1016/j.ins.2010.01.011

*Corresponding author.Tel.:+16173738610;fax:+16173732921.E-mail address:yilin@https://www.wendangku.net/doc/1a5078373.html, (Y.Lin).

Information Sciences 180(2010)1942–1954

Contents lists available at ScienceDirect

Information Sciences

journal homepage:www.else v i e r.c o m /l o c a t e /i n s

G.Yang et al./Information Sciences180(2010)1942–19541943

1.1.Contextual features based method

The contextual features mainly include(i)the personality,sleeping quality,circadian rhythm,physical condition,(ii)the work conditions such as noise,driving hours[11,30],and the cab temperature;(iii)the environment such as monotony of road,density of cars,and number of lane.Such contextual features are collected mainly by questionnaires,and then the dri-ver’s fatigue is inferred from the collected data using some statistical methods or other means such as neural network or fuzzy set theory[10,11,33,35].

1.2.Physiological features based method

The drivers may exhibit some easily observable physiological features from which their fatigue can be inferred [15,28,32,39,41].Physiological features may be classi?ed into:contact features,including the brain activity,heart rate vari-ability,and skin conductance–these can be easily detected by EEG(electroencephalogram),ECG(Electrocardiograph),and EMG(electromyogram);and contactless features,including the eye movements(EM),head movement,and facial expressions –these can be easily observed from the dynamic images provided by a CCD camera.Consequently,two approaches for re-search are feasible:the contact feature based method and the contactless feature based method.

The contact feature based method focuses on inferring the driver’s fatigue from the contact https://www.wendangku.net/doc/1a5078373.html,ing the fact that the EEG can represent abundant information on the human cognitive states,an algorithm based on the changes in all the major EEG bands(delta,theta,alpha,and beta bands)during the fatigue was developed by Lal et al.[19]to detect different levels of https://www.wendangku.net/doc/1a5078373.html,bining the EEG power spectrum estimation,principal component analysis,and fuzzy neural network model,Jung et al.[17]designed a system to estimate and predict the drowsiness level of a driver.Taking the associated wavelet representations for the EEG at different scales as system inputs,Wilson and Bracewell[41]constructed a neural net-work to detect the onset of the driver’s fatigue.Zhou et al.[46]proposed a new feature extraction method based on the bi-spectrum and applied it for the classi?cation of the right and left motor imagery for developing EEG-based brain–computer interface systems.Budi et al.[2]assessed the four electroencephalography(EEG)activities,(delta(d),theta(h),alpha(a)and beta(b))during a monotonous driving session for52subjects(36males and16females),and got the results for conditions stable delta and theta activities over time,a slight decrease of alpha activity,and a signi?cant decrease of beta activity.

The ECG is another contact feature,including the LF(low frequency),VFH(very low frequency),HF(high frequency),and the LF/HF ratio,that contains relevant information about fatigue[33].By taking the Hermite polynomial coef?cients of the ECG as inputs,[24]presented a neuro-fuzzy network approach that was used to recognize and classify the heart rate vari-ation.It is noted that Picard et al.[28]also applied this to affective computing,and proposed a hybrid recognition algorithm combining the Sequential Floating Forward Search and the Fisher Projection for the emotion recognition,by selecting the means,the standard deviations,the?rst differences,and the second differences of the EMG,BVP(blood volume pulse), GSR(galvanic skin response),and respiration from the chest expansion as physiological features.In addition,the fast Fourier transforms(FFTs)and three other modeling techniques,namely,the autoregressive(AR)model,the moving average(MA) model and the autoregressive moving average(ARMA)model,are used to estimate the power spectral densities of the RR interval variability in Zachary et al.(2008).The spectral parameters obtained from the spectral analysis of the HRV signals are used as the input parameters to the arti?cial neural network(ANN)for the classi?cation of the different cardiac classes.

The contactless feature-based method focuses on inferring the driver’s fatigue from the contactless features [13,18,26,44,1.Experiments have demonstrated that the driver in fatigue should exhibit some visual cues Ji et al.[15].Horng et al.[13]proposed a driver fatigue detection algorithm based on the eye tracking and dynamic template matching.Norima-tsu et al.[26]investigated the detection of the gaze direction using the time-varying image processing in which the facial and the gaze directions,without considering the facial direction,were detected separately,and then they were integrated into the?nal gaze direction.Kim et al.[18]constructed a fuzzy neural network-based method for fatigue recognition by taking the openness degrees of the mouth and eyes respectively,and the vertical distance between the eyebrows and eyes as inputs.

1.3.Performance measurement based method

Driver’s fatigue can contribute to the deterioration in the operational performance(such as the reaction time,lane posi-tion deviation,and hand movement of controlling the steering wheel).A fuzzy set-based method involving the small move-ment of controlling the steering wheel was put forward by Vysoky′[38,37]to calibrate and predict the driver’s fatigue.

1.4.Multi-feature fusion-based method

The three methods described above focus only on a certain speci?c aspect,and that may lead to inaccurate results be-cause the driver’s fatigue is not directly observable but can only be inferred from the information available.There are a num-ber of reasons for the inaccuracies using the method mentioned above:(i)the driver’s fatigue derived from the contextual features contains much subjectivity that can not always re?ect the real objectivity;(ii)inferring the driver’s fatigue from the facial expression is not always reliable because of the following two limitations:(a)the current techniques for image pro-cessing can not always ensure the recognition accuracy;(b)an introverted person might have a tendency to control his or her display of emotions,especially in the presence of people he/she is not well acquainted with[6],which leads to an inaccurate

interpretation of the facial expression.Thus,to fuse as many as possible features from uncertain events is a better way to make an accurate inference [5].Further,Picard et al.[28]pointed out that it was necessary to fuse the contextual and phys-iological features,and the driver’s performance in order to make the fatigue recognition more reliable.

By considering the evidence and beliefs of the contextual information and the visual cues from a single time instant,Ji et al.[15]constructed a static Bayesian network (SBN)to infer and predict the fatigue of human beings,enhancing the reliability of fatigue recognition.However,such a network does not consider the physiological contact features and is not suited to systems that evolve over time [16,21,43,45].The Dynamic Bayesian network (DBN)has been developed to overcome this limitation.Li and Ji [21]introduce a new probabilistic framework based on DBN to dynamically model and recognize the user’s affective states and to provide the appropriate assistance in order to keep the users in a produc-tive state.Considering the evidence and beliefs of contextual information and visual cues from multiple time stamps,a new probabilistic framework based on DBN has been introduced in Ji et al.[16]but it has excluded the contact physio-logical features.

Besides the contextual information and visual cues (the contactless features),the contact physiological features (such as the EEG,and the ECG)may also contribute signi?cantly to the fatigue because a person usually has little control over these contact features and so they could provide reliable source of information on a person’s emotion [6].However,it is very dif-?cult to apply these two physiological signals non-intrusively because usually the electrodes and wires are used to contact a driver intrusively in order to obtain the EEG and ECG signals.There have been some efforts in developing non-obtrusive EEG and ECG technologies,and there has been a certain degree of success related to the non-obtrusive instrument use in labo-ratory settings.It is thus expected that the non-obtrusive EEG and ECG technologies (e.g.wireless technology)will become feasible in the near future for applications to fatigue estimation for drivers.Therefore,it is useful to investigate fusing the ECG and EEG features with other features for getting reliable fatigue estimations,which lays a strong foundation for the real application of getting reliable fatigue estimation from multiple features.

Inspired by the research of Ji et al.[16],in particular by the inclusion of the contextual features with the contactless features (mainly the facial expression features),we have developed a DBN-based fatigue recognition model along with its inferring algo-rithm to make the fatigue recognition task more feasible.However,our approach differs from that of Ji et al.[16]in the following ways:(i)we have included the contact physiological features –in particular the ECG and EEG,and (ii)in the treatment of the dynamics of a Bayesian network from one time slice to another,we have used the ?rst order HMM (Hidden Markov Model).The rest of the paper is organized as follows.Section 2presents the problem description and a general architecture of the proposed DBN-based fatigue recognition model.In Section 3,the proposed DBN-based fatigue recognition model using mul-tiple contextual and physiological features is presented along with the inference method corresponding to the model.In Sec-tion 4,the validation of the model is presented.Section 5concludes the paper with further discussions.2.Problem description

Assume that [Z 1,Z 2,...,Z t ,...]is the semi-in?nite collection of random variables,Z t =(C t ,X t ,O t )denotes the input,hidden and output variables of a state-space model at a certain time instant t .A DBN is used to model the probability distributions over the semi-in?nite collection.A DBN can be considered as a collection of SBNs interconnected by sequential time slices,and the relationships between two neighboring time slices are modeled by an HMM (hidden Markov Model)[21,43].In par-ticular,without loss of generality,we took the ?rst-order HMM.A DBN is de?ned as a pair of eB ;B !T,where B is a SBN which de?nes the prior P (Z 1),and B !

is a two-slice Temporal Bayesian Network (2TBN)which de?nes P (Z t —Z t à1)in the following equation [25]by means of a DAG (directed acyclic graph):

P eZ t j Z t à1T?Y N i ?1

P Z i t Pa Z i t

e1T

where N is the number of the nodes in the graph,Z i t is the i th node at time t ,which could be a component of C t ,X t or O t ,and Pa Z i t

are the parents of Z i t which can be either in the same time slice or in the previous time slice.In the following,we show how to construct a DBN for fatigue recognition in particular.The construction of a DBN has two tasks:(1)the determination of nodes and (2)the determination of their prior probability.The nodes are related to the features (i.e.,the cues)of human drivers while the prior probability indicates the likelihood of a particular feature that contributes to the fatigue.

As remarked in Section 1,there are many contextual and physiological features related to driver fatigue.Among these features,some of them lead to more contributions to the fatigue while others have lesser contributions to the fatigue.For the sake of simplicity but without any loss of generality,we only select those contextual and physiological features that have immediate relations with the fatigue.In particular,the following features or variables are selected.2.1.Sleeping quality (SQ)analysis

The SQ is an important contextual feature that has an immediate relation with the fatigue [33].The driver’s SQ is asso-ciated with such quantities such as:the duration of sleep (and the lack thererof),dif?culty in falling asleep at night,the sleeping environment,and other social factors.Among them,the sleep time and the sleeping environment were taken as the key contributors to SQ because a certain minimum number sleep hours is necessary for everyone,especially to drivers,

1944G.Yang et al./Information Sciences 180(2010)1942–1954

G.Yang et al./Information Sciences180(2010)1942–19541945 and whether the sleep is good or not mainly depends on the sleeping environment.Therefore,the SQ was taken as one of the contextual features corresponding to the nodes of the DBN graph.

2.2.Circadian rhythm(CR)analysis

The circadian rhythm(CR)is a cardinal contextual variable in recognizing the https://www.wendangku.net/doc/1a5078373.html,l et al.[20]pointed out that the CR should be an important consideration in the study of the driver fatigue because it is found that there are two peaks of sleep each day(these peaks appear during3–5A.M.and3–5P.M.approximately),and sleep may come more easily and fatigue may reach the highest level during these periods.Vysoky′[37]identi?ed CR as a factor mainly in?uencing the driver’s alertness. Therefore,the CR is also selected in this paper as one of the contextual variables corresponding to the nodes of the DBN graph.

2.3.Work environment(WE)

It is obvious that noise,the monotony of the road,the density of cars on a highway,the number of lanes,and the in-car temperature have strong relations with the driving environment that has contributions to the driver’s fatigue.Among these features,the noise and temperature have immediate relations with the work environment.Therefore,the noise and temper-ature were taken as two contextual features corresponding to the nodes of the DBN graph.

2.4.Eye movement(EM)analysis

The eye gaze,eye blink,and eyelid closure are different manifestations of the EM[22].When the EM is used to research the driver’s fatigue,these manifestations are described as the PERCLOS(percentage of eyelid closure over the pupil in a given time)[40],which is a reliable and valid determination of a driver’s fatigue[15].Several studies[15,40]indicate that the dri-ver is possibly in a state of fatigue if the eyes are at least80%closed in the unit of time of a minute.Thus,the proportion of the eye-closed time was taken in this paper as one of the observable variables corresponding to the nodes of the DBN graph.

2.5.ECG analysis

The heart rate varies signi?cantly for the same individual in different states such as alertness and fatigue.This is the main reason why the ECG is often used for detecting the driver’s states.The ECG signal is?rst smoothed by a simple low-pass?lter with a cut-off frequency of100Hz,and then transformed by the FFT algorithm into the frequency domain mainly including the LF,VLF,and HF.Among these frequency features is the LF/HF ratio that has strong relations to a driver’s fatigue.Calcag-nini et al.[4]pointed out that the LF/HF ratio would decrease progressively when passing from the awake state to the fatigue state.Therefore,the LF/HF ratio describing driver’s states was taken as one of the observable variables corresponding to the nodes of the DBN graph.In this paper,the method presented by Yang et al.[9]is adapted to calculate the changes around the standard baseline of EEG.

2.6.EEG analysis

The frequency domain of EEG mainly includes the delta band(0.5–4Hz)corresponding to the sleep activity,the theta band(4–7Hz)related with drowsiness,the alpha band(8–13Hz)corresponding to relaxation and creativity,and the beta band(13–25Hz)corresponding to activity and alertness[17].Note that only the alpha band has strong relations with fatigue study,and the variations in the EEG trace,such as a decrease in the alpha rhythms,is interpreted to indicate states of fatigue [20,31].Further,the decrease in the alpha rhythms shows that a driver is at the fatigue state.During a stage of vigorous activ-ity or stress,the driver’s average magnitude of the signal within the alpha band is taken as the standard baseline.In the fa-tigue situation,obvious changes of the alpha signals around the standard baseline always take place.Therefore,the change around the standard baseline of the EEG spectrum was taken as one of the observable variables corresponding to the nodes of the DBN graph.In the present study,a simple low-pass?lter with a cuto?frequency of50Hz and the independent compo-nent analysis are employed to smoothen the EEG signals,the smoothened signals are then transformed into the frequency domain by use of the fast Fourier transform(FFT)algorithm(for further details on calculating the change around the stan-dard baseline of EEG,see Yang et al.[9]).

On the basis of the above analysis,the SQ,WE and CR are chosen as the key contextual variables corresponding to the component C t of Z t,while the EM,ECG,and EEG are the observable variables corresponding to the component O t of Z t.Given that the FAT representing the driver’s fatigue has two states(fatigue and alertness)corresponding to the hidden variable X, the proposed generic DBN structure used to recognize driver’s fatigue is illustrated in Fig.1.

3.DBN-Based fatigue recognition model

A DBN can be applied to deal with either continuous or discrete stochastic processes.In this paper,we only consider the discrete stochastic process;i.e.,the contextual,hidden and observable variables have?nite random values,which form a

discrete DBN.To set up a fatigue recognition model based on the discrete DBN,the ?rst step is to specify the nodes of the discrete DBN.In other words,we need to specify the contextual,hidden and observable variables that are used to construct the discrete DBN network (where we take the SQ,WE and CR as the key contextual variables,the EM,ECG,and EEG as the observable variables,and the FAT including fatigue and alertness as the hidden variable,as explained in Section 2,see Fig.1).The second step is to determine what values are used to represent the discrete variables.The third step is to con?gure the initial states of variables,i.e.,to calculate the SBN (or B )at time t =1.The last step is to calculate the conditional probability over time and to infer the fatigue of a driver.In the following,the last three steps are described in detail.3.1.Step 1:Determining discrete values for each node (variable)

As for the contextual,hidden and observables selected in Section 2,the fuzzy method is used to determine the discrete values for each variable based on a set of heuristic knowledge rules [31].Tables 1–4summarize the discrete variables and their state values.

3.2.Step 2:Calculating SBN (B)

With reference to Eq.(1),it is necessary for calculating DBN to know the prior P (Z 1)in advance,i.e.,determining the SBN at time t =1given the initial conditions.We use capital letters to denote the variable (or node)names,and lowercase

letters

Table 1

SQ and its parent discrete variables and their states.Sleep_time node (states)Sleep environment node (states)SQ node (states)suf?cient

Deprived

Poor

Normal

Bad

Good

Table 2

WE and its parent discrete variables and their states.Temperature node (states)Noise node (states)WE node (states)High

Normal

High

Normal

Bad

Good

Table 3

CR discrete variables and their states.CR node (states)Low

High

1946G.Yang et al./Information Sciences 180(2010)1942–1954

to denote the speci?c values taken by the variables.Following such a notation,let X t ;C j t and O i t (j =1,2or 3be the SQ ,WE or CR (where SQ and WE are represented in conditional probability by sleep time and sleep environment variables or tempera-ture and noise variables ),while i =1,2or 3can be the EM ,ECG or EEG )be the hidden fatigue node,the contextual nodes,and

the observable nodes at time t ,respectively,and x k t ;c j ;m t

and o j ;n

t ek ;m ?1;2and j ;n ?1;2;3Tdenote the speci?c values taken by X ,C j and O i

,respectively.From Fig.1,we can derive the SBN at time t =1,shown as Fig.2.Assume that the evidences from the contextual nodes at time t =1are represented as e c 1?e i ;j c ;1n o

,where e i ;j

c ;1represents the evidence of the i th contextual node with the j th state value,an

d th

e evidences from the observable nodes at time

t =1are represented as e o

1?e i ;j o ;1n o ,where e i ;j o ;1represents the evidence of the i th observable node with the j thstate value.

Denote e 1?e c 1;e o

1èéto be the evidences from the contextual and observable nodes at time t =1,then the conditional prob-ability of X given the occurrence of e c 1can be written as [7]

P X ?

x k 1e c 1

à

á

/X 2i ?1

X 2j ?1

X 2l ?1

P X ?x k 1c 1;i 1; c 2;j 1c 3;l

1 P c 1;i 1 P c 2;j 1

P c 3;l 1 k ?1;2e2T

and the conditional probability of e o 1given the occurrence of node X can be written as [7]

P e o 1X ?x k 1 àá/P e 1;j o ;1X ?x k 1 P e 2;j o ;1X ?x k 1 P e 3;j o ;1X ?x k 1 ?X 3l ?1

P e 1;j o ;1o 1;l 1 P o 1;l 1X ?x k 1 !?X 3m ?1

P e 2;j o ;1o 2;m 1 P o 2;m 1X ?x k 1 !?X 3n ?1

P e 3;j o ;1o 3;n 1

P eo 3;n 1X ?x k

1 T !k ?1;2and j ?1;2;3e3T

Table 4

Hidden and observation discrete variables and https://www.wendangku.net/doc/1a5078373.html,ponent Variable State values Description

Hidden variable FAT State1Fatigue The state of driver’s fatigue

State2Alertness Observation variable

EM

State1Large Percentage of eyelid closure over time

State2Medium State3Small ECG State1Decrease LF/HF ratio of ECG wave

State2No-change State3Increase EEG State1Decrease The changes of average magnitude within alpha band of EEG spectrum

State2No-change State3

Increase

G.Yang et al./Information Sciences 180(2010)1942–1954

1947

According to Bayes’theorem,the conditional probability of node X given the occurrence evidence of e 1at time t =1is obtained by combining Eqs.(2)and (3).

P X ?

x k 1e 1

j à

á

?P X ?x k 1e c 1 àáP e o 1X ?x k 1

àá2j ?1

P X ?x j 1e c 1 P e o 1

X ?x j 1 k ?1;2e4T

Eqs.(2)–(4)indicate the initial case,i.e.,the SBN at time t =1.3.3.Step 3:Calculating the conditional probability over time

Having speci?ed the nodes of the discrete DBN and the initial state values of each node,and having con?gured the SBN (or

B )at time t =1,the next step is to calculate the conditional fatigue probability over time and to infer what we want about the driver,i.e.,to calculate Eq.(1)(or B !

).In this paper,a DBN is viewed as interconnected time slices of SBNs,and the relation-ships between two neighboring time slices are modeled by a ?rst-order HMM.Following such a stipulation,we have con-sidered that the random fatigue variable at the current time slice t is in?uenced by the contextual and observable variables at the current time slice t ,as well as by the corresponding random fatigue variable at the previous time slice t à1only.Based on this principle and corresponding to Fig.1,we draw the DBN structure at time t ,as shown in Fig.3.

Denote P x k t à1àá

;where k ?1;2as the conditional probability of the node X with different state values at time slice t à1.The conditional probability of X given the occurrence of e c t at time slice t can be obtained by using Eq.(2),see Fig.3:

P X ?x k t e c t àá/X 2i ?1

X 2j ?1

X 2l ?1X 2m ?1

P X ?x k 1c 1;i t ; c 2;j t c 3;k t x m t à1 P c 1;i 1 P c 2;j 1 P c 3;k 1

P x m t à1àák ?1;2e5T

and the conditional probability of e o t given the occurrence of node X at time slice t can be calculated by using Eq.(3).

P e o t X ?x k t àá/P e 1;j o ;t X ?x k t P e 2;j o ;t X ?x k t P e 3;j 0;t X ?x k t

?X 3l ?1

P e 1;j 0;t o 1;l t

P o 1;l t X ?x k

t !?X 3m ?1

P e 2;j o ;t o 2;m t P o 2;m t X ?x k t !?X 3n ?1

P e 3;j o ;t o 3;n t P o 3;n t X ?x k t !k ?1;2j ?1;2;3e6T

According to the Bayes’theorem,the conditional probability of node X given the occurrence evidence of e t ?e c t ;e o

t èéat time slice t is obtained by combining Eqs.(5)and (6).

P X ?x k t e t

j àá

?P X ?x k t e c t àáP e o t X ?x k t

àá

2j ?1

P X ?x j t e c t j P e o t X ?x j t

k ?1;2e7T

1948G.Yang et al./Information Sciences 180(2010)1942–1954

G.Yang et al./Information Sciences180(2010)1942–19541949

4.Validation

The validation of the proposed DBN model to predict the fatigue was conducted in a simulated driving environment.In the following,we?rst describe how the parameters of the proposed model are determined,and then we present the results of the experiments.

4.1.Construction of prior probability tables

The prior probabilities for the root nodes and the conditional probabilities for the links of the network need to be deter-mined before the model can be https://www.wendangku.net/doc/1a5078373.html,ually,the probability is obtained from statistical analysis of a large amount of train-ing data.In this study,we acquired information from several published papers[11,12,15,16,21,28,30,33,44].However,not all the required data can be obtained;in this study we also obtained data through the computer generation following the noise-or principle(https://www.wendangku.net/doc/1a5078373.html,,Murphyk).Yet,some probabilities were still determined based on our experience.For example,the transitional probability between the same states of two slices,e.g.,the positive to positive or the negative to the negative,is considered to be relatively high;on the other hand the transitional probability between the opposite states, the positive to negative,or the negative to positive,is much lower.With all these efforts,we obtained the probabilities used in our DBN model,which are shown in Tables5–10.

In Table5,the numbers represent the conditional probability for SQ as the different events of the sleep_time and sleep_environment take place simultaneously.

In Table6,the numbers represent the conditional probability for WE as the different events of the temperature and noise take place simultaneously.

In Table7,the numbers represent the conditional probability for CR as the event of the active time or drowsy time takes place.

In Table8,the numbers represent the conditional probability for fatigue as the different events of SQ,WE and CR take place simultaneously.

In Table9,the numbers represent the conditional probability for EM,ECG,and EEG respectively as the event of fatigue take place simultaneously.

In Table10,the numbers represent the conditional probability for the current fatigue as the different events of SQ,WE,CR and the fatigue before the current fatigue take place simultaneously.

To get the data set of CR,we designed a questionnaire mainly concerning the time period in which the drowsy state is most likely to take place.The questionnaires were distributed among thirty computer science students of the Henan Univer-

Table5

Conditional probability for SQ.

Sleep_time node Sleep_environment node SQ node(states)

Bad Good

Suf?cient Poor0.340.66

Normal0.050.95 Deprived Poor0.950.05

Normal0.730.27

Table6

Conditional probability for WE.

Temperature node Noise node WE node(states)

Bad Good

High High0.940.06

normal0.80.2 Normal High0.730.27

Normal0.100.9

Table7

Probability for CR.

CR node(States=drowsy or awake)

Drowsy time0.940.06 Active time0.80.2

sity,China who were asked to answer questions regarding their drowsiness statees from 2:30P.M to 5:30P.M in the recent days.The statistical analysis of the questionnaire results in the probability for CR,as shown in Table 11.

To get the data sets of SQ,EEG,ECG and WE,a driver simulator equipped with instruments such as the CCD camera,EEG and ECG was acquired with the help of the Multi-Media Lab and the Psychology Lab of the Henan University.Thirty students from the Computer Science Department of Henan University who do not have any kind of sleep disorder volunteered to par-ticipate in the experiments.They were deprived of good sleep during the previous night (e.g.the sleep time was less than 6h)and were asked to participate in the simulation test when they came to the Lab after 2:30P.M next day.With this sce-nario (the Lab environment was relatively good),each participant was asked to operate the driving simulator at the speed of 65km/h,and no food or drink were permitted during the experiment.The probabilities of SQ and WE were determined and shown in Tables 12and 13.

The simulation experiments lasted from 2:30P.M to 5:30during which,each participant was asked to operate the driving simulator at the speed of 65km/h.The EEG and ECG signals of each participant were measured at the sampling rate of 250HZ,and his/her dynamical facial image was obtained at the sampling rate of 2seconds.The EEG,ECG and dynamical fa-cial image signals of each participant were collected at the same rate of 6minutes.Signals were processed with the corre-sponding methods to form the evidence data sets which are needed to infer driver’s fatigue estimation.For example,if the

evidence coming from EM is that PERCLOS is equal to 85,then P e 1;10;t ?0:89;P e 1;20;t ?0:42;P e 1;3

0;t ?0:18;if the evidence

coming from ECG is that the decrease of LF/HF is large,then P e 2;10;t ?0:92;P e 2;20;t ?0:21;P ee 2;3

0;t T?0:09;if the evidence

Table 10

Conditional probability for Fatigue node.Fatigue (time t à1)

SQ

WE

CR

Fatigue (time t )Drowsy

Active FA

Bad

Bad Drowsy 0.910.09Active 0.880.12Good

Drowsy 0.900.10Active 0.850.15Good

Bad Drowsy 0.870.13Active 0.820.18Good

Drowsy 0.830.17Active 0.810.19AL

Bad

Bad Drowsy 0.200.80Active o.170.83Good

Drowsy 0.180.82Active 0.130.87Good

Bad Drowsy 0.150.85Active 0.10.9Good

Drowsy 0.120.88Active

0.09

0.91

Table 8

Conditional probability for fatigue node.SQ

WE

CR Fatigue node Drowsy

Active Bad Bad High 0.980.02Normal 0.890.11Good

High 0.880.12Normal 0.770.33Good Bad High 0.510.49Normal 0.270.73Good

High

0.150.850.05

0.95

Table 9

Conditional probabilities for EM,ECG and EEG given fatigue node.Fatigue node

EM node ECG node EEG node Large

Medium Small Decrease No-change Increase Decrease No-change Increase FA 0.940.050.010.930.060.010.910.080.01AL

0.01

0.05

0.94

0.01

0.06

0.93

0.01

0.08

0.91

1950

G.Yang et al./Information Sciences 180(2010)1942–1954

coming from EEG is that the decreases in alpha rhythms is large,then P e 3;10;t ?0:91;P e 3;20;t ?0:19;P e 3;3

0;t ?0:10.These probabilities were assigned according to the statistical properties of the data obtained from the participants.

4.2.Results and discussion

Under the constructed simulation scenarios,computer simulations were performed on the proposed fatigue recognition

model by using the data described above.The simulation results are shown in Figs.4–7.Fig.4is the simulation result with the features of SQ,WE,CR,EM,EEG and ECG.It can be observed from Fig.4that:(1)the time period in which the participants are in their completely drowsy state is about from 3P.M to 3:45P.M,which is consistent with the ‘‘true”fatigue;(2)when multiple features of SQ,WE,CR,EM,EEG and ECG are employed to infer the driver’s fatigue,the estimation is almost com-pletely approximating the ‘‘true”fatigue after 30minutes,especially in the drowsy time period;and (3)the average square

error is 1=30?P

eestimated fatigue àtrue fatigue T2?0:5269.These results have provided a good validation of the effective-ness of the proposed fatigue recognition model.

Fig.5is the simulation result with the features of SQ,WE,CR,EM and EEG but without ECG.Fig.6is the simulation result with the features of SQ,WE,CR,EM and ECG but without EEG.Fig.7is the simulation result with the features of SQ,WE,CR and EM but without ECG and EEG.The following observations can be made from Figs.5–7:

Table 11

Probability for CR.Drowsy Active 0.89

0.11

Table 12

Probability for SQ.Bad Good 0.95

0.05

Table 13

Probability for WE.Bad Good 0.1

0.9

Fig.4.Simulation result (Features:SQ,WE,CR,EM,EEG and ECG).

G.Yang et al./Information Sciences 180(2010)1942–1954

1951

Fig.5.Simulation result (Features:SQ,WE,CR,EM,and EEG,without

ECG).

Fig.7.Simulation result (Features:SQ,WE,CR and EM,without ECG and

EEG).

Fig.6.Simulation result (Features:SQ,WE,CR,EM,and ECG,without EEG).

1952G.Yang et al./Information Sciences 180(2010)1942–1954

G.Yang et al./Information Sciences180(2010)1942–19541953

(1)When the ECG or EEG features are removed from the feature set,the performance of the fatigue estimation becomes

slightly worse than that of Fig.4,as can be observed from Figs.5and6.However,such a difference is not obvious, which can be highlighted by the fact that the average square error in Fig.5is0.6723,while the average square error for Fig.6is0.7488,both are a little bigger than the one(0.5269)in Fig.4.This shows that the ECG or EEG feature has an immediate impact on the inferring driver’s fatigue estimation.

(2)When both the ECG and EEG feature are removed from the feature set,an obvious difference exists between the esti-

mated fatigue and the true fatigue,especially in the drowsy time period,which can be seen from Fig.7.Thus,the per-formance of the fatigue estimation without ECG and EEG is much worse than that depected in Fig.4,which can be explained by the fact that the average square error in Fig.7is1.2629,while the average square error for Fig.4is

0.5269.

Comparing Fig.4with Fig.7,the previous works such as Ji et al.[16]that can be considered as the one without ECG and EEG(see Fig.7).Thus,the result based on the simulated experiment has implied that the proposed model may improve the accuracy of predictio.

5.Conclusion and future work

In this paper,a new method for inferring driver’s fatigue estimation based on the dynamic Bayesian network was pro-posed.Multiple features,including contextual,contact physiological,and contactless physiological features were used, which have the widest coverage of the categories of features.The?rst-order Hidden Markov Model(HMM)has been em-ployed to compute the dynamics of a Bayesian network at two different time slices.Simulation-based experiments were per-formed to demonstrate the validation of the proposed model.Two important conclusions can be drawn from this study:(i) more features,especially the contact physiological feature category,which covers more features implying driver fatigue rec-ognition,are favorable for inferring the driver fatigue more reliably and accurately;(ii)the ECG and EEG are two important features for fatigue recognition,and they should not be absent from consideration in any driver fatigue detection system.

It would be of signi?cant interest to extend the current model of a discrete random process to a continuous random pro-cess to handle more practical situations;and also to investigate how to decrease the subjectivity in determining the transi-tion probability(i.e.,learning the DBN structure and parameters from the samplings),which is very important for the problem discussed in this study.We hope that this work would generate further interest in this challenging research problem.

Acknowledgements

The corresponding author Dr.Lin would like to acknowledge the?nancial supports from the National Science Foundation (NSF)and the Natural Sciences and Engineering Research Council(NSERC)of Canada throughout the research. References

[1]L.M.Bergasa,J.Nuevo,M.Sotelo,A.R.Barea,M.E.Lopez,Real-time system for monitoring driver vigilance,IEEE Transactions on Systems7(2006)63–

77.

[2]T.J.Budi,https://www.wendangku.net/doc/1a5078373.html,l,P.Fischer,E.Bekiaris,Using EEG spectral components to assess algorithms for detecting fatigue,Expert Systems with Applications36

(2009)2352–2359.

[3]H.Cai,Y.Lin,A roadside ITS data bus prototype for future intelligent highway,IEEE Transactions on Intelligent Transportation Systems9(2008)344–

348.

[4]G.Calcagnini,G.Biancalana,F.Giubilei,S.Strano,S.Ceruti,Spectral analysis of heart rate variability signal during sleep stages,in:Proceedings of the

16th Annual IEEE International Conference,1994,vol.2,pp.1252–1253.

[5]H.Chen,P.Meer,Robust fusion of uncertain information,IEEE Transactions on Systems Man,and Cybernetics,Part B35(2005)578–586.

[6]C.Conati,Probabilistic assessment of user’s emotions in educational games,Applied Arti?cial Intelligence16(2002)555–575.

[7]R.O.Duda,P.E.Hart,D.G.Stork,Pattern Classi?cation,second ed.,Wiley,New York,2001.

[8]B.Fasel,J.Luettin,Automatic facial expression analysis:a Survey,Pattern Recognition36(2003)259–275.

[9]G.Yang,Y.Lin,P.Bhattacharya,Multimodality inferring of human cognitive states based on integration of neuro-fuzzy network and information fusion

techniques,EURASIP Journal on Advances in Signal Processing2008(2008)14.

[10]G.Hamonda,F.F.Saccomanno,Neural network model for truck driver fatigue accident detection,in:Proceedings of the IEEE Canadian Conference on

Electrical and Computer Engineering,Montreal,Canada,vol.1,1995,pp.362–365.

[11]C.D.He,C.C.Zhao,Evaluation of the critical value of driving fatigue based on the fuzzy sets theory,Environmental Research61(1993)150–156.

[12]J.A.Healey,Wearable and Automotive Systems for Affective Recognition from Physiology,Doctoral Thesis,Department of Electrical Engineering and

Computer Science,Massachusetts Institute of Technology,Cambridge,MA,2000.

[13]W.Horng,C.Chen,Y.Chang,C.Fan,Driver fatigue detection based on the eye tracking and dynamic template matching,in:Proceedings of the IEEE

International Conference on Networking,Sensing and Control,Taiwan,vol.1,2004,pp.7–12.

[15]Q.Ji,Z.Zhu,https://www.wendangku.net/doc/1a5078373.html,n,Real-time nonintrusive monitoring and prediction of driver fatigue,IEEE Transactions on Vehicular Technology53(2004)1052–

1068.

[16]Q.Ji,https://www.wendangku.net/doc/1a5078373.html,n,C.Looney,A probabilistic framework for modeling and real-time monitoring human fatigue,IEEE Transactions on Systems Man,and

Cybernetics,Part A36(2006)862–875.

[17]T.P.Jung,S.Makeig,M.Stensmo,T.J.Sejnowski,Estimating alertness from the EEG power spectrum,IEEE Transactions on Biomedical Engineering44

(1997)60–69.

[18]D.Kim,Z.Bie,K.Park,Fuzzy neural network-based approach for personal facial expression recognition with novel feature selection method,in:

Proceedings of the12th IEEE International Conference on Fuzzy System,St.Louis,Missouri,USA,vol.2,2003,pp.908–913.

1954G.Yang et al./Information Sciences180(2010)1942–1954

[19]https://www.wendangku.net/doc/1a5078373.html,l,A.Craig,P.Boord,L.Kirkup,H.Nguyen,Development of an algorithm for an EEG-based driver fatigue countermeasure,Journal of Safety

Research34(2003)321–328.

[20]https://www.wendangku.net/doc/1a5078373.html,l,A.Craig,A critical review of the psychophysiology of driver fatigue,Biological Psychology55(2001)173–194.

[21]X.Li,Q.Ji,Active affective State detection and user assistance with dynamic Bayesian networks,IEEE Transactions on Systems Man,and Cybernetics,

Part A35(2005)93–105.

[22]Y.Lin,W.J.Zhang,L.G.Watson,Using eye movement parameters for evaluating human–machine interface frameworks under normal control operation

and fault detection situations,International Journal of Human Computer Studies59(2003)837–873.

[23]Y.Lin,P.Tang,W.J.Zhang,Q.Yu,Arti?cial neural network modeling of driver handling behavior in a driver–vehicle–environment system,International

Journal of Vehicle Design37(2005)24–45.

[24]T.H.Linh,M.Stodolski,S.Osowski,On-line heart beat recognition using Hermite polynomials and neuro-fuzzy network,IEEE Transactions on

Instrumentation and Measurement52(2003)1224–1231.

[25]K.P.Murphy,Dynamic Bayesian Networks:Representation,Inference and Learning,Doctoral Thesis,University of California,Berkeley,2002.

[26]Y.Norimatsu,S.Mita,K.Kozuka,T.Nakano,S.Yamamoto,Detection of the gaze direction using the time-varying image processing,in:Proceedings of

the IEEE International Conference on Intelligent Transportation Systems,Shanghai,China,vol.1,2003,pp.74–79.

[28]R.W.Picard,E.Vyzas,J.A.Healey,Toward machine emotional intelligence:analysis of affective physiological state,IEEE Transactions on Pattern

Analysis and Machine Intelligence23(2001)1175–1191.

[30]T.Pierre,B.Jacques,Monotony of road environment and driver fatigue:a simulator study,Accident Analysis and Prevention35(2003)381–391.

[31]J.C.Principe,S.K.Gala,T.G.Chang,Sleep staging automaton based on the theory of evidence,IEEE Transactions on Biomedical Engineering36(1989)

503–509.

[32]S.Roberts,I.Rezek,R.Eversor,H.Stone,S.Wilson,C.Alford,Automated assessment of vigilance using committees of radial basis function,IEE

Proceedings of Science,Measurement and Technology147(2000)333–338.

[33]O.G.Tal,S.David,Driver fatigue among military truck drivers,Transportation Research Part F3(2000)195–209.

[34]TRB Driver Behavior Modeling Workshop,January13,2008..

[35]L.Ulf,Noise and fatigue in working environments,Environmental International16(1990)471–476.

[37]P.Vysoky′,Changes in car driver dynamics caused by fatigue,Neural Network World14(2004)109–117.

[38]P.Vysoky′,Central fatigue identi?cation of human operator,Neural Network World11(2001)525–535.

[39]T.Watanabe,K.Watanabe,Noncontact method for sleep stage estimation,IEEE Transactions on Biomedical Engineering51(2004)1735–1748.

[40]W.W.Wierwille,L.A.Ellsworth,S.S.Wreggit,R.J.Fairbanks,C.L.Kirn,Research on vehicle-based driver status/performance monitoring:development,

validation,and re?nement of algorithms for detection of driver drowsiness,National Highway Traf?c Safety Administration Final Report:DOT HS808 247,1994.

[41]B.J.Wilson,T.D.Bracewell,Alertness monitor using neural networks from EEG analysis,in:Proceedings of the IEEE Workshop on Neural Networks for

Signal Processing X,Sydney,Australia,vol.2,2000,pp.814–820.

[43]Y.Zhang,Q.Ji,C.G.Looney,Active information fusion for decision making under uncertainty,in:Proceedings of the5th International Conference on

Information Fusion,vol.1,2002,pp.643–650.

[44]Y.Zhang,Q.Ji,Active and dynamic information fusion for facial expression understanding from image sequences,IEEE Transactions on Pattern Analysis

and Machine Intelligence27(2005)699–714.

[45]Y.Zhang,Q.Ji,Active and dynamic information fusion for multisensor systems with dynamic Bayesian networks,IEEE Transactions on Systems,Man

and Cybernetics,Part B36(2006)467–472.

[46]S.-M.Zhou,J.Q.Gan,F.Sepulveda,Classifying mental tasks based on features of higher-order statistics from EEG signals in brain–computer interface,

Information Sciences178(2008)1629–1640.

模型驱动的开发方法——基于面向对象的开发

模型驱动的开发方法——基于面向对象的开发 2012210874 魏翔案例 案例名称:《基于UML的GRAPPLE在数字化医院信息系统设计中的应用》 案例简述: GRAPPLE (Guidelines for Rapid application Engineering: 快速应用工程指导原则)主要适用于面向对象系统。因此,每个段中的动作主要是生成面向对象的工作产品。GRAPPLE 所包括的5个段分别为: 1需求收集 1.1发现业务过程 首先要分析员要用客户业务常用的词汇与客户进一步面谈,从而建立一个或者一组能够捕获业务过程中的步骤和判定点的活动图,即从客户的业务流程出发理解系统。 1.2领域分析 领域分析可以与前一个动作同时进行,它们的共同目标是达到对某特定领域的理解。在此过程中,分析员需要分析与客户的会谈从而开发初步类图、建立和标记类之间的关联并且找出关联的多重性。 1.3发现系统需求 在此阶段,GRAPPLE 要求开发组举行一次联合应用开发会议,参加者包括客户的决策者、用户以及开发组成员。会议的参加者一同收集系统需求,需求收集的结果是一个包图,这个包图中的每个包代表系统的一个主要功能模块,每个包中包括一组用例,它们详细说明这个包代表的功能。本系统最重要的是事务对象包,它包括了系统涉及的大部分功能模块,例如挂号收费模块、看病诊断模块、取药模块、住院出院模块等;用户接口包定义了数据导入导出接口、打印接口;数据库包则定义了系统使用的数据库表、视图、存储过程。 2分析 2.1开发用例 “发现系统需求”阶段得到的每个功能包中的用例说明系统必须要做的事。在“开发用例”阶段开发组还必须分析和理解每个用例,描述用例执行步骤以便绘制详细用例图。HIS 系统案例的用例图如图 1所示。

MDA白皮书-模型驱动开发和UML+2.0

白皮书 模型驱动开发和UML 2.0 传统编程方式的终结? 本文档包含Telelogic AB专有信息。未经Telelogic AB书面许可,不得使用本文档内的任何信息,不得复印、影印本文档的任何部分。

前言 “模型驱动开发”——体会一下这几个词。它们说出了这个不断变化的工业中一个新的改变。这里不是说一种革命,而是一种缓慢的变化,但是肯定会渗透到我们开发系统的方式中。这种推动将降低代码的重要性,并且专注于一些开发中的真正事情:最终的应用程序被期望怎样工作,并确保你能够根据客户的需求可靠地建立起它来。 模型驱动开发是更伟大视景MDA中的一部分。MDA是模型驱动体系架构(Model-Dri ven Architecture)的简称,由对象管理组织OMG(Object Management Group)所驱动。M DA表示了一种模型驱动开发方法的概念框架。然而,尽管完整的MDA还没有成为现实,模型驱动开发现在已成为可能。实际上,它已以较低级的形式存在了较长一段时间,所以我们并不是在做某种新的东西(当然,除非你在听某些市场人员的宣传)。 没有魔法 如果模型驱动开发这么好的话,为什么不是每个人立刻加入到这个潮流中来呢?首先,模型驱动开发不是一个银子弹,能神奇地解决你所有的问题。总有某人需要去实现系统的功能,并且还找不到任何工具来完成这一点。所有你能发现的工具只是使这项工作更容易和直接一些。 第二,采用模型驱动开发,并不只是在开发项目的过程中更换一种工具。它还必须和已根深蒂固的开发过程结合起来(如果没有的话,你就可以开始使用模型驱动开发了;否则你就只能改善当前的情况),但实际上更重要的是,你还会担心它对现有应用程序的影响。决定改用基于模型的方法前确实需要有一些仔细的考虑,并且,一般说来,为了不影响当前的工作,你只会在新项目中改变开发方法。 第三,你还需要获得那些使用工具的人们的支持(你需要一些工具来应用模型驱动开发)。开发人员常会认为“模型驱动开发不是编程”而回避它,并且当心他们的工作难于被接受。他们还可能担心模型驱动开发将会使他们以前辛苦学来的一些技巧过时。他们的担心也不是完全没有理由。采用模型驱动开发后,市场确实很有可能会减少对那些精通好几种编程语言的开发人员的需求。但是另一方面,所有好的开发人员,首先和最主要的是,他们是问题的解决者。他们感兴趣的是尽可能地为手边的主要问题找到新的更好的解决方案。模型 第 2 页/共 2 页

数据驱动经验分享:从方法到实践

目录 1.数据驱动价值:驱动决策、驱动产品智能 2.数据驱动闭环:数据采集—数据建模—数据分析—数据反馈 3.数据驱动各环节方法与实践 一、数据驱动价值:驱动决策、驱动产品智能 数据驱动能做什么? 我们认为主要包含驱动决策、驱动产品智能两方面的价值。 图 1 数据驱动价值 驱动决策包括运营监控、产品迭代、营销分析、商业决策。 其中涉及的每一个场景在今年数据驱动大会都会有专门的讲师来介绍。 驱动产品智能,现在基本上已成为所有的电商类、资讯类产品的标配,如“产品推荐”、“猜你喜欢”等。企业要么组建团队实现智能化的应用场景,要么应用外部工具来解决问题,因为在流量红利逐渐消失的今天,千篇一律的内容会让你的“留存”数字非常难看。 我们曾为某一家很知名资讯类企业做 Feed 流的改版,神策来提供具体的推荐策略。通常,个性化推荐的评价指标是 CTR——展现了一千种内容,有多少人点击? 在 2018 年,我们认为再评价一个算法的好坏,用 CTR 非常不合适。神策从关注指标 CTR 转为衡量“命中了策略的人”跟“命中热门随机内容”的两大用户群体,观察他们在平均访问深度、7 日留存、停留时长等更深层指标上的差异。

二、数据驱动闭环 数据采集——数据建模——数据分析——数据反馈,这是一个完整的数据驱动闭环。我们在很多场合提到此,这里不再赘述。 PPT 下载 | 神策数据曹犟:数据驱动从方法到实践 图 2 数据驱动闭环 有很多企业来找我做关于数据采集方面的分享,我用这张图描述了典型的数据分析平台,一个为数据驱动而构建的数据分析平台,各位可以参考。 PPT 下载 | 神策数据曹犟:数据驱动从方法到实践

MDA模型驱动开发方法学

MDA模型驱动开发方法学 主讲:张文(Jevons)一、传统软件工程方法学 传统的软件开发方式有许多模型,瀑布模型是其中最典型也最受诟病的一种,为了描述一个软件的生命周期,我们暂时以这种模型来阐述一下软件开发的过程。 软件开发要经历可行性分析研究,需求分析,总体设计(概要设计),详细设计,集成和测试等过程。一个成熟的软件模型在这些环节都需要生成大量的文档,目前的很多CMMI工具能很好的管理好这些文档,比如将需求文档关联到后期的详细设计的过程或编码的过程等。由于这个过程的生命周期太长,导致了开发过程中发现的问题不能及时反映到模型中来(虽然某些工具能跟踪到需求的变化),这个传统的工作过程虽然在目前遇到了极大的挑战,所以目前非常流行所谓的敏捷开发,本人也非常崇尚这种开发方式,但从我的经验来看,敏捷开发应该更多的体现在小项目或大项目的子模块的开发。对于一个较大的项目而言,一定的设计和研讨还是必不可少的。但如何解决之前所提到的开发周期过长,错误反馈不到位的诟病呢? 我认为,在详细设计阶段,如果能有一个好的开发模型将能极大的解决这种问题,而MDA就是这么一个开发模型。 二、MDA的过程

MDA,全称叫模型驱动开发,顾名思义,开发是由模型来推动的,即开发之前需要建立良好的模型。 也许大家现在有了一定的概念了,因为大家在大大小小的开发时都会画一些uml图,建立一定的模型,然后一个软件的雏形就应运而生了。如果大家能做到这一步,恭喜你,说明你已经具备一定的设计能力了。但我也要反问你,在工作过程中,请问有哪次的模型是你自己觉得非常满意的,或者说是你的得意之作吧。面对这个简单问题,我想任何肯定回答都是牵强的,因为小的软件过程基本上不需要良好的设计,而大的软件过程,则很难做到良好的设计,如果没有一个良好的开发机制的话。 而MDA的开发方式则不一样,因为设计和编码可以融为一体,而且任何编码之前都是设计,任何设计都能生成编码,代码中也能访问到设计中的元数据定义,这就是MDA的神奇之处。 三、MDA的具体实施 金蝶的MDA方式建立在金蝶BOS的基础之上,BOS意思是Busingess Operation System,意思是业务定义系统,但远没那么牛,但在这个工具上实施MDA则是恰到好处。 一个典型的开发过程如下:首先定义实体,该实体具有一定的属性,而且从一定的父实体集成过来(如表单,基础数据等),这个实体也有一定的业务方法,在业务方法的定义中可以确定参数、返回值和异常,同时,可以在方法上定义EJB事务属性等。这些方法都可

模型驱动案例设计

案例一、超市管理系统。是一个面向超市用来进行超市日常信息处理的管理信息系统。该系统能够方便地为超市的售货员提供各种日常售货功能,也能够为超市的管理者提供各种管理功能,如进货、统计商品等。 案例二、考试成绩管理系统。是对每个参与考试的学员成绩进行综合管理的系统。学员报名参加相应的科目考试,通过该系统办理考试报名,并产生相应的考试编号。每次考试完成后,管理员及时将考试学员的考试成绩录入到该系统中。学员和管理员均可查询考试成绩。管理员可以进行各类信息的管理,如查询、删除等。同时该系统能够根据学员考试成绩,执行统计分析并分类显示。 案例三、网上教学系统。学员登录本系统后可以浏览网站的网页信息、选择和查找自己所需要学习的文章和课件并进行下载。教师可以登录本系统,在网站上输入课程介绍,上传课程的课件,发布、更新和修改消息。管理员可以维护本系统页面和批准用户申请注册。 案例四、汽车租赁系统。客户可以通过电话、网上和前台预订租借车辆。客户填写订单后,职员查看客户租赁记录,如记录无问题,同意客户的预订;如果记录情况不佳,可拒绝预订的请求;如果没有查到客户记录,则建立新的客户记录,并通知客户。客户取车时出示通知,职员查看无误后,要求客户支付押金,填写工作记录并更新车辆状态,将车借与客户。客户还车时,结清租借车辆的金额,职员更新车辆状态,填写客户记录,更新工作记录。 案例五、酒店订房系统。可以向用户提供客房介绍、客房预订、预订

变更、客房入住、退房结账、旅客信息查询、娱乐介绍、留言簿等使用功能。订房人可以通过电话、短信、网络或面对面等方式预订客房。允许预订人根据自己情况的变化更改预订信息。旅客入住客房前需要出示证件并登记,并要预交一定的押金。旅客提交押金后,柜台工作人员将要登记旅客信息、分配房间,并打印旅客入住单,旅客持入住单到指定客房入住。旅客离开宾馆前需要结账退房。旅客或宾馆管理人员可以随时查询旅客或客房的入住信息。 案例六、在线购物系统。客户可以在厂商的网页上挑选计算机。计算机分为服务器、台式机和笔记本电脑。客户可以在线挑选标准配置或者按照自己期望的配置组装。可配置的组件如内存,以下拉列表的方式共客户选择。对于每一种新配置,系统都能计算价格。为了使订单生效,客户必须填写送货地址和支付信息。一旦订单被提交,系统会给客户发电子邮件,确认订单的详细信息。在等待过程中,客户随时可以查看订单的状态。 案例七、音像商店管理系统。音像店想要给更广泛的人群提供娱乐素材的租赁和销售。它将保持CD、DVD的存货。存货都是从一个供应商那里订购。现有的客户能够预约娱乐资料,并在指定的日期来取。系统必须具有灵活的搜索引擎来回答客户的查询,包括资料的查询。对于音箱商店没有的资料,可以根据要求订购。 案例八、高校教材管理系统。高校的每个学生使用自己的姓名和学号登陆系统后,可以查询自己每个学期的教材使用情况,也能够查询自己的教材费用。高校的每个教师使用自己的姓名和密码登陆系统后,

数据驱动建模和控制系统设计案例研究

数据驱动建模和控制系统设计案例研究 Motor Control Case Study in Data-Driven Modeling and Control Design 迈斯沃克软件公司 作者:PravallikaVinnakota 摘要:本文以简单的直流电机控制系统为例,介绍如何从输入输出数据辨识对象模型,使用辨识的模型来设计控制器并予以实 施。工作流程包括以下步骤:采集数据,辨识线性和非线性对象模型,设计和仿真反馈控制器以及在嵌入式微处理器上实施这些控制器以便实时测试。在物理原型或对象硬件上调节控制器可能造成不安全运行状态甚至损坏硬件。一种更可靠的方法是构建一个对象模型并进行仿真,在不同的运行条件下验证控制器,以便无风险地运行假设情景。当机理建模不可行时,备选方法是通过对象的输入输出数据来开发模型。一个低阶的线性模型可能足以用来设计基本控制器。但较高性能的控制器的详细分析和设计需要一个具有较高精度的模型,且可能是非线性模型。 直流电机:控制设计目标 物理系统是通过电机驱动连接到Arduino Uno 板卡上的一台直流电机(图 1)。我们想为这台电机设计一个用于跟踪参考位置的反馈控制器。该控制器将基于电机位置参考数据生成合适的电压命令。此电压作用于电机时,会促使电机产生扭转电机轴的扭矩。我们将使用电位计测量电机轴旋转的角度,然后将此角度反馈给控制器。 电机驱动集成电路 (IC) 增加了驱动电流并能够双向驱动电机。我们通过Arduino 板卡上的“模拟输入”引脚接收电机位置数据,然后计算参考位置与实际位置(控制器输入)之间的误差。我们将一个电压命令(控制器输出)发送到板卡上的两个“模拟输出”引脚,为 PWM 信号。这些信号连接到驱动电路,为电机提供适当的驱动电流。 控制器必须保持系统稳定,并以最小的稳态误差和超调量提供快速参考跟踪。 图 1. 连接直流电机的Arduino 板卡

模型驱动的嵌入式仿真系统设计

—237— 模型驱动的嵌入式仿真系统设计 李秀萍,董云卫 (西北工业大学计算机学院,西安710072) 摘 要:为解决嵌入式系统仿真应用需求多样性的问题并提高系统的开发效率,设计一种通用嵌入式仿真系统。该系统在Matlab/Simulink 开发环境的基础上,采用模型驱动的方法设计仿真模型并构建仿真组件库,实现了仿真系统模型的快速建立。同时设计了多接口、可扩展的仿真器硬件结构,解决了嵌入式系统接口的多样性问题。该仿真系统具有良好的可重用性和可移植性等特点,可用于多种嵌入式软件的开发,具有现实意义。 关键词:仿真系统;模型驱动架构;仿真模型;组件库 Design of Model-Driven Embedded Simulation System LI Xiu-ping, DONG Yun-wei (College of Computer, Northwestern Polytechnical University, Xi’an 710072) 【Abstract 】In order to solve the problem of diverse simulation application and improve the efficiency of development, a general simulation system for embedded software is designed, which adopts Model-Driven Architecture(MDA) development to construct simulation model for embedded system simulation based on the Matlab/Simulink. A simulation component library is built to achieve rapid establishment of the simulation system model. Extensible hardware of simulator is designed to fit variable I/O interfaces of the embedded system. The system has some strong advantages,such as reusability, portability, and can be used in the development of various embedded software. 【Key words 】simulation system; Model-Driven Architecture(MDA); simulation model; component library 计 算 机 工 程Computer Engineering 第36卷 第16期 Vol.36 No.16 2010年8月 August 2010 ·工程应用技术与实现·文章编号:1000—3428(2010)16—0237—03 文献标识码:A 中图分类号:TP391.9 1 概述 嵌入式系统是面向具体应用领域的特定软硬件的紧密结合体。因此,嵌入式软件对特定嵌入式硬件具有较强的依赖性。在嵌入式软件开发前期,由于真实的目标环境还没建立,因此必须向开发人员提供与目标硬件相似的仿真环境,使嵌入式软件能够尽早得到较真实的运行确认[1],以提高嵌入式系统的开发效率、缩短开发周期、减少开发成本。 仿真平台是嵌入式系统开发的重要支持工具,在嵌入式系统开发的很多领域得到广泛应用,但也出现了一些问题:(1)用户应用需求的多样性要求仿真平台具有可配置、可定制的能力;(2)由于开发时间越短越好,因此要求能够在现有仿真硬件的基础上快速地开发出一套仿真软件。为解决上述问题,本文运用模型驱动架构(Model-Driven Architecture, MDA)的思想并基于Matlab/Simulink 开发平台,设计了通用的嵌入式仿真系统。该系统由硬件和软件2个部分组成,硬件提供了多种I/O 接口,实现了平台的可扩展性,能够适应嵌入式系统接口多样性的需求;仿真软件使用模型驱动的开发方法使仿真软件具有可定制、可重用等特点。该仿真系统可以大幅度提高嵌入式系统的开发效率,能够对嵌入式系统的实时性、可靠性等进行验证,具有较高的实用价值。 2 理论基础 MDA 的提出为通用嵌入式仿真系统的实现提供了很好的解决方法。MDA [2]是软件工程领域近年来的重要研究成果,MDA 方法使设计者能够独立于具体平台进行系统设计,而最终又能够在某个具体平台中实现系统,从根本上解决了软件模型与实现代码之间难以同步的问题,实现系统的可重用性,使系统具有良好的可配置性和可移植性。MDA 软件 设计方法已经在现实的软件工程中得到了广泛应用,在仿真领域也得到了应用。 Matlab/Simulink [3]是一种对动态系统进行建模、仿真和分析的软件包,可以快速创建与系统交互的物理对象的动态行为模型。Simulink 使用图形化的编程方式,操作方便直观,允许用户用S 函数自定义模块。S 函数扩展了Simulink 的功能;Matlab 工具RTW(Real-Time Workshop)可用Simulink 模型生成优化的、可定制的、可移植的代码,此程序可以在实时系统和非实时系统等众多目标环境中运行仿真。因此,Matlab/Simulink 为模型驱动的仿真系统开发提供了工具 支持。 3 通用嵌入式仿真系统设计 3.1 嵌入式仿真系统组成 嵌入式仿真系统由仿真主控计算机、仿真器、嵌入式目标机、作动器等组成,如图1所示。目标机和作动器是进行具体仿真的连接对象,这里不作介绍。其中,仿真主控计算 机是一台普通PC , 具有C++ Compiler 、Matlab/Simulink 、RTW 等软件,通过以太网或串口与仿真器相连,在其上进行组件库开发、仿真模型开发、仿真参数设置、代码生成和下载、仿真控制、仿真数据回显和仿真结果分析等。为了满足嵌入式系统的实时性要求,仿真器上运行xPC 目标、VxWorks 等 基金项目:国家自然科学基金资助重点项目“高可靠构件化嵌入式软件设计与验证技术及其支撑环境研究”(60736017) ;国家“863”计划基金资助项目“高可信嵌入式软件生产线”(2007AA010304) 作者简介:李秀萍(1985-),女,硕士研究生,主研方向:嵌入式系统设计与仿真;董云卫,教授、博士生导师 收稿日期:2010-02-11 E-mail :lixiuping0322@https://www.wendangku.net/doc/1a5078373.html,

模型驱动的体系架构MDA

模型驱动的体系架构MDA 很多组织已经开始对模型驱动的体系架构(MDA)进行关注,MDA 是一种应用系统设计和实现的方法。对于几个原因来说这都是非常积极的发展。 MDA 鼓励在软件的开发过程中有效的使用系统的模型,并且它支持创建类似系统的最佳实践的重用。所谓由对象管理组织(OMG)定义的标准,MDA 是一种组织和管理被自动化工具支持的企业体系架构和用于定义模型和推动不同模型类型之间的转换的服务的方法。 当被 OMG 定义的 MDA 标准和用于创建和进化企业级软件系统的术语在业界被广泛的引用时,仅仅到目前为止, OMG 和它的成员,包括 IBM Rational ,已经能够在 MDA 意味着什么、MDA 将向哪里发展、MDA 的哪些方面对于今天的技术是可能的和如何在实践中利用 MDA 上提供清晰的指导。 有效的企业软件开发 今天开发企业级的应用要求一种软件架构的方法,这种方法应该能够以一种灵活的方式帮助架构师来发展他们的架构。这种方法应该允许在及时的实现业务功能的新的能力的情况下重用已有的劳动成果,甚至是当目标基础架构本身在一直的演进。两个重要的思想现在被认为是应对这种挑战的中心: ? 面向服务的体系架构(SOA)。企业解决方案能够被视作通过良好的说明定义了他们的服务接口契约连接的服务联合。结果的系统设计通常被称作面向服务的体系架构(SOAs)。通过将一个系统组织成为被封装好的服务集合,这些服务可以通过他们定义的服务接口被操作,系统的灵活性被大大的增强了。现在很多组织用一系列的服务和服务之间的相互连接表示他们的解决方案。 ? 软件的产品线。通常,在一个组织开发和维护的系统中,存在着大量的可公用的部分。从捕获核心业务过程和领域概念的标准领域模型,到开发人员在代码中使用的实现设计的实现细节方案,我们在企业的软件项目的每一个级别上看到了重用的方法。当模式能够被经验丰富的从业者开发出来并在跨越组织的范围内传播时,软件开发组织将获得大量的效率。这表现了一种朝着促进计划的资产重用,增加自动化的级别来实现被开发系统大部分的方案的软件产品线开发视图的迁移。更加普遍的情况下,我们能够将在开发的产品线视图中定义良好模式的应用理解成为一种从一个抽象级别到一个更底层抽象级别的方案转化描述的方法。 这两种思想对对象管理组织(OMG)的思想有着重大意义的影响,一个开发和支持规范以改进企业软件开发和部署实践的软件组织联盟(在下一个部分 OMG 将扮演更重要的角色)。OMG 已经创建了一个概念性的框架,这个概念性的框架将平台选择与独立的面向业务的决定分离开来以使在架构和演进这些系统时允许更大的灵活性。这个概念性框架和帮助实现它的标准就是 OMG 称为的"模型驱动的体系架构(MDA)."。应用的架构师使用 MDA 框架作为表示他们企业架构的蓝图,并且使用在 MDA 中的开发标准作为他们独立于供应商和技术的"未来的证明"。 OMG 的 MDA 的概念通过 OMG 的构建模型的标准对系统的交互性提供了一种开放的、供应商中立的方法:统一建模语言(UML),Meta-Object Facility (MOF),XML Metadata Interchange (XMI) 和Common Warehouse Meta-model (CWM) 。企业应用的描述能够使用这些建模标准被建立并被转化到一种主流的开发的或者是私有的平台上,包括 CORBA ,J2EE ,.NET 和基于 Web 的平台。 在我们开始深入的了解 MDA 之前,让我们考虑一下在软件开发中进行建模的基本概念和好处。 建模的基本原理 模型提供了一个物理系统的抽象,模型可以让工程师们通过忽略无关的细节而把注意力放到系统的重要部分来思考系统。工程中的所有工作形式都依赖模型来理解复杂的、真实世界的系统。模型被用在很多的方面:预期系统的质量,当系统的某些方面变化时推理特定的属性,和为各种涉众沟通关键的系统特征。模型也可以作为实现物理系统的先驱被开发,或者模型可以根据一个已存在的系统或者开发中的系统被产生作为理解系统行为的帮助手段。

基于TMS320DM642驱动模型的驱动程序开发

基于TMS320DM642驱动模型的驱动程序开发 武汉大学金朝辉 随着新技术不断涌现和DSP实时系统日趋复杂,不同类型的外部设备越来越多,为这些外部设备编写设备驱动程序已成为依赖操作系统管理硬件的内在要求。但是,由于内存引脚、响应时间和电源管理等条件的限制,为一个给定的DSP系统编写设备驱动程序有时会很困难。针对设备驱动程序开发者遇到的上述难题,TI公司为C64X系列DSP的开发者提供了一种"类/微型驱动模型(Class/Mini-driver Model)",该模型在功能上将设备驱动程序分为依赖硬件层和不依赖硬件层,两层之间使用通用接口。实践结果表明,采用类/微型驱动模型进行设计后,应用软件可以复用绝大部分相似设备的驱动程序,从而提高驱动程序的开发效率。 1 类/微型驱动模型简介 在类/微型驱动模型中,类驱动通常用于实现多线程I/O请求的序列化和同步功能;同时对设备实例进行管理。在包括视频系统I/O和异步I/O的典型实时系统中,只有少数的类驱动需要表示出外部设备的类型。 类驱动通过每个外部设备独有的微型驱动对该设备进行操作,微型驱动则通过控制外设的寄存器、内存和中断资源来实现对外部设备的控制,微型驱动程序必须将特定的外部设备有效地表示给类驱动。例如:视频显示设备存在一些不同的帧存,应用软件会根据不同的I/O操作进行帧存的分配,此时微型驱动必须映射视频显存,使得类驱动可对不连续的内存(分别存放RGB或YUV分量)设计特定的I/O请求,类/微型驱动模型允许发送由开发者定义数据结构的I/O请求包给微型驱动来控制外部设备,此分层结构使设备驱动的复用能力得到加强,并且丰富了发送给微型驱动I/O 请求包的结构。 类/微型驱动模型的结构如图1所示,上层应用程序并非直接控制微型驱动,而是使用一个或一个以上的类驱动对其进行控制。每个类驱动在应用程序代码中表现为一个API函数,并且通过微型驱动的接口IOM与微型驱动进行通信,类驱动使用DSP/BIOS的中的API函数来实现诸如同步等系统服务(DSP/BIOS是TI公司推出的一种实时操作系统,实际上它是一组可重复调用系统模块的ABI函数集合)。到目前为止DSP/BIOS共定义了3种类驱动:流输入输出管理模块(SIO/DIO)、管道管理模块(PIP/PIO)和通用输入输出模块(GIO)。在PIP/PIO和SIO/PIO类驱动中,调用的API函数已存在于DSP/BIOS的PIP和SIO模块中,这些API函数将参数传给相应的适配模块(Adapter),适配模块再与微型驱动交换数据。在GIO类驱动中,调用的API函数直接与微型驱动通信(需在CCS2.2以上)。

相关文档