Weeds in paddy fields compete with rice for nutrients and cause pests and diseases, greatly affecting rice yield. Accurate weed detection is vital for implementing variable spraying with unmanned aerial vehicles (UAV) for weed control. Therefore, this paper presents an improved weed detection algorithm, YOLOv10n-FCDS (YOLOv10n with FasterNet, CGBlock, Dysample, and Structure of Lightweight Detection Head), using UAV images of Sagittaria trifolia in rice fields as the research object, to address challenges like the detection of small targets, obscured weeds and weeds similar to rice. We enhanced the YOLOv10n model by incorporating FasterNet as the backbone for better small target detection. CGBlock replaced standard convolution and SCDown modules to improve the detection ability of obscured weeds, while DySample enhanced discrimination between weeds and rice. Additionally, we proposed a lightweight detection head based on shared convolution and scale scaling, maintaining accuracy while reducing model parameters. Ablation studies revealed that YOLOv10n-FCDS achieved a 2.6% increase in mean average precision at intersection over union 50% for weed detection, reaching 87.4%. The model also improved small target detection (increasing mAP50 by 2.5%), obscured weed detection (increasing mAP50 by 2.8%), and similar weed detection (increasing mAP50 by 3.0%). In conclusion, YOLOv10n-FCDS enables effective weed detection, supporting variable spraying applications by UAVs in rice fields.