arXiv:1504.05619v1 [] 21 Apr 2015

Learning Opposites with Evolving Rules
H.R. Tizhoosh

S. Rahnamayan

Centre for Pattern Analysis and Machine Intelligence
University of Waterloo
Waterloo, Ontario, Canada
Web: http://tizhoosh.uwaterloo.ca/

Electrical, Computer and Software Engineering
University of Ontario Institute of Technology
Oshawa, Ontario, Canada
Email: shahryar.rahnamayan@uoit.ca

Abstract—The idea of opposition-based learning was introduced 10 years ago. Since then a noteworthy group of researchers
has used some notions of oppositeness to improve existing optimization and learning algorithms. Among others, evolutionary
algorithms, reinforcement agents, and neural networks have
been reportedly extended into their “opposition-based” version
to become faster and/or more accurate. However, most works
still use a simple notion of opposites, namely linear (or typeI) opposition, that for each x ∈ [a, b] assigns its opposite as
x̆I = a + b − x. This, of course, is a very naive estimate of the
actual or true (non-linear) opposite x̆II , which has been called
type-II opposite in literature. In absence of any knowledge about a
function y = f (x) that we need to approximate, there seems to be
no alternative to the naivety of type-I opposition if one intents to
utilize oppositional concepts. But the question is if we can receive
some level of accuracy increase and time savings by using the
naive opposite estimate x̆I according to all reports in literature,
what would we be able to gain, in terms of even higher accuracies
and more reduction in computational complexity, if we would
generate and employ true opposites? This work introduces an
approach to approximate type-II opposites using evolving fuzzy
rules when we first perform “opposition mining”. We show with
multiple examples that learning true opposites is possible when
we mine the opposites from the training data to subsequently
approximate x̆II = f (x, y).

I.

W HAT IS THE P ROBLEM ?

It was 10 years ago that “opposition-based learning”
(OBL) was born. Since then, a modest but growing community of researchers has tried to use OBL to improve diverse
optimization and learning techniques. Evolutionary algorithms,
reinforcement agents, swarm-based methods, and neural networks, to mention a few, have been extended to employ oppositeness in their processing. Evaluating the error of weights
and opposite weights, examining the rewards for actions and
counter-actions, and examining the fitness of chromosomes
and anti-chromosomes are examples for rethinking existing
concepts by embedding opposite entities. Apparently, as a review of literature easily illustrates, using opposites can actually
help accelerating many optimization and learning processes
(see section III). The main benefit of using opposites seems
to be contributing to an accelerated convergence. Apparently
by simultaneous consideration of entities and opposite entities,
algorithms become capable of jumping over large portions of
the solution landscape for difficult problems when they do not
exhibit any significance.
Since the first paper was published on OBL in 2005 [32],
it has not been really clear how oppositeness can actually be
captured with respect to the intrinsic behaviour of the problem
at hand. The proposed scheme was that for any given x ∈ [a, b]

the opposite x̆ can be given via x̆ = a + b − x. This, if at
all, only makes sense for “linear” functions, in which case
no particular algorithmic sophistication is required to begin
with. But in spite of its simplicity, many works have reported
benefits for using x̆ = a + b − x, which is called “type I
opposite” in context of opposition-based computing [35].
After 10 years, some questions are still unanswered: Is
there such thing as type II opposites? If they exist, how can
we calculate them? And most importantly, would using type II
opposites bring any benefit to existing machine-learning and
optimization methods?
II.

T HE I DEA

What we call type II (or true) opposite of x, denoted with
x̆II , is supposed to be meaningful for “non-linear” mappings
and relationships, in contrast to type I opposites x̆I that latently
assume a linear relationship between in- and outputs.
Looking at the function y = f (x1 , x2 , . . . , xn ) in a typical
machine-learning or optimization context, one is generally
fortunate to receive the output values y for some input variables
x1 , x2 , . . . , xn . However, the function y = f (·) itself is
generally unknown otherwise there would be little justification
for resorting to machine intelligence. Instead, one has some
sort of evaluation function g(·) (error, reward, fitness etc.) that
enables us to assess the quality of any guess x̂1 , x̂2 , . . . , x̂n
delivering an estimate ŷ of the true/desired output y.
The idea proposed in this paper is to use training data,
whenever available, to perform opposition mining in order
to approximate type II opposites gradually by learning the
x, y, x̆II -relationship, or more precisely by learning x̆II =
f (x, y). Of course, if a large number of training data is
available, then one could also just apply them at once instead
of perpetual/continuous change.
For every input x, in contrast to the type I opposites which
are defined according to
x̆I = a + b − x,

(1)

we propose to use the more meaningful type II opposites
according to
x̆II = {xi |f (xi ) = ymin + ymax − f (x)}.

(2)

There are several challenges for such an approach: 1) the range
of the output y = f (·) may not be a-priori known, hence
we may need to continuously (in an evolving manner) update
our knowledge of the output range [ymin , ymax ], 2) the exact
output for a type-II opposite may not be present in data. Hence,

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey

too [8], [36], [37]. Tizhoosh and Ventresca [35] presented
a complete collection of oppositional concepts in machine
intelligence in an edited volume, in which the term “typeII opposition” was coined in the chapter opposition-based
computing. Ventresca and Tizhoosh also extended simulated
annealing [38] and introduced the notion of opposite transfer
functions for neural networks [39].

