## 3 Methodology
### Progressive Learning for Food Category and Ingredient Classification
#### 3.4.2 Progressive Kernel Extreme Learning Machine
\begin{table}
\begin{tabular}{l} \hline \hline
**Initialization Phase** \\
1. Initialize the network and creates two mapping nodes, \(n_{1}\) and \(n_{2}\), using a small chunk of training data \(N_{b}=\{\{x_{i},t_{i}\}\}_{i=1}^{N_{b}}\). \\
2. The connection set \(C\) is set to empty \(C=\phi\). \\
3. Compute the initial kernel matrix Equation (12). \\
4. Estimate the initial output weight Equation (13) and set \(k=0\). \\
**Progressive Learning** \\ For each iteration of the algorithm \\
5. Select the data sample \(x_{i}\) from the input. \\
6. For each mapping node \(i\) in the network, computes the distance with the input node \\ Equation (15). \\
7. Selects the first best matching node and second-best matching node, that is the nodes, \(f,s\in A\) \\ Equation (16). \\
8. Create a new connection if it does not exist between the first and second-best matching nodes \\ Equation (17). \\
9. Compute the activity of the best matching node. Update the beta matrix Equation (19), when new output neurons are added corresponding to a new food category or ingredients in the case of multi-label learning. \\
10. When the activity, \(a<\) activity threshold \(a_{T}\), and firing counter \(<\) firing threshold \(h_{T}\). \\
1. Insert the new node in the model Equation (21). \\
2. Compute the new weight vector and set the value to the average of the best matching mapping and input node Equation (22). \\
3. Insert the edges between the input node and the first and second-best matched \\ Equation (23). \\
4. Remove the link between the first best and second-best Equation (24). \\
5. Compute the kernel matrix of the input vector with nodes in the network by using Equations (25) and (26). \\
6. Insert a new mapping node in the kernel matrix by using the growing hidden neuron \\ methodology Equations (7)-(11). \\
11. If no new mapping node, then update the position of the first best match as in Equation (27), and its neighbors by using Equation (28) to which it is connected. \\
12. Increment the age of all the edges of the neighbors of first best matched by 1. \\
13. Compute the kernel matrix by using Equation (30). \\
14. Update the output matrix \(G\) and \(B\) according to Equations (31) and (32). \\
15. Reduce the firing frequency of the winning node as in Equation (33) and of its neighbors by using Equation (34). \\
16. Remove mapping nodes with age greater than the threshold or no neighbors. \\
17. If new inputs, go to step 1; otherwise, the model is already updated. \\
**Testing Phase** \\
1. During the testing phase computes the distance between the input node and the mapping \\ nodes. \\
2. Compute the kernel matrix by using Equation (35). \\
3. Compute the output \(Y\) vector as in Equation (36). \\
4. Select food category corresponding to the index of the highest value in the \(Y\) vector. \\
5. For multi-label classification, compute the final classification results by using the threshold \\ value. Select the labels corresponding to the indexes of the \(Y\) vector with a threshold greater than zero as in Equation (37). \\
**Noise or Novelty Detection** \\
1. Compute the activation value with the best matching neuron. \\
2. Use Equation (40) to compute the network response. If it is less than the threshold, then it is a novel concept or noisy sample. \\
**Labeling Data** \\
1. Compute the activation value and check the response Equation (40). \\
2. If it is larger then the threshold assigns the label of the winning neuron. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Proposed PKELM for food categorization and ingredient detection. Let \(A\) denotes the set of map nodes. The \(C\subset AxA\) is the set of connections of the nodes in the map field. The input distribution is denoted by \(p(x_{n})\) for \(x_{n}\) inputs. Define \(w_{n}\) as the weight vector of node \(n\).