In
troduction of Homeostatic Regulation
in Face Detection
J. Lorenzo, M. Castrill´on, M. Hern´andez, and O. eniz
?
Institute of Intelligent Systems and Numerical Applications in Engineering
Edificio Central del Parque Tecnol´ogico
Campus Univ. de Tafira
Univ. of Las Palmas de G.C. - Spain
Abstract. In this paper the introduction of a homeostatic mechanism
in a vision system is proposed. This homeostatic mechanism is based on
artificial hormones for which five different states have been defined. The
goal is to keep the system into a regime where the performance were
acceptable for the task and to recover it when the environmental condi-
tions change. For a face detection task we have propose the control of
the luminance, white balance, contrast and size of the face. The intro-
duction of the artificial hormones will allow to implement simple control
strategies and with the definition of different states for each hormone we
will be able to introduce adaptation depending on the deviation from the
optimal regime. Finally we realize a set of experiments to test the pro-
posed mechanism on a face detection system and using as performance
measure the rate of detected faces.
Keywords: Emotion-based Systems, Face Detection, Human-Computer Inter-
action
1 Introduction
Homeostasis is defined in the Merriam Webster on line dictionary as “a relatively
stable state of equilibrium or a tendency toward such a state between the different
but interdependent elements or groups of elements of an organism, population,
or group”. The state of equilibrium is normally related to the survival of the
organism in an environment making sure that it gets enough to eat or it does
not overheat or freeze. Thus, organisms are endowed with regulation mechanisms,
generally referred to as homeostatic regulation, in order to maintain this state
of equilibrium. Homeostatic regulation is responsible for physiological changes
in the body. For example, in humans the eccrine sweat glands are part of the
thermoregulation mechanisms to keep the body with a temperature around 36.5
?
Th
is work has been partially supported by the University of Las Palmas de Gran
Canaria under Research Projects UNI2002/16 and UNI2003/06, and by the Regional
Canary Islands Goverment under Research Projects PI2003/165 and PI2003/160
Lorenzo J., Castrillon M., Hernandez M. and Déniz O. (2004).
Introduction of Homeostatic Regulation in Face Detection.
In Proceedings of the 4th International Workshop on Pattern Recognition in Information Systems, pages 5-14
DOI: 10.5220/0002683900050014
Copyright
c
SciTePress
Celsius degrees, increasing sweat levels when it is hot. These glands also resp ond
to emotional changes and that fact has been used by Healey and Picard [1] to
control a wearable camera which detects emotional changes measuring the skin
conductive response.
In Figure 1 the outline of a homeostatic regulation mechanism is shown. The
state of the system is considered to fall into one of three categories: homeo-
static, overwhelmed and understimulate. The goal is to keep the system in the
homeostatic regime modifying its behavior toward this goal. The computational
processes in charge of the task are normally called drives. Inputs to these drives
are the controlled variables and according to them, they modify the system be-
havior in order to restore the homeostatic regime.
Fig. 1. Homeostatic regulation mechanism
This idea has been used by some authors in the construction of systems that
carry out their activity in a complex environment. Arkin and Balch in their
AuRA architecture [2] propose a homeostatic regulation system which modifies
the performance of the overall motor response according to the level of inter-
nal parameters such as battery or temperature. Another work which includes a
homeostatic regulation mechanism is the proposal of Hsiang [3] who introduces
it to regulate the dynamic behavior of the robot during task execution.
Damasio [4] studied the role of emotions in the decision making process and
he found that some emotions, which he called primary emotions, are in charge of
taking decisions about the individual survival, so they are part of the homeostatic
regulation mechanism. The idea of emotions as a way to select actions has been
explored by some authors. In this case the homeostatic regulation is considered as
primary or innate emotions that respond to urgent needs of the agent, normally
related to the welfare or survival of the agent. Some authors as Ca˜namero [5] or
Breazeal [6] consider homeostasis as a motivational mechanism that drives the
b ehavior of the agent to meet bodily needs.
The idea of primary or innate emotions as homeostatic regulation has been
used by some other authors. Velasquez [7, 8], introduces the concept of drive
releasers in his Cathexis architecture as the computational systems that maintain
the controlled variable, i.e. battery level in a robot, around a set point. Gadanho
6
and Hallam [10] propose an emotion-based architecture to learn actions which
relies on a set of internal needs that have to be satisfied by the robot. Also in the
same line but in a different context, Fujita et al. [9] propose the EGO architecture
for symbol grounding. In EGO architecture, the homeostatic regulation along
with external stimuli select behavior for grounding symbols using visual and
audio p erceptions.
The works reviewed above are mainly related to robotics since robots posses
elements (effectors) to modify its behavior in the environment. However, with
the introduction of the Active Vision paradigm [11], the vision systems include
p erception strategies which are controlled by the interaction with the environ-
ment when a specific goal is pursued. Thus, we can consider the inclusion of a
homeostatic regulation in such vision systems because they share with the de-
scribed rob otics systems the fact that a goal has to be achieved (survive) in a
changing environment and they have to adjust their behaviors to get the best
p erformance.
Here we explore the introduction of a homeostatic regulation mechanism
from a affective computing framework to study how it influence the system
p erformance. In the next section the homeostatic mechanism is presented and
a description of the methods implemented to compute the controlled variables .
In section 3 the results obtained with the introduction of proposed mechanism
in a face detection system are presented.
2 A homeostatic regulation mechanism for a vision
system
In most of the computer vision systems, the performance depends heavily on the
quality of the images supplied by the acquisition subsystem. For example face
detection systems that make use of the skin color as primary clue depend on the
white balance, tracking systems based on edge detection depend on image con-
trast and so. On the other hand, image quality is affected by the environmental
conditions, namely lighting conditions or distance from the object of interest to
the camera, and the setting of the camera parameters.
In computer vision applications where the environment E is completely con-
trolled, i.e. industrial applications, the camera parameters that define the quality
of the images are initially tuned to get the best performance. This is illustrated
in Figure 2 where the set of camera parameters δ is the one which maximizes
the performance of the system under the environmental conditions E. If the en-
vironment changes to E
0
, for example due to different lighting conditions, the
p erformance of the system will be maximum for another set of camera param-
eters δ
0
as it is shown in Figure 3. So if the system can not detect the new
environment E
0
, its performance will drop because it will continue using the
initial parameter set δ, and we must rely on an external agent to readjust the
parameter set to δ
0
.
In the introduction, we presented the concept of homeostatic regulation as
a mechanism to increase the survival opportunities of an agent in a changing
7
Fig. 2. Set of camera parameters for an en-
vironment E
Fig. 3. Set of camera parameters for an en-
vironment E
0
environment. We can use the same concept to keep the performance of a vision
system as high as possible when environmental conditions change, endowing the
vision system with a homeostatic regulation mechanism.
In a vision system, the changes in the environment affect the quality of the
acquired image. For example, if the temperature of the light source varies, the
white balance changes or if the object of interest goes further or nearer, obviously
its size in the image changes. Thus, the homeostatic regulation tries to compen-
sate for these effects on the image making use of the configurable parameters of
the camera.
In the affective computing framework, systems must be “bodily” because hu-
man emotions involve both the bo dy and the mind. Since our system does not
have a body, as an anthropomorphic robot, we simulate the physiological changes
that influence the homeostasis mechanism. Ca˜namero [5] proposes synthetic hor-
mones to imitate physiological changes in the body of a robot which evolves in
a two-dimensional world and whose motivations respond to the levels of the
synthetic hormones. We adopt this approach in our system and implement some
synthetic hormones that reflect the internal state of the computer system “body”
(Fig. 4).
The internal state of the vision system is represented by four hormones as-
so ciated to the luminance (h luminance), contrast (h contrast), color constancy
(h whitebalance) and size of the object (h size). The homeostatic mechanism will
b e in charge of keeping this internal state into a regime which will allow the sys-
tem to operate at an acceptable performance. The internal state of the system
also modifies high level behaviors, as it is shown in Figure 4. For example if the
image is to o dark, it has no sense to realize any visual process on it.
An important element in a homeostatic mechanism is its adaptive aspect.
When the internal state of the body is too far away from the desired regime, the
homeostatic mechanism must recover it as soon as possible.
The adaptive response of the homeostatic mechanism is governed by the
hormone levels which are computed from the controlled variables by means of
a sigmoid mapping (Fig. 5). In this way, we can implement adaptive strategies
more easily in the drives since the hormone levels that define the normal and
8
Fig. 4. Elements of the homeostatic regulation mechanism
urgent recovery zones are always the same independently of the controlled levels.
Below we briefly describe the methods used to compute these variables.
Fig. 5. Hormone value mapping from the variable of interest
2.1 Luminance
The luminance of the image is computed by dividing the image into five regions,
similar to the method proposed by Lee et al. [12]: an upper strip (R
0
), a lower
strip (R
4
) and the central strip is divided into three regions (R
1
, R
2
and R
3
from left to right). These five regions allow us to define different auto exposure
(AE) strategies according to the nature of the object of interest giving different
weights to the average luminance in each region.
9
We have tested three different strategies for auto exposure that we have called
as uniform, centered and selective. The luminance for each of these strategies is
computed as follows:
L
uniform
= (L
0
+ L
1
+ L
2
+ L
3
+ L
4
)/5 (1)
L
centered
= 0.8L
2
+ 0.2(L
0
+ L
1
+ L
3
+ L
4
)/4 (2)
L
selective
= 0.8(L
2
+ L
4
)/2 + 0.2(L
0
+ L
1
+ L
3
)/3 (3)
where L is the total luminance of the image and L
i
denotes the average luminance
of Region i.
The L
centered
strategy is suitable for tracking tasks where the object of in-
terest will be in the center of the image, whereas L
selective
is suitable for human-
computer interaction because it considers the part of the image where normally
a person appears when it is sat in front of a computer.
2.2 Contrast
A focused camera gives sharp images and hence the acquired image has a high
contrast. We use an autofocus algorithm (AF) for regulating the contrast of the
images. Since the study of complex focus algorithms is out of scope of this work,
we choose a passive focus technique with a measure, proposed by Nanda and
Cutler [13], which exhibits a maximum when the image is at the best focus. The
measure of contrast is the absolute difference of a pixel with its eight neighbors,
summed over all the pixels of the image. This measure exhibits a sharp and well
defined p eak at the position of the best focus and decreases monotonically as
the de-focus increases. It has the advantage that it exhibits a high tolerance to
noise in the image.
Fig. 6. Autofocus algorithm: initialization
Fig. 7. Autofocus algorithm
The AF algorithm we have developed starts with a run along the whole range
of focus lens positions with a step β (Fig. 6). Due to the discretization effect of the
fo cus positions, the maximum value A could be found at F
A
whereas the actual
10
maximum is M at position F
M
. To estimate the value M , a quadratic function
f
F
is computed from points (F
B
, B), (F
A
, A) and (F
C
, C) and the maximum
of f
F
is taken as an estimation of M. Thus, we avoid to use slow hill-climbing
techniques around the point A.
After the initial focus value has been found, the system does not need to
compute the focus values for the whole run of the focus positions but it only
gets the focus value A
0
for the current position F
M
and two adjacent positions
F
B
0
and F
C
0
(Fig. 7). With these three points, the new focus value of M
0
is
estimated and its focus position F
M
0
is used as the current one.
2.3 White Balance
For applications based on color it is necessary to have a certain constancy because
depending on the light source temperature the same color appears different in
the image. This situation can b e dealt with white balance techniques because a
white surface has the same power spectrum than the one of the light source. As
the white surface should appear to be white independent of the light source, we
can use it to get a balance. To do it dynamically we adopt the Grey World [13]
assumption which tries to make the average amount of green, blue and red in
the image the same, by adjusting the red and blue gain parameters.
2.4 Size
The last variable to control in our proposal is the size of the object of interest
in the image. Here we are interested in keeping constant the aspect ratio of
the object in the image. This is very important for applications such as object
recognition, facial analysis,... To accomplish this, we act over the optical zoom
of the camera.
3 Experiments
Now we are interested in knowing if the previously described homeostatic mech-
anism can improve the performance of a face detection task under changing
environmental conditions. This application utilizes the architecture ENCARA
[14] which is based on the concatenation of naive classifiers whose inputs are
weak clues about the presence of a face in the image. These classifiers have a
go od accuracy but with a high rate of false positives. The cascade combination
of the classifiers allows to reduce the rate of false positives without increasing
the rate of false negatives. Thus the face detection starts with a weak clue as a
skin color blob and then some filters are applied based on geometric constraints,
detection of facial features (eyes, nose and mouth) and implicit pattern tests
that allows to accept or reject the initial blob as a face.
The input to the system are color images taken with a Firewire camera that
has control over zoom, focus, gain, iris, shutter speed, red and blue gain, etc.
11
Fig. 8. Face detection rate with and without homeostatic mechanism
The system has been developed in C++ under Microsoft Windows operating
system. The OpenCV library was used for the image processing tasks.
To test the introduction of the homeostatic mechanism in the face detection
task, we define a performance measure as the ratio between the number of de-
tected faces in a second and the number of images per second. As ENCARA
depends on the skin color to detect the faces, we will study the influence of the
luminance and white balance in the performance.
Figure 8 shows the values of the h luminance and h whitebalance hormones
and the performance of the application. In dashed lines are marked the changes
in the environmental condition (lighting).
When the system starts the performance is high and it decreases a bit
when more lights are switched on (30-57 secs.). When the lights are switched
on, both the h luminance and h whitebalance hormones go out of their desired
states but the homeostatic mechanism recovers them after a delay, larger for the
h whitebalance hormone than for the h whitebalance one.
The homeostatic mechanism is deactivated after 70 seconds, so when the
conditions change again the state of the hormones is not recovered and the
p erformance of the system decreases with a low rate of face detected.
To speed up the recovery time, we implement an adaptive strategy making
use of the two recovery levels that the hormones have. So when a hormone
go es into the urgent recovery zone we apply a more aggressive recovery strategy
(increasing aperture of the iris or the red and blue gains) than when hormones
12
are in the normal recovery zone (Fig. 5). We repeated the experiment, but we
were only interested in the delay until the hormones return to the homeostatic
regime. Figure 9 shows the results with the adaptive strategy and it can noted
that the recovery time has been reduced.
Fig. 9. Effects of the introduction of an adaptive strategy in the recovery time
4 Conclusions
In this paper, we have presented a homeostatic mechanism for vision systems
based on the idea of emotion-based systems proposed by some authors. To carry
it out, we have defined a set of artificial hormones related to the variables that
affect the quality of the image as the luminance, white balance or contrast.
To compute the values of the hormones we implement a sigmoid mapping so
all the hormones have the same range of values independently of the variables
they are computed from. This fact have permitted to implement simpler control
strategies.
To compute the controlled variables we have implemented some techniques
and we have introduced a two phase autofocus method based on the fitting of
a quadratic function that avoids a hill climbing search to find the best focus
p osition.
13
In the experiments carried out with a face detection task we have found that
the introduction of the homeostatic mechanism reduces the effects of the changes
in the lighting conditions in the rate of detected faces. Besides, the definition
of two recovery threshold for the hormone values has permitted to implement
an adaptive recovery strategy that decreases the time needed to achieve the
homeostatic regime when the environmental conditions vary.
References
1. Healey, J., Picard, R.W.: StartleCam: A cybernetic wearable camera. In: 2nd
International Symposium on Wearable Computers. (1998) 42–49
2. Arkin, R.C., Balch, T.: AuRA: Principles and practice in review. Journal of
Experimental and Theoretical Artificial Intelligence 7 (1997) 175–188
3. Hsiang, K., Kheng, W., Ang, M.: Integrated planning and control of mobile robot
with self-organizing neural network. In: 18th IEEE Int. Conference on Robotics
and Automation, Washington DC (2002) 3870–3875
4. Damasio, A.R.: Descartes’ Error: Emotion, Reason and Human Brain. Picador,
London (1994)
5. Ca ˜namero, D.: Modeling motivations and emotions as a basis for intelligent be-
havior. In Lewis, J., ed.: Proceedings of the First Int. Symposium on Autonomous
Agents, New York, ACM Press (1997) 148–155
6. Breazeal, C.: A motivational system for regulating human-robot interaction. In:
AAAI/IAAI. (1998) 54–61
7. Velasquez, J.D.: Modeling emotions and other motivations in synthetic agents. In:
Proceedings of the AAAI Conference. (1997) 10–15
8. Velasquez, J.D.: Modeling emotion-based decision making. In Ca˜namero, D., ed.:
Emotional and Intelligent: The Tangled Knot of Cognition. AAAI Press (1998)
164–169
9. Fujita, M., Hasegawa, R., Costa, G., Tkagi, T., Yokono, J., Shimomura, H.: Phys-
ically and emotionally grounded symbol acquisition for autonomous robot. In
Ca˜namero, D., ed.: Emotional and Intelligent I I: The Tangled Knot of Cognition.
AAAI Press (2001) 43–48
10. Gadanho, S.C., Hallam, J.: Robot learning driven by emotions. Adaptive Behavior
9 (2002) 42–64
11. Aloimonos, J.Y.: Introduction: Active vision revisited. In Aloimonos, J.Y., ed.:
Active Perception. Lawrence Erlbaum Assoc. Pub., New Jersey (1993)
12. Lee, J.S., Jung, Y.Y., Kim, B.S., Sung-Jea, K.: An advanced video camera system
with robust AF,AE and AWB control. IEEE Transactions on Consumer Electronics
47 (2001) 694–699
13. Nanda, H., Cutler, R.: Practical calibrations for a real-time digital onmidirec-
tional camera. In: Proceedings of the Computer Vision and Pattern Recognition
Conference (CVPR 2001). (2001)
14. Castrill´on, M., Lorenzo, J., Cabrera, J., Hern´andez, M.: Detection of frontal faces
in video streams. In: Post-ECCV Workshop on Biometric Authentication, Copen-
hagen, Denmark (2002) 893–902
14