## 2 Description of Neural Network  
The mathematical description of 2-stage backward propagation neural networks (BPNN) consists of definition of shelf life, structure of generic BPNN, heuristic approaches, and application of NN model for shelf life prediction. The theory and applications of NNs were described by [PERSON] and [PERSON] [14]. _The definition of shelf life._ We collected data of total shelf lives from a number of units of lettuce grown experimentally or commercially. Each unit (box) of lettuce has its own history of average daily temperatures. In this study, shelf life is defined as average shelf life (days) of a box of lettuce with 12-24 heads. The criteria for determining shelf life must be consistent for all the units and all sources of harvest. Given this data, we are required to build a model to predict the RSL. The question is \"For this unit of produce with known daily average temperature history up-to-today, what RSL (days) can be expected under various scenarios of future temperatures?\"  
_Generic BPNN._ Generic NN models for modeling RSL can be expressed as a function of the product of a weight matrix \(W\) and input vector \(T\),  
\[[\text{RSL}=f(W*T)] \tag{1}\]  
where \(W\) is a resulting BPNN weight matrix, \(T\) represents the temperature history, and RSL is the remaining shelf life. The number of points of temperature data in a given unit is the same as the number of days of total shelf life, and each unit has its own total shelf life. The dimension of input vector \(T\) (the number of input nodes) is fixed in a given BPNN model. In order to accommodate the varying number of total shelf lives, the input vector \(T\) was the average daily temperature for each unit. For example, a maximum of 18 daily temperature inputs are possible for a box of lettuce observed having 18 days of shelf life. If the temperature history of a unit has a total shelf life of \(n\) days, the daily temperatures are _t_(1), t(2),..., _t_(_c_),..., _t_(_n_). The \(c\) in _t_(_c_) indicates the current day (\"today\") as it moves from _t_(1) to _t_(_n_) along the time axis. The components of vector \(T\), i.e. the input nodes for current day (_c_), can be assigned as follows. Input node _fs_ (future sum): the sum of daily temperatures from tomorrow (_c_+1) to end of shelf life (_n_). This node _fs_ covers the temperatures of the RSL of (_n_-_c_) days. \[[f\text{s}=t(c+1)+t(c+2)+\ldots+t(n)] \tag{2}\]  
Input node _fa_ (future average): the average daily temperature of the remaining days (_n_-_c_). \[[f\text{a}=f\text{s}/\text{ (}n\text{-}c)] \tag{3}\]  
Input nodes _pm_: one node for each of the previous \(m\) days counting back from day _c_: For example, If _m_=4 days, then we are using _t_(_c_), _t_(_c_-1), _t_(_c_-2) and _t_(_c_-3) as inputs. \[[pm=\{t(c),\,t(c\text{-}1),\,t(c\text{-}2),\,\ldots,\,t(c\text{-}(m\text{-}1))\}] \tag{4}\]  
Input node _ps_ (prior sum): the sum of daily temperatures prior to day (_c_-(_m_-1)). \[[ps=t(1)+t(2)+\ldots+t(c\text{-}m)] \tag{5}\]  
The output node, RSL, for a given day \(c\) is simply described as:  
\[[\text{RSL}=n\text{-}c] \tag{6}\]  
This design is one of numerous possibilities, and allocating the up-to-date temperatures into aggregates of nodes (i.e. _pm_) is an art. In our design of nodes _pm_, we emphasize the details of temperatures in the last \(m\) days (i.e. immediately before current day (_c_)), assuming that the last \(m\) days of temperature may be most important. We used a summation (_ps_) as a single node for the temperatures prior to day (_c_-(_m_-1)). _Heuristics._ NN models are established by learning from examples (i.e. available data set), but they can not provide in-depth solutions (i.e. no explanation capacity). On the other hand, knowledge-based expert systems can not easily process information from real-life, unpredictable data. A hybrid structure of expert systems and neural networks has been proposed and implemented in bioprocessing and chemical engineering [14](section 6.1 Introduction to Expert Networks, pp. 365-369).