## 2 Methodology
### Event Filtering and Expert Knowledge Extraction Modules: Structure and Operation
#### 2.2.2 Automatic Expert Knowledge Extraction Module  
Parallel to anomaly detection, it is necessary to extract and codify the decision-making process of human experts. Over three years, experts in each department provided quality labels and developed ontological rules to guide their decisions. This module's purpose is to analyze these expert decisions, compare them against the formal rules, and generate a refined knowledge database. This module is organized in a sequential pipeline. Figure 7: Flow chart of the event filtering module operation. * Data Collection and Integration Historical records of expert decisions are collected along with the ontological rules that were formulated concurrently. By combining these two sources, the module ensures that both practical decision outcomes and formalized expert knowledge (the rules) are represented. * Discrepancy Analysis Submodule The module compares the decisions made by experts with the outcomes predicted by the ontological rules (it is important to note that ontological rules are statistical representations of the choices taken, but their results do not have to overlap with the decisions). Instances of coincidence, discrepancy, or missing rule output are identified. * Rule Evaluation and Refinement Submodule In cases where the ontological rules do not generate a clear decision or when discrepancies arise, the module applies techniques based on neural networks to refine the rule set; this approach has been widely used in industry for its ability to learn from complex data [18]. This step is critical for trying to determine what the \"ideal\" decision would be given the complete set of sensor inputs. We must take into account that we should not, in any case, contradict a bad quality label from the human experts; the aim of the module is to be even more restrictive than the human experts, learning from their knowledge. * Knowledge Database Generation Submodule The refined decisions, now aligned with both sensor data and expert insight, are compiled into a new CSV file that can be easily added to the knowledge extraction module database. This final database is then used to train the neural network inference modules (departmental and interdepartmental decision-making), ensuring that the system learns an accurate representation of expert decision-making. This structure of the expert extraction module is represented in Figure 8 and was chosen to address the inherent complexity of human decision-making. The human expert's decisions are mostly influenced by the visual inspection of the product and the information given by the EDDYEyes system developed by ISEND S.A. so that the decision is not influenced at all by the sensor information, making the extraction of expert information a complex task. By separating data collection, discrepancy analysis, and output generation, the module allows for a systematic and iterative improvement of the knowledge base. This design enhances transparency, making it easier to pinpoint where expert judgments diverge from formal rules, and supports continuous refinement. Ultimately, the refined database served as the cornerstone for training our decision-making models, ensuring that they can replicate expert decisions or even improve them. To achieve this behavior, we built the module with the following architecture. The model starts with an input layer with dimensions according to the number of parameters in each stage (steel mill \(\rightarrow\) 28, logistics \(\rightarrow\) 8, rolling mill \(\rightarrow\) 40, sales \(\rightarrow\) 4); this is followed by 3 hidden layers with double size than the input layer dimension and, finally, an output layer with a dimension according to the number of labels for each stage. This architecture was chosen so that the model was kept simple (adding more layers does not improve the results obtained) to achieve the best possible results; a dense neural network type structure is the most efficient for extracting information to classify into the different labels.