## 4 Results and Discussion
### Model Architectures
#### 4.1.1 Base NN Models  
The optimization results for the hidden layers of CNN and MLP models for each of the classification cases are shown in Table 2. For example, the CNN model for EM vs. PU classification contains a convolutional layer with 11 3 \(\times\) 3 kernels followed by one dense layer with 12 nodes. It can be noticed that the optimizer gives quite a similar NN structure for MLP in all classification tasks, while the suggested CNN in EM vs. MIX is somewhat bigger; it has an additional dense layer, which is expected because the classification problem is more complex.  
The activation functions are the same in all cases; the inner layers use ReLu, and classification is performed using softmax. For both models, the loss function is the binary cross-entropy, and optimization is conducted using the Adam algorithm, with a learning rate obtained by the optimizer and a batch size of 128. The learning rate values determined by the optimizer are in the range of 0.009 to 0.07, depending on the model and classification case. Early stopping is implemented if no progress is seen beyond ten epochs. Early stopping is a form of regularization that reduces model complexity and prevents overfitting [71].  
Both the training and testing sets contain balanced samples of the classes in all the classification tasks. There are a total of 36,000 samples in each classification task, consisting of 18,000 EM samples and 18,000 background samples (either PU or QCD). Out of these, 15,300 samples of each type were used for training and validation, and 2700 were used for testing. The first group of tests was conducted on the full data set without any normalization, selection, or quantization. Input images represent the full HGCAL profile, that is, all 36 layers.  
The results of baseline NN methods for different types of EM vs. background classification are shown: for PU in Table 3, for QCD in Table 4, and for mixed background in Table 5. Architectures of the developed networks are presented in Figure 10.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **acc** & **prec** & **rec** & **f1** & **AUC** & **fpr** & **fnr** \\ \hline CNN & **0.968** & 0.9899 & **0.9822** & **0.9861** & **0.9951** & **0.0100** & **0.01781** \\ MLP & 0.9830 & **0.9891** & 0.9767 & 0.9829 & 0.9920 & 0.0107 & 0.0233 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The results for the base CNN and MLP model for EM vs. QCD.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Case/Model** & **CNN** & **MLP** \\ \hline EM vs. PU & conv1 layer: 11 kernels dense1 layer: 5 nodes dense2 layer: 13 nodes \\ \hline EM vs. QCD & conv1 layer: 12 kernels dense1 layer: 10 nodes \\ \hline EM vs. MIX & conv1 layer: 6 kernels dense1 layer: 12 nodes dense2 layer: 13 nodes \\ \hline \hline \end{tabular}
\end{table}
Table 2: The results of model structure optimization for CNN and MLP for each classification case. The table describes just hidden layers.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Model** & **acc** & **prec** & **rec** & **f1** & **AUC** & **fpr** & **fnr** \\ \hline CNN & **0.968** & **0.9756** & **0.9637** & **0.9696** & **0.9914** & **0.0241** & **0.0363** \\ MLP & 0.9639 & 0.9665 & 0.9611 & 0.9638 & 0.9884 & 0.0333 & 0.0389 \\ \hline \hline \end{tabular}
\end{table}
Table 5: The results for the base CNN and MLP model for EM vs. MIX.  
It can be noticed that in all cases, CNN gives slightly better accuracy than MLP. Both models are better at classifying between EM and neutrino PU clusters than between EM and QCD jets. The EM vs. MIX classifier, as expected, is somewhat better than EM vs. QCD, and worse than EM vs. PU. In the rest of the paper, the focus is put on EM vs. MIX classification problem. The models are minimized, making them suitable for FPGA implementation and playing an important role in L1 triggering. At the same time, the methods described in the previous section are used to improve accuracy and minimize FNR.