Emotion modeling

From Hanson Robotics Wiki
(Redirected from Emotion Modeling)
Jump to: navigation, search

Emotion modeling is a critical part of the OpenPsi function, which in turn drives behavior via the action orchestrator.

The paradigm for emotion modeling used in OpenCog is based on Joscha Bach's elaboration of Dietrich Dorner's Psi theory of human emotion. This appears to provide a solid, scientifically-based foundation for handling motivations, emotions and personalities in Hanson Robots. However, it will require plenty of elaboration and tweaking to be customized appropriately for the HR context.

See Chapter 4 of Joscha's book Principles of Synthetic Intelligence, a draft of which is at


See Figure 4.7 and the following discussion for information on "proto-emotions" and emotions. A direct impelmentation of this theory in the Hanson Robotics / OpenCog framework would involve having behavior trees (or other similar components) send OpenCog signals indicating the modulation of these proto-emotions based on current environmental conditions.

See also the paper "A Framework for Emergent Emotions, Based on Motivation and Cognitive Modulators" , which goes into a little more detail about the relation between Psi and personality and emotion: http://goertzel.org/BachEmotionPreprint.pdf

See also the paper by Jinhua Cai, summarizing his PhD thesis work using OpenPsi (OpenCog's implementation of the Psi model of emotion and motivation) to control a simple animated character in a game world:


The following sections of this wiki page are (in their initial version) Ben Goertzel's attempt to simplify key aspects of the Psi model of emotion and personality for the particular purpose of guiding emotion and personality for Hanson Robots in the near term. Some things are treated in a fairly "fast and loose" manner for sake of clarity and near-term implementability. The rest of the page is intended to by read by folks who have already read the two papers linked above and thus have a basic idea of Psi theory.


The key modulators used in Psi to help explain emotions are:

  • Valence: amount of + or - reinforcement signals
  • Arousal: urgency and importance of currently active demands
  • Resolution level: Urgency of the leading demand. If something is really urgent,

perception gets “quick and dirty”. If nothing is so urgent, perception can be slow and careful.

  • Selection threshold: How much resistance is there to changing the dominant demand
  • Goal-directedness: controls random exploratory behaviors vs. goal-oriented behaviors
  • Securing rate (frequency of background checks): How often does the agent check to be sure the environment around is safe. High importance of the leading motive should lead to a reduction in background checks.

Emotions are viewed as corresponding to regions in the dimensional space whose axes are these proto-emotions, together (in some cases) with activation of particular cognitive subsystems.

How should these be updated in a near-term Hanson Robotics context?

  • Valence: Behavior trees (or other similar mechanisms) need to feed OpenCog information on whether the humans interacting with Eva are giving positive or negative reinforcement. This could be done initially and simplistically in some obvious ways, e.g. identifying positive/negative words in what's said to Eva; or tone of voice.
  • Arousal: It seems that some behavior tree should send OpenCog an "urgency" signal, indicating how urgent is the current situation. As a simple initial case: If nobody is saying anything and nothing visually salient is happening, the urgency is low. If someone is talking to Eva or something visually salient is happening, the urgency is higher.
  • Resolution level: For the short term, Sophia-wise, it seems there is nothing much to do with this. It can be considered as inversely proportional to arousal, and also to be controlled by "urgency" signals.
  • Selection threshold: The default selection threshold is a "personality parameter" which controls how "jumpy" the character is. However, we may want Sophia to specifically stick to her goal better in some situations than others. I suppose that when someone is talking to Sophia, the selection threshold should be higher; we don't want her to so easily veer from the goal of holding the conversation. But if nobody's talking then she's kind of "on her own" and the selection threshold can be lower. Signals may be sent from some behavior tree to OpenCog indicating the current selection threshold.
  • Goal-directedness: For initial Eva work, it seems this should be handled the same as selection threshold. In a conversation the goal-directedness should be high, otherwise not much so. Signals to this effect could be sent from some behavior tree to OpenCog.
  • Securing rate (frequency of background checks): Low perceived safety would lead to a higher securing rate. Some novel salient event occurring in the environment should increase the securing rate. On the other hand, being engaged in a conversation should decrease the securing rate (because she should pay attention to the conversation not to the general environment).

The above detailed short-term suggestions make very clear the rich interdependency of the different modulators. They also make clear that, in the context of Eva's immediate-term sensors, there's not much information to guide the adjustment of these modulators based on the situation. But Sophia will get better sensors as time goes on. We can build simple mechanisms for modulator updating now, and then these mechanisms can make use of better sensor output when it comes along.


The "Emergent Emotion" paper contains a few comments relating specific emotions to underlying modulator values (which are basically pasted from earlier writings on the topic):

  • Anger: negative valence, high arousal, low resolution level, high selection threshold
  • Sadness: negative valence, low arousal, high resolution level, low securing rate, low goal-directedness
  • Joy: positive valence, high arousal, low resolution level
  • bliss: positive valence, low arousal, high resolution level

This is only a minority of the emotions we would like to express. Anyone who feels like doing some speculative cognitive science should try to express additional emotions in these terms. Just add to the following list:

  • Frustration: negative valence, medium arousal, low resolution level, low selection threshold. [added by Ben G. Note from Ben: my assumption here is that being frustrated is a bit like being angry, but less intense, and easier to give up on.]
  • add more as you see fit, folks! ...

Philosophically, note that we are not really trying to "reduce" human emotions to combinations of modulator values in any strong sense. Rather, we consider that emotion words like "anger", "joy", etc. are just very crude descriptions of complex human psychodynamics. By combining modulator values appropriately we can indicate regions of system-dynamics-space that are somewhat close to the regions habitually indicated by various emotion words. Of course the dynamical system of the human brain/body is very complicated with many, many parameters not modeled in Psi, and we're not attempting exact neurophysiological emotion modeling here.


Some of the key "demands" in the Emergent Emotions paper (and the Psi model generally) are:

  • affiliation: need for interaction w/ others
  • competence: how likely is the agent to succeed at what it’s now trying to do
  • certainty: how much does the agent know about its environment, esp. relative to its goals
  • novelty (here I differ from Joscha in that I think this should be a goal, separately from certainty)
  • aesthetics: seeking out better representations of the world

My suggestion in a short-term Eva context is that the degree of fulfillment of many of these demands should be evaluated by a small behavior tree, which should then send information to OpenPsi regarding the degree to which the demand is fulfilled at the current time. Of course, given Eva's initial sensorium the evaluation of the fulfillment of these demands will need to be done pretty simplistically. Some of the demands on the other hand will need to be evaluated on the OpenCog side.

Some initial suggestions regarding particulars, for early or mid stage Eva work:

  • affiliation: this is fulfilled to a certain extent if people are present in the room, and to a greater extent if people are talking, and to a greater extent if they are saying positive things (which could be determined via applying sentiment analysis to the words they are saying, or via tone of voice analysis)
  • competence: this would need to be estimated on the OpenCog side. Most simply, for each goal, OpenCog can estimate the extent to which it's managed to fulfill that goal in the past. Depending on the weighting of various goals at the present time, it could then estimate the degree to which its current goals will be fulfilled (by summing the product (weight of goal)*(probability of fulfilling goal)). Of course, doing this smarter would involve estimating the extent to which the system has managed to fulfill each goal G in contexts similar to the current context. But for a very first version we can do this in a context-independent way, just to get something working.
  • certainty: If there are people the agent does not know in the environment, or objects the agent cannot recognize, then certainty should be lower. In a short-term Eva context, certainty would decrease when new people came into the environment (because new people means less certainty about what will happen).
  • novelty (here I differ from Joscha in that I think this should be a goal, separately from certainty). New people coming into the room brings Eva more novelty. The visual salience detector also increases perceived novelty (at the time when a new salient object is observed).
  • aesthetics: I'm not sure how to supply Eva an aesthetic sense in the early stages. One idea would be to create a measure of how emotionally expressive a face is, or a voice. Then if we assume Eva's aesthetic values emotional expressiveness in other people, we could use these measures as an initial measure of Eva's aesthetic satisfaction at a given point in time.

Each demand has a number of parameters. Here are some of the tweakable parameters of the demands, as specified in the Psi model:

  • weight: how is the demand weighted, relative to others, at a given point in time
  • gain: a scaling factor determining the amount satisfaction derived from fulfillment of the demand
  • loss: a scaling factor determining the amount of DIS-satisfaction derived from NON-fulfillment of the demand
  • decay: basically, the rate of increase of a given urge over time. The model here is that in the absence of stimulation, urges increase over time. I’m not sure this is realistic as a general cognitive model, but it’s an OK short-term mechanism for making sure an agent keeps doing stuff.

Adjusting the gain, loss and decay corresponding to the various demands, is a way of varying the "personality" of an agent.

Adjusting the weights corresponding to the various demands can also help vary personality, but is often more a matter of what mood or state the agent is in at a certain point in time.


The classic "five factor" model of human personality explains variation among human personalities using 5 factors

  • openness
  • conscientiousness
  • extraversion
  • agreeableness
  • neuroticism

The "Emergent Emotions" paper argues that these can be at least roughly explained in terms of variation of the gain, decay and loss parameters for the following demands: affiliation, competence, certainty and aesthetics.

What this suggests pragmatically is that one could write code that would calculate estimates of each of the 5 factors for a given character, based on the parameters for the various demands.

Alternately, one could reverse the math, and write simple equations with

  • input: a quantitative measure for each of the 5 personality factors, as associated with a particular character
  • output: specific gain, loss and decay parameter values for the affiliation, competence, certainty and aesthetics demands, intended to correspond to the specified values of the 5 personality factors

This would allow one to specify a character personality in a config file, via specifying a number in the range [0,1] for each of the big 5 factors (i.e. a personality specified as a 5D vector). Of course this is very crude but it would be a reasonable pragmatic tool, to be used alongside the provision of specific personality content for various characters, and probably more ad hoc tuning of various other parameters on a per-character basis.

(P.S. I note that Joscha doesn't like novelty as a demand/goal. He prefers to think about novelty-seeking as somehow a consequence of the quest for uncertainty reduction. I don't like this particularly and prefer to think of novelty as a separate goal. I think novelty and uncertainty reduction are separate, often competing goals that both play a role in human motivational structure.)