# A Multi-Machine and Multi-Modal Drift Detection (M2D2) Framework for Semiconductor Manufacturing
## 3 Methodology
### Phase 6: Drift-Aware Federated Learning
The micro-round training can be formalized as follows: \[\theta_{k}^{r,(\mathscr{C}+1)}=\theta_{k}^{r,(\mathscr{C})}-\eta\
abla_{ \theta}\mathscr{C}\Big{(}\theta_{k}^{r,(\mathscr{C})};D_{k}^{r}\Big{)}, \mathscr{C}=1,\ldots,L_{max}.\] (16) After these extra steps, the updated \(\theta_{k}^{r,final}\) is uploaded to the server, potentially reducing the drift gap. 2. Drop Strategy If \(\delta_{k}^{r}\) is exceedingly large (i.e., the site is severely out of sync with the global distribution) and cannot be quickly corrected, the server may skip (drop) that site in the current aggregation: \[\text{if }\delta_{k}^{r}\gg\gamma^{\prime},\text{ then do not include }\theta_{k}^{r}\text{ in the aggregation}.\] When temporarily excluding extreme outliers, the global model remains stable. Later, once the drifting machine \(k\) completes more extensive local retraining or maintenance (see below), it can rejoin the FL process. 4. Multi-Head/Multi-Task FL with Continual Learning:1. Shared Backbone + Task-Specific Heads To handle both common features across sites and site-specific variations, one can adopt a shared-backbone-plus-head architecture. Let \[\theta_{k}=\Big{(}\theta_{shared},\theta_{k}^{head}\Big{)}.\] (17) The server aggregates the shared backbone \(\theta_{shared}^{r}\) across all sites (global update). Each site \(k\) fine-tunes its own head \(\theta_{k}^{head}\) based on local drift or anomalies (local update), enabling more extensive adaptation for that site without disrupting the globally shared backbone. 2. Dynamic Head Generation (Continual Learning) If a site undergoes a radical or \"conceptual\" shift (e.g., the entire manufacturing process changes or sensor hardware is replaced), a new head \(\theta_{k}^{head_{out}}\) can be dynamically created while preserving the old head \(\theta_{k}^{head_{out}}\). This design merges continual learning with FL, ensuring that previously learned knowledge is retained and the system can accommodate newly emerging distributions. (5) Collective Drift and Graph-Based Adaptation: In real industrial settings, machines often have upstream-downstream or spatial interdependencies. A drift in a first-stage machine can reverberate downstream. Let us define a site-dependency graph \(G=(V,E)\), where each node \(v_{k}\in V\) corresponds to a machine \(k\), and edges \(E\) represent interlinked processes. 1. Group-Based Aggregation: If a subgraph of machines concurrently exhibits high drift, the server can perform more frequent local aggregations within that subgraph and coordinate maintenance for them as a group. 2. Neighbor-Aware: If a neighbor's drift scores spike, the system can proactively adjust or warn nearby machines, facilitating a more holistic approach to distributed production lines. (6) Maintenance Decisions and Closed-Loop Integration: 1. Maintenance Triggers When \(\delta_{k}^{r}\) surpasses a critical threshold, or when interpretability methods (Phase 4) highlight sensor/log anomalies (e.g., \"_Current fluctuations_\"), we initiate PdM to prevent imminent failures. In multi-machine scenarios, we can formulate a global scheduling objective balancing maintenance cost \((Cost_{maint})\) and risk (_Risk_), e.g., \[\min_{M_{k}\in\{0,1\}}\sum_{k=1}^{K}\big{(}Cost_{maint}(k)\cdot M_{k}+Risk(k) \cdot(1-M_{k})\big{)},\] (18) where \(M_{k}=1\) indicates that site \(k\) undergoes immediate maintenance, and \(Risk(k)\) represents expected downtime or failure risk if not repaired. 2. Active Learning (Phase 5) and Retraining After maintenance, each site collects new data reflecting the repaired conditions. With an active learning process, it can select or label critical samples to rapidly adapt local parameters. The updated \(\theta_{k}\) is then transmitted to the server, forming a detect-explain-repair-retrain loop. 3. Interpretability Feedback (Phase 4) If interpretability methods (e.g., attention weights, SHAP, or LIME) converge on specific features, sensors, or textual signals as causes of anomalies, multiple sites can share these explanations with the server.