the approach should be capable of improving its estimation
as data stream provides more clues about the gaps in our
estimate of the in- and output relationship, and 3) sufficient
(representative) data may not be available at any given time;
another reason in favour of an evolving approach.
In this work, we put forward a concise algorithm to learn
opposites via fuzzy inference systems (FIS) with or without
evolving rules depending on application whereas the evolving
fuzzy systems may offer more versatility in many challenging
applications (section IV). Before that, we briefly review the
existing literature in section III. Experiments and results, to
verify the correctness and the usefulness of the proposed
approach are described in section V.
III.

Surveys are available to provide an overview of OBL
methods. For instance, Al-Qunaieer et al. [7] provide a compact survey of oppositional methods. The most comprehensive
survey of opposition-based methods so far has been published
by Xu et al. [40].
Type II opposites have not been examined in-depth. However, as we will briefly review them in the following two
paragraphs, recently two papers have independently proposed
different possibilities for estimating type II opposites.

R EVIEWING P REVIOUS W ORKS

In this section, we briefly review the existing literature on
opposition-based learning and the evolving fuzzy systems.

Mahootchi et al. [15] provided some new ideas for type-II
opposites when dealing with reinforcement learning methods
such as Q- and sarsa learning. Looking at actions a that
an agent could take to manipulate its environment, the typeI opposite action ă was originally defined as ‘directional’
opposite for grid-world agents, hence “up” was the opposite of
“down”, for instance. However, in a stochastic environment it
makes sense to examine the discounted accumulated rewards
Q(s, a) for each state s and estimate the opposite as follows:


ă ∈ â|Qt (i, â) ≈ max Qt (i, b)+min Qt (i, b)−Qt (i, a)

A. Opposition-Based Learning
Opposition-based learning was introduced in 2005 [32].
Motivated by finding an alternative for random initialization,
it was observed that for many algorithms we start with a
random guess and hope to move toward an existing solution in
a speedy fashion. Examples were named such as the weights
of a neural network, the population in genetic algorithms, and
the action policy of reinforcement agents. Further, the paper
stated that if we begin with a random guess far away from the
existing solution, “let say in worst case it is in the opposite
location, then the approximation, search or optimization will
take considerably more time, or in worst case becomes intractable”. The paper advocated that “we should be looking
in all directions simultaneously, or more concretely, in the
opposite direction” in order to have a higher chance of finding
a solution in a shorter time, and established the following
definition [32]:

b

b

(3)
To obtain new knowledge about the opposites from observations, the authors train an MLP network which is updated every
several episodes. For higher accuracy, the approximate function
could be updated online when the agent can interact with the
stochastic environment. “In other words, after the first training
of the network, two sets of action-value functions exist, with
the first being used to find the action that the agent should take
and the approximate one being used to extract the opposites.
This means that there is a mutual relationship between the
agent and the opposite agent. This process may assist each
agent to accomplish its tasks more efficiently in terms of
convergence time and accuracy in real-world applications”
[15]. The authors also reported that MLP may not be efficient
for large applications due to its computational expense. They
suggest that one may substitute MLP with other types of
function approximations such as fuzzy inference systems.

Opposition-Based Learning – Let f (x) be the function in
focus and g(·) a proper evaluation function. If x ∈ [a, b] is
an initial (random) guess and x̆ is its opposite value, then
in every iteration we calculate f (x) and f (x̆). The learning
continues with x if g(f (x)) > g(f (x̆)), otherwise with x̆. The
evaluation function g(·), as a measure of optimality, compares
the suitability of results (e.g. fitness function, reward and
punishment, error function).
Of course, after many reports in the past 10 years we
know that x should not necessarily be a random guess at the
beginning, but it can be a calculated or estimated value by a
learning or optimization algorithm at any stage of the process.
As well, we may not necessarily need to evaluate g(f (x)) and
g(f (x̆)) in all iterations.

Salehinejad et al. [30], examining a type-II extension of
opposition-based differential evolution (ODE) also point to the
fact that the true opposites should be calculated via f˘(x) =
ymin +ymax −f (x) to focus on the output but they use centroidbased method instead of depending on min and max specially
where the landscape boundaries are unknown. A look-up table
can help to find f˘(x), and if not present in the table, its value
can be estimated via interpolation. In their algorithm, they use
type-I and type-II opposition simultaneously.

Rahnamayan et al. introduced opposition-based differential
evolution (ODE) which seems to be one of the most successful
applications of OBL via integration within an existing algorithm [19]-[22]. Among other early works, there are papers on
the application of OBL for reinforcement learning [33], [34]
where “opposite actions” were defined for specific problems,
hence, not engaging in question of type-I versus type-II opposites. Defining opposite fuzzy sets, which may be mistaken
with “antonyms” and their applications have been introduced

B. Evolving Fuzzy Systems
An evolving fuzzy system has been initially introduced as
an unsupervised method of updating the rule-based structure
of a fuzzy inference system (FIS) in a non-iterative way [1],
2

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey

where xi and y are variables defined in corresponding universes of discourse Xi and Y , respectively, and Ai is a fuzzy
(sub)set. The function fj (x1 , x2 , · · · , xn ) is a crisp (nonfuzzy)
function of xi. In general, the function fj is defined as the
weighted combination of all variables fj (x1 , x2 , · · · , xn ) =
w − 0 + w1 x1 + w2 x2 + · · · + wn xn .

