Significant progress has been made in flood prediction through the development of intelligent data-driven models. However, most existing approaches rely solely on hydrogeological data, ignoring scientific knowledge of flood dynamics during the training process. Consequently, these models often struggle to detect flood events effectively, becoming biased toward non-flood conditions, achieving reasonable accuracy but limited effectiveness in detecting flood peak events. Therefore, this study proposes a composite data-driven model guided by expert knowledge of flood events through a modified Huber loss function for improved flood forecasting. The model integrates a time-distributed approach and a spatial attention mechanism to capture complex spatial dependencies, while temporal features are extracted using a combination of long short-term memory (LSTM) and temporal convolutional networks (TCN) equipped with a temporal attention module. Furthermore, expert knowledge is incorporated directly into the loss function, allowing the model to prioritize accurate flood peak prediction during training. The framework was evaluated using 6-hourly hydrometeorological data from Changhua, Heihe, and Tunxi basins in China, with a focus on flood peak forecasting. Results demonstrate that the knowledge-guided loss function outperforms conventional mean squared error (MSE) and standard Huber loss. Compared to baseline models -including convolutional neural network (CNN), long short-term memory (LSTM), convolutional LSTM (ConvLSTM), temporal convolutional network (TCN), spatial-temporal attention LSTM (STA-LSTM), Informer, and time-distributed CNN-LSTM (TD-CNN-LSTM)- the proposed model improves mean absolute error (MAE) by 6.9-25 %, 27.7-88 %, and 10.8-52 %, while reduces root mean square error (RMSE) by 2.5-19.3 %, 14.3-73.4 %, and 14.6-37.1 % across three basins, respectively.