## 3 Methodology
### Progressive Learning  
After initialization, the proposed classifier incrementally learns new food categories and ingredients. The PKELM inserts new mapping nodes at any time and adjusts the structure. The new node is inserted into the network when the activation value of the best matching node is less than the threshold. The activation value is the Euclidean distance between the input representation of the food image and the weights of the nodes in the network. Each iteration of the algorithm is as follows: For every node \(i\) of the network, the method computes the distance from input by using Equation (15). \[d_{i}=\|x_{i}-w_{i}\|, \tag{15}\]  
where \(x_{i}\) represents the input vector and \(w_{i}\) refers to the weight of the ith mapping node. Figure 5: Shows the architecture of PKELM classifier. The network selects the first best \(f\) and second best mapping node \(s\) based on Euclidean distance as in Equation (16). \[ \begin{array}{l}f=argmin\limits_{n\in A}\|x_{i}-w_{n}\|,\\ s=arg\min\limits_{n\in A/\{s\}}\|x_{i}-w_{n}\|\,\end{array}  \tag{16}\]  
where \(f,s\in A\) and \(w_{n}\) represents the weight vector of the node \(n\). If there is no connection between the first and second-best matching nodes, then create a new connection. \[C=C\cup\{(f,s)\} \tag{17}\]  
Compute the activity value with the best matching node as in Equation (18). \[a=exp(-\left\|x_{i}-w_{f}\right\|). \tag{18}\]  
Here, \(x_{i}\) refers to the incoming feature vector, and \(w_{f}\) refers to the weight of the best matching node. The age is set to zero when the link exists between the first best and second best. When the input feature vector belongs to a new food category or contains novel ingredients, then Equation (19) increases the output neurons in the network by multiplying the output weights with the transformation matrix. For food ingredient detection, the newly added output neurons will be equal to the total number of novel ingredients. All the columns corresponding to new neurons in the transformation matrix are set to zero. \[\beta^{(k+1)}=\beta^{(k)}.M \tag{19}\]  
where, \(M\) is a transformation matrix as in Equation (20),  
\[M= \begin{bmatrix}1&\cdots&0&0\\ \vdots&\ddots&\vdots&0\\ 0&\cdots&1&0.\end{bmatrix}  \tag{20}\]  
Following that, if the activity is less than the activation threshold and the firing counter is less than the firing threshold, a new node \(m\) is inserted in the model between the winning node (badly matched) and the input. The weight vector of the newly added input node is initialized to the mean average of the weight of the input node and the best matching node. \[A=A\cup\{m\}. \tag{21}\]  
Equation (22) computes the weight vector of the new mapping node \(w_{m}\), which is the average weight vector of the best matching node and the input node, and Equation (23) creates new edges, and Equation (24) removes link between first winner and second winner. \[w_{m}=0.5.(w_{f}+x_{i}) \tag{22}\]  
\[C=C\cup\{(m,f),(m,s)\} \tag{23}\]  
\[C=C/\{(f,s)\}. \tag{24}\]  
As the model adds a new mapping node, the \"Growing Hidden Neuron Methodology\" will update the kernel matrix by Equations (7)-(11). The \(Z_{n}\) and \(K_{n}\) in Equations (7)-(11) is computed by Equations (25) and (26). \[Z_{n}=K(x_{i},w_{m}) \tag{25}\]  
\[K_{n}=K(x_{i},w_{A}). \tag{26}\]It then updates the output weights by using Equations (9)-(11). In the second scenario, when the best matching nodes represent the input well, the network will update the position of its winning node as in Equation (27), and its \(i\) neighbors by using Equation (28). \[\triangle w_{f}= \varepsilon_{b}\cdot h_{f}.(x_{i}-w_{f}) \tag{27}\] \[\triangle w_{i}= \varepsilon_{n}\cdot h_{i}.(x_{i}-w_{i}) \tag{28}\]  
where \(0<\varepsilon_{n}<\varepsilon_{b}<1\), \(h_{f}\) represents the value of firing counter of node \(f\) and then the age of the edges of the \"first best match\" neighbors is incremented by \(1\). \[age_{(f,i)}=age_{(f,i)}+1. \tag{29}\]  
Here, \(age_{(f,i)}\) refers to the age of the ith edge of the first best matched node with its neighbour.