# Deep Learning-Based Oyster Packaging System
## 2 Oyster Packaging System
### Deep Learning-Based Oyster Detection Model  
To achieve intelligent grasping and packaging of oysters by the mechanical arm on the production line, it is necessary to construct a visual perception model to detect the oysters on the conveyor belt in real time and to realize oyster tracking, prediction of oyster grasping position, and oyster counting. Since the oyster visual perception model needs to be able to perform well on devices with average arithmetic and performance and, at the same time, to track and detect oysters moving on the conveyor belt in real time, the intelligent perception counting model should have the following characteristics:  
* Low latency: the vision algorithm needs to be able to obtain the movement information of oysters in real time within the field of view of the camera. * High detection accuracy and robustness: able to accurately recognize and locate oysters without leakage under different speeds of conveyor belts. * Accurate tracking: able to realize the optimal prediction of oyster grabbing position and counting function. The oyster perception model is constructed for real-time detection of oysters on the production line and obtaining the location information, so the recognition and localization of oysters is the core of the intelligent perception model. The rapid and accurate recognition and acquisition of oyster position information from the vision sensor are the prerequisites for the mechanical arm to be able to accurately complete the oyster grasping task. Traditional perception algorithms perform target detection and localization through traditional image processing algorithms such as binarization, threshold segmentation, and edge detection [23]. In the actual unmanned workshop production, the traditional image processing shortcomings such as poor real time, poor robustness, and the need to be constantly adjusted for the detection of the object--oyster is an extremely irregular, black-and-white mixed shellfish--the traditional image processing algorithms are likely to lead to the target-missed detection. Deep learning systems, which can automatically discover features and patterns within a given dataset, simplify tasks such as pattern recognition and detection [24]. Therefore, the deep learning-based object detection algorithm makes it more generalizable by extracting more abstract and higher dimensional features of the oyster in the image and performs better in complex scenes. In this study, oyster detection weights were trained as an oyster detection model based on the single-stage object detection model You Only Look Once version 5 (YOLOv5) [25; 26]. Single-stage object detection does not require pre-generation of candidate frames, direct convolution of the image to extract features, classification, regression, and the output of the predicted location and class of the target [27]. Also known as regression-based object detection, the YOLO series is a typical representative of the algorithm based on regression detection. The YOLO series algorithms have been iteratively improved for a variety of scenarios due to their excellent detection speed and accuracy. The streamlined architecture and ease of deployment of YOLOv5 contribute to its outstanding performance in real-time object detection tasks. It strikes a fine balance between speed and precision, exhibits the capability to handle diverse environmental conditions, and demonstrates adaptability to various object classes. Its advanced performance across diverse benchmark datasets underscores its robustness in varied scenarios. The oyster intelligent perception model is applied to the moving production line, so there are high requirements for the computing speed and accuracy of the real-time detection model. Considering the detection scenario on the oyster production line, this study chose YOLOv5, which has the shallowest depth and the smallest width as the oyster detection model. The network structure of the YOLOv5 model is shown in Figure 3 and consists of the backbone, neck, and prediction.