[2]. The main idea is that FIS can be extended as more data
becomes available. The fuzzy rule base evolves (is extended)
by adding more rules to a basic rule set formed by the initial
fuzzy model or by replacing existing rules with ones that
approximate the data better. When data are captured online,
its potential is calculated, and the potentials of existing cluster
centers are recursively updated. The potential of the new data
is compared with the existing centers and one of the following
decisions is made: 1) Replace one or more existing clusters
with the new data point if its potential is higher than a certain
threshold and the new data point is close to an old center, 2)
Add the new data as a new cluster if its potential is higher
than a certain threshold.

The output is then calculated by
PN
y=

m

fj (x1 , x2 , · · · , xn )Ti=1j µj (xi )
PN
mj
j=1 Ti=1 µj (xi )

(4)

where N is the number of fuzzy rules, n is the number
of inputs (features), µj is the membership value of the ith
input xi for the jth rule, 1 ≤ mj ≤ n, and T is a T-norm
representing the logical conjunction.

The term “evolving” may imply that instead of retraining
the initial system, the system should be updated online when
new data become available. However, the evolution of rules in
a fuzzy inference system can occur in a variety of ways, and
as long as the initial fuzzy model (rule set) is continuously
updated, no preference exists with respect to how the actual
update is performed. In [3], the Takagi–Sugeno (T-S) type
of fuzzy controller with an evolving structure was proposed
for online identification of T-S systems. The fuzzy rules of
this controller are expanded through the use of data collected
during the control process, and is, thus, trained in a noniterative (recursive) way. There have been approaches that
use an iterative approach specially for the application where
keeping and re-training the data does not pose a challenge [16].
More recent approaches to evolving fuzzy systems have been
proposed [4],[5]. Evolving rules have been used for modelling
nonlinear dynamic systems [6] and image classification and
segmentation [10][16][17].

In order to learn the type II (true) opposites with evolving
fuzzy rules, we first have to sample the problem at hand to find
existing (quasi-)opposites. This is the opposition mining stage
that provides the data for clustering and the subsequent rule extraction. One generally assumes that the more data is available
the better the approximation becomes because we expect that
more data increases the probability for opposition mining to
find more representative samples for rule generation in order
to more accurately approximate x̆II = f (x, y). We assume
that the range of input variables is known, xi ∈ [ximin , ximax ],
j
j
but the range of output, yj ∈ [ymin
, ymax
], may be a-priori
unknown. Since we are looking for the true (type-II) opposites,
we need to calculate the (quasi-)opposite of the output for each
sample. Subsequently, we find the closest value to that point
and select its corresponding input as the opposite of the given
input. If the inflow of data continues, the reliability of the
mined opposites as training data increases which would result
in higher accuracies for the approximated true opposites.

Comprehensive treatment and reports on new advances in
evolving fuzzy systems can be found in literature [11], [12],
[18], [13]. There are other learning approaches one could use.
For instance, participatory learning [41] where compatibility
between observations and beliefs plays an important role.

As preparation for designing the learning procedure, let us
look at Figure 1:

In this paper, we propose a general, simple and efficient
approach to learn type-II opposites using fuzzy inference
systems. The emphasis is on opposition mining (finding
opposites or quasi-opposites in the available training data) and
evolving rules (which perpetually adjust the approximation of
the mined opposites).
IV.

j=1

•

Calculating type I opposites is straightforward (top
diagram). For any given x we calculate its opposite
x̆ = a + b − x (denoted with ox on the x-axis)
which can then be used to estimate the value of f (x̆)
(denoted with f(ox) on the y-axis). However, as it
is apparent from the diagram, calculation of ox is
completely detached from the output.

•

Type II opposites, in contrast, are based on a more
realistic (or more intuitive) understanding of oppositeness (bottom diagram in Figure 1). For any given x
( 1 ), we first need an estimate or evaluation of f (x)
( 2 ). Then, we find the opposite of f (x), namely f˘(x)
or of(x) in Figure 1 ( 3 ). Any input that can produce
outputs like of(x) is the type II opposite of x (ox1,
ox2 and ox3 on the x-axis) ( 4 ). Of course, for nonmonotonic functions, we may get multiple opposites
for each input. In most cases, one of those opposites
might suffice to exploit the potential benefits of OBL
when validated with the available objective function.

L EARNING O PPOSITES VIA E VOLVING RULES

A fuzzy inference system (FIS) generally consists of a set
of IF–THEN rules of the following form:
IF x1 is A1 AND x2 is A2 AND · · · AND xn is An
THEN y is B
where xi , y ∈ X are variables defined in corresponding
universes of discourse Xi and Y , respectively, and Ai and B
are fuzzy (sub)sets (in this work we investigate the problems
with many inputs and one output only). These rules can be
defined by experts. However, in most real-world applications
they can be extracted from available data via clustering. A
Takagi-Sugeno, or T–S fuzzy inference system operates with
fuzzy rules of the following general form [31]:

Algorithm 1 describes the steps how we learn the opposites
based on the same steps in the bottom diagram of Figure 1.
The approach consists of two distinct stages:

