brain_3_1


63 

Time-Delay Artificial Neural Network Computing Models for Predicting Shelf 
Life of Processed Cheese 

 

Sumit Goyal 
Senior Research Fellow, National Dairy Research Institute, Karnal – 132001- India 

thesumitgoyal@gmail.com 

 
Gyanendra Kumar Goyal 

Emeritus Scientist, National Dairy Research Institute, Karnal – 132001- India 
gkg5878@yahoo.com 

 
Abstract 
This paper presents the capability of Time–delay artificial neural network models for 

predicting shelf life of processed cheese. Datasets were divided into two subsets (30 for training and 
6 for validation). Models with single and multi layers were developed and compared with each 
other. Mean Square Error, Root Mean Square Error, Coefficient of Determination and Nash - 
Sutcliffo Coefficient were used as performance evaluators, Time- delay model predicted the shelf 
life of processed cheese as 28.25 days, which is very close to experimental shelf life of 30 days. 

Keywords: Time – delay, ANN, Artificial Intelligence, Processed Cheese, Shelf Life, 
Prediction 

 
1. Introduction 
This paper highlights the significance of Artificial Neural Network (ANN) models for 

predicting shelf life of processed cheese stored at 30
o
C. ANN is inspired by the functional aspects 

of biological neural networks. A neural network consists of an interconnected group of artificial 
neurons, and it processes information using a connectionist approach to computation. In most cases 
an ANN is an adaptive system that changes its structure based on external or internal information 
that flows through the network during the learning phase [1].Processed cheese is very nutritious and 
generally manufactured from ripened Cheddar cheese, but sometimes less ripened Cheddar cheese 
is also added in lesser proportion. Its manufacturing technique includes addition of emulsifier, salt, 
water and sometimes selected spices. The mixture is heated in jacketed vessel with continuous 
stirring in order to get homogeneous mass. It is a protein rich food. This variety of cheese has 
several advantages over raw and ripened Cheddar cheese, such as excellent supplement to meat 
protein, tastier with longer shelf life. 
Time-Delay Neural Network (TDNN) is an alternative neural network architecture whose primary 
purpose is to work on continuous data. The advantage of this architecture is to adapt the network 
online and hence helpful in many applications. The architecture has a continuous input that is 
delayed and sent as an input to the neural network [2]. In this study, TDNN’s models with single 
and multilayer layers for predicting shelf life of processed cheese have been developed. 

 
Single Layer 
Single layer perceptron network consists of a single layer of output nodes; the inputs are fed 

directly to the outputs via a series of weights. The sum of the products of the weights and the inputs 
is calculated in each node, and if the value is above some threshold (typically 0) the neuron fires 
and takes the activated value (typically 1); otherwise it takes the deactivated value (typically -1). 
Neurons with this kind of activation function are also called artificial neurons or linear threshold 
units [3]. 

 
Multilayer  
This class of networks consists of multiple layers of computational units, usually 

interconnected in a feed-forward way. Each neuron in one layer has directed connections to the 
neurons of the subsequent layer. In many applications the units of these networks apply a sigmoid 
function as an activation function. Multilayer networks use a variety of learning techniques, the 



BRAIN. Broad Research in Artificial Intelligence and Neuroscience 

Volume 3, Issue 1, February 2012, ISSN 2067-3957 (online), ISSN 2068 - 0473 (print) 

 

 64 

most popular being back-propagation. Here, the output values are compared with the correct answer 
to compute the value of some predefined error-function. By various techniques, the error is then fed 
back through the network. Using this information, the algorithm adjusts the weights of each 
connection in order to reduce the value of the error function by some small amount. After repeating 
this process for a sufficiently large number of training cycles, the network usually converge to some 
state where the error of the calculations is small [3]. 

 
Shelf Life 

 Shelf life is the length of time given before a product is considered unsuitable for sale, use, 
or consumption. In some regions, a best before, use by or freshness date is required on packaged 
perishable foods. Use prior to the expiration date does not necessarily guarantee the safety of a food 
or drug, and a product is not always dangerous or ineffective after the expiration date [4]. ANNs 
have been applied for predicting shelf life of Kalakand [5], milky white dessert jeweled with 
pistachio [6], and instant coffee flavoured sterilized drink [7, 8]. Time-Delay and Linear Layer 
ANN models were developed for predicting shelf life of soft mouth melting milk cakes [9], soft 
cakes [10]. Radial Basis models were successfully applied for predicting shelf life of Brown milk 
cakes [11]. The aim of this study is to develop TDNN single and multilayer models for predicting 
shelf life of processed cheese stored at 30

o
C, and to compare the developed models with each other. 

The outcome of this research would be very useful for cheese manufacturers, retailers, consumers 
and researchers. 
 

2. Method Material  
The data consisted of 36 samples, which were divided into two subsets, i.e., 30 used for 

training the network and 6 for testing the TDNN models. Soluble nitrogen, pH, standard plate 
count, yeast & mould count, and spore count were taken as input parameters, and sensory score as 
output parameter for developing TDNN single and multilayer models (Fig.1).   

 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 

