Accurate vessel speed prediction is essential for maritime traffic supervision, navigational safety, and intelligent coastal management. However, due to the nonlinear, time-varying, and context-dependent characteristics of vessel motion in nearshore waters, conventional single-model approaches often fail to provide sufficiently accurate forecasts. To address this issue, this study proposes a hybrid deep learning framework for AIS-based nearshore vessel speed prediction and risk warning, integrating a temporal convolutional network (TCN), an attention mechanism, and a bidirectional long short-term memory network (BiLSTM) into a unified architecture. In the proposed framework, TCN is used to extract local temporal patterns and multi-scale sequence features from historical AIS observations, the attention mechanism is introduced to adaptively emphasize informative representations, and BiLSTM is employed to model bidirectional contextual dependencies in vessel motion sequences. On this basis, a speed-risk warning process is constructed by combining the predicted speed with electronic-fence threshold constraints. Experiments conducted on real AIS data from coastal waters show that the proposed method outperforms several benchmark models in terms of mean absolute error (MAE), mean squared error (MSE), root mean square error (RMSE), and coefficient of determination (R2). The results demonstrate that the proposed framework can effectively improve vessel speed prediction accuracy and provide practical support for proactive maritime supervision and nearshore safety management.