Introduction {#Sec1}
============

Rehydration is a complicated process aimed at the reinstatement, by way of the contact with water, of the features the dried material had prior to its pretreatment preceding the drying and the drying itself.  The following three processes take place in the course of the rehydration: water absorption by the tissues of the dried material, thanks to which it increases its mass and volume as well as the leaching of water-soluble substances such as sugars, acids, vitamins and minerals from the rehydrated material \[[@CR1], [@CR2]\].  The progress of the discussed processes depends on the features of the raw material and conditions in which the drying with preceding pretreatments takes place \[[@CR3]\].  Because of that, the progress of the rehydration process reflects the changes that took place in the raw material tissue as a result of the following processes: drying and pretreatment and also rehydration \[[@CR4]\].  Such changes are the reason why the dried product fails to attain the features of the raw material after its rehydration, which shows irreversibility of the drying process \[[@CR5]\]. 

Many studies of the rehydration process focused on the determination of rehydration indicators defining the reinstatement value of the dried material and on the process description using empirical formulae \[[@CR6], [@CR7]\].  There are also works oriented on the optimisation of parameters in selected technology of the thermal treatment \[[@CR8], [@CR9]\] and on the studying of changes in the tissue structure \[[@CR10], [@CR11]\], the chemical content \[[@CR12]\] and colour \[[@CR13], [@CR14]\]. 

In the process of drying and rehydration, complex and highly nonlinear phenomena take place \[[@CR15]\].  Therefore, it is difficult to estimate relationships between the input and the output of this complex system on the basis of mathematical approaches. 

Intelligent techniques such as artificial neural networks show a high learning ability and capability of identifying mentioned systems \[[@CR16]\].  The ability of neural networks to learn from repeated exposure to system characteristics has made them a popular choice for many applications, including drying technology \[[@CR17], [@CR18]\]. 

In the literature, several papers are related to modelling the heat and mass transfer kinetics \[[@CR19]\], drying characteristics \[[@CR20], [@CR21]\], approximating the moisture content \[[@CR22]\] and quality of apple tissue \[[@CR23]\].  ANN models were also developed for predicting some physicochemical properties of apple tissue during hot air drying in thin layer \[[@CR24]\].  Recently, several authors applied neural network for modelling heat and mass transfer during rehydration process \[[@CR25], [@CR26]\].  A simple ANN model was used to predict the shrinkage and estimate the rehydration capacity of the dried cooked rice \[[@CR27]\] and dehydrated carrots \[[@CR28]\].  A comprehensive review study devoted to application of ANNs in drying technology was made in paper \[[@CR29]\]. 

Determination of the best ANN topology for estimation of colour change is usually put through by trial and error procedure that is very time-consuming \[[@CR30]\].  Optimisation of neural networks parameters requests a large number of different topologies have to be constructed, trained and tested.  However, there is no general rule used in selecting the value of variables in ANN.  Also, it is dependent on the complexity of the system that is modelled. 

In recent times, many researchers have used response surface methodology \[[@CR31]--[@CR33]\] and genetic algorithms \[[@CR34], [@CR35]\] to optimise ANN topology. 

Genetic algorithm is a biologically inspired optimisation technique \[[@CR36]\].  Recently, GA has gained popularity as a robust optimisation tool for multi-modal nonlinear problems.  Sometimes GAs can exploit ANN models as their fitness function.  In food industry, ANNs and GA system were used to control the fruit storage process.  The authors \[[@CR37], [@CR38]\] indicated the need to apply a hybrid system for selection of input parameters (temperature, density) and output parameters (colour, mass loss, hardness) to improve the quality of the stored fruit.  The authors noticed that the complex system of ANNs and GAs is superior to traditional computational techniques used in problems related to agriculture.  ANN and GA system was successfully used for optimising thermal conditions for conduction-heated foods \[[@CR39], [@CR40]\].  Recently, ANN and GA approaches in drying technology have been described in papers \[[@CR41]--[@CR43]\]. 

It can be concluded from the literature review that the coupling of these two methods has many benefits for finding the global optimum neural networks topology and improving the model performance \[[@CR33], [@CR34]\]. 

The objective of this work is to optimise the neural network topology to predict the colour change in the rehydrated apple cubes using integrated RSM and GA methods. 

Materials and methods {#Sec2}
=====================

Material {#Sec3}
--------

High-quality Ligol apples were bought from the local market.  They were washed in water, cut into cubes, with dimensions of 10 × 10 × 10 mm and were dried on the same day.  The initial moisture content of a sample amounted to ca.  85% w.b. ( 5.66 d.b.). 

Drying equipments and experiments {#Sec4}
---------------------------------

The drying experiments were carried out in the dryer constructed in our laboratory.  The details of dryer equipment and conducting the drying process can be found in a paper \[[@CR44]\].  The laboratory dryer was run about 1 h, and when the steady conditions were achieved the samples were placed on a tray.  The drying process lasted until the mass of the sample became constant.  The drying experiments were performed at three levels of drying air temperatures of 50, 60 and 70 °C, together with two levels of air flow velocities---0.5 and 2 m/s. The final moisture content of dried apples amounted to ca.  9% w.b. ( 0.098 d.b.).  Dry matter of the solid was determined according to AOAC standards \[[@CR45]\].  The dried material obtained in the given conditions from three independent experiments was mixed and stored in a tightly sealed container for about one week at 20 °C; after that, samples were taken for further studies.  The container in which the dried material was stored was placed in a cupboard, so the dried apples were not exposed to the sunlight. 

Rehydration procedure {#Sec5}
---------------------

The apple cubes were immersed in distilled water at four levels of temperatures---20, 45, 70 and 95 °C, using a water bath ELP 12 (LABOPLAY, Bytom, Poland).  The initial mass of each dried sample subjected to rehydration was 10 g, and dried sample mass-to-medium mass ratio at the beginning of rehydration was 1:20.  The rehydration lasted from 6 h (20 °C) to 2 h (95 °C).  After removal from the water, the sample was dried on a filter paper.  The medium was not stirred during the rehydration process, and its temperature was constant. 

Colour determination {#Sec6}
--------------------

Colour images of fresh and rehydrated apple were acquired using a flatbed scanner (Canon CanoScan 5600F).  The device was equipped with 6-line colour CCD sensor, fluorescent lamp and the 48-bit input/output interface (16 bits for each RGB channel).  Images of resolution of 300 dpi were acquired to sRGB colour space and then saved in BMP format as matrixes with dimensions of 2552 × 3508 pixels.  During the scanning process, all tools for an automatic image enhancement were disabled.  Apple cubes were randomly positioned on the scanner platen.  For fresh apple and each type of dehydrated cubes (various drying conditions: drying temperature, drying air velocity, and various rehydration temperatures and times) 30 images were acquired.  The images were then transformed to CIEXYZ colour space \[[@CR45], [@CR46]\].  Nonlinear transformation of CIEXYZ to CIEL\**a*\**b*\* coordinates was done relative to illuminant D50 and observer 10° according to CIE standard using 94.811, 100, 107.32 values as reference whites for X, Y and Z coordinates, respectively \[[@CR47]\].  Chroma (*C*\*) and hue (*h*\*) of CIEL\**C*\**h*\*colour space were calculated according to Schanda \[[@CR48]\].  Original digital image of raw apple cubes and preprocessed image of apple cubes extracted from the image background is shown in Fig.  [1](#Fig1){ref-type="fig"}.Fig.  1Original digital image of raw apple cubes---**a**, **b** preprocessed image extracted from the image background and **c** split into R, **d** split into G, **e** split into B channels

Quality of rehydrated product {#Sec7}
=============================

It was also assumed that quality of the rehydrated product is defined by means of its colour change.  The colour of a food product can be considered as a very important quality factor because it plays a decisive role in consumer's acceptability.  The colour change (*C* ~ch~) was calculated according to the formula, given by \[[@CR49]\] $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$C_{\text{ch}} = \sqrt {\left( {\frac{{\Delta L^{*} }}{{K_{L} S_{L} }}} \right)^{2} + \left( {\frac{{\Delta C^{*} }}{{K_{C} S_{C} }}} \right)^{2} + \left( {\frac{{\Delta H^{*} }}{{K_{H} S_{H} }}} \right)^{2} }$$\end{document}$$where *S* ~*L*~ *, S* ~*C*~ *, S* ~*H*~ denote the weighing functions, adjusting the internal non-uniform structure of the CIEL^\*^ *a* ^\*^ *b* ^\*^ and may be obtained using Eqs.  ([2](#Equ2){ref-type=""}--[4](#Equ4){ref-type=""})$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$S_{L} = 1$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$S_{C} = 1 + 0.045 \cdot C^{*}$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$S_{H} = 1 + 0.015 \cdot C^{*}$$\end{document}$$

The parameters *K* ~*L*~ *, K* ~*C*~ *, K* ~*H*~ express the variation from the reference conditions.  The discussed parameters are equal to 1 in reference conditions \[[@CR50]\].  Parameters Δ*L* ^*\**^, Δ*C* ^*\**^, Δ*H* ^*\**^ denote difference between the tested sample (~*T*~) and the standard (~*S*~) in terms of luminance, chroma and hue, respectively, and are determined according to formulae ([5](#Equ5){ref-type=""})--([7](#Equ7){ref-type=""})$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta L^{*} = L_{T}^{*} - L_{S}^{*}$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta C^{*} = C_{T}^{*} - C_{S}^{*}$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\Delta H^{*} = 2\sqrt {C_{T}^{*} \cdot C_{S}^{*} } \cdot \sin \left( {\frac{{\Delta h^{*} }}{2}} \right)$$\end{document}$$

Neural networks {#Sec8}
===============

Design of ANN architecture {#Sec9}
--------------------------

A MLFF backpropagation (BP) neural model was developed (Fig.  [2](#Fig2){ref-type="fig"}) for predicting the colour change in apple cubes during drying and rehydration processes.  The following variables considered as the input parameters for the model were taken: drying air temperature, drying air velocity, temperature of distilled water, rehydration time.  The network output variable included colour change.  Since one output variable (colour change) was dependent on four exogenous input variables, one neuron was taken for the output whereas four neurons for the input layers.  It was reported in earlier works \[[@CR32], [@CR33]\] that a network with one hidden layer and hyperbolic tangent sigmoid (tansig) function is commonly used for forecasting in practice \[[@CR51], [@CR52]\].  So, a single hidden layer network was used in this study.  Therefore, for optimisation one hidden layer with tansig transfer function was considered.  The tansig function was determined using Eq.  ([8](#Equ8){ref-type=""})Fig.  2Schematic neural network architecture $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\text{tansig}}\left( n \right) = \frac{2}{{1 + { \exp }\left( { - 2n} \right)}} - 1$$\end{document}$$

Moreover, a linear (pureline) function for output was selected for simulation process. 

Data preprocessing {#Sec10}
------------------

In order to produce the most efficient training, the data before training should be normalised.  It is also helpful to analyse the network response after having completed the training.  Therefore, to achieve this, 189 cases were chosen from our experiments.  Chosen cases were randomly divided into the following sets: for training 133 samples (consisted of ≈70% cases), for validation 28 samples (≈15%) and for testing 28 samples (≈15%).  The second data set was applied for evaluating the performance of the network in the process of training, while the third one was used for estimation of the predictive ability of the model which has been developed \[[@CR51]\].  The data were normalised between 0.1 and 0.9 in the following way \[[@CR53]\]$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$x_{{{\text{normalized}} \;{\text{value}} }} = 0.1 + 0.8\left( {\frac{{y_{{{\text{actual}}\;{\text{value}}}} - y_{{{\text{minimum}}\;{\text{value}}}} }}{{y_{{{\text{maximum}}\;{\text{value}}}} - y_{{{\text{minimum}}\;{\text{value}}}} }}} \right)$$\end{document}$$

Training methods {#Sec11}
----------------

In the MLP networks, MSE can be obtained by various methods, including Levenberg--Marquardt (LM), gradient descent (GD) and conjugate gradient (CG).  MLPs are as a rule trained using error backpropagation (BP) algorithm.  It is a general method for iterative solution for weights and biases.  BP uses GD technique.  This technique is very slow at a small learning rate, but its convergence properties are slow.  Different methods concentrated on speeding up BPs have been applied for an instance momentum term, variable learning rate.  Finally, gradient descent momentum (GDM) algorithm has been chosen for training the networks.  It avoids local minima, speeds up learning and stabilises convergence \[[@CR33], [@CR34]\].  Moreover, GDM allows a network to respond to the local gradient and to ignore small features in the error surface \[[@CR51]\]. 

Training parameters {#Sec12}
-------------------

In our training process, number of neurons in the hidden layer, number of epochs, learning rate and momentum coefficient are parameters that can affect the network simulation efficiency.  However, GDM mainly depends on two training parameters: learning rate (*lr*) and momentum constant (*mc*).  The first parameter determines the time indispensable for finding the minimum in the weight space.  Too high *lr* leads to an increase in the magnitude of the oscillations for the MSE.  Too small *lr* causes smaller steps taken in the weight space.  Moreover, in this case the learning becomes slower and the capability of the network to escape from the local minima in the error surface becomes lower.  The *mc* defines the amount of momentum.  A *mc* of 1 result in a network that is totally insensitive to the local gradient.  Consequently, *mc* does not learn properly.  Too high *mc* causes diverging of the adaptation and gives unusable weights.  Too small *mc* is responsible for a long learning time \[[@CR32]\]. 

Number of neurons in the hidden layer is decisive for network performance.  The small number of hidden neurons causes that the ANN is disable for adapting to a being modelled process, whereas when the number of hidden neurons is too big the system memorise errors \[[@CR51]\].  Moreover, too many neurons do not propagate errors back efficiently \[[@CR33]\] and therefore worsen the ability of the neural network to learn.  Similar problems can be encountered while selecting the number of epochs.  Too small number of epochs limits the ability of the network to process modelling.  Too many epochs can lead to an overtraining of network and to an increasing of errors. 

Therefore, figuring out the optimum values of affecting parameters for ANN is an important task and appropriate ranges should be chosen.  The following numerical variables were chosen for ANN optimisation number of neurons in the hidden layer, *lr*, *mc*, epoch number and number of training runs.  The responses sought were faulty on the best validation performance.  BP uses a GD technique.  Its stability depends on *lr*.  Small *lr* leads to very stable GD.  In the MATLAB 7.0 software, the defaults value for *lr* and *mc* equal 0.01 and 0.9, respectively.  Accordingly, we changed *lr* from 0.01 to 0.4 and *mc* between 0.1 and 0.9.  Similarly, the number of neurons in the hidden layer (2--16), training epoch (300--5000) and number of training runs (3--7) were chosen.  The range of input variables in ANN model is shown in Table [1](#Tab1){ref-type="table"}.Table 1Limit of input variables in the neural network modelParametersDownUp*x* ~1~: Neurons number216*x* ~2~: Learning rate0.010.4*x* ~3~: Training epoch3005000*x* ~4~: Momentum constant0.10.9*x* ~5~: Number of training runs37

Performance evaluation {#Sec13}
----------------------

After having found the optimal ANN topology, measuring its performance is the next step.  The performance of the designed ANN was estimated on the basis of coefficient of determination (*R* ^2^), mean square error (MSE) and mean absolute error (MAE) \[[@CR33]\].  Discussed parameters were determined using Eqs.  ([10](#Equ10){ref-type=""}--[12](#Equ12){ref-type=""})$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$R^{2} = 1 - \frac{{\mathop \sum \nolimits_{i = 1}^{n} \left( {x_{pi} - x_{di} } \right)^{2} }}{{\mathop \sum \nolimits_{i = 1}^{n} \left( {x_{pi} - \bar{x}} \right)^{2} }}$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\text{MSE}} = \frac{1}{N}\mathop \sum \limits_{i = 1}^{n} \left( {x_{pi} - x_{di} } \right)^{2}$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\text{MAE}} = \frac{1}{N}\mathop \sum \limits_{i = 1}^{n} \left| {\left( {x_{pi} - x_{di} } \right)} \right|$$\end{document}$$where *x* ~*pi*~ is the network (predicted) output derived from observation *i*, *x* ~*di*~ is an experimental (actual) output derived from observation *i*, $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\bar{x}$$\end{document}$ is the average value of an experimental output, and *N* is the number of data.  MSE informs of the differences between the value implied by the estimator and estimated quantity.  The value of MSE close to 0 indicates that the network can be considered as a satisfactory one. * R* ^2^ informs of the correctness of model fitting.  If *R* ^2^ = 1, the regression line fits the data excellent.  MAE shows how close the predictions are to the final outcomes.  The value of MAE close to 0 indicates that the error of our model decreases. 

Hybrid intelligent system {#Sec14}
=========================

Figure [3](#Fig3){ref-type="fig"} provides a schematic diagram of simulation system.  The proposed hybrid RSM--ANN--GA system is described briefly below.  This system includes the following steps:Fig.  3Block diagram of simulation process *Step 1* Collection of the data set*Step 2* RSM designs the experiment and builds a fitness function*Step 3* GA optimises ANN architecture*Step 4* ANN predicts the colour change

The algorithm proceeded with its iterations until a specified performance criterion became satisfactory.  More details related to applied RSM and GA algorithm are described in Sects.  [5.1](#Sec15){ref-type="sec"} and [5.2](#Sec16){ref-type="sec"}. 

Response surface method {#Sec15}
-----------------------

The optimum architecture of ANN was determined on the basis of the runs designed by response surface methodology.  A face-centred full central composite design of five numerical factors (number of neurons in the hidden layer, learning rate, momentum constant, training epochs and number of training times) with three-level factorial design matrix was selected.  The experimental design matrix (see Table [2](#Tab2){ref-type="table"}) consisting of 50 set of conditions and comprising a full replication of five-factor factorial design of 32 points, 10 star points and 8 centre points was used.  The upper and lower limits of the parameters were coded as +1 and −1, respectively. Table 2Mean square error (MSE) results obtained by various neural network configurationDesign pointsExperiment IDNumber of neuronsLearning rateMomentum constantTraining epochNumber of training runMSEPoints120.010.130030.3518220.010.130070.0827320.010.1500030.1879420.010.1500070.0955520.010.930030.3472620.010.930070.1361720.010.9500030.1933820.010.9500070.1848920.400.130030.13581020.400.130070.03221120.400.1500030.02401220.400.1500070.01611320.400.930030.10891420.400.930070.04701520.400.9500030.03081620.400.9500070.020017160.010.130030.195318160.010.130070.086819160.010.1500030.021720160.010.1500070.017421160.010.930030.133022160.010.930070.064723160.010.9500030.023724160.010.9500070.033025160.400.130030.030626160.400.130070.016927160.400.1500030.007428160.400.1500070.008529160.400.930030.017430160.400.930070.011631160.400.9500030.008032160.400.9500070.0086Star points3320.2050.5265050.03053490.0100.5265050.02733590.2050.1265050.00923690.2050.530050.05763790.2050.5265030.00843890.2050.5265070.01023990.2050.5500050.01104090.2050.9265050.01054190.400.5265050.010842160.2050.5265050.0089Centre points4390.2050.5265050.01554490.2050.5265050.00944590.2050.5265050.01084690.2050.5265050.01494790.2050.5265050.01084890.2050.5265050.01274990.2050.5265050.00985090.2050.5265050.0104

Fifty different patterns of proposed ANNs (Table [2](#Tab2){ref-type="table"}) were designed and trained to model the best MSE performance on validation data set using the Design-Expert (DOE) software.  Finding a suitable approximation for the true efficient relationship between the response and the set of independent variables makes the first stage in discussed methodology \[[@CR54], [@CR55]\].  The response variables were then transformed to natural logarithm function.  It makes the distribution of the response variable closer to the normal distribution and improves the model fitting to the data.  The experimental results of the CCD were fitted with a second-order polynomial equation using a multiple regression technique.  Equation ([13](#Equ13){ref-type=""}) represents the quadratic model for predicting the optimal point$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$Y = \beta_{0} + \mathop \sum \limits_{i = 1}^{k} \beta_{i} x_{i} + \mathop \sum \limits_{i = 1}^{k} \beta_{ii} x_{i} x_{i} + \mathop \sum \limits_{i = 1}^{k - 1} \mathop \sum \limits_{j = i + 1}^{k} \beta_{ij} x_{i} x_{j} + \varepsilon_{ij}$$\end{document}$$where *Y* is the response (MSE), $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\beta_{0} , \beta_{i} , \beta_{ii} ,$$\end{document}$ and *β* ~*ij*~ are regression coefficients (intercept, linear, quadratic and interaction, respectively), *x* ~i~ and *x* ~j~ are the independent variables, *k* is the number of levels, and *ɛ* ~*ij*~ is an error observed in the response. 

Genetic algorithm {#Sec16}
-----------------

GAs use the evolutionary principle of survival characteristics for the best adapted chromosomes \[[@CR56]\].  A group of chromosomes is called a population.  Each population of chromosomes has the same size which is referred to as population size.  According to the researchers \[[@CR32], [@CR33], [@CR57]\], a suitable population size numbers about 20--30 chromosomes.  However, sometimes a population size with 50--80 has lead to the best answers \[[@CR58], [@CR59]\].  With a large population size, the GA searches the solution space more thoroughly, thereby reducing the chance that the algorithm returns a local minimum that is not a global minimum.  In addition, a large population size causes the algorithm to run more slowly \[[@CR58], [@CR60]\]. 

The main data structures in GA toolbox are chromosomes, objective function values and fitness values.  The chromosome data structure stores an entire population in a single matrix of size Nind × Lind, where Nind is the number of individuals in the population and Lind is the length of the genotypic representation of these individuals.  Each of the rows correspond to an individual's genotype, consisting of base-n, typically binary, values$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\text{Chrome}} = \left[ {\begin{array}{*{20}c} {{\text{g}}_{1.1} } & {{\text{g}}_{1.2} } & {{\text{g}}_{1.3} } & \ldots & {{\text{g}}_{{1.{\text{Lind}}}} } \\ {{\text{g}}_{2.1} } & {{\text{g}}_{2.2} } & {{\text{g}}_{2.3} } & \ldots & {{\text{g}}_{{2.{\text{Lind}}}} } \\ {{\text{g}}_{3.1} } & {{\text{g}}_{3.2} } & {{\text{g}}_{3.3} } & \ldots & {{\text{g}}_{{3.{\text{Lind}}}} } \\ .& .& .&  \ldots & .\\ {{\text{g}}_{Nind.1} } & {{\text{g}}_{{{\text{Nind}}.2}} } & {{\text{g}}_{{{\text{Nind}}.3}} } & \ldots & {{\text{g}}_{{{\text{Nind}}.{\text{Lind}}}} } \\ \end{array} } \right]\begin{array}{*{20}c} {{\text{individual}}\;1} \\ {{\text{individual}}\;2} \\ {{\text{individual}}\;3} \\ . \\ {{ \text{individual}}\;{\text{Nind}}} \\ \end{array}$$\end{document}$$

Such a data representation does not force the chromosome structure, requiring only all chromosomes to be of equal length.  Thus, structured populations or populations with varying genotypic bases may be used in the GA toolbox provided that a suitable decoding function, mapping chromosomes onto phenotypes, is employed. 

The decision variables (phenotypes) in the GA are obtained by applying some mapping from the chromosome representation into the decision variable space.  Here, each of the strings contained in the chromosome structure decodes to a row vector of order Nvar, according to the number of dimensions in the search space and corresponding to the decision variable vector value.  The decision variables are stored in a numerical matrix of size Nind × Nvar.  Again, each of the rows corresponds to a particular individual's phenotype.  An example of the phenotype data structure is given below, where bin2real is used for representation of an arbitrary function, possibly from the GA Toolbox, mapping the genotypes onto the phenotypes.$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{aligned} {\text{Phen }} & = {\text{ bin2real}}\left( {\text{Chrom}} \right)\;\% \;{\text{map}}\;{\text{genotype}}\;{\text{to}}\;{\text{phenotype}} \\ {\text{Phen}} & = \left[ {\begin{array}{*{20}c} {{\text{x}}_{1.1} } & {{\text{x}}_{1.2} } & {{\text{x}}_{1.3} } & \ldots & {{\text{x}}_{{1.{\text{Lind}}}} } \\ {{\text{x}}_{2.1} } & {{\text{x}}_{2.2} } & {{\text{x}}_{2.3} } & \ldots & {{\text{x}}_{{2.{\text{Lind}}}} } \\ {{\text{x}}_{3.1} } & {{\text{x}}_{3.2} } & {{\text{x}}_{3.3} } & \ldots & {{\text{x}}_{{3.{\text{Lind}}}} } \\ .& .& .&  \ldots & .\\ {{\text{x}}_{{{\text{Nind}}.1}} } & {{\text{x}}_{{{\text{Nind}}.2}} } & {{\text{x}}_{{{\text{Nind}}.3}} } & \ldots & {{\text{x}}_{{{\text{Nind}}.{\text{Lind}}}} } \\ \end{array} } \right]\;\begin{array}{*{20}c} {{\text{individual}}\;1} \\ {{\text{individual}}\;2} \\ {{\text{individual}}\;3} \\ . \\ {{ \text{individual}}\;{\text{Nind}}} \\ \end{array} \\ \end{aligned}$$\end{document}$$

An objective function is used for evaluation of the performance of the phenotypes in the problem domain.  Objective function values can be scalar or, in the case of multi objective problems, vectorial.  Discussed values are not necessarily the same as the fitness values.  Objective function values are stored in a numerical matrix of size Nind × Nobj, where Nobj is the number of objectives.  Each of the rows corresponds to a particular individual's objective vector.$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{aligned} {\text{Objv}} & = {\text{ OBJFUN}}\left( {\text{Phen}} \right)\;\% \;{\text{Objective}}\;{\text{Function}} \\ {\text{Objv}} & = \left[ {\begin{array}{*{20}c} {{\text{y}}_{1.1} } & {{\text{y}}_{1.2} } & {{\text{y}}_{1.3} } & \ldots & {{\text{y}}_{{1.{\text{Lind}}}} } \\ {{\text{y}}_{2.1} } & {{\text{y}}_{2.2} } & {{\text{y}}_{2.3} } & \ldots & {{\text{y}}_{{2.{\text{Lind}}}} } \\ {{\text{y}}_{3.1} } & {{\text{y}}_{3.2} } & {{\text{y}}_{3.3} } & \ldots & {{\text{y}}_{{3.{\text{Lind}}}} } \\ .& .& .&  \ldots & .\\ {{\text{y}}_{{{\text{Nind}}.1}} } & {{\text{y}}_{{{\text{Nind}}.2}} } & {{\text{y}}_{{{\text{Nind}}.3}} } & \ldots & {{\text{y}}_{{{\text{Nind}}.{\text{Lind}}}} } \\ \end{array} } \right]\begin{array}{*{20}c} {{\text{individual}}\;1} \\ {{\text{individual}}\;2} \\ {{\text{individual}}\;3} \\ . \\ {{ \text{individual}}\;{\text{Nind}}} \\ \end{array} \\ \end{aligned}$$\end{document}$$

Fitness values are derived from the objective function values through a scaling or ranking function.  Fitnesses are non-negative scalars and are stored in the column vectors of length Nind, an example of which is shown below.  Again, ranking is an arbitrary fitness function \[[@CR61]\].$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\text{Fitn}} = {\text{ranking}}\left( {\text{ObjV}} \right).$$\end{document}$$ $$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{array}{llll} {\text{Fitn}} =& {f_{1} } &{{\text{individual}}\;1} \\ &{f_{2} } & {{\text{individual}}\;2} \\ &{f_{3} } & {{\text{individual}}\;3} \\ &\cdots & {} \\ &{f_{\text{Nind}} } & {{\text{individual}}\;{\text{Nind}}} \\ \end{array}$$\end{document}$$

The general steps of a genetic algorithm are presented in Fig.  [4](#Fig4){ref-type="fig"}.  This algorithm encodes a possible solution to a particular problem on a simple chromosome string and applies specified operators to a chromosome for preserving critical information and producing a new set of population with the aim to generate strings which map to high function values \[[@CR36]\].  The main GA operators are selection, crossover and mutation (see Table [3](#Tab3){ref-type="table"}).  Roulette as selection method was used in the study.  Roulette simulates a roulette wheel with the area of each segment proportional to its expectation.  GA then uses a random number to select one of the sections with a probability equal to its area.  The next main operator is crossover.  Crossover combines two chromosomes, or child, for the next generation.  A single point as a crossover function was applied in the study.  Single point chooses a random integer *n* between 1 and a number of variables, selects the vector entries numbered less than or equal to *n* from the first parent, selects genes numbered greater than *n* from the second parent, and concatenates these entries to form the child. Fig.  4General structure of the genetic algorithm Table 3Genetic algorithm operatorsPopulation size30Selection methodRouletteCrossover rate0.95Crossover functionSingle pointMutation rate0.15Mutation functionUniformNumber generations3000Stall generations2000

For example, if *p*1 and *p*2 are the parents$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{aligned} p1 \, & = \, \left[ {{\text{a}}\;{\text{b}}\;{\text{c}}\;{\text{d}}\;{\text{e}}\;{\text{f}}\;{\text{g}}\;{\text{h}}} \right] \\ p2 \, & = \, \left[ {1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7 \, 8} \right] \\ \end{aligned}$$\end{document}$$and the crossover point is 3, the function returns the following child$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$${\text{child}} = \left[ {{\text{a}}\;{\text{b}}\;{\text{c}}\;4\;5\;6\;7\;8} \right].$$\end{document}$$

The next parameter of GA is mutation.  This operator makes small random changes in the individuals of the population, which provide genetic diversity and enable GA to search a broader space.  Uniform as the mutation function was applied in the simulation process.  In this case, GA selects a fraction of the vector entries of chromosomes for mutation, where each entry has the same probability as the mutation rate of being mutated.  Next, the algorithm replaces each selected entry by a random number selected uniformly from the range of that entry. 

The simulation process proceeds by 58 s. The computer simulations were conducted using the computer with the following specifications: Intel Core i5-2400s, processor 2.50 GHz speed, 6 GB memory and commercially available ANN software, MATLAB 7.0 \[[@CR56]\]. 

Results {#Sec17}
=======

Statistical test results {#Sec18}
------------------------

The MSE results on validation data set are given in Table [2](#Tab2){ref-type="table"}.  In this study, the cubic model (CM) was chosen to give the correlation between neural network effective factors and the response of ln(MSE).  Moreover, mentioned model was selected due to high amount of *R* and non-significant lack of fit.  Finally, the selected CM was reduced to modified cubic model (MCM) on the basis of low *P* value and high ln(MSE) values.  The results of the reduced CM in the form of ANOVA are shown in Table [4](#Tab4){ref-type="table"}.  ANOVA gives a very high *F* value (121.20) and a very low *P* value (\<0.0001).  The model implies the model significant.  The prediction *R* ^2^ (0.973) is very close to adjusted *R* ^2^ (0.982).  The difference is \<0.2.  Moreover, adequate precision that measures the signal-to-noise ratio (37.359) indicates an adequate signal. Table 4ANOVA for predicted RSM modelSourceSum of squaresDOFMean square*F* value*P* valueModel64.67232.81121.20\<0.0001*x* ~1~: Number of neurons12.72112.72548.38\<0.0001*x* ~2~: Learning rate0.4310.4318.530.0002*x* ~3~: Momentum constant0.0210.020.950.3397*x* ~4~: Training epoch1.3711.3759.08\<0.0001*x* ~5~: Number of training run0.0210.020.810.3757*x* ~1~ *x* ~2~0.0010.000.110.7425*x* ~1~ *x* ~3~0.2610.2611.040.0027*x* ~1~ *x* ~4~0.5910.5925.41\<0.0001*x* ~1~ *x* ~5~0.4410.4418.870.0002*x* ~2~ *x* ~3~0.0910.093.970.0571*x* ~2~ *x* ~4~0.0310.031.420.2446*x* ~3~ *x* ~4~0.2310.239.710.0044*x* ~3~ *x* ~5~0.1510.156.570.0165*x* ~4~ *x* ~5~1.0111.0143.74\<0.0001*x* ~1~^2^0.3610.3615.720.0005*x* ~2~^2^0.4510.4519.400.0002*x* ~4~^2^1.6611.6671.73\<0.0001*x* ~5~^2^0.1110.114.680.0400*x* ~1~ *x* ~2~ *x* ~4~1.3311.3357.53\<0.0001*x* ~1~ *x* ~3~ *x* ~4~0.0910.093.710.0651$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$x_{2}^{2}$$\end{document}$ *x* ~2~0.1510.156.290.0187$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$x_{2 }^{2}$$\end{document}$ *x* ~4~0.2410.2410.540.0032$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$x_{2}^{2}$$\end{document}$ *x* ~5~0.2610.2611.030.0027Residual0.60260.02Lack of fit0.35190.020.520.8772Pure error0.2570.04Cor total65.2849

The results of statistical test show that the first-order effect of neurons number was the most significant term in estimation of ln(MSE).  It was followed by a training epoch and *lr*, respectively, whereas *mc* and number of training runs had no significant effect on the responses.  Similar results in case of *lr* and training epoch were reported by \[[@CR33], [@CR34]\]. 

Mathematical model results {#Sec19}
--------------------------

Finally, a MCM term of coded value is:$$\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$\begin{aligned} { \ln }\left( {\text{MSE}} \right) & = - 4.48 - 0.611 \cdot x_{1} - 0.463 \cdot x_{2} + 0.025 \cdot x_{3} - 0.82 \cdot x_{4} + 0.097 \cdot x_{5} \\ \quad + 0.008 \cdot x_{1} \cdot x_{2} - 0.08 \cdot x_{2} \cdot x_{3} - 0.13 \cdot x_{1} \cdot x_{4} + 0.11 \cdot x_{1} \cdot x_{5} - 0.05 \cdot x_{2} \cdot x_{3} - 0.032 \cdot x_{2} \cdot x_{4} \\ \quad + 0.08 \cdot x_{3} \cdot x_{4} + 0.069 \cdot x_{3} \cdot x_{5} + 0.17 \cdot x_{4} \cdot x_{5} + 0.37 \cdot x_{1}^{2} + 0.41 \cdot x_{2}^{2} + 0.79 \cdot x_{4}^{2} - 0.20 \cdot x_{5}^{2} \\ \quad + 0.20 \cdot x_{1} \cdot x_{2} \cdot x_{4} + 0.051 \cdot x_{1} \cdot x_{3} \cdot x_{4} - 0.27 \cdot x_{1}^{2} \cdot x_{2} + 0.36 \cdot x_{1}^{2} \cdot x_{4} - 0.36 \cdot x_{1}^{2} \cdot x_{5} \\ \end{aligned}$$\end{document}$$where $\documentclass[12pt]{minimal}
                \usepackage{amsmath}
                \usepackage{wasysym} 
                \usepackage{amsfonts} 
                \usepackage{amssymb} 
                \usepackage{amsbsy}
                \usepackage{mathrsfs}
                \usepackage{upgreek}
                \setlength{\oddsidemargin}{-69pt}
                \begin{document}$$x_{1} , x_{2} , x_{3} , x_{4, }$$\end{document}$ and *x* ~5~ parameters are defined in Table [1](#Tab1){ref-type="table"}.  This model was checked hierarchically.  The above statistical estimators indicate an adequate neural model with optimal structure that can be used for prediction of colour change in rehydrated apple cubes. 

RSM and contour plot results {#Sec20}
----------------------------

Figure [5](#Fig5){ref-type="fig"} shows the effect of normal percent probability on the internally studentised residuals.  As can be seen from a residual plot, the linear function very well approximates the results.  Moreover, the residual scatters randomly on the display (Fig.  [6](#Fig6){ref-type="fig"}), suggesting that the variance of the original observation is constant for all responses.  Therefore, it can be concluded from these plots that the empirical model is suitable for describing relationships between design variables described by RSM.Fig.  5Normal probability of the internally studentised residuals Fig.  6Internally studentised residuals versus predicted response

Figure [7](#Fig7){ref-type="fig"} shows the response surfaces (RSs) and contour plots (CPs) obtained by Design-Expert (DOE) software.  Each graph represents a combination of two factors at the time and holding all other factors at the middle level.  The effect of different values of neurons number and training epoch on ln(MSE) can be predicted from the RSs and CPs as shown in Fig.  [7](#Fig7){ref-type="fig"}a, b. It is obvious that minimum value of MSE can be found by 3000--4000 epochs and 0.25--0.35 *lr*.  Moreover, this range was observed for epoch number in relation with number of neurons (Fig.  [7](#Fig7){ref-type="fig"}b).  The CPs show that along with an increase in number of neurons from 2 to 16 and *lr* from 0.01 to 0.4, the ln(MSE) decreases to −5 (see Fig.  [7](#Fig7){ref-type="fig"}c).Fig.  7Response surface and contour plots of ln(MSE) for: **a** training epoch and learning rate, **b** training epoch and number of neurons in the hidden layer and **c** learning rate and number of neurons in the hidden layer

The response surface plot of momentum constant and learning rate is shown in Fig.  [8](#Fig8){ref-type="fig"}a.  The CP shows that along with an increase in *lr* from 0.01 to 0.4 and *mc* from 0.1 to 0.5, the ln(MSE) decreases to −4.615.  Figure [8](#Fig8){ref-type="fig"}b shows the contour plot, where along with an increase in training epochs from 3000 to 4500 and *mc* to 0.5, the ln(MSE) decreases to −4.75.Fig.  8Response surface and contour plots of ln(MSE) for: **a** learning rate and momentum constant and **b** training epoch and momentum constant

GA optimisation results {#Sec21}
-----------------------

The fitness function Eq.  ([14](#Equ14){ref-type=""}) developed by the RSM model was applied for predicting the colour change in rehydrated apple cubes.  The fitness function was a function minimising the ln(MSE) in experimental ranges presented in Table [1](#Tab1){ref-type="table"}. 

As can be noticed in Fig.  [9](#Fig9){ref-type="fig"}a, the optimisation terminated when maximum number of generations exceeded 2000 iterations.  The objective function value ln(MSE) = −5.47257 was obtained for the final points presented in Fig.  [9](#Fig9){ref-type="fig"}b.  Table [5](#Tab5){ref-type="table"} shows results of optimised ANN parameters.  The optimum values were as follows: number of neurons = 13, training epoch = 3869, *lr* = 0.33, *mc* = 0.89 and number of training runs = 3.Fig.  9Results of genetic algorithm optimisation:**a**) converged values of drying and rehydration parameters,**b**) convergence of fitness values Table 5Optimised ANN parametersParametersMSE*x* ~1~*x* ~2~*x* ~3~*x* ~4~*x* ~5~130.330.89386930.0072095

Errors of model results {#Sec22}
-----------------------

Next, ANN with the proposed topology was trained and tested.  As can be seen from Fig.  [10](#Fig10){ref-type="fig"}a, the training stopped when the validation error increased after 1147 iterations.  The result is sensible because MSE is very small.  As can be seen from graph (Fig.  [10](#Fig10){ref-type="fig"}a), the test and validation errors have similar characteristics.  Furthermore, no significant overfitting has followed \[[@CR58]\].  Finally, MSE of optimal ANN topology was equal to 0.0072095 (see Fig.  [10](#Fig10){ref-type="fig"}a).Fig.  10Performance goal of the network, **a** MSE on the validation samples, **b** regression graph for observed and predicted values of the colour change

Figure [10](#Fig10){ref-type="fig"}b shows ANN regression plots between outputs and targets samples.  The *R* values in each case are greater than 95%.  Therefore, the fit is reasonably good for all data sets.  Additionally, MAE and *R* for colour change in rehydrated apple cubes were estimated as 0.0259 and 0.96475 for training, 0.0399 and 0.95243 for testing and 0.0264 and 0.95151 for validation data sets.  Therefore, the topology with 3 inputs, 13 neurons with 1 hidden layer and 1 output (3--13--1) was applied for predicting the colour change in rehydrated apple cubes. 

Comparing the results of the simulation using AG and results from Table [2](#Tab2){ref-type="table"} (ID.  27), it can be seen that MSE (=0.0072) of optimised ANN topology is smaller compared to the errors values presented in Table [2](#Tab2){ref-type="table"} (MSE = 0.0074).  Moreover, both of the numbers of hidden neurons and epochs are less in case of ANN optimised by genetic algorithm. 

Validation model results {#Sec23}
------------------------

According to the authors \[[@CR32]--[@CR34]\], the trained neural network must have a high predictability for new data.  Therefore, 40 data sets of colour change obtained from the new experimental run (drying air temperature = 55 °C, drying air velocity = 0.52 m/s, rehydration temperature = 35 °C and rehydration time = 35 min) were used for the verification of the developed model.  The regression result of the testing model with new samples is shown in Fig.  [11](#Fig11){ref-type="fig"}.  It can be seen that the genetic algorithm has been successfully applied to optimise of neural network topology.  Moreover, the optimised ANN topology was efficient for predicting colour change in the rehydrated apple cubes.  This system can also be used for optimising the topology of a neural network which describes the other engineering problems. Fig.  11Comparison of predicted and desired output values using optimal neural network topology

Conclusions {#Sec24}
===========

The following conclusions can be drawn from the investigations conducted in this work:An efficient hybrid intelligent approach was proposed to find the optimal topology of neural networks. The optimal ANN topology was more precise for predicting colour change in the rehydrated apple cubes with a low mean square error (0.0072095) and a high regression coefficient (0.96).The optimum neural model had minimum when the number of hidden neurons, learning rate, momentum constant, number of epochs and number of training runs were equal to 13, 0.33, 0.89, 3869 and 3, respectively. The results of the testing model on new trials showed excellent agreement between the actual and predicted data with a coefficient of determination equal to 0.97.This optimisation method significantly reduces the number of experiments comparing with more expansive learning methods. 

The article was written as parts of a research Grant No.  NN313780940 financed by the National Science Centre funds, Poland.