## 4 Discussion  
This study proposes an IoT-based solution for remote collaboration among the plant's needed devices. The research investigates the viability of replacing human operators with AI systems in defect detection following Industry 4.0 principles. Several challenges to applying such tactics were highlighted throughout the investigation, including integration concerns and AI's limits in detecting minor errors. The findings highlight the need for collaboration between AI systems and human knowledge. Inside IoT infrastructures, the proposed solution demonstrates the collaborative vision of Industry 5.0. This strategy balances automation and human monitoring to achieve peak performance. As a result of analyzing the obtained results, the answers to the RQs enunciated in the introduction section are as follows:  
1. Implementing Azure IoT Hub and the NIA algorithm solves the integration of the AIoT infrastructure into quality control in foundries in remote communication.
2. Azure IoT Hub addresses the challenges of hardware and software compatibility by enabling communication standardization. The study has demonstrated the capability of devices programmed in different languages (C++, Bash, C#) to interoperate.
3. The NIA algorithm contributes to defect detection in distributed quality control systems through multiple frame acquisition and subsequent analysis. The tests showed superior quality metrics compared to those in the specialized literature, demonstrating its contributions to Industry 5.0 based on remote collaboration.  
This research presents the development of an IoT-based monitoring system employing real-time sensor fusion techniques for quality control in cast manufacturing environments. The system integrates data from multiple sensors, including visual sensors like the ESP32-CAM, within an IoT framework powered by Azure IoT Hub and Azure Custom Vision Service. The system accurately detects cast defects by applying advanced algorithms and cloud-based AI models.  
The study results are as follows: \(F_{1}\)-_Score_ of 97.50%, a _Recall_ of 96.56%, a _Precision_ of 98.44%, and an _Accuracy_ of 98.18%. This strategy was confirmed by the successful deployment of Azure Custom Vision Service, which was trained on domain-specific datasets. Additionally, Azure IoT Hub was used to overcome the compatibility issues caused by combining devices that were coded in multiple languages (C++ for the ESP32-CAM and M5 Stack using Arduino IDE, Bash scripts for Unix-based computers, and C# programs in a Windows environment). This platform enabled unified data transmission, standardizing protocols, and smooth connection between disparate devices. The results provided by the AI service emphasize the necessity of collaboration between AI models and human operator intervention, embodying an evolutionary principle central to Industry 5.0. This synergistic approach leverages the strengths of advanced technologies and human expertise to address complex challenges, such as detecting subtle defects and ensuring a balance between automation and human-centric decision-making.  
The proposed infrastructure has specific limitations inherent to using a pre-implemented solution. Therefore, although Microsoft Azure provides solutions for virtually any problem requiring integration, it comes with the disadvantage of costs. There are situations where these costs can be genuinely expensive. As mentioned in Section 3.3, which is dedicated to the limitations introduced by this infrastructure proposal, the necessity of ensuring compatibility between equipment is a requirement that cannot be ignored. Another disadvantage stems from the need to hire experienced programmers who are familiar with Azure's integration capabilities. Attempting to connect these technologies developed by Azure without thoroughly understanding their advantages, disadvantages, and modes of operation can lead to important infrastructure issues.