In this paper, a lightweight model—OMC-YOLO, improved based on YOLOv8n—is proposed for the automated detection and grading of oyster mushrooms. Aiming at the problems of low efficiency, high costs, and the difficult quality assurance of manual operations in traditional oyster mushroom cultivation, OMC-YOLO was improved based on the YOLOv8n model. Specifically, the model introduces deeply separable convolution (DWConv) into the backbone network, integrates the large separated convolution kernel attention mechanism (LSKA) and Slim-Neck structure into the Neck part, and adopts the DIoU loss function for optimization. The experimental results show that on the oyster mushroom dataset, the OMC-YOLO model had a higher detection effect compared to mainstream target detection models such as Faster R-CNN, SSD, YOLOv3-tiny, YOLOv5n, YOLOv6, YOLOv7-tiny, YOLOv8n, YOLOv9-gelan, YOLOv10n, etc., and that the mAP50 value reached 94.95%, which is an improvement of 2.62%. The number of parameters and the computational amount were also reduced by 26%. The model provides technical support for the automatic detection of oyster mushroom grades, which helps in realizing quality control and reducing labor costs and has positive significance for the construction of smart agriculture.