Social media has become an indispensable part of our daily lives in recent times. On social media, users commonly express their thoughts and opinions by sharing a substantial number of reviews and feedback. Twitter is one of the social media platforms with the best growth, and it also serves as a news and business tool. This study proposed the ReLU based Gated Recurrent Unit (ReLU-GRU) for Twitter sentiment analysis to classify the emotions like fear, anger, joy, and sadness. Covid-19, Sentiment-140 and twitter emoji datasets are used in this research to conduct the analysis. First, a pre-processing step using tokenization, stemming, adding part of speech, and punctuation removal is carried out using the collected datasets. Then, using Bag of Words (BoW), Latent Dirichlet Analysis (LDA), Term Frequency, and Inverse Document Frequency (TF-IDF), the processed data is employed for feature extraction. The next stage is to choose the best features for accurate classification which is carried out by using the proposed Improved Atom Search Optimizer (ASO) and a Simulated Annealing (SA) method. Finally, in the classification stage, ReLU-GRU is proposed for classifying the chosen features into various classes. From the outcomes, it evidently shows that proposed ReLU-GRU has outperformed existing methods by obtaining 97.87% and 96.52% of accuracy on Covid-19 and Sentiment-140 datasets.INDEX TERMS Improved atom search optimizer, simulated annealing, ReLU based gated recurrent unit, sentiment analysis, twitter datasets.