Figure 1. Inputs and output parameters for TDNN models 

 

Soluble nitrogen 

 

pH 

Standard plate count 

 

Yeast & mould count 

 

Spore count 

 

Sensory 
Score 
 



S. Goyal, G. K. Goyal - Time-Delay Artificial Neural Network Computing Models for Predicting Shelf Life of Processed 

Cheese 

 

   65 

Many combinations were tried and tested, as there is no defined rule of getting good results 
rather than hit and trial method. As the number of neurons increased, the training time also 
increased. Several algorithms like Bayesian regularization, Levenberg Marquardt algorithm, 
Gradient Descent algorithm with adaptive learning rate, Powell Beale restarts conjugate gradient 

algorithm and BFG quasi-Newton algorithms were tried. Backpropagation algorithm based on 
Bayesian regularization was finally selected for training the networks, as it gave most promising 
results. TDNN was trained up to 100 epochs with single as well as multiple hidden layers. Transfer 
function for hidden layer was tangent sigmoid while for the output layer, it was pure linear 
function. 
 

 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 

 

 

 

 

Figure 2. Training pattern of TDNN models 

 
The Neural Network Toolbox under MATLAB software was used for developing the TDNN 

models. Training pattern of TDNN models is presented in Fig.2.  

Weights Selection 

 

Error Evaluation 

 

Weights Adjustment 

 

Training TDNN models 

Training 
Dataset 

 

Error Calculation 

Minimum 
Error 

End 

No 

Yes 



BRAIN. Broad Research in Artificial Intelligence and Neuroscience 

Volume 3, Issue 1, February 2012, ISSN 2067-3957 (online), ISSN 2068 - 0473 (print) 

 

 66 

 
 Measures for Prediction Performance

     


























 −
= ∑

2

1

exp
N

cal

n

QQ
MSE

    (1) 



























 −
= ∑

2

1 exp

exp1
N

cal

Q

QQ

n
RMSE

 (2) 



























 −
−= ∑

2

1
2

exp

exp2
1

N
cal

Q

QQ
R

  (3) 





























−

−

−= ∑
2

1 expexp

exp2
1

N
cal

QQ

QQ
E

  (4) 

Where, 

expQ  = Observed value; 

cal
Q  = Predicted value;  

expQ =Mean predicted value;  

n = Number of observations in dataset.  
 
Mean Square Error: MSE (1), Root Mean Square Error: RMSE (2), Coefficient of Determination: 
R

2 
(3) and Nash - Sutcliffo Coefficient:E

2
 (4) were used in order to compare the prediction ability of 

the developed models. 
 
 

3. Results and discussion 
TDNN model’s performance matrices for predicting sensory scores are presented in Table 1 

and Table 2, respectively. 
 
Table 1. Performance of single layer for predicting sensory score 

Neurons MSE RMSE R2 E2 

3 3.01226E-05 0.005488403 0.994511597 0.999969877 

5 0.000128522 0.011336741 0.988663259 0.999871478 

6 0.00019086 0.013815219 0.986184781 0.99980914 

8 0.000177938 0.013339332 0.986660668 0.999822062 

10 1.20278E-06 0.001096714 0.998903286 0.999998797 

12 2.41185E-05 0.004911058 0.995088942 0.999975882 



S. Goyal, G. K. Goyal - Time-Delay Artificial Neural Network Computing Models for Predicting Shelf Life of Processed 

Cheese 

 

   67 

14 3.46851E-05 0.005889404 0.994110596 0.999965315 

15 0.00021437 0.014641378 0.985358622 0.99978563 

16 0.001314906 0.036261628 0.963738372 0.998685094 

18 0.000840727 0.028995291 0.971004709 0.999159273 

20 8.5198E-05 0.009230276 0.990769724 0.999914802 

24 8.91481E-06 0.002985769 0.997014231 0.999991085 

30 9.62368E-05 0.009810037 0.990189963 0.999903763 

 
Table 2. Performance of multilayer for predicting sensory score 

Neurons MSE RMSE R2 E2 

3:3 4.67356E-05 0.006836347 0.993163653 0.999953264 

4:4 2.77834E-05 0.005270993 0.994729007 0.999972217 

5:5 3.40619E-05 0.00583626 0.99416374 0.999965938 

7:7 0.000428285 0.020695048 0.979304952 0.999571715 

8:8 2.18493E-05 0.004674322 0.995325678 0.999978151 

9:9 0.000160167 0.012655697 0.987344303 0.999839833 

10:10 1.3025E-05 0.003609012 0.996390988 0.999986975 

11:11 0.000266194 0.016315438 0.983684562 0.999733806 

12:12 4.47103E-05 0.006686576 0.993313424 0.99995529 

13:13 0.000111797 0.010573389 0.989426611 0.999888203 

14:14 0.000112257 0.01059513 0.98940487 0.999887743 

15:15 0.00022446 0.014981988 0.985018012 0.99977554 

