Drug–target interaction (DTI) prediction is a critical step in drug discovery, and accurate prediction of potential interactions can significantly accelerate the drug-development process. Although deep-learning approaches have achieved promising performance in DTI prediction, two challenges remain: single models often fail to comprehensively capture heterogeneous sequence information, resulting in limited stability and generalization, while insufficient integration of local and global features restricts interaction representation. To address these limitations, we propose HFEDTI, a DTI prediction model that integrates hierarchical feature fusion and weighted ensemble learning. Specifically, a residual convolutional neural network (ResCNN) is employed to extract local structural features of drugs and targets, while a self-attention-based hierarchical bidirectional long short-term memory network (SAHBiLSTM) captures global contextual dependencies. Furthermore, a hierarchical heterogeneous attention mechanism is introduced to align and fuse multi-level cross-modal representations, and a weighted ensemble strategy based on validation performance ranking is developed to enhance model robustness and generalization. Experimental results on three benchmark datasets demonstrate the effectiveness of HFEDTI. On the DrugBank dataset, HFEDTI achieves an AUC of 0.9238 and an AUPR of 0.9327, improving the best-performing baseline by 0.90 and 1.40 percentage points, respectively. Moreover, HFEDTI consistently achieves strong performance on the C. elegans and Human datasets, further validating its effectiveness and generalization capability for DTI prediction.