The accurate weed detection is the premise for precision prevention and control of weeds in fields. Machine vision offers an effective means to detect weeds accurately. For precision detection of various weeds in carrot fields, this paper improves You Only Look Once v4 (YOLO v4) into a lightweight weed detection model called YOLO v4-weeds for the weeds among carrot seedlings. Specifically, the backbone network of the original YOLOv4 was replaced with MobileNetV3-Small. Combined with depth-wise separable convolution and inverted residual structure, a lightweight attention mechanism was introduced to reduce the memory required to process images, making the detection model more efficient. The research results provide a reference for the weed detection, robot weeding, and selective spraying.
A quality detection system for the “Red Fuji” apple in Luochuan was designed for automatic grading. According to the Chinese national standard, the grading principles of apple appearance quality and Brix detection were determined. Based on machine vision and image processing, the classifier models of apple defect, contour, and size were constructed. And then, the grading thresholds were set to detect the defective pixel ratio t, aspect ratio λ, and the cross-sectional diameter Wp in the image of the apple. Spectral information of apples in the wavelength range of 400 nm~1000 nm was collected and the multiple scattering correction (MSC) and standard normal variable (SNV) transformation methods were used to preprocess spectral reflectance data. The competitive adaptive reweighted sampling (CARS) algorithm and the successive projections algorithm (SPA) were used to extract characteristic wavelength points containing Brix information, and the CARS-PLS (partial least squares) algorithm was used to establish a Brix prediction model. Apple defect, contour, size, and Brix were combined as grading indicators. The apple quality online grading detection platform was built, and apple’s comprehensive grading detection algorithm and upper computer software were designed. The experiments showed that the average accuracy of apple defect, contour, and size grading detection was 96.67%, 95.00%, and 94.67% respectively, and the correlation coefficient Rp of the Brix prediction set was 0.9469. The total accuracy of apple defect, contour, size, and Brix grading was 96.67%, indicating that the detection system designed in this paper is feasible to classify “Red Fuji” apple in Luochuan.