16:16 9.56217E-05 0.009778634 0.990221366 0.999904378 

 
TDNN single and multilayer models were developed; for single layer TDNN model with 10 
neurons, the best performance was MSE: 1.20278E-06, RMSE: 0.001096714, R2: 0.998903286, 
E2: 0.999998797; while for the multilayer combination of 10:10 neurons MSE: 1.3025E-05, 
RMSE: 0.003609012, R2: 0.996390988, E2: 0.999986975 performed the best. On comparing them 
with each other, it was observed that single layer TDNN model performed better. Therefore, it was 
selected for predicting the shelf life of processed cheese. The comparison of Actual Sensory Score 
(ASS) and Predicted Sensory Score (PSS) for single layer and multilayer models are illustrated in 
Fig.3 and Fig.4, respectively. 
 



BRAIN. Broad Research in Artificial Intelligence and Neuroscience 

Volume 3, Issue 1, February 2012, ISSN 2067-3957 (online), ISSN 2068 - 0473 (print) 

 

 68 

 
Figure 3. Comparison of ASS and PSS single layer model 

 

 
Figure 4. Comparison of ASS and PSS for multilayer model 

 

 

 R
2
 was found to be 96.5 percent of the total variation as explained by sensory scores. Period 

of storage (days) for which the processed cheese has been in the shelf can be determined based on 
sensory score (Fig. 5). 

 



S. Goyal, G. K. Goyal - Time-Delay Artificial Neural Network Computing Models for Predicting Shelf Life of Processed 

Cheese 

 

   69 

 
Figure 5. Sensory score and period of storage for processed cheese  

 
The shelf life is calculated by subtracting the obtained value of days from experimentally 

determined shelf life, which was found to be 28.25 days. The predicted value is slightly higher than 
the experimentally obtained shelf life of 30 days. 

 
4. Conclusion  
TDNN models with single and multi layers were developed taking soluble nitrogen, pH, 

standard plate count, yeast & mould count, spore count as input parameters, and sensory score as 
output parameter for predicting the shelf life of processed cheese stored at 30

o 
C. Mean Square 

Error, Root Mean Square Error, Coefficient of Determination and Nash - Sutcliffo Coefficient were 
used in order to compare the prediction ability of the developed TDNN models. Regression 
equations were developed for predicting the shelf life of processed cheese, which came out as 28.25 
days. Since, predicted value is close to the experimentally determined shelf life of 30 days, hence 
from the study it can be concluded that TDNN artificial neural network models are quite efficient in 
predicting shelf life of processed cheese.  
 

References 
[1] http://en.wikipedia.org/wiki/Artificial_neural_network (accessed on 19.8.2011) 
[2] http://en.wikipedia.org/wiki/Time_delay_neural_network (accessed on 30.8.2012) 
[3] R.A. Chayjan. ”Modeling of sesame seed dehydration energy requirements by a soft- 

computing”. Australian Journal of Crop Science, vol. 4, no.3, pp.180-184, 2010 
[4] http://www.answers.com/topic/shelf-life (accessed on 30.8.2011) 
[5] Sumit Goyal and G.K. Goyal. ”Advanced computing research on cascade single and double 

hidden layers for detecting shelf life of Kalakand: An artificial neural network approach”. 
International Journal   of   Computer Science & Emerging Technologies, vol.2, no.5, pp. 
292- 295, 2011. 

[6]    Sumit Goyal and G.K. Goyal. “A new scientific approach of intelligent artificial neural 
network engineering for predicting shelf life of milky white dessert jeweled with pistachio”. 
International Journal of Scientific and Engineering Research, vol.2, no. 9, pp.1-4, 2011. 

[7]     Sumit Goyal and G.K. Goyal. ”Cascade and feedforward backpropagation artificial neural 
networks models for prediction of sensory quality of instant coffee flavoured sterilized 



BRAIN. Broad Research in Artificial Intelligence and Neuroscience 

Volume 3, Issue 1, February 2012, ISSN 2067-3957 (online), ISSN 2068 - 0473 (print) 

 

 70 

drink”. Canadian Journal on Artificial Intelligence, Machine Learning and Pattern 
Recognition.  vol. 2, no. 6, pp.78-82, 2011. 

[8]    Sumit Goyal and G.K. Goyal. ”Application of artificial neural engineering and regression 
models for forecasting shelf life of instant coffee drink”. International Journal of Computer 
Science Issues, vol. 8, no.4, pp. 320- 324, 2011 

[9]   Sumit Goyal and G.K. Goyal. ”Development of intelligent computing expert  system models 
for shelf life prediction of soft mouth melting milk cakes”. International Journal of 
Computer Applications, vol.25, no.9, pp.41-44, 2011. 

[10]   Sumit Goyal and G.K. Goyal. ”Simulated neural network intelligent computing models for 
predicting shelf life of soft cakes”. Global Journal of Computer Science and Technology. 
vol.11, no. 14, version 1.0, pp. 29-33, 2011. 

[11]   Sumit Goyal and G.K. Goyal. “Radial basis artificial neural network computer  
engineering approach for predicting shelf life of brown milk cakes decorated with almonds”. 
International Journal of Latest Trends in Computing. vol. 2, no.3, pp. 434-438, 2011.