This research paper presents a proactive approach to congestion control in IoT networks using an encoder–decoder LSTM (ED-LSTM) model to predict packet loss ratios ahead of time. By forecasting congestion before it affects applications, gateways can dynamically adjust transmission rates, priorities, and protocols to maintain quality of service (QoS). Tested on realistic simulations (Cooja/Contiki with 6LoWPAN, RPL, CoAP), ED-LSTM outperforms other models like LSTM, GRU, and CNN in prediction accuracy (RMSE). Applications span healthcare, industrial IoT, and smart cities, offering benefits like reduced retransmissions, better SLA compliance, and lower infrastructure costs. The proposed edge/cloud integration enables scalable deployment without overhauling existing protocols.