## 3 Eye-Machine Interaction Technology Based on the YOLOv5 Network
### Construction of Experimental Platform  
This experimental scheme aims to use the combination of facial expression and eye movement information to judge people's intentions, as shown in Figure 14. The platform mainly consists of the following parts: a six-degrees-of-freedom robot, an eye movement state capture camera, an intention recognition host, Raspberry PI, and robot-host computer.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Ocular State** & **Criterion of Discrimination** \\ \hline Up, down, left, and right & Last more than 1.5 s \\ \hline Close one’s eyes & Last more than 1 s \\ \hline Single wink & There was a continuous change in “closed eye—open eye” eye state within 1 s \\ \hline Double wink & Two consecutive changes in “closed eye—open eye” appeared within 1.5 s \\ \hline \hline \end{tabular}
\end{table}
Table 11: Criteria for eye behavior.  
Figure 14: Human–computer interaction experiment platform.  
First, the intent recognition results are sent via the PC side and sent to the Raspberry PI using the MQTT communication protocol. After the Raspberry PI receives the message, it runs the YOLOv5 model ported to the Raspberry PI for eye movement recognition. Finally, the identified eye movement state information is transmitted to the robot arm through the Modbus communication protocol for corresponding actions. The overall flow chart of the experiment is shown in Figure 15.  
In this study, the improved YOLOv5 eye state detection algorithm is successfully transplanted to Raspberry PI 4B to achieve high-precision eye movement state judgment. Through the export.py tool, the YOLO model is converted to ONNX format for easy deployment on the Raspberry PI. Using MQTT protocol, the asynchronous communication between the computer's intention detection program and the Raspberry PI robot arm control program is realized. The Mosquito server is installed on the Raspberry PI to ensure that the PC and Raspberry PI are in the same network segment. The weight and label are replaced by VNC Viewer to complete the model migration. In addition, the six-axis cooperative robot interacts with the Raspberry PI through the Modbus TCP protocol, and the user writes jbi scripts in the instructor to control the robot arm to perform specific actions. This integrated system provides an effective scheme for the deployment of eye control technology in practical applications.  
We conduct a comprehensive evaluation of the computational efficiency of our models, especially for those deployed on resource-constrained devices such as the Raspberry PI. To measure the model's performance more accurately, we introduce three key computational efficiency metrics: processing time, memory usage, and power consumption. Table 12 shows the efficiency indicators of the YOLOv5 model before and after the improvement.  
As shown in Figure 16, the improved YOLOv5 model outperforms the original model in terms of processing time, memory usage, and power consumption. This result shows that our improvement not only improves the accuracy of the model but also improves the computational efficiency of the model on the resource. The jbi script information is shown in Table 13.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Processing Time (ms)** & **Memory Usage (MB)** & **Power Dissipation (W)** \\ \hline The original YOLOv5 & 23.6 & 256 & 2.1 \\ Improved YOLOv5 & 18.9 & 220 & 1.9 \\ \hline \hline \end{tabular}
\end{table}
Table 12: Comparison of calculation efficiency indicators.  
Figure 15: The overall flow chart of the experiment.