ACTA IMEKO  September 2014, Volume 3, Number 3, 57 – 62  www.imeko.org    ACTA IMEKO | www.imeko.org  September 2014 | Volume 3 | Number 3 | 57  Fuzzy scales for the measurement of color  Eric Benoit   LISTIC, Polytech Annecy‐Chambery, University of Savoie, B.P. 80439, 74944 Annecy le Vieux Cedex, France      Section: RESEARCH PAPER   Keywords: Measurement theory; color; colour; Scale; Distance; Fuzzy subset; Fuzzy scale  Citation: Eric Benoit, Fuzzy scales for the measurement of colors, Acta IMEKO, vol. 3, no. 3, article 12, September 2014, identifier: IMEKO‐ACTA‐03 (2014)‐ 03‐12  Editor: Paolo Carbone, University of Perugia   Received March 8 th , 2013; In final form March 24 th , 2014; Published September 2014  Copyright: © 2014 IMEKO. This is an open‐access article distributed under the terms of the Creative Commons Attribution 3.0 License, which permits  unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited  Funding: (none reported)  Corresponding author: Eric Benoit, e‐mail: eric.benoit@univ‐savoie.fr    1. INTRODUCTION  Some quantities like color, odor or software complexity are usually measured with inappropriate scales. Indeed, the theories chosen to abstract such quantities usually define an affine space to represent measurement values even if this choice is not justified. For example, colors are represented in many different colorimetric spaces like RGB, xyz, Luv, Lab, HSV and the transformation from one to each other is not always an affine transformation. We can conclude from this situation that the empirical space of colors doesn’t hold an affine structure and then cannot be represented by an affine space. Conversely, the metric, defined with psychophysic experiments stays stable and is the most known relation on colors. The basis hypothesis of this paper is that the empirical space of some quantities manifestations, more specifically the color, can be represented by a non-affine abstract space that holds a metric. The determination of such metric depends on the theory used to perform calculus reasoning or decision, and on an abstract world where quantities are represented by their quantity value [1]. Let us describe the full process. First the area of interest, i.e. the concrete world is identified. Then the concrete objects and their associated quantities are selected. Finally, a theory that is made of entities, axioms and theorems is chosen. Experiments are then performed in order to obtain some observations of the quantity manifestations. The representations of the manifestations are named quantity values [2] and are expressed into a space which structure depends on the chosen theory. The choice of the theory is crucial and depends on the goal of the experiment. In the color area, the experiment goal can be a color based identification of chemical components. In this case the theory is defined on the area of molecular physics and color manifestations are represented by spectral energy distributions. The spectra are expressed as an n- dimensional vector space. If the goal is to check the quality of a manufactured color, then the experiment is based on a theory of color vision and colors are expressed into a colorimetric space. 2. COLOR VISION REPRESENTATION  This paper, will focus on psychophysical aspects of colors. This means that color quantities are not considered exclusively into the context of physics but also into the context of human perception. From a pure physics based consideration, the color of an electromagnetic flow is defined by its spectral power distribution (SPD). As for any distribution, a general definition is never obtained due to the necessity to define the spectral resolution. Indeed the quantity that represents a color is a vector which length depends on the chosen resolution and on ABSTRACT  The color, with the particularity to be defined simultaneously as a physical quantity and as a psychophysical quantity, is one of the  concepts  that  can  link  hard  sciences  and  behavioural  sciences.  From  the  viewpoint  of  behavioural  sciences,  colors  are  basically  measured with nominal scales. in hard sciences, colors are measured with interval scales. Our hypothesis is that the main relation that  must be preserved during a color measurement is a metric. We suggest then that colors must be measured with metrical scales. The  fuzzy metrical scale is preferred due to the possibility to define it like a nominal scale. ACTA IMEKO | www.imeko.org  September 2014 | Volume 3 | Number 3 | 58  the chosen range of the spectrum. We can see that even with a given theory, the goal of the experiment has a strong incidence on the representation of the measured quantities. As an example, the International Commission on Illumination (CIE) specified that for color measurements of visible light the spectrum range is from 360 nm to 830 nm with 1nm resolution. This institution gave also a first approximation of human color perception with the definition of the tristimulus values XYZ. The X, Y and Z values are obtained with 3 colorimetric observers x(), y() and z() (see (1) and Figure 1) that approximate the spectral sensitivity of human photosensors [3]. (1) This representation of colors into a 3D space is justified by the fact that 2 colors represented with the same XYZ tristimuli are considered as equal by any human. It is then easy to deduce that this color measurement is based on a nominal scale, i.e. on a scale that links an equivalence relation on empirical quantities with an equality on measured values. All colorimetric spaces are derived from the XYZ tristimuli by the use of one-to-one transformations. As one-to-one transformations are admissible transformations for the nominal scales, this confirms that the color measurement scales are equivalent when they are considered as nominal scales. For a given color classification, color histogram methods do not depend on the colorimetric space and they use the classification as a nominal scale. Most other methods need a metric on the colorimetric space or at least a similarity relation between colors [4]. In the first case, a metrical scale, i.e. a scale that preserves a metric, is needed. With its ability to preserve a similarity relation, a fuzzy nominal scale is a good candidate for the second case [5][6]. Some methods use colorimetric spaces as affine spaces [7]. These last approaches are questionable when the different colorimetric spaces must be considered as equivalent representation spaces of the same quantity. From a formal point of view, a method must not depend on the choice of a representation space that actually depends on the choice of a scale. In this paper, we promote the hypothesis that the number of different colorimetric spaces proposed shows that the representation space of a scale for color measurement may have a metric but not necessary be an affine space. The preservation of distances is then the generic property of such scales known as metrical scales. The consequence is that any signal processing method needs to be defined on the basis of a distance. 3. COLOR REPRESENTATION BY LEXICAL FUZZY SUBSETS  Fuzzy nominal scales where introduced in order to formalize an application to the measurement process of the description of a quantity by a fuzzy subset of symbols [8]. With these scales, the measured values are expressed in the representation space with fuzzy subsets of symbols, also called lexical fuzzy subsets (LFS). The measurement is split into a measurement from the set of manifestations to a numerical space X and into a mapping from X to a linguistic space. A mapping D called fuzzy description or simply description translates a numerical scalar or a vector into a lexical fuzzy subset. In the following example, a manifestation is represented by a scalar itself described by a LFS defined by its membership function on a lexical set S = {a,b,c,d}. Building the fuzzy representation. 3.1 The following notation is used for the representation of fuzzy subsets: A fuzzy subset A on a set S is characterized by its membership function also denoted A: Then A(c) is called the grade of membership of c to A. The grade of membership of a symbol a to the fuzzy description D(x) of a value x is then denoted D(x)(a). The grade of membership of a couple (x,y) to a relation R will be denoted by R(x, y), or by (x R y). In this paper, we restrict our study to the fuzzy nominal scales that respect: (2) Such scales define a fuzzy equivalence relation between LFSs like for example the simplest one: (3) This relation also known as similarity relation is a representation of a relation between manifestations. It respects the reflexivity condition, expressed by (2), and a weak version of the transitivity condition. In our case ~ is TL-transitive: (4) where (5) Using fuzzy scales for color measurement is justified by the fact that a similarity relation between colors always exists even if such a relation is not clearly known. Figure 1. The color matching functions x(), y() and z() as given by the  CIE.  Figure 2. Example of a fuzzy description mapping a scalar into a lexical fuzzy  subset (LFS).  ACTA IMEKO | www.imeko.org  September 2014 | Volume 3 | Number 3 | 59  A fuzzy representation mechanism is defined by a fuzzy symbolism where X is a numerical space, S is a lexical set and R is a fuzzy mapping from X to S. The fuzzy description D is then (6) On the other hand, the fuzzy meaning of a symbol s is defined by: (7) Applying eq. (2) imposes the set family M(S) to be a fuzzy partition of the set X. (8) Finally, given a numerical space and a lexical set, the fuzzy representation mechanism is simply defined by a fuzzy partition on the numerical space. Definition of the numerical space 3.2 From an anthropocentric viewpoint, a color is fully defined by 3 coordinates in one of the standard colorimetric spaces. Actually, several colorimetric spaces hold a coordinate for luminance, and two separate coordinates for the chromacity. In this paper we restrict the study to the measurement of the chromaticity. A color is then represented by an element of a chromatic plane. In this case, white, black and intermediate grey colors are represented by the same value. As for many applications, the ab chromatic plane defined as a projection of the Lab space, is chosen for its closeness with human perception. Definition of the lexical set  3.3 The numerical set can be used as lexical set where each item is a couple (a,b). In this trivial situation the fuzzy relation R is reduced to an isomorphism and the scale is no more fuzzy but is a classical two-dimensional ratio scale. This case gives the larger lexical set that can be used to represent the chromacity. Smaller lexical sets can be defined by sub-sampling. For example the set of couples S={-10,...,10}x{-10,...,10}. The semantic of such lexical set stays close to the preceding one, and the syntax, i.e. the set of available relations, is derived from the syntax of the ratio scale. The smaller lexical sets are well known and hold three symbols: S = {green, red, blue} and S = {cyan, magenta, yellow}. In this case, using fuzzy subsets of symbols to represent colors fits in with the additive mixing or with the subtractive mixing of primary colors. A usual lexical set for the representation of colors is the set of the 8 colors of the RGB cube and of the affine transformations of the RGB cube: S = {green, yellow, red, purple, blue, cyan, black, white}. As we work only on the chomatic plane, we choose the symbol neutral for the linguistic representation of the values associated to white, black and the intermediate gray colors. The new lexical set is then defined as S = {green, yellow, red, purple, blue, cyan, neutral}. We propose also to use different symbols to represent real colors and colors that define the boundaries of the chromatic plane. Finally we add the color orange to the set in order to obtain a lexical set more representative of the human feeling. A possible lexical set is then S = {full_green, full_orange, full_yellow, full_red, full_purple, full_blue, full_cyan, neutral, green, yellow, orange, red, purple, blue, cyan}. (9) Definition of the fuzzy meaning 3.4 Except for the trivial case of an infinite lexical set, the set of fuzzy meaning of symbols defines a fuzzy partition of the numerical space. Two other simple cases are the definition of the fuzzy meaning of the lexical sets S = {green, red, blue} and S = {cyan, magenta, yellow}. Assuming that each color x into the mapping of the RGB cube on the Lab plane has obviously an RGB coordinate (xR,xG,xB), the fuzzy partition can be simply defined by the normalized RGB coordinates: (10) The same approach can be used to define the fuzzy meaning of the lexical set S = {cyan, magenta, yellow} with the CMY (Cyan, Magenta Yellow) coordinates. These two fuzzy representations of colors are equivalent to a chromatic plane defined on the RGB space and to a chromatic plane defined on the CMY space, respectively. In this case, the fuzzy representation is useless. Between these two extreme situations, the fuzzy representation of colors is useful when the lexical set has more than 3 symbols. In our approach, we suggest to use the preceding lexical set made of 15 symbols as defined in Eq. (9). In order to define the meaning of each symbol, we first associate each symbol with a chromatic coordinate that characterizes this symbol. This coordinate is called the modal coordinate of the symbol. The fuzzy meaning is defined by a piecewise linear interpolation based on a triangulation of the chromatic plane. First a set of symbols and their modal coordinates are defined. Then the plane is split into triangles such that vertices are modal coordinates. The meaning of a symbol is then defined as a fuzzy subset which membership function is equal to 1 for the modal coordinate of the symbol and equal to 0 for the modal coordinates of the other symbols. The membership of any Figure  3.  Projection  of  the  lighter  colors  of  the  RGB  cube  into  the  Lab  chromatic space.    ACTA IMEKO | www.imeko.org  September 2014 | Volume 3 | Number 3 | 60  coordinate to a fuzzy meaning is then interpolated on the triangles. Figure 3 shows a triangulation used to define the meaning of the lexical set on the ab chromatic plane. 4. FUZZY SCALES  Within the formalism of the representative theory of measurement, the scale , where R is a fuzzy relation and ~ is a similarity relation, is a fuzzy nominal scale. This scale preserves a similarity relation on X during the measurement process. Actually, R is a morphism that links the empirical relational system and the representational relational system , where FS(S) is the set of fuzzy subsets of S and ~ are relations that coincide with the equality = on the singletons of S. This means that the grade of membership of the couple ({a} ~ {b}) is equal to 1 when a = b: The similarity relation ~ on X, is associated with the similarity relation ~ on FS(S) (Eq. 3). At this step, the similarity relation preserved by the measurement process allows to compare the colors in a small region of the chromatic space. In order to compare colors over a wider range, we need a stronger scale. A two-dimensional affine scale will be the solution applied in the case of a numeric scale, i.e. in the case of an infinite lexical set from the view point of this paper. We consider that the chromatic plane cannot be considered as an affine space. This hypothesis is first based on the multiplicity of color spaces that cannot be transformed from one each other by an affine transformation. In this case, the affine scale cannot be used to measure colors. Another argument to confirm this hypothesis is that color perception highly depends on a context. As for any psychophysical human perception, such context is given by the human itself and leads to his history (see [9]) and subjectivity. The goal of the perception is also part of the context. Another hypothesis is to consider that chromatic planes are metrizable spaces, i.e. spaces that can hold a metric. Then it might be possible to build a scale that preserves a metric: a metrical scale. Building a metrical scale from a fuzzy scale needs to define a distance d on the lexical set and to define a distance d’ between lexical fuzzy subsets that verifies:  the singleton coincidence: d’({a},{b}) = d(a,b),  the continuity property,  the precision property that imposes that the distance between two LFSs must be a positive real number,  the consistency property that is usually verified by distances on crisp subsets. The transportation distance verifies all these properties [10]. It is computed as solution for a mass transportation problem [11] where the masses are membership degrees, the sources and the destinations are items of the lexical set and the unit cost from a source to a destination is given by the distance d on S [12]. This distance can be defined relatively to the goal of the measurement process or relatively to the application. If the distance on S is unavailable we propose to use the triangulation to compute a distance on the basis of the adjacency of the symbols provided by the graph of characteristic coordinates. 5. ADAPTATION OF THE SCALE  According to the hypothesis that color perception is context dependent, it is necessary to adapt the scale to a given context. In this part, we propose to start from an initial knowledge materialized by a scale defined as a mean consensus about the meaning of colors. The adaptation, performed iteratively, is based on the identification of clusters of colors in the chromatic plane. At each iteration the clusters are identified relatively to the preceding scale. Then clusters are used to update the scale. The crucial point of the scale definition is the location of the modal coordinates. The modal coordinates given as the initial knowledge are defined for general use and are not usable for specific cases. For example, a Van Gogh painting usually not fits with this generic scale. In this paper, we choose a painting as application example, because the used colors highly depend on the subjective perception of the artist. The proposal of this paper is to perform a Fuzzy C-Means clustering (FCM) to adapt the generic knowledge given by the initial modal coordinates. The idea is to fit each characteristic Figure  4.  Triangulation  that  defines  the  fuzzy  meaning  of  S  =  {full_green,  full_orange,  full_yellow,  full_red,  full_purple,  full_blue,  full_cyan,  neutral,  green,  orange,  yellow,  red,  purple,  blue,  cyan}.  The  letters  a,b,c,..  replace  full_green, full_orange, full_yellow, …    Figure 5. The fuzzy meaning of the symbol orange (letter k) is a fuzzy subset  with a membership equal to 1 for the modal coordinate of orange and equal  to 0 for other modal coordinates.  ACTA IMEKO | www.imeko.org  September 2014 | Volume 3 | Number 3 | 61  point with the center of its closest cluster. The original FCM algorithm is based on the minimization of an objective function based on the computation of the Euclidean distance between samples and cluster centers and cannot be directly used. Indeed, as seen before, nothing can justify that the colorimetric space, or the space of LFSs, holds an Euclidean metric. In the original FCM algorithm a set of clusters is first defined. Each cluster is randomly defined by a fuzzy subset of samples. At each iteration, the FCM algorithm computes the center of each cluster. Then the membership degree of each sample to each cluster is re-evaluated relatively to its proximity to the associated cluster center. In our approach, we propose several adaptations to this process. Let M be a set of samples in X. In the initial state, Each cluster Cs is identified by a symbol s and is defined by a fuzzy subset of X derived from the fuzzy description. (11) where (12) As the fuzzy equivalence relation that characterizes the scale defines a distance for short range LFSs, eq. (11) can be simplified to: (13) The main difference with the standard FCM is the inclusion of a basic knowledge at the initial step of the algorithm. This knowledge can be considered as an average knowledge about the representation of colors. At each iteration, the cluster center is simply computed as the gravity center of the cluster. (14) The scale is then transformed such that the center of the cluster Cs becomes the modal coordinate of the symbol s. As for the original algorithm the iterations stop when the changes reach a termination criterion. The  parameter, must be defined into [0,1]. It represents the inertia of the learning process. If  = 1, each iterated cluster includes only its modal point as unique sample, and the modal points never moves during the algorithm. If  = 0, then each iterated cluster can include new samples far from the modal point. The next figure shows the triangulation after the adaptation of the scale with this method. As the colors full_green, full_orange, full_yellow, full_red, full_purple, full_blue, full_cyan, neutral are synthetic colors defined by a norm, they are not supposed to be changed during the learning process. So the parameter  is set to 0 for these colors. 6. DISCUSSION  The information of color has the property on one side to be typically psychophysical information, on the other side to be acquired with accurate measuring instruments and then to be accurately represented in a numerical space. Between the physical world, from where the color entities are issued, and the abstract human mental world, where they are defined and represented, is the sensitive world that is a partial perception of the physical world. Color entities, like the orange color for example, cannot be considered as concrete physical entities of Figure 6. Van Gogh painting as a context for color measurement.  Figure  7.  Color  histogram  of  the  painting  in  comparison  with  the  modal  coordinates of each symbol before the adaptation of the scale.  ACTA IMEKO | www.imeko.org  September 2014 | Volume 3 | Number 3 | 62  the concrete physical world. They are issued from a concrete entity, an electromagnetic spectrum, and appear into the sensitive world. The difficulty of color measurement is that the human sensitive world, i.e. the human perception of the concrete world, differs from the instrumental sensitive world, i.e. the instrumented perception of the world. The consequence is that the abstract worlds used to represent these sensitive worlds also differ. In particular, the structure of the colorimetric spaces of the instrumental abstract world is richer than the structure of the colorimetric spaces of the mental abstract world. Indeed, each colorimetric space of the instrumental abstract world holds a metric. Usually, but not necessarily, an Euclidean metric. So it is legitimate to consider that the colorimetric space in the instrumental sensitive world also holds this metric. A colorimetric space of the abstract mental world is a metrizable space, but the associated metric is not defined. This fits with the general knowledge that a distance between color exists but cannot be precisely defined. Within this context, the space of lexical fuzzy subsets gives an alternative to the usual numerical colorimetric spaces. Indeed, this space is a metrizable space, and the metric depends on the goal of the color process and not on the sensitive world. Furthermore, the distance is based on a fuzzy scale that can be adapted through a learning algorithm. 7. CONCLUSION  The color measurement does not lead to a unique theory and needs a scale for each application, or more precisely for each context. We proposed in this paper to use scales that preserve a similarity relation or a metric. The fuzzy scales, with their ability to express the measurement values on a non affine space, give a good solution for color measurement. The counter part is the necessity to adapt the scale according to a context or a color process. This paper gives an algorithm to perform such adaptation. This adaptation can be compared with a calibration process where the calibration standards are color entities. Finally the colorimetric space associated to a fuzzy scale has a structure closer to the human representation than classical colorimetric spaces. The goal of a measurement process is to obtain a consensual value to represent a unique quantity. This goal might be felt as contradictory with the approach presented in this paper. But actually it is not. Indeed the linguistic representation of a psychological quantity is influenced by subjectivity and the usual scales are not adapted to reach a consensual value. Using scales that can be adapted to a context or a human perception is a way to compensate the subjectivity and then to reach the initial goal of any measurement process. REFERENCES  [1] L. Finkelstein, Representation by symbol systems as an extension of the concept of measurement, Kybernetes, Vol. 4, (1975) 215- 223. [2] JCGM/WG2, VIM, International vocabulary of metrology — Basic and general concepts and associated terms, Ed. BIPM, 2008. [3] H. Pauli, Proposed extension of the CIE recommendation on “Uniform color spaces, color difference equations, and metric color terms”, J. Opt. Soc. Am. 66, (1976) 866-867. [4] M. Stricker, M. Orengo, Similarity of color images, Proc. SPIE 2420, Storage and Retrieval for Image and Video Databases III, San Jose /CA, USA, 1995, 381-392. [5] E. Benoit, L. Foulloy, “Towards fuzzy nominal scales”, Measurement, ISSN 0263-2241, Vol. 34, No. 1 (Fundamental of Measurement), (2003) 49-55. [6] E. Benoit, L. Foulloy, G. Mauris, “Fuzzy approaches for measurement”, Handbook of Measuring Systems Design, Vol. 1, Eds. Peter Sydenham and Richard Thorn, John Wiley & Sons, 2005, ISBN 978-0470021439, 60-67. [7] T.A. Ell, Hypercomplex color Affine Filters, ICIP 2007, IEEE International Conference on Image Processing, 2007, 249-252. [8] Zadeh L.A., Quantitative fuzzy semantics, Information Sciences, Vol. 3, (1971) 159-176. [9] E. Ozgen, "Language, learning and color perception", Current Directions in Psychological Science, vol. 13, no. 3 ,(2004) 95-98. [10] T. Allevard, E. Benoit, L. Foulloy, “Dynamic gesture recognition using signal processing based on fuzzy nominal scales”, Measurement, No. 38, (2005) 303-312. [11] T. Allevard, E. Benoit, L. Foulloy, “The transportation distance for fuzzy descriptions of measurement”, Metrology and Measurement Systems, Vol. XIV, No. 1/2007, (2007) 25-35. [12] S.T. Rachev, L. Rüschendorf, Mass transportation problems, Springer-Verlag, New-York, 1998, ISBN 978-0387983509. Figure  8.  Color  histogram  of  the  painting  in  comparison  with  the  modal  coordinates after the adaptation of the scale with the FCM like clustering (  = 1 for colors a to h,  = 0.5 for colors i to o).