IF x1 is A1 AND x2 is A2 AND · · · AND xn is An
THEN y = fj (x1 , x2 , . . . , xn ), j = 1, 2, · · · , N
3

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey

Learning the Opposites (Lines 26 to 30) – Here any
learning and approximation method may be used to employ
the results of opposition mining. As for our approach, namely
the fuzzy inference systems (FIS), in- and outputs are clustered
to extract rules. Performing fuzzy inference with these rules
will then approximate the type-II opposites for new (unseen)
inputs.
In following section, we report the results of some experiments to verify the superiority of type II over type I opposites.
Algorithm 1 Learning the opposites via Evolving Rules
1: ————– Initialization —————–
2: Set FIS mechanism, e.g. Takagi-Sugeno
3: Determine the number of samples ns
4: Set the number of clusters nc
5: Select oppositeness scheme Ti , i ∈ {1, 2, 3}
6: ————– Opposition Mining —————–
7: Get sample points < xi1 , xi2 , . . . , y i > (i = 1, 2, . . . , ns )
8: Calculate ymin , ymax , and ȳ
9: for i = 1 : ns do
10:
thisY ← y(i);
11:
Use Ti to estimate the opposite of the ouput:
12:
Ti = T1 : oppY ← ymin + ymax − thisY 
max )
13:
Ti = T2 : oppY ← thisY + (ymin +y
% ymax
2
14:
Ti = T3 : oppY ← 2ȳ − thisY
15:
minDiff ← ∞ (a large number)
16:
for j = 1 : ns do
17:
thatY ← y(j)
18:
thisDiff ← |oppY − thatY |
19:
if thisDiff < minDiff then
20:
minDiff ← thisDiff
21:
x̆II (i) ← x(j)
22:
end if
23:
end for
24: end for
25: ———– Train FIS ————–
26: Set < xi1 , xi2 , . . . , y i > as input
27: Set < x̆i1,II , x̆i2,II , . . . > as output
28: Partition the data into nc clusters
29: Extract fuzzy rules
30: Save the FIS data

Fig. 1. Type I versus Type II Opposition. TOP: 1) variable x is given, 2)
opposite of x, xo, is calculated via a+b-x . BOTTOM: 1) variable x is given, 2)
f(x) is calculated, 3) opposite of f(x), namely of(x) is calculated, 4) opposite(s)
of x are found: ox1,ox2 and ox3.

Opposition Mining (Lines 7 to 24) – The training data
is sampled to established the output boundaries. Depending
on a specific oppositeness scheme, all data points are then
processed to find the (quasi-)opposite of each input and the
corresponding input x̆II , which is the type-II opposite. At the
end of the opposition mining we have ns opposites.
We also look at different ways of calculating opposition
in general. Given any function y = f (x) with variables x ∈
[xmin , xmax ] with a sample average of x̄, one may calculate
oppositeness for the input domain in different ways [32], [35],
[25], [24] (% denotes the modulo operator):

T1 :

x̆I

T2 :

x̆I

T3 :

x̆I

= x
min + xmax − x 
xmin + xmax
% xmax
=
x+
2
= 2x̄ − x

(5)
V.

(6)

We conduct multiple experiments to demonstrate the usefulness of opposition mining and learning opposites with
evolving fuzzy rules. We examine 9 simple functions with
known inverse functions to verify the correctness of the
algorithm, and to establish a better understanding of the approach. Using functions with known inverse relations is a very
reliable testing vehicle because the true opposites can be easily
calculated for validation. As well, we employed MatlabTM
“genfis3” function to implement a clustering-based TakagiSugeno fuzzy inference system (note: MatlabTM “genfis3”
was trained incrementally to achieve the rule evolution). We
experimented with number of clusters nc to be 30 or 60
clusters (with relatively similar results) and set the number
of maximum iterations to maxIter= 5000. The fuzzy exponent
was set to m = 2 and the clustering error threshold was fixed
at  = 0.00001.

(7)

Analogously, given the output y ∈ [ymin , ymax ] with an average
ȳ, one may calculate its opposite y̆I in different ways:
T1 :

y̆

T2 :

y̆

T3 :

y̆

= ymin + ymax − y


ymin + ymax
=
y+
% ymax
2
= 2ȳ − y

E XPERIMENTS AND R ESULTS

(8)
(9)
(10)

For T3 scheme, we may go out of the existing boundary of
the variables sometimes. For the experiments, we solved this
problem by switching to scheme T1 whenever necessary. It is
paramount to emphasize that any opposite calculate based on
y̆ is a type-II opposite.
4

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey

A. First Experiment Series

B. The Second Experiments Series

The results for 9 functions are summarized in Table I (also
see Figure 2). The simplicity of the functions enable us to
easily formulate the inverse function such that we can exactly
calculate the true opposites. With exception of f7 (x), the
inverse of all other test functions are given in Table I:

In the second experiment series, we looked at the effect
of evolving rules: What happens if data is fed into the system
one-by-one or block-wise? Intuitively, one expects that through
clustering of more data, a more compact rule base can be
generated which can more accurately approximate the true
opposites.

1

f7−1 (x) =


9

y
2

+



y
2

−


1
29 2
− 729
54

 12

− 29
54



1
3

