To address low detection accuracy and poor small-object detectability in unmanned aerial vehicle (UAV) image object detection, this paper proposes an edge-guided dual-branch feature optimization network (ED-DETR) based on real-time detection transformer (RT-DETR). First, a dual-branch feature extraction and aggregation unit (DFEA) is designed, which extracts high-frequency texture and low-frequency structure features separately to avoid feature overlap loss, with reparameterization technology ensuring network lightweighting. Second, an edge-guided dual-branch feature extraction and aggregation (EDFEA) module is proposed by integrating an edge-guided unit into DFEA to enhance small-target detection via edge feature perception. Finally, a hybrid loss function (Mal-Shape) is constructed by combining Mal loss and ShapeIoU loss, boosting bounding box matching robustness and enabling precise small-object localization in complex scenarios. Experiments show ED-DETR outperforms the baseline by 3.7%, 1.2%, and 1.6% in on VisDrone, RSOD, and UAVDT datasets, respectively, with comparable computational complexity, validating its effectiveness for UAV small-object detection.