549

Page 1

Poster Paper Proc. of Int. Joint Colloquium on Emerging Technologies in Computer Electrical and Mechanical 2011

Conversion between Colour Spaces Hemanth Yaji1, Brian Stimpson2 1

Department of Electronics and Communication Engineering, Kurunji Venkatramana Gowda College of Engineering, Kurunjibhag, Sullia, India Email: hemanthyaji@yahoo.com 2 The Department of Electronic and Electrical Engineering, The University of Strathclyde, 204, George Street, Glasgow, United Kingdom Email: b.stimpson@eee.strath.ac.uk Abstract: Function approximation by neural networks is found to be the efficient method for conversion between colour spaces. The performance of the neural networks is evaluated for conversion of a Red, Green, Blue (RGB) colour space to a perceptually uniform Hue, Saturation, Value (HSV) colour space and vice versa. The set of equations given by Smith are used for converting a RGB colour space to a HSV colour space and vice versa. A suitable architecture for the neural networks is selected. We have found that the neural networks fail to approximate a function at the region of ambiguity. The region of colour space where the error is huge, during approximation by using the neural networks is found. Suitable algorithms are developed to post process the approximation results to reduce the errors, and improve the measured accuracy. We found that the computational efficiency for conversion between colour spaces by neural networks will be better compared to conversion using Matlab or any other type of conversion, if the neural network has only a few number of neurons in the hidden layer, which can be achieved, if there is no ambiguity in the target colour space. Matlab is used for programming.

of neural networks. A MLP neural network with one hidden layer consisting of 30 neurons created using newff, is used for converting a RGB colour space to a HSV colour space and vice versa. The number of neurons here is arbitrarily chosen as 30. Newff is the neural network toolbox function in Matlab, for creating a feed-forward back propagation network. The number of neurons in the hidden layer is chosen empirically here. A data set, with uniformly spaced data, with 24,389 samples is used for training a MLP neural network, for converting a RGB colour space to a HSV colour space. Any further increase in the number of samples, leads to memory problems. The neurons are trained using the function trainlm, the Matlab function for Levenberg-Marquardt [5] (LM) optimisation algorithm. The LM algorithm is designed specifically for reducing sum of squares of error. LM optimisation algorithm is used to train the neurons to reduce the Mean Square Error (MSE) between the target colour space and the approximated colour space. Trainlm will train the neurons for the given approximation as long as the weight, net input and the transfer function have derivative functions. Back Propagation weight bias learning is achieved by the Matlab function learngdm, the default. Learngdm is the gradient descent with momentum weight and bias learning function. It produces the weight change factor according to gradient descent for a given learning rate and momentum constant [6]. The Learning Rate and the Momentum Constant are taken as 0.01 and 0.9 respectively, the default values in Matlab. The logsig squashing transfer function activates the neurons in the hidden layer and the output layer. The MSE goal is taken to be 0.000004, the equivalent of Quantisation Error in a 2563 (16,777,216) RGB colour space. An early stopping is applied by specifying the number of epochs. The number of epochs is arbitrarily taken as 500. The time taken for training the neural network to approximate a RGB colour space to a HSV colour space is measured. The correction algorithm for Hue, as a circular measure, as explained below is applied to find all types of errors. Hue traverses from zero to 360 degrees or zero to 2ď ° radians showing a circular measure and the usual way of finding the errors will not apply. Assuming that the neural networks learn well to approximate the conversion of a RGB colour space to a HSV colour space and the error in Hue will not be more than 0.5, the following correction algorithm for absolute errors greater than 0.5 in Hue will be able to compute the real error in Hue during mapping.

Index Terms: Colour Spaces, Neural Networks

I. INTRODUCTION The neural networks take a very little computation for function approximation [1]. For mapping continuous functions, multi layer perceptron (MLP) neural networks provide accurate and efficient approximation than any other approximation techniques [2]. This paper evaluates the performance of MLP neural networks for converting one colour space to another. Here RGB colour space is converted to a HSV colour space and vice versa, using MLP neural networks. The set of equations given by Smith [3] have been used for converting a RGB colour space to a HSV colour space and vice versa. The set of equations provided by Smith have been used in Matlab tool box functions rgb2hsv and hsv2rgb for converting a RGB colour space to a HSV colour space and vice versa. The revised codes by P. Gravel for faster execution and less memory are provided by Matlab in the function rgb2hsv for converting a RGB colour space to a HSV colour space. II. TRAINING OF THE NEURAL NETWORKS Hudson and Postma [4] have provided the guidelines for selecting a right architecture for neural networks. Comparisons are obtained by the analysis of general features Š 2011 ACEEE DOI: 02.CEM.2011.01.549

69


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.