As Figure 3 shows some representative examples, the
average error and standard deviation of approximated opposites
decrease over time as the estimated values by evolving rules
become more and more representative of the true opposites.
We also observed a typical pinnacle point at which the
error reaches its maximum when one observes the evolving
opposites long enough (Figure 4). This appear to be due to
the intrinsic nature of evolving steps as at the beginning there
are not enough data points to extract good rules, thus resulting
in large errors.

(11)

v
 13
!
u 
2
u
y 29
1
1
29
y + t
−
−
−  −
2
2 54
729
54
3


+

For every function 100 random samples were drawn in
the opposition mining stage. The error for x̆I and x̆II is
calculated through direct comparison with the true opposite
x̆∗ available through inverse functions: error(x̆I ) = |x̆∗ − x̆I |
and error(x̆II ) = |x̆∗ − x̆II |.

C. Third Experiment Series
In this section, we test 3 standard optimization functions
which are commonly used in the literature of global optimization. For our convenience and without any loss of generality,
we use only 2D functions, two variables x1 and x2 . We learn
the opposites with ns = 1000 samples and then test the
function optimization with 0.1×ns new samples. Two random
variables are generated and used to call FIS for their opposites.
The combination of these two may provide a lower error as
seen for the examined functions. Now, as we have established
the superiority of evolved type II opposites over type I opposites in previous sections, here we also examine type II
opposites in conjunction with random samples (also see [27],
[26]). Here we would like to verify whether the fundamental
statement of OBL is true: Simultaneous consideration of guess
and opposite guess provides lower errors at each iteration of
learning and optimization processes.

Analysis of the Results –
•

Type-II opposite is clearly more accurate than type-I
opposite with exception of linear function f3 (x).

•

The opposition scheme T1 seems to be the best representation of oppositeness. T2 is the best oppositeness
scheme only for f8 (x).

•

If we only examine type I opposites, T3 is better than
T1 and T2 for 7 out of 9 test functions.

Given a function f (x1 , x2 ) = 0 we generate two random samples xr1 and xr2 and we calculate the error. Then,
we approximate the opposites x̆r1 and x̆r2 and calculate the
error. As generally proposed in OBL schemes, we can simultaneously look at all results and continue with the best
results depending on the evaluation of the function call.
That means we continue with the results of xr1 and xr2 if
Error(f (xr1 , xr2 ))<Error(f (x̆r1 , x̆r2 )) otherwise with x̆r1 and x̆r2 .
The opposites x̆ri can be type I (as used in existing literature)
or type II (as we are proposing). The question is which one
can provide a statistically significant benefit when used in
conjunction with the initial random guess xri .
Ackley Function – The Ackley function is given as



q
f (x1 , x2 ) = 20 1 − exp −0.2 0.5(x21 + x22 )
− (12)
exp (0.5(cos (2πx1 ) + cos (2πx2 ))) + exp(1).
The global minimum is f (x1 , x2 ) = f (3, 0.5) = 0
where the search domain is −35 < xi < 35. The results for
Ackley function are given in Table II. The random guesses
(first column) and their type I opposites (third column) were
statistically the same (null hypothesis could not be rejected).
Their simultaneous consideration therefore does not provide

Fig. 2. Examples for the test functions: f2 (x) (top) and f8 (x) (bottom)
according to equations provided in Table I. The simplicity of the functions
allows us to calculate the inverse (hence the true opposites) but they are still
difficult enough to demonstrate the limitations of the type-I opposition as large
errors in Table I demonstrate.

5

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey
TABLE I.
T HE RESULTS FOR TEST FUNCTIONS ( BEST RESULTS HIGHLIGHTED ): F OR EVERY FUNCTION BOTH T YPE I AND T YPE II OPPOSITES ARE
CALCULATED USING THE THREE DIFFERENT OPPOSITENESS SCHEME . T HE AVERAGE ERROR m AND ITS STANDARD DEVIATION σ IS CALCULATED USING
DIRECT COMPARISON WITH THE KNOWN TRUE OPPOSITE VIA INVERSE FUNCTION .
Oppositeness

Type-I Opposites

Type-II Opposites

scheme

m ± σ for 30 runs

m ± σ for 30 runs

f1 (x) = (2x + 8)3

T1

378.91 ± 178.48

22.62 ± 24.01

f1−1 (x) = (y 1/3 − 8)/2

T2

337.20 ± 303.62

78.12 ± 96.86

Function and its inverse

T3

234.27 ± 187.97

155.25 ± 228.39

f2 (x) = log(x + 3)

T1

478.06 ± 270.07

18.95 ± 29.47

f2−1 (x)

T2

470.85 ± 296.33

24.00 ± 51.03

T3

529.12 ± 1881.12

557.06 ± 2051.47

f3 (x) = 2x

T1

0±0

0.02 ± 0.01

f3−1 (x) = y/2

T2

0±0

210.66 ± 137.20

T3

0.51 ± 2.90

0.82 ± 0.53

T1

285.91 ± 117.22

21.77 ± 19.91

T2

248.87 ± 297.11

118.34 ± 129.50

T3

152.22 ± 129.68

120.17 ± 185.21

T1

313.05 ± 140.76

0.028 ± 0.018

T2

317.94 ± 335.52

161.85 ± 156.19

T3

96.79 ± 99.41

101.09 ± 156.69

= exp(y) − 3

f4 (x) = x
f4−1 (x) =

