Traditional human resource allocation methods often rely on empirical judgments and lack the support of scientific quantitative analysis, making it difficult to find a balance between cost control and benefit maximization. Aiming at the cost-benefit balance problem in hospital human resource allocation, this study proposes a multiobjective optimization model based on the improved NSGA-II algorithm. By introducing the cosine similarity to adjust the congestion distance ranking, the multi-objective decision-making model with the objectives of minimizing human resource costs and maximizing project benefits is constructed, and the multi-dimensional chromosome coding and adaptive parameter selection strategy are used to solve the problem. An empirical study is conducted in three departments of respiratory medicine, neurology and orthopedics in a hospital, and the results show that the improved algorithm reduces the human resource cost by 6.81% to 23.90%, improves the project benefit by 10.95% to 41.07%, and converges to the optimal distance of about 20 at the 150th iteration cycle. Compared with the traditional NSGA-II algorithm, the improved algorithm shows significant advantages in both Pareto frontier quality and convergence performance, and provides an effective quantitative analysis method for the dynamic optimization of hospital human resources.