## 1 Introduction  
The Poka Yoke concept was first formalised by [PERSON] [1] within the context of the Toyota Production System [2]. The Poka Yoke idea lies in geometrical or methodological constraints aimed to prevent unwanted operations or events. Some examples are given by the component positioning of a mechanical assembly constrained by geometry (geometrical Poka Yoke) or tools that constrain certain actions in order to achieve or not a given effect (methodological Poka Yoke). An example of the former is the USB-C connector, whereas an example of the latter is the clutch mechanism in the last generation manual transmission vehicles with the aim of starting the engine and preventing accidental movement of the car during its ignition.  
In manufacturing contexts, a Poka Yoke is a solution whose goal is to prevent human errors through a process constraint design (generally low cost). All market solutions are oriented to obtain zero defects: the final target is to avoid low quality products reaching the client due to incorrect processes. Industry 4.0 brings new technologically advanced possibilities also in this area. In particular, the contamination of Industry 4.0 and Lean Manufacturing has led to the so-called \"Lean 4.0\": under this lens, Lean Manufacturing becomes a prerequisite for the application of the concepts of Industry 4.0, and Industry 4.0 in turn promotes Lean Manufacturing [3].  
A strict relation between Lean Manufacturing approaches and Industry 4.0 technologies has been proved also by [4] via a methodological survey proposed to sector experts.  
The result highlights how many of the Lean Manufacturing tools (JIT, TPM, Automation and VSM) can benefit IoT applications, improving information flow, decision making, productivity, and responsiveness. The positive relation between Lean Manufacturing and IoT makes the latter the basic building block of Industry 4.0, connecting the _Genbu_-physical world to the digital world and enabling advanced applications.  
In this paper, we present the re-design of an assembly line with a process that combines methods that follow typical lean production principles and novel techniques based on artificial intelligence and computer vision. During the re-design of the assembly line study, a practical problem linked to a human assembly error emerged, namely the correct positioning of an oil seal within a speed increase. The problem affected the First Time Quality index of the assembly line, lowering its overall performance and generating frequent returns in customer orders. This problem needed a careful analysis and a customised solution exploiting advanced deep learning technologies applied to a computer vision problem. The overall solution resulted in a Poka Yoke that impacts positively on the First Time Quality production index.  
The paper is organised as follows. Section 1.1 describes related works in the context of artificial intelligence applied to Lean Manufacturing. Then, Section 2.1 illustrates all the phases of the redefinition of the assembly line, whereas Section 2.2 focuses on the problem of the automatic control of the oil seal placement and describes the proposed solution based on computer vision tools. Section 3 depicts project results, and Section 4 concludes the paper.