f5 (x) =

2

√

√

y

x

f5−1 (x) = y 2

3/2

T1

183.72 ± 72.06

15.38 ± 13.35

T2

171.61 ± 280.48

150.75 ± 142.32

T3

83.11 ± 73.16

59.28 ± 98.56

f7 (x) = x + x + 1

T1

380.63 ± 177.82

22.98 ± 26.77

(for f7−1 (x) see Eq.11)

T2

328.18 ± 297.96

75.55 ± 93.71

T3

131.57 ± 85.13

130.22 ± 177.85

f8 (x) = 1/x

T1

503.26 ± 292.20

3.46 ± 13.49

f8−1 (x) = 1/y

T2

496.60 ± 289.02

0.56 ± 0.27

T3

434.52 ± 338.03

39.72 ± 163.92

T1

306.25 ± 138.12

0.03 ± 0.02

T2

299.37 ± 324.00

159.08 ± 165.29

T3

95.63 ± 92.46

97.60 ± 147.43

f6 (x) = x

f6−1 (x) = y 2/3

3

f9 (x) =

2

p

(x + 1)/3

f9−1 (x) = 9y 2 − 1

any benefit. In contrast, the type II opposites (second column)
are not only different but also exhibit lower errors.
TABLE II.

E RRORS FOR ACKELY F UNCTION

xr1 and xr2

x̆r1,II and x̆r2,II

x̆r1,I and x̆r2,I

1. run

284.89 ± 263.32

10.35 ± 9.21

284.89 ± 263.32

2. run

20.45 ± 2.39

2.09 ± 2.09

20.45 ± 2.39

3. run

20.61 ± 1.50

3.90 ± 0.41

20.61 ± 1.50

4. run
5. run

same distribution. Their simultaneous consideration therefore
does not provide any benefit. In contrast, the type II opposites
(second column) are different. The simultaneous consideration
of guess and opposite guess does provide a plausible benefit.

20.24 ± 2.27
20.63 ± 1.71

2.40 ± 1.19
4.06 ± 1.01

TABLE III.

20.24 ± 2.27
20.63 ± 1.72

E RRORS FOR B OOTH F UNCTION

xr1 and xr2

x̆r1,II and x̆r2,II

x̆r1,I and x̆r2,I

1. run

448.78 ± 460.46

1930 ± 612.73

432.54 ± 444.90

2. run

403.22 ± 425.78

2000 ± 575.18

400.88 ± 424.10

3. run

470.40 ± 556.03

1875 ± 717.06

374.51 ± 388.70

4. run

382.35 ± 405.19

2103 ± 545.19

400.07 ± 465.64

5. run

422.20 ± 483.02

2058 ± 609.94

415.63 ± 455.30

Booth Function – The Booth function is given as
f (x1 , x2 ) = (x1 + 2x2 − 7)2 + (2x1 + x2 − 5)2 .

(13)

Bukin4 Function – The Bukin4 function is given as
q
f (x1 , x2 ) = 100 ||x2 − 0.01x21 || + 0.01||x1 + 10||. (14)

The global minimum is f (x1 , x2 ) = f (1, 3) = 0 where
the search domain is −10 < xi < 10. The results for Booth
function are given in Table III. Apparently, the random guesses
(first column) and their type I opposites (third column) are the

The global minimum is f (x1 , x2 ) = f (−10, 0) = 0 where
the search domain is −15 < x1 < −5 and −3 < x2 < 3. The
6

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey

Fig. 3. The errors and standard deviations (std) for three different runs: In each run opposites are first trained offline with 100 samples (not shown here). The
diagrams show the error of estimating the true opposites based on f1 (x) (Table I) with 100 new opposites online whereas the rules are clustered and evolved
with 101, 102, · · · , 199, 200 samples, respectively.

Fig. 4. The evolving opposites gradually become more accurate after processing each additional data point. The average error (black) and standard deviation
(gray) decrease with each new sample. At the beginning there may be fluctuations due to lack of sufficient number of data to extract reasonable clusters and
hence meaningful rules. Standard deviation may grow larger than mean if a small sample contains variables with large range.

results for Bukin4 function are given in Table IV. Apparently,
the random guesses (first column) and their type I opposites
(third column) are the same distribution (null hypothesis could
not be rejected). Their simultaneous consideration therefore
does not provide any benefit. In contrast, the type II opposites
(second column) are both different and deliver lower errors.
TABLE IV.
xr1

and

VI.

Ten years after introducing opposition-based learning, there
exists no general algorithm to generate opposites for learning
and optimization purposes. In this paper, taking the 50th anniversary of fuzzy sets as a pretext, we introduced an approach
to learn true (type II) opposites via evolving fuzzy inference
systems. The core idea in this paper is “opposition mining” to
extract (quasi-)opposites by processing the available training
data. This makes the learning of opposites possible as it
extracts the necessary data (specially the desired outputs)
for any learning scheme to approximate. The evolving fuzzy
rules can then capitalize on these data points and refine the
estimate of opposition with perpetual incorporation of future
data points. We tested the proposed algorithm with simple
test functions, examined its evolving aspect, and investigated
three widely used optimization benchmark functions as well to
verify both the correctness and usefulness of type II opposites.

R ESULTS FOR B UKIN 4 F UNCTION
xr2

