## 5 Proposed Method
### Physical Rules as a Loss Function in Our CNN's Architecture  
Integrating physical rules into the training process of a CNN offers a promising approach to enhancing learning efficiency and predictive accuracy by incorporating domain-specific knowledge. To achieve this, we designed a total loss function \(\mathcal{L}\) for a physics-informed neural network (PINN), combining a data-driven loss with a physics-based loss. As shown in Equation (2), the physics-based loss incorporates laws represented as rules. These rules penalize the discrepancy between the predicted model outputs and results derived from the applied physical laws, ensuring alignment with domain-specific principles. This integration is mathematically articulated through a bespoke loss function \(\mathcal{L}\) that encompasses both data fidelity and physical law compliance. We defined the rules as part of a set of known physics relations, not constituents of boundaries but of physical equations; for this reason, we just use \(\mathcal{L}_{F}\) to define our physical support of the model. In our case, since it is a binary classification problem, we denote the discrepancy between network predictions and observed data through a binary cross-entropy loss \(\mathcal{L}_{data}\) described by  
\[\mathcal{L}_{\text{data}}(y,\hat{y})=-(y\log(\hat{y})+(1-y)\log(1-\hat{y})), \tag{7}\]  
where \(\hat{y}\) represents the predicted probability of an instance \(x\), and \(y\) is the actual binary label (0 or 1) representing the overload class. This function computes the binary cross-entropy loss, which penalizes the model based on the discrepancy between predicted probabilities and actual labels. On the other hand, our proposed loss based on physical rules, described by \(\mathcal{L}_{F}\), measures deviations of predictions and the results of the applied physical laws, with \(\lambda\) as a balancing factor of the importance of the physical information of the total loss results [11]. The core of our PINN resides in embedding prior physical knowledge, encapsulated by differential equations, into the training process [15]. We propose achieving it by formulating \(\mathcal{L}_{F}\) as the residual of the physical equations:  
\[\mathcal{L}_{F}(\hat{\mathbf{u}},\hat{\mathbf{y}})=-(\hat{u}\log(\hat{y})+(1- \hat{u})\log(1-\hat{y})), \tag{8}\]  
we define each \(\hat{u}_{k}\) as a differentiable rule applied to pairs of features to reduce the search space of overloads, allowing the model to improve the predictions of these events, such that  
\[\hat{u}_{k}(\mathbf{x}_{k})=\sigma\Big{(}\
abla_{t}\mathbf{x}_{k}^{(i)}\Big{)} \sigma\Big{(}\
abla_{t}\mathbf{x}_{k}^{(j)}\Big{)}, \tag{9}\]  
where \(\mathbf{x}_{k}=(\mathbf{x}_{k}^{(i)},\mathbf{x}_{k}^{(j)})^{T}\) represents the \(k\)th input pairs involved in the \(k\)th rule, \(\sigma\) is the sigmoid function (11), \(\
abla_{t}\mathbf{x}_{k}=(\
abla_{t}\mathbf{x}_{k}^{(1)},\
abla_{t}\mathbf{x} _{k}^{(2)})\) are the gradients of the features involved in each rule (10), and \(t\) is the time elapsed in each window of observation \(w\). Figure 6: Effect of temporal filter over Gram matrix sample. This matrix was reduced in dimension to clarify the effect in this document. \[\
abla_{t}\mathbf{x}_{k}=\frac{\partial\mathbf{x}_{k}}{\partial t}. \tag{10}\]  
\[\sigma(\
abla_{t}\mathbf{x}_{k};\alpha_{k})=\frac{1}{1+e^{(-\alpha_{k}\
abla_{t }\mathbf{x}_{k})}}, \tag{11}\]  
where the parameter \(\alpha_{k}=(\alpha_{k}^{(1)},\alpha_{k}^{(2)})^{T}\) represents a pair of trainable, strictly positive parameters that determine the strength of the relationship between the slopes described in Equation (10). The design premise is rooted in the idea that encoding physical and operational principles as mathematical constraints or heuristic rules can streamline the learning process. By focusing the CNN on features and interactions known to be relevant, the physical rules loss function guides the model toward an understanding that goes beyond simple data-driven pattern recognition.