scieee AI-readable full text Open interactive document viewer

Munsell Soil Colour Classification Using Smartphones through a Neuro-Based Multiclass Solution

Pegalajar Jiménez, María Del Carmen,Baca Ruiz, Luis Gonzaga

Abstract

Colour is a property widely used in many fields to extract information in several ways. In soil science, colour provides information regarding the chemical and physical characteristics of soil, such as genesis, composition, and fertility, amongst others. Thus, accurate estimation of soil colour is essential for many disciplines. To achieve this, experts traditionally rely on comparing Munsell colour charts with soil samples, which is a laborious process. In this study, we proposed using artificial neural networks to catalogue soil colour with a two-step classification. Firstly, the hue variable is estimated, and then the remaining two coordinates, value and chroma. Our experiments were conducted using three different, common cameras (one digital camera and two mobile phones). The results of our tests showed a 20% improvement in classification accuracy using the lowest-quality camera and an average accuracy of over 90%.

Full text

Citation: Pegalajar, M.C.; Ruiz, L.G.B.; Criado-Ramón, D. Munsell Soil Colour Classification Using Smartphones through a Neuro-Based Multiclass Solution. AgriEngineering 2023,5, 355–368. https://doi.org/ 10.3390/agriengineering5010023 Academic Editor: Robert J. Lascano Received: 14 December 2022 Revised: 7 February 2023 Accepted: 7 February 2023 Published: 10 February 2023 Copyright: © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). AgriEngineering Article Munsell Soil Colour Classification Using Smartphones through a Neuro-Based Multiclass Solution M. C. Pegalajar 1, L. G. B. Ruiz 2,* and D. Criado-Ramón1 1Department of Computer Science and Artificial Intelligence, University of Granada, 18014 Granada, Spain 2Department of Software Engineering, University of Granada, 18014 Granada, Spain *Correspondence: [email protected] Abstract: Colour is a property widely used in many fields to extract information in several ways. In soil science, colour provides information regarding the chemical and physical characteristics of soil, such as genesis, composition, and fertility, amongst others. Thus, accurate estimation of soil colour is essential for many disciplines. To achieve this, experts traditionally rely on comparing Munsell colour charts with soil samples, which is a laborious process. In this study, we proposed using artificial neural networks to catalogue soil colour with a two-step classification. Firstly, the hue variable is estimated, and then the remaining two coordinates, value and chroma. Our experiments were conducted using three different, common cameras (one digital camera and two mobile phones). The results of our tests showed a 20% improvement in classification accuracy using the lowest-quality camera and an average accuracy of over 90%. Keywords: artificial neural networks; colour matching; Munsell soil-colour charts; multiclassification 1. Introduction Pedology is a branch of earth sciences that explores soils in their natural environment. It involves the study of soil’s chemical and physical features, formation, distribution, morphology, and classification of bodies within the natural habitat. One of the properties that provide this kind of information is colour [ 1 , 2 ]. However, accurately estimating the soil colour is not a trivial task. It may provide valuable information to the expert who is capable of interpreting it. Based on the colour, an expert can obtain data concerning the genesis, composition, or even the age of soil and rock surfaces. To do so, the Munsell colour chart (MCC) is commonly used [ 3 , 4 ]. The MCC is the classical way of estimating colour information. The technique involves visually comparing soil samples and colour chips belonging to the MCC [ 5 ]. The Munsell charts consist of a list of standard cardboards arranged by three coordinates: shade or hue (H), lightness or value (V), and intensity or chroma (C). Thus, the charts are arranged based on the H, and this has five central values: red (R), yellow (Y), green (G), blue (B) and purple (P). At the same time, we can find in-between combinations: yellow-red (YR), green-red (GR), and so on. The MCC has been used in a variety of scenarios. As a result, various methodologies can be found in the literature. The main issue to be addressed is the uncertainty caused by the subjectivity of the observer. Marqués et al. [ 5 ] used k-nearest neighbour to analyse colour consistency and quantify soil colour measurements. They conducted their experiments in a controlled laboratory setting, resulting in a more precise and objective quantitative soil colour identification. In [ 6 ], a method of extracting colour information from digital images of cultural heritage was presented. The authors adopted multiple colour spaces (RGB, HSV, and Munsell) to solve their problem. Mancini et al. [ 7 ] utilised sensors and random forest to obtain the Munsell coordinates for soil classification. They achieved an accuracy and Kappa index of 0.93 in their prediction. Additionally, the authors of the latter research took into consideration that physical MCC can be affected by time and dirt. The colours in the charts can fade or change, and dirt and other contaminants may also AgriEngineering 2023,5, 355–368. https://doi.org/10.3390/agriengineering5010023 https://www.mdpi.com/journal/agriengineering AgriEngineering 2023,5356 obscure details and potentially cause damage to the surface. As a result, they studied dirty and old Munsell charts and they found that the prediction accuracy could be reduced due to the noise in the samples. In [ 8 ], the authors used spectroscopy and compared the results with observed MCC estimates in order to ensure robustness in the process of observation and data collection. They detected a certain correlation between the spectrophotometer and the observed measures. They developed a three-factor regression to effectively predict soil organic carbon based on the colours. Massawe et al. [ 9 ] combined digital soil mapping and machine learning to develop a predictive soil map. They also conducted their analysis in a laboratory, examining several soil characteristics such as pH, electrical conductivity, texture, nitrogen, and organic carbon. The classification was performed using a decision tree model. Many other studies can be found using different machine learning techniques, such as decision tree [ 9 – 12 ], random forest [ 7 , 13 – 15 ], k-nearest neighbour [ 5 , 16 , 17 ], fuzzy system (FS) [ 18 , 19 ], artificial neural network (ANN) [ 20 – 22 ], and even deep learning [ 23 ], among others. The latter includes a comprehensive review of the recent advances in computer vision for soil classification. As can be seen there and in the rest of the mentioned studies, nearly all the studies were performed in a controlled scenario and using some sophisticated devices. Additionally, another feature in addition to the colour has been examined, namely texture. By exploring these methods, we can point out two drawbacks. The first disadvantage is the equipment required to obtain the data. The second one is the scenario, as it is tedious to collect the data and not be able to extract many conclusions until the samples are examined in a laboratory. Some solutions using mobile phones have been proposed to address this problem. For example, Gómez-Robledo et al. [ 24 ] utilised a mobile phone camera to measure soil colour, and their result showed that their models had accuracy similar to that of a set of observers. They transformed the RGB values into the XYZ space and again into HVC. Another example can be found in [ 25 ], where the authors classified soil based on smartphone images with colour sensors. The main issue with these method is that the direct conversion of RGB values does not take into account the sensitivity of the camera; therefore, the variability in the estimates can be high for the same sample. Additionally, the incorporation of external gadgets increases the cost of the solution. Thus, as opposed to previously published methods, we attempted to solve the problem by developing a methodology using an inexpensive device that is accessible to everyone, i.e., a common camera. As in other studies, we obtained samples by using images taken by a camera. However, while other researchers used only one device, in order to validate our solution, we used of three different-quality cameras. Furthermore, we implemented an artificial neural network to classify the soil samples. The main issue we found with previous methods is that lower-quality images were not able to provide suitable precision, while other high-quality cameras could. We propose a two-step classification method: first, obtain the H coordinate of the MCC; second, take advantage of the H estimate to predict the remaining two variables, V and C. 2. Methodology 2.1. Dataset and Precedent Studies The current study continues a research line initiated several years ago; while prior researchers have examined this problem using alternative methodologies, we evaluated the efficacy of our novel approach in comparison with a previously established one [20]. This was motivated by the methodology employed for data collection, including the procedures for extraction and methods used to eventually obtain each numerical sample. The main flowchart of the data acquisition is shown in Figure 1. AgriEngineering 2023,5357 AgriEngineering 2023, 5, 3 RGB values Image acquisition Imagesegmentation algorithm Classification model Figure 1. Flowchart of data acquisition in previous studies. For this study, all images were manually captured with three devices: two mobile phones (Nokia C301 and Samsung Galaxy S2) and one digital camera (Canon EOS 1100D). To ensure accurate colour representation, a reference white was included in each image to calibrate the camera’s white balance based on the ambient lighting conditions. After that, an image-segmentation algorithm was used to obtain the RGB values. Specifically, the algorithm processed an image and generated a set of representative pixels from each chip. The RGB coordinates of these pixels were then retained for use in training a classification model. In the previously discussed study [20], after obtaining RGB samples, three separate ANNs were simultaneously trained, one for each HVC coordinate. Then, a fuzzy system was utilised to process the output from the three ANNs, resulting in a set of possible Munsell chips. Because we were training three separate models to independently estimate each HVC value, a potential issue arose when the models generated nonvalid combinations of HVC values. Thus, the key aspect of the method proposed in this study is using additional information to reduce the search space and improve the models’ performance. 2.2. Artificial Neural Networks As we previously stated, in this study, we implemented several ANNs for the soil classification problem. ANN is a type of machine learning model inspired by the structure and function of biological neural networks. An ANN consists of layers of interconnected neurons (or nodes), which can process and diffuse information. These networks are trained using large sets of labelled data and can be used for a variety of tasks such as image recognition, natural language processing, and decision making. ANNs are particularly useful for tasks where the relationship between inputs and outputs is complex and not easily defined by a simple rule or equation [26]. In the literature, we can find many kinds of ANNs. In feedforward neural network, the most basic type of ANN, the information flows in only one direction, from input layers to output layers, without any loops. This is also called multilayer perceptron (MLP) and is used for various supervised learning tasks such as regression and classification. Recurrent neural networks have the ability to maintain an internal state, allowing them to process sequential data such as time series, speech, or text. Convolutional neural networks (CNNs) are designed to process and analyse grid-like data such as images, video frames, and audio spectrograms [27]. Although CNNs are commonly used for image-related tasks, we chose to implement MLP for this study. Our data representation motivated this decision because we were not directly working with images but rather with an image segmentation algorithm that ultimately generates a set of numerical RGB values. This dataset is better suited for MLP models. 2.3. Method The proposed methodology is divided into three main stages. The first step involves analysing the quality of the data by using correlation analysis. It is important to keep in mind that the RGB values of an image captured by different devices may vary depending on the device’s settings and other factors. Moreover, some devices can have different colour profiles, which can affect the RGB values. As a consequence, a correlation analysis is Figure 1. Flowchart of data acquisition in previous studies. For this study, all images were manually captured with three devices: two mobile phones (Nokia C301 and Samsung Galaxy S2) and one digital camera (Canon EOS 1100D). To ensure accurate colour representation, a reference white was included in each image to calibrate the camera’s white balance based on the ambient lighting conditions. After that, an image-segmentation algorithm was used to obtain the RGB values. Specifically, the algorithm processed an image and generated a set of representative pixels from each chip. The RGB coordinates of these pixels were then retained for use in training a classification model. In the previously discussed study [ 20 ], after obtaining RGB samples, three separate ANNs were simultaneously trained, one for each HVC coordinate. Then, a fuzzy system was utilised to process the output from the three ANNs, resulting in a set of possible Munsell chips. Because we were training three separate models to independently estimate each HVC value, a potential issue arose when the models generated nonvalid combinations of HVC values. Thus, the key aspect of the method proposed in this study is using additional information to reduce the search space and improve the models’ performance. 2.2. Artificial Neural Networks As we previously stated, in this study, we implemented several ANNs for the soil classification problem. ANN is a type of machine learning model inspired by the structure and function of biological neural networks. An ANN consists of layers of interconnected neurons (or nodes), which can process and diffuse information. These networks are trained using large sets of labelled data and can be used for a variety of tasks such as image recognition, natural language processing, and decision making. ANNs are particularly useful for tasks where the relationship between inputs and outputs is complex and not easily defined by a simple rule or equation [26]. In the literature, we can find many kinds of ANNs. In feedforward neural network, the most basic type of ANN, the information flows in only one direction, from input layers to output layers, without any loops. This is also called multilayer perceptron (MLP) and is used for various supervised learning tasks such as regression and classification. Recurrent neural networks have the ability to maintain an internal state, allowing them to process sequential data such as time series, speech, or text. Convolutional neural networks (CNNs) are designed to process and analyse grid-like data such as images, video frames, and audio spectrograms [27]. Although CNNs are commonly used for image-related tasks, we chose to implement MLP for this study. Our data representation motivated this decision because we were not directly working with images but rather with an image segmentation algorithm that ultimately generates a set of numerical RGB values. This dataset is better suited for MLP models. 2.3. Method The proposed methodology is divided into three main stages. The first step involves analysing the quality of the data by using correlation analysis. It is important to keep in mind that the RGB values of an image captured by different devices may vary depending on the device’s settings and other factors. Moreover, some devices can have different colour profiles, which can affect the RGB values. As a consequence, a correlation analysis is first performed because the quality of the images is directly proportional to the correlation AgriEngineering 2023,5358 among RGB points. The second step is adjusting and transforming the data from the images and preparing the data for modelling. The third and final phase is to model each of the Munsell colour coordinates. The current study builds on previous studies [ 20 , 21 ], where a hybrid neuro-fuzzy approach was proposed to solve the problem at hand. For this solution, ANNs were used to predict each of the HVC values. Independent ANNs were trained to learn each coordinate, and then an FS estimated the degree of membership for all the available chips. Although that solution provided appealing results, it had two drawbacks. First, we had to design an FS with more than two hundred rules, one per chip. Second, that approach worked properly for high-quality devices but did not achieve the expected accuracy for poorer-quality ones. Note that in addition to aiming to solve the problem, we also sought to address issues stemming from the use of cheaper cameras. An overview of the methodology is illustrated in Figure 2. We started with a set of pictures taken by three different devices: a Canon EOS 1100D, which had the best quality pictures, and two mobile phones with similar features (Nokia C301 and Samsung Galaxy S2). All the samples were taken on a grey background along with white colour as a reference in order to address the lighting conditions. These images provided the raw data: a set of RGB coordinates. AgriEngineering 2023, 5, 4 first performed because the quality of the images is directly proportional to the correlation among RGB points. The second step is adjusting and transforming the data from the images and preparing the data for modelling. The third and final phase is to model each of the Munsell colour coordinates. The current study builds on previous studies [20,21], where a hybrid neuro-fuzzy approach was proposed to solve the problem at hand. For this solution, ANNs were used to predict each of the HVC values. Independent ANNs were trained to learn each coordinate, and then an FS estimated the degree of membership for all the available chips. Although that solution provided appealing results, it had two drawbacks. First, we had to design an FS with more than two hundred rules, one per chip. Second, that approach worked properly for high-quality devices but did not achieve the expected accuracy for poorer-quality ones. Note that in addition to aiming to solve the problem, we also sought to address issues stemming from the use of cheaper cameras. An overview of the methodology is illustrated in Figure 2. We started with a set of pictures taken by three different devices: a Canon EOS 1100D, which had the best quality pictures, and two mobile phones with similar features (Nokia C301 and Samsung Galaxy S2). All the samples were taken on a grey background along with white colour as a reference in order to address the lighting conditions. These images provided the raw data: a set of RGB coordinates. Raw data Analysis and quality Data transformation Modelling Munsell chip Figure 2. General flow of the proposed methodology. To confirm that all the samples represented the same information, we analysed these RGB values and tested the quality of the information they gathered. They were supposed to exhibit the same, or very similar, information, but we found that there was high variability in terms of colour depending on the device. In order to solve this problem, we transformed the data according to a reference gamut. Because the Canon camera provided the best-quality images, we selected that one as a reference, so that all the samples were able to have improved RGB quality. This transformation was performed as illustrated in Figure 3. The input of the ANN was the RGB values to convert for each device (Nokia and Samsung), and the ANN predicted the new R′G′B′ coordinates according to the Canon camera. R G B R’ G’ B’ Figure 3. ANN to compute the new RGB coordinates according to the reference gamut. Then, we trained an ANN to compute the hue; after that, we trained another ANN to estimate the value and chroma. This decision was made in this order, as the Munsell colour charts are distributed in this way: first the H, and then V and C together. In this way, we anticipated that the accuracy of the models would increase as the range of possible solutions reduced. We also tested training the ANN, transforming colour space from RGB to hue, saturation, and value (HSV) as this colour space seemed to be more similar to the HCV than Figure 2. General flow of the proposed methodology. To confirm that all the samples represented the same information, we analysed these RGB values and tested the quality of the information they gathered. They were supposed to exhibit the same, or very similar, information, but we found that there was high variability in terms of colour depending on the device. In order to solve this problem, we transformed the data according to a reference gamut. Because the Canon camera provided the bestquality images, we selected that one as a reference, so that all the samples were able to have improved RGB quality. This transformation was performed as illustrated in Figure 3. The input of the ANN was the RGB values to convert for each device (Nokia and Samsung), and the ANN predicted the new R0G0B0coordinates according to the Canon camera. AgriEngineering 2023, 5, 4 first performed because the quality of the images is directly proportional to the correlation among RGB points. The second step is adjusting and transforming the data from the images and preparing the data for modelling. The third and final phase is to model each of the Munsell colour coordinates. The current study builds on previous studies [20,21], where a hybrid neuro-fuzzy approach was proposed to solve the problem at hand. For this solution, ANNs were used to predict each of the HVC values. Independent ANNs were trained to learn each coordinate, and then an FS estimated the degree of membership for all the available chips. Although that solution provided appealing results, it had two drawbacks. First, we had to design an FS with more than two hundred rules, one per chip. Second, that approach worked properly for high-quality devices but did not achieve the expected accuracy for poorer-quality ones. Note that in addition to aiming to solve the problem, we also sought to address issues stemming from the use of cheaper cameras. An overview of the methodology is illustrated in Figure 2. We started with a set of pictures taken by three different devices: a Canon EOS 1100D, which had the best quality pictures, and two mobile phones with similar features (Nokia C301 and Samsung Galaxy S2). All the samples were taken on a grey background along with white colour as a reference in order to address the lighting conditions. These images provided the raw data: a set of RGB coordinates. Raw data Analysis and quality Data transformation Modelling Munsell chip Figure 2. General flow of the proposed methodology. To confirm that all the samples represented the same information, we analysed these RGB values and tested the quality of the information they gathered. They were supposed to exhibit the same, or very similar, information, but we found that there was high variability in terms of colour depending on the device. In order to solve this problem, we transformed the data according to a reference gamut. Because the Canon camera provided the best-quality images, we selected that one as a reference, so that all the samples were able to have improved RGB quality. This transformation was performed as illustrated in Figure 3. The input of the ANN was the RGB values to convert for each device (Nokia and Samsung), and the ANN predicted the new R′G′B′ coordinates according to the Canon camera. R G B R’ G’ B’ Figure 3. ANN to compute the new RGB coordinates according to the reference gamut. Then, we trained an ANN to compute the hue; after that, we trained another ANN to estimate the value and chroma. This decision was made in this order, as the Munsell colour charts are distributed in this way: first the H, and then V and C together. In this way, we anticipated that the accuracy of the models would increase as the range of possible solutions reduced. We also tested training the ANN, transforming colour space from RGB to hue, saturation, and value (HSV) as this colour space seemed to be more similar to the HCV than Figure 3. ANN to compute the new RGB coordinates according to the reference gamut. Then, we trained an ANN to compute the hue; after that, we trained another ANN to estimate the value and chroma. This decision was made in this order, as the Munsell colour charts are distributed in this way: first the H, and then V and C together. In this way, we anticipated that the accuracy of the models would increase as the range of possible solutions reduced. We also tested training the ANN, transforming colour space from RGB to hue, saturation, and value (HSV) as this colour space seemed to be more similar to the HCV than to RGB. Nonetheless, as the experiment described in the next section confirms, we did not use the HSV-based models, using the RGB ones instead. AgriEngineering 2023,5359 3. Experiments In this study, we conducted a series of experiments to evaluate the performance of our proposed method. The aim of these experiments was to demonstrate the effectiveness of the new method in comparison with that of existing approaches. The experiments were designed to test the proposed method under different scenarios and conditions. The results of these experiments provide insight into the strengths and limitations of the new approach and offer guidance for its practical application. Figure 4provides a schematic representation of the experimental design. First, a preliminary analysis of the data quality was conducted on the RGB samples obtained from the images. This was necessary due to the potential variations in image quality and, therefore, in the information captured, which may have resulted from using different devices. AgriEngineering 2023, 5, 5 to RGB. Nonetheless, as the experiment described in the next section confirms, we did not use the HSV-based models, using the RGB ones instead. 3. Experiments In this study, we conducted a series of experiments to evaluate the performance of our proposed method. The aim of these experiments was to demonstrate the effectiveness of the new method in comparison with that of existing approaches. The experiments were designed to test the proposed method under different scenarios and conditions. The results of these experiments provide insight into the strengths and limitations of the new approach and offer guidance for its practical application. Figure 4 provides a schematic representation of the experimental design. First, a preliminary analysis of the data quality was conducted on the RGB samples obtained from the images. This was necessary due to the potential variations in image quality and, therefore, in the information captured, which may have resulted from using different devices. RGB values Correlation analysis Reference gamut Improvement? Colour space experiment No Store new RGB values Yes RGB values Improvement? Yes ANN training for H No ANN training for VC Comparison Figure 4. Overview of the designed experiments. Following the confirmation of the variations among our samples, our next objective was to enhance the data quality by using a reference gamut. To achieve this, we applied two ANNs: one for mapping the Nokia samples to Canon samples, and the other for mapping the Samsung samples to the Canon gamut. This produced a significant improvement in data quality; the dataset was updated with the new values. In addition to the reference gamut approach, we aimed to further improve the data representation by converting the RGB coordinates to a different colour space, the HSV colour space, which is similar to the MCC representation. Once again, if an improvement was found, the database was updated with the best data representation. Finally, the highest-quality data were used to train our ANNs. First, we trained the model to fit the hue; then, using the estimation from the previous step, we trained another ANN to fit the remaining two coordinates. To complete the validation of the implemented models, a comparison with previous results was made. 4. Results This section presents a summary of the most notable findings of our study. As we mentioned in the previous section, the first step was to analyse the quality of the data. Table 1 shows the correlation of each channel RGB for each device. At first glance, the results showed that there was a strong correlation between some of the RGB channels. The correlation was higher for Canon and Samsung but not for Nokia, which attained lower correlation statistics. All these correlations can be visually displayed in Figure 5. Figure 4. Overview of the designed experiments. Following the confirmation of the variations among our samples, our next objective was to enhance the data quality by using a reference gamut. To achieve this, we applied two ANNs: one for mapping the Nokia samples to Canon samples, and the other for mapping the Samsung samples to the Canon gamut. This produced a significant improvement in data quality; the dataset was updated with the new values. In addition to the reference gamut approach, we aimed to further improve the data representation by converting the RGB coordinates to a different colour space, the HSV colour space, which is similar to the MCC representation. Once again, if an improvement was found, the database was updated with the best data representation. Finally, the highest-quality data were used to train our ANNs. First, we trained the model to fit the hue; then, using the estimation from the previous step, we trained another ANN to fit the remaining two coordinates. To complete the validation of the implemented models, a comparison with previous results was made. 4. Results This section presents a summary of the most notable findings of our study. As we mentioned in the previous section, the first step was to analyse the quality of the data. Table 1shows the correlation of each channel RGB for each device. At first glance, the results showed that there was a strong correlation between some of the RGB channels. The correlation was higher for Canon and Samsung but not for Nokia, which attained lower correlation statistics. All these correlations can be visually displayed in Figure 5. AgriEngineering 2023,5360 Table 1. Correlation matrix of the RGB values for each device. R C , G C, and B C stand for the RGB values for Canon, respectively; R N , G N, and B N are the Nokia’s RGB values, respectively; R S , G S and BScorrespond to the RGB values for Samsung, respectively. RC GC BC RN GN BN RS GS BS RC 1.0000 0.9449 0.8112 0.4838 0.5059 0.3694 0.9737 0.9422 0.6986 GC 0.9449 1.0000 0.9163 0.4429 0.5382 0.4532 0.8820 0.9881 0.8143 BC 0.8112 0.9163 1.0000 0.3704 0.4866 0.5600 0.7324 0.9010 0.9559 RN 0.4838 0.4429 0.3704 1.0000 0.9555 0.7952 0.4864 0.4766 0.3687 GN 0.5059 0.5382 0.4866 0.9555 1.0000 0.8780 0.4774 0.5655 0.4836 BN 0.3694 0.4532 0.5600 0.7952 0.8780 1.0000 0.3280 0.4835 0.6149 RS 0.9737 0.8820 0.7324 0.4864 0.4774 0.3280 1.0000 0.9005 0.6489 GS 0.9422 0.9881 0.9010 0.4766 0.5655 0.4835 0.9005 1.0000 0.8295 BS 0.6986 0.8143 0.9559 0.3687 0.4836 0.6149 0.6489 0.8295 1.0000 AgriEngineering 2023, 5, 6 Table 1. Correlation matrix of the RGB values for each device. RC, GC, and BC stand for the RGB values for Canon, respectively; RN, GN, and BN are the Nokia’s RGB values, respectively; RS, GS and BS correspond to the RGB values for Samsung, respectively. RC GC BC RN GN BN RS GS BS RC 1.0000 0.9449 0.8112 0.4838 0.5059 0.3694 0.9737 0.9422 0.6986 GC 0.9449 1.0000 0.9163 0.4429 0.5382 0.4532 0.8820 0.9881 0.8143 BC 0.8112 0.9163 1.0000 0.3704 0.4866 0.5600 0.7324 0.9010 0.9559 RN 0.4838 0.4429 0.3704 1.0000 0.9555 0.7952 0.4864 0.4766 0.3687 GN 0.5059 0.5382 0.4866 0.9555 1.0000 0.8780 0.4774 0.5655 0.4836 BN 0.3694 0.4532 0.5600 0.7952 0.8780 1.0000 0.3280 0.4835 0.6149 RS 0.9737 0.8820 0.7324 0.4864 0.4774 0.3280 1.0000 0.9005 0.6489 GS 0.9422 0.9881 0.9010 0.4766 0.5655 0.4835 0.9005 1.0000 0.8295 BS 0.6986 0.8143 0.9559 0.3687 0.4836 0.6149 0.6489 0.8295 1.0000 Canon Nokia Samsung Canon Nokia Samsung Figure 5. Representation of the correlation coefficients of the RGB values obtained by each device. In order to improve the quality of the data, we designed the reference gamut experiment. We experimented with some ANN parameters in order to find the optimal model. Because there were many experiments, we do not describe all of them. As an example, the experiment with the number of neurons is shown in Table 2. In this training, we tested different values for the number of neurons, and we finally selected the best one. For each neuron value, we performed 10 experiments, and we chose the average (see columns from 3 to 6). In order to obtain a clear picture of our results, column 6 was included: it represents the denormalised error. By checking this column, we could examine the variability in the estimates in terms of colour. The last two columns illustrate the best test and validation metrics during the training process, respectively. The progression of these experiments is illustrated in Figure 6. Note that this figure does not display the error for the one-neuron case as it was too high. From these two graphs, we can see that between 20 and 25 neurons, the ANNs managed to obtain the best fit; after that, the variability was not significant. In any case, we selected the best ones and stored them for the next step. Once we acquired the optimal ANN to change the gamut, we computed the new RGB values. The results are illustrated in Table 3. The results evidenced an improvement in the quality of the data. However, the correlation with the Nokia device did not increase. Overall, the correlations considerably strengthened. Figure 5. Representation of the correlation coefficients of the RGB values obtained by each device. In order to improve the quality of the data, we designed the reference gamut experiment. We experimented with some ANN parameters in order to find the optimal model. Because there were many experiments, we do not describe all of them. As an example, the experiment with the number of neurons is shown in Table 2. In this training, we tested different values for the number of neurons, and we finally selected the best one. For each neuron value, we performed 10 experiments, and we chose the average (see columns from 3 to 6). In order to obtain a clear picture of our results, column 6 was included: it represents the denormalised error. By checking this column, we could examine the variability in the estimates in terms of colour. The last two columns illustrate the best test and validation metrics during the training process, respectively. AgriEngineering 2023,5361 Table 2. Experiments for the reference gamut modelling. Device Neurons Train Test Validation Denorm. Validation Min. Test Min. Validation Nokia 1 0.02669 0.02680 0.02620 1703.1960 0.02438 0.02312 5 0.00167 0.00175 0.00167 108.43533 0.00127 0.00111 10 0.00086 0.00092 0.00099 64.18800 0.00065 0.00072 15 0.00075 0.00079 0.00077 49.87453 0.00061 0.00059 20 0.00068 0.00074 0.00079 51.64453 0.00059 0.00060 25 0.00069 0.00086 0.00075 48.96067 0.00065 0.00060 30 0.00060 0.00076 0.00075 49.04147 0.00050 0.00049 35 0.00059 0.00076 0.00081 52.91627 0.00056 0.00054 40 0.00062 0.00078 0.00071 46.10627 0.00059 0.00058 45 0.00053 0.00075 0.00083 53.89320 0.00058 0.00055 50 0.00056 0.00077 0.00082 53.50213 0.00059 0.00062 Samsung 1 0.00441 0.00436 0.00444 289.00307 0.00381 0.00395 5 0.00103 0.00113 0.00100 64.83067 0.00089 0.00071 10 0.00085 0.00091 0.00086 55.68960 0.00068 0.00061 15 0.00079 0.00080 0.00087 56.35720 0.00069 0.00065 20 0.00064 0.00074 0.00079 51.57760 0.00044 0.00057 25 0.00060 0.00070 0.00073 47.49813 0.00054 0.00055 30 0.00055 0.00081 0.00082 53.25147 0.00051 0.00055 35 0.00054 0.00080 0.00073 47.49560 0.00061 0.00054 40 0.00054 0.00075 0.00072 47.13880 0.00060 0.00045 45 0.00053 0.00078 0.00080 51.73093 0.00062 0.00045 50 0.00052 0.00076 0.00075 48.97707 0.00055 0.00053 The progression of these experiments is illustrated in Figure 6. Note that this figure does not display the error for the one-neuron case as it was too high. From these two graphs, we can see that between 20 and 25 neurons, the ANNs managed to obtain the best fit; after that, the variability was not significant. In any case, we selected the best ones and stored them for the next step. AgriEngineering 2023, 5, 7 Table 2. Experiments for the reference gamut modelling. Device Neurons Train Test Validation Denorm. Validation Min. Test Min. Validation Nokia 1 0.02669 0.02680 0.02620 1703.1960 0.02438 0.02312 5 0.00167 0.00175 0.00167 108.43533 0.00127 0.00111 10 0.00086 0.00092 0.00099 64.18800 0.00065 0.00072 15 0.00075 0.00079 0.00077 49.87453 0.00061 0.00059 20 0.00068 0.00074 0.00079 51.64453 0.00059 0.00060 25 0.00069 0.00086 0.00075 48.96067 0.00065 0.00060 30 0.00060 0.00076 0.00075 49.04147 0.00050 0.00049 35 0.00059 0.00076 0.00081 52.91627 0.00056 0.00054 40 0.00062 0.00078 0.00071 46.10627 0.00059 0.00058 45 0.00053 0.00075 0.00083 53.89320 0.00058 0.00055 50 0.00056 0.00077 0.00082 53.50213 0.00059 0.00062 Samsung 1 0.00441 0.00436 0.00444 289.00307 0.00381 0.00395 5 0.00103 0.00113 0.00100 64.83067 0.00089 0.00071 10 0.00085 0.00091 0.00086 55.68960 0.00068 0.00061 15 0.00079 0.00080 0.00087 56.35720 0.00069 0.00065 20 0.00064 0.00074 0.00079 51.57760 0.00044 0.00057 25 0.00060 0.00070 0.00073 47.49813 0.00054 0.00055 30 0.00055 0.00081 0.00082 53.25147 0.00051 0.00055 35 0.00054 0.00080 0.00073 47.49560 0.00061 0.00054 40 0.00054 0.00075 0.00072 47.13880 0.00060 0.00045 45 0.00053 0.00078 0.00080 51.73093 0.00062 0.00045 50 0.00052 0.00076 0.00075 48.97707 0.00055 0.00053 (a) (b) Figure 6. Evolution of the error according to the number of neurons for the (a) Nokia-to-Canon and (b) Samsung-to-Canon ANN to change the gamut. Table 3. Correlation matrix of the new RGB values after the change of gamut. The correlations that increased from those in Table 1 are indicated in bold. RC GC BC RN GN BN RS GS BS RC 1.0000 0.9449 0.8112 0.9950 0.9426 0.8129 0.9949 0.9450 0.8127 GC 0.9449 1.0000 0.9163 0.9441 0.9961 0.9151 0.9441 0.9950 0.9153 BC 0.8112 0.9163 1.0000 0.8102 0.9115 0.9920 0.8076 0.9090 0.9893 RN 0.9950 0.9441 0.8102 1.0000 0.9474 0.8174 0.9931 0.9464 0.8143 GN 0.9426 0.9961 0.9115 0.9474 1.0000 0.9184 0.9440 0.9953 0.9153 BN 0.8129 0.9151 0.9920 0.8174 0.9184 1.0000 0.8121 0.9131 0.9902 RS 0.9949 0.9441 0.8076 0.9931 0.9440 0.8121 1.0000 0.9499 0.8172 GS 0.9450 0.9950 0.9090 0.9464 0.9953 0.9131 0.9499 1.0000 0.9191 BS 0.8127 0.9153 0.9893 0.8143 0.9153 0.9902 0.8172 0.9191 1.0000 RC, GC, and BC stand for the RGB values for Canon, respectively; RN, GN, and BN are the Nokia’s RGB values, respectively; RS, GS, and BS correspond to the RGB values for Samsung, respectively. The transformed RGB values were used to train our ANN with seven outputs, which were O , where k∈󰇟1, 7󰇠 represents the H to be predicted. Before presenting the test battery for this stage, we fixed the parameters of the networks to examine whether a colour Figure 6. Evolution of the error according to the number of neurons for the ( a ) Nokia-to-Canon and (b) Samsung-to-Canon ANN to change the gamut. Once we acquired the optimal ANN to change the gamut, we computed the new RGB values. The results are illustrated in Table 3. The results evidenced an improvement in the quality of the data. However, the correlation with the Nokia device did not increase. Overall, the correlations considerably strengthened. AgriEngineering 2023,5362 Table 3. Correlation matrix of the new RGB values after the change of gamut. The correlations that increased from those in Table 1are indicated in bold. RCGCBCRNGNBNRSGSBS RC1.0000 0.9449 0.8112 0.9950 0.9426 0.8129 0.9949 0.9450 0.8127 GC0.9449 1.0000 0.9163 0.9441 0.9961 0.9151 0.9441 0.9950 0.9153 BC0.8112 0.9163 1.0000 0.8102 0.9115 0.9920 0.8076 0.9090 0.9893 RN0.9950 0.9441 0.8102 1.0000 0.9474 0.8174 0.9931 0.9464 0.8143 GN0.9426 0.9961 0.9115 0.9474 1.0000 0.9184 0.9440 0.9953 0.9153 BN0.8129 0.9151 0.9920 0.8174 0.9184 1.0000 0.8121 0.9131 0.9902 RS0.9949 0.9441 0.8076 0.9931 0.9440 0.8121 1.0000 0.9499 0.8172 GS0.9450 0.9950 0.9090 0.9464 0.9953 0.9131 0.9499 1.0000 0.9191 BS0.8127 0.9153 0.9893 0.8143 0.9153 0.9902 0.8172 0.9191 1.0000 RC, GC, and BC stand for the RGB values for Canon, respectively; RN, GN, and BN are the Nokia’s RGB values, respectively; RS, GS, and BS correspond to the RGB values for Samsung, respectively. The transformed RGB values were used to train our ANN with seven outputs, which were Ok H , where k∈[1, 7] represents the H to be predicted. Before presenting the test battery for this stage, we fixed the parameters of the networks to examine whether a colour space change would influence the performance of our networks. These results are gathered in Table 4. Table 4. Comparison between the RGB and HSV approaches to obtain hue. Device Space C1 C2 C3 C4 C5 C6 C7 Canon RGB 0.9517 0.9078 0.9208 0.9330 0.9412 0.9393 0.9578 HSV 0.9204 0.8473 0.8595 0.8962 0.9380 0.9370 0.9666 Nokia RGB 0.9044 0.8454 0.8656 0.8540 0.8641 0.8811 0.9452 HSV 0.7977 0.7153 0.7740 0.7635 0.7857 0.8813 0.9366 Samsung RGB 0.9092 0.8450 0.8628 0.8576 0.8588 0.8790 0.9227 HSV 0.9048 0.7737 0.7210 0.6307 0.5922 0.6609 0.6071 Bold text indicates the best accuracy between the RGB and HSV of each device. C1 . . . C7 are each of the seven charts evaluated. The series of experiments with all the configurations tested are provided in Table 5. Each cell represents the mean of 10 executions. To easily refer to each cell of the table, we used this notation, Ckd, where k is the number of the chart, and d is the device. Table 5. Battery of experiments to compute the hue value. Device N C1 C2 C3 C4 C5 C6 C7 Canon 1 0.99184 0.98456 0 0 0.99603 0 1 5 0.91429 0.92278 0.90909 0.67347 0.94841 0.96774 0.97235 10 0.87347 0.88803 0.91775 0.89388 0.90476 0.96313 0.98618 15 0.93469 0.91892 0.85714 0.91429 0.96032 0.96313 0.97696 20 0.93061 0.89575 0.88312 0.92653 0.93651 0.98157 0.97696 25 0.94694 0.90347 0.93506 0.93061 0.96825 0.95853 0.97235 30 0.95918 0.90734 0.8961 0.92245 0.96032 0.97235 0.98618 35 0.9551 0.92278 0.92208 0.91429 0.96032 0.96774 0.95853 40 0.96327 0.89961 0.89177 0.90612 0.96032 0.9447 0.98157 45 0.94694 0.91892 0.90909 0.94694 0.96825 0.97235 0.98157 50 0.97143 0.91506 0.90909 0.9102 0.96032 0.97696 0.97235 Nokia 1 0.97959 0.97683 0 0.04081 0.30159 0.98157 0.90783 5 0.93878 0.79151 0.28139 0.79184 0.67063 0.69585 0.98157 10 0.85714 0.86873 0.78788 0.8 0.75794 0.82488 0.91705 AgriEngineering 2023,5363 Table 5. Cont. Device N C1 C2 C3 C4 C5 C6 C7 15 0.90204 0.84556 0.80952 0.63265 0.7381 0.89862 0.89401 20 0.90204 0.88031 0.69264 0.78367 0.78968 0.87097 0.94931 25 0.92245 0.84556 0.73593 0.73061 0.7619 0.89862 0.91705 30 0.8449 0.83784 0.8355 0.77959 0.72619 0.82488 0.95392 35 0.86122 0.87645 0.81818 0.77143 0.80159 0.8341 0.94009 40 0.90204 0.86873 0.7013 0.82857 0.79365 0.87558 0.94009 45 0.86939 0.8417 0.85281 0.76327 0.74603 0.88018 0.9447 50 0.90204 0.88803 0.82684 0.64082 0.75794 0.80184 0.96774 Samsung 1 0.91837 0.94595 0 0 0.1746 0.94931 0.85714 50.89796 0.85328 0.02164 0.72245 0.65873 0.71889 0.93548 10 0.84082 0.79537 0.54545 0.63673 0.72222 0.77419 0.85714 15 0.86531 0.82625 0.59307 0.71837 0.63095 0.75115 0.93088 20 0.82449 0.88803 0.61472 0.70204 0.7619 0.84332 0.86175 25 0.85306 0.91506 0.58874 0.75102 0.72619 0.7235 0.93088 30 0.82449 0.87645 0.58874 0.69796 0.7619 0.80645 0.90323 35 0.89388 0.85328 0.61905 0.66122 0.71429 0.77419 0.89862 40 0.88163 0.92278 0.58009 0.68571 0.69444 0.86175 0.90783 45 0.87347 0.90347 0.68398 0.70612 0.74603 0.82949 0.88479 50 0.86939 0.88417 0.58874 0.62449 0.77381 0.75576 0.9447 In bold, the best configuration for each chart. C1. . . C7are each of the seven charts evaluated. Figure 7depicts an illustrative example to better interpret the information in Table 5. Note that some of the first points (one and five neurons) were omitted in this figure to clearly visualise the evolution of the experiments. In the table we can discern the best configurations for each of the charts. Notice that the first row was skipped, highlighting that the ANNs were not generalising properly. AgriEngineering 2023, 5, 9 Figure 7. Illustrative example of the evaluation of neurons for the Canon device. The colours represent the mean accuracy of the ANN from green (the best learned chart) to red (the worst). Having selected the best model to predict the hue, the last stage in our study was to predict the remaining two variables, value and chroma. By following the same process as in the rest of the experiments, we obtained the results provided in Table 6. Finally, in order to validate our method, we compared the results attained in this method with those of previously published methods. To do so, we constructed Table 7, which contains the best accuracy accomplished for each chart [19]. The general improvement provided by our method is clearly seen in this table. Table 6. Results of the estimation of the value and chroma. Canon Nokia Samsung Neurons Value Chroma Value Chroma Value Chroma 1 0.9787 0.9756 0.9396 0.7942 0.9313 0.8135 5 0.9795 0.9743 0.9404 0.7956 0.9336 0.8132 10 0.9801 0.9744 0.9394 0.7947 0.9345 0.8112 15 0.9782 0.9749 0.9398 0.7975 0.9318 0.8163 20 0.9797 0.9740 0.9394 0.7969 0.9304 0.8105 25 0.9791 0.9741 0.9375 0.7942 0.9321 0.8163 30 0.9786 0.9756 0.9370 0.7864 0.9315 0.8105 35 0.9794 0.9769 0.9392 0.7943 0.9322 0.8115 40 0.9796 0.9735 0.9384 0.7962 0.9340 0.8163 45 0.9784 0.9739 0.9391 0.7962 0.9361 0.8165 50 0.9791 0.9747 0.9355 0.7937 0.9310 0.8082 Table 7. Performance comparison between our new method and the best results obtained by previous methods [19]. Device Method C1 C2 C3 C4 C5 C6 C7 Canon New 0.9918 0.9846 0.9567 0.9674 0.9960 0.9862 1.0000 Previous 0.8857 0.9167 0.9677 0.9459 0.9355 0.9697 0.9714 Nokia New 0.9796 0.9768 0.8528 0.8286 0.8373 0.9816 0.9816 Previous 0.7286 0.6389 0.8871 0.8108 0.8065 0.9091 0.6000 Samsung New 0.9306 0.9460 0.7143 0.7714 0.8095 0.9493 0.9493 Previous 0.8143 0.6944 0.7419 0.7973 0.5968 0.7273 0.7429 Figure 7. Illustrative example of the evaluation of neurons for the Canon device. The colours represent the mean accuracy of the ANN from green (the best learned chart) to red (the worst). Having selected the best model to predict the hue, the last stage in our study was to predict the remaining two variables, value and chroma. By following the same process as in the rest of the experiments, we obtained the results provided in Table 6.