x̆r1,II and x̆r2,II

x̆r1,I and x̆r2,I

1. run

290.14 ± 271.39

1.75 ± 1.59

290.14 ± 271.39

2. run

317.69 ± 253.78

7.34 ± 9.6

317.69 ± 253.78

3. run

301.05 ± 301.05

1.26 ± 1.03

301.05 ± 289.75

4. run

299.18 ± 262.70

49.06 ± 34.26

299.18 ± 262.70

5. run

282.59 ± 274.73

6.43 ± 5.01

282.59 ± 274.73

S UMMARY

As apparent from the three tables, the simultaneous consideration of random guess and its opposite, as already demonstrated in existing literature, has clear benefit as always one of
them is much closer to the solution. This shows that the learned
type-II opposites do satisfy the fundamental assumption of
OBL, namely that the simultaneous consideration of a guess
and its opposite delivers a shorter path to the solution.

We used the Takagi-Sugeno fuzzy systems in this work
to learn the true opposites. This approach does employ a tnorm and hence triggers axis-parallel rules. However, It has
been clearly shown in recent literature that arbitrarily rotated
rules are able to outperform the conventional axis-parallel ones
[13]. This is certainly a possibility for potential improvement
7

To be published in proceedings of The 2015 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE 2015), August 2-5, 2015, Istanbul, Turkey

in future works. As well, in this work we only investigated the
problems with one output. The extension to multiple output
systems will certainly be of interest.
The authors are investigating the benefits of the proposed
approach for complex learning and optimization problems, and
hope to report the results in foreseeable future.
Acknowledgment – The authors would like to thank the
anonymous reviewers who provided us with critical feedback
and pointed to relevant literature we had missed. The authors
would also like to thank NSERC (Natural Sciences and Engineering Research Council of Canada) for providing funding
for this project in form of two Discovery Grants.
R EFERENCES
[1]

[2]
[3]
[4]

[5]
[6]

[7]

[8]

[9]

[10]

[11]
[12]

[13]

[14]

[15]

[16]

[17]
[18]

P. Angelov and R. Buswell, Evolving rule-based models: A tool for
intelligent adaptation, in Proc. Joint 9th Int. Fuzzy Syst. Assoc. World
Congr. 20th North Amer. Fuzzy Inf. Process. Soc. Int. Conf., vol. 2, pp.
1062–1067, 2001.
P. Angelov and R. Buswell, Identification of evolving fuzzy rule-based
models, IEEE Trans. Fuzzy Syst., vol. 10, no. 5, pp. 667–677, Oct. 2002.
P. Angelov, A fuzzy controller with evolving structure, Inf. Sci., vol. 161,
nos. 1–2, pp. 21–35, 2004.
P. Angelov, E. Lughofer, and X. Zhou, Evolving fuzzy classifiers using
differentmodel architectures, Fuzzy Sets Syst., vol. 159, no. 23, pp. 3160–
3182, 2008.
P. Angelov and X. Zhou, Evolving fuzzy-rule-based classifiers from data
streams, IEEE Trans. Fuzzy Syst., vol. 16, no. 6, pp. 1462–1475, 2008.
J. de Barros and A. Dexter, On-line identification of computationally
undemanding evolving fuzzy models, Fuzzy Sets Syst., vol. 158, no. 18,
pp. 1997–2012, 2007.
F.S. Al-Qunaieer, H. R. Tizhoosh, S. Rahnamayan, Opposition based
computinga survey, International Joint Conference on Neural Networks
(IJCNN), pp. 1–7, 2010.
F. S. Al-Qunaieer, H.R. Tizhoosh, S. Rahnamayan, Oppositional fuzzy
image thresholding, IEEE International Conference on Fuzzy Systems
(FUZZ-IEEE), pp. 1–7, 2010.
H. Salehinejad, S. Rahnamayan, H.R. Tizhoosh, Type-II opposition-based
differential evolution, 2014 IEEE Congress on Evolutionary Computation
(CEC), pp. 1768–1775, 2014.
E. Lughofer, On-line evolving image classifiers and their application to
surface inspection, Imag. Vis. Comput., vol. 28, no. 7, pp. 1065–1079,
2010.
E. Lughofer, Evolving Fuzzy Systems – Methodologies, Advanced
Concepts and Applications, Springer, Berlin Heidelberg, 2011.
E. Lughofer, Evolving Fuzzy Systems – Fundamentals, Reliability,
Interpretability, Useability, Applications, in: Handbook of Computational
Intelligence, editor: P. Angelov, World Scientific, 2015.
E. Lughofer, C. Cernuda, S. Kindermann and M. Pratama, Generalized
Smart Evolving Fuzzy Systems, Evolving Systems, on-line and in press,
2015, DOI:10.1007/s12530-015-9132-6.
M. Mahootchi, H.R. Tizhoosh, K. Ponnambalam, Oppositional extension of reinforcement learning techniques, Information Sciences, vol.
275, pp. 101–114, 2014.
M. Mahootchi, H.R. Tizhoosh, K. Ponnambalam, Oppositional extension of reinforcement learning techniques. Information Sciences 275, pp.
101–114, 2014.
A.A. Othman, H.R. Tizhoosh, Evolving fuzzy image segmentation,
IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), pp.
1603–609, 2011.
A.A. Othman, H.R. Tizhoosh, F. Khalvati, EFIS–evolving fuzzy image
segmentation, IEEE Transactions on Fuzzy Systems, 22 (1), 72–82, 2014.
M. Pratama and S.G. Anavatti and P. Angelov and E. Lughofer,
PANFIS: A Novel Incremental Learning Machine, IEEE Transactions on
Neural Networks and Learning Systems, vol. 25 (1), pp. 55–68, 2014.

