In this study, we address the challenges of counting cattle in large pasture areas using Unmanned Aerial Vehicles (UAVs) equipped with high-resolution cameras. Traditional manual counting methods are laborious and error-prone, while existing automated approaches struggle with duplicate animal detection. To overcome these limitations, we propose a novel graph-based method that incorporates multiple-attributes, including velocity, direction, state (lying down or standing), color, and distance, to improve duplicate removal and counting accuracy. We conducted extensive experiments involving automated hyper-parameter learning to effectively integrate these attributes into our method. By employing a Ford–Fulkerson graph algorithm, we detect and remove duplicated cattle based on their multiple attributes. An ablation study validates the contribution of each attribute. Additionally, we provide new datasets of drone images captured in large pastures to support research in this field. Our results demonstrate that our proposed method outperforms state-of-the-art techniques, achieving an average percentage error of 2.34%. Comparisons with mosaic-based and other graph-based methods validate the effectiveness of our approach, which contributes to more efficient cattle counting practices and enhances livestock management in agriculture.