## 4 Results and Discussion
### Model Architectures
#### 4.1.2 Model Analysis  
In this subsection, three critical aspects of model performance are examined: model robustness, error analysis, and the interpretation of model decisions. It should be noted that simple robustness analysis was performed utilizing artificially introduced offsets in energy distribution profiles in regard to the layer in which particular energy appears. The NN models demonstrated good robustness without any changes in accuracy for offsets up to three layers (about 10% of ECAL size), while offsets of four or more layers resulted in an accuracy drop, especially in MLP. Additionally, in [72], we showed that the same family of NNs can cope with a change in the type of data being used; i.e., it was shown that models pre-trained on electron EM showers (which we used in our experiments) can successfully classify events containing photon EM showers. We believe all of this information demonstrates the robustness of the proposed approach. Furthermore, the error analysis conducted in this study identified some potential limitations. Our findings suggest that the model struggles to differentiate between two scenarios due to the complex nature of the data. Specifically, the NNs may encounter difficulties in accurately predicting outcomes for low-energy EM showers that start appearing in earlier layers than usual. Additionally, EM instances wherein hadronic deposits  
Figure 10: ASCII diagrams showing architecture and parameters of (**a**) CNN model (**b**) MLP model. are higher than usual also pose challenges to the model. The use of low-level features, such as HGCAL images and energy deposits, has its limitations when dealing with these specific scenarios. To enable the interpretability of the presented models, the SHAP (Shapley additive explanations) [73; 74] framework was used. It allows one to understand the contribution of each feature to a model's output, making the decision-making process clearer. SHAP values provide an explicit indication of feature importance, making it easier to comprehend a model's operation. Both MLP and CNN models were investigated utilizing SHAP, providing insights into the key factors influencing model predictions. After conducting an extensive literature review and examining the SHAP tool's documentation, no examples of its application for 3D image classification were found. As a result, we had to make certain adjustments to the tool to accommodate our data, which limited the use of some of the (standard) SHAP functionalities. Despite this, useful insights into the operation of the models were gained, identifying the most important features for accurate predictions. A summary of the key findings is given below:  
* To utilize MLP for EM classification based on raw detector data, the 3D HGCAL image is flattened. This essentially means that the 3D image is transformed into a 1D array of values, where each value represents a pixel. To be precise, there are 900 pixels in the flattened version of the image, and these pixels serve as the features for the classification task. To ensure absolute clarity in the different pixel positions, the feature name is always displayed in the following format: layer_row_column. It is worth noting that the position of each pixel in a particular channel or layer is not as significant as the layer itself. The summary plot given in Figure 11 provides an overview of the most impactful features of a model. It ranks these features according to their effect on the model's predictions. The x-axis represents the SHAP value, which is a measure that quantifies the influence of a feature on a specific prediction. The y-axis displays the features, while the plot also shows the distribution of SHAP values for each feature. The color of the plot indicates the value of the feature, ordered from low to high. Upon closer examination of the diagram, it is noticeable that the features or pixel positions that have the greatest impact on the prediction are mostly between layers 5 and 10 (Figure 11 shows just the first top-ranked features).