8

[19]

S. Rahnamayan, H.R. Tizhoosh, M.M.A., Salama, Opposition-based
differential evolution algorithms. IEEE Congresson Evolutionary Computation, Vancouver, Canada, pp. 2010–2017, 2006.

[20]

S. Rahnamayan, Opposition-based differential evolution. Ph.D thesis,
University of Waterloo, Waterloo, Canada, 2007.

[21]

S. Rahnamayan, H.R. Tizhoosh, M.M.A. Salama, A novel population
initialization method for accelerating evolutionary algorithms. Comput.
Math. Appl. 53(10),1605–1614, 2007.

[22]

S. Rahnamayan, H. R. Tizhoosh, Image thresholding using micro
opposition-based differential evolution (micro-ODE), IEEE Congress on
Evolutionary Computation, CEC 2008, pp. 1409–1416, 2008.

[23]

S. Rahnamayan, G.G. Wang, Center-based sampling for populationbased algorithms. IEEE Congress on Evolutionary Computation, Trondheim, Norway, pp.933–938, 2009.

[24]

S. Rahnamayan, J. Jesuthasan, F. Bourennani, H. Salehinejad and G.F.
Naterer. ”Computing opposition by involving entire population.” IEEE
Congress on Evolutionary Computation (CEC), pp. 1800–1807, 2014.

[25]

S. Rahnamayan et al., ”Centroid Opposition-Based Differential Evolution.” International Journal of Applied Metaheuristic Computing
(IJAMC) 5.4: 1-25, 2014.

[26]

S. Rahnamayan, G. Gary Wang, and M. Ventresca. ”An intuitive
distance-based explanation of opposition-based sampling.” Applied Soft
Computing 12.9: 2828–2839, 2012.

[27]

S. Rahnamayan, H.R. Tizhoosh, and M.M.A. Salama. ”Opposition versus randomness in soft computing techniques.” Applied Soft Computing
8.2: 906–918, 2008.

[28]

S. Rahnamayan, H. R. Tizhoosh, M.M.A. Salama, Opposition-based
differential evolution, IEEE Transactions on Evolutionary Computation,
vol. 12, issue 1, pp. 64–79, 2008.

[29]

F. Sahba, H.R. Tizhoosh, M.M.A. Salama, Application of oppositionbased reinforcement learning in image segmentation, IEEE Symp.on
Comp. Intell. Image and Signal Processing, pp. 246–251, 2007.

[30]

H. Salehinejad, S. Rahnamayan, H.R. Tizhoosh, Type-II oppositionbased differential evolution. IEEE Congress on Evolutionary Computation (CEC), pp. 1768–1775, 2014.

[31]

T. Takagi and M. Sugeno, Fuzzy identification of systems and its
applications to modeling and control, IEEE transactions on systems, man,
and cybernetics, vol. 15, no. 1, pp. 116132, 1985.

[32]

H.R. Tizhoosh, Opposition-Based Learning: A New Scheme for Machine Intelligence; Proceedings of International Conference on Computational Intelligence for Modelling Control and Automation - CIMCA2005,
Vienna - Austria, vol. I, pp. 695–701, 2005.

[33]

H.R. Tizhoosh, Reinforcement learning based on actions and opposite
actions, International Conference on Artificial Intelligence and Machine
Learning, pp. 94–98, 2005.

[34]

H.R. Tizhoosh, Opposition-Based Reinforcement Learning, JACIII,
vol.10, issue 4, pp. 578–585, 2006.

[35]

H.R. Tizhoosh, M. Ventresca, Oppositional Concepts in Computational
Intelligence. Springer, XII, Hardcover. ISBN: 978-3-540-70826-1, 2008.

[36]

H.R. Tizhoosh, Opposite Fuzzy Sets with Applications in Image Processing, IFSA/EUSFLAT, pp. 36–41, 2009.

[37]

H.R. Tizhoosh, F. Sahba, Quasi-global oppositional fuzzy thresholding,
IEEE Int. Conf. on Fuzzy Systems, pp. 1346–1351, 2009.

[38]

M. Ventresca, H.R. Tizhoosh, Simulated annealing with opposite neighbors, IEEE Symposium on Foundations of Computational Intelligence,
FOCI 2007, pp. 186 –192, 2007.

[39]

M. Ventresca, H.R. Tizhoosh, Opposite transfer functions and backpropagation through time, IEEE Symposium on Foundations of Computational Intelligence, pp. 570–577, 2007.

[40]

Q. Xu, L. Wang, N. Wang, X. Hei, L. Zhao, A review of oppositionbased learning from 2005 to 2012, Engineering Applications of Artificial
Intelligence vol. 29, pp. 1–12, 2014.

[41]

R.R. Yager, A model of participatory learning. IEEE Transactions on
Systems, Man and Cybernetics, vol. 20, n. 5, pp. 1229–1234, 1990.

