Weed detection technology is of paramount significance in achieving automation and intelligence in weed control. Nevertheless, it grapples with several formidable challenges, including imprecise small target detection, high computational demands, inadequate real-time performance, and susceptibility to environmental background interference. In response to these practical issues, we introduce CCCS-YOLO, a lightweight weed detection algorithm, built upon enhancements to the Yolov5s framework. In this study, the Faster_Block is integrated into the C3 module of the YOLOv5s neck network, creating the C3_Faster module. This modification not only streamlines the network but also significantly amplifies its detection capabilities. Subsequently, the context aggregation module is enhanced in the head by improving the convolution blocks, strengthening the network’s ability to distinguish between background and targets. Furthermore, the lightweight Content-Aware ReAssembly of Feature (CARAFE) module is employed to replace the upsampling module in the neck network, enhancing the performance of small target detection and promoting the fusion of contextual information. Finally, Soft-NMS-EIoU is utilized to replace the NMS and CIoU modules in YOLOv5s, enhancing the accuracy of target detection under dense conditions. Through detection on a publicly available sugar beet weed dataset and sesame weed datasets, the improved algorithm exhibits significant improvement in detection performance compared to YOLOv5s and demonstrates certain advancements over classical networks such as YOLOv7 and YOLOv8.