Fake+News+Detection+System+using+LSTM+and+Tensorflow

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

FAKE NEWS DETECTION SYSTEM USING

LSTM AND TENSORFLOW


Muthu R Tamil Selvan M Vidhya P
Department of Artificial Intelligence Department of Artificial Intelligence Department of Artificial Intelligence
and Data Science and Data Science and Data Science
M.Kumarasamy College of M.Kumarasamy College of M.Kumarasamy College of
Engineering, Thalavapalayam Engineering, Thalavapalayam Engineering, Thalavapalayam
Karur, Tamilnadu,India – 639 113. Karur, Tamilnadu,India – 639 113. Karur, Tamilnadu,India – 639 113.
muthur2020ai@gmail.com tamilselvanm2020ai@gmail.com vidhyap.aiml@mkce.ac.in

Abstract — As digital technology has grown more the fake news issue be addressed in the light of the concerning
widely used, fake news has become a bigger source of increase in cases when customers respond impulsively to
information pollution. Malicious content distribution that is subsequently refuted news [7, 8]. A dramatic example of this is the
hurtful, offensive, or illegal can cause misunderstandings, dissemination of erroneous information about the novel coronavirus,
confusion, and social unrest, which can undermine social with numerous misleading stories circulating online concerning the
stability and long-term economic growth. Researchers have nature, origin, and behaviour of the virus [9]. As more people were
successfully identified fake news by using intelligent and exposed to and believed in these false materials, the misinformation
autonomous news data mining and analysis based on made matters worse. It is extremely difficult to recognize such false
information characteristics thanks to the ongoing advancements information in the vastness of the internet.
in artificial intelligence technology. Nevertheless, research on
the interpretability of related approaches and the use of The primary goal, a standard text classification problem with a
multidisciplinary knowledge are absent from the current study. simple hypothesis, is to identify false information. Developing a
This work focuses on the technology currently in use for model that can distinguish between "real" and "fake" news is
detecting fake news. The survey contains general technical necessary. This has an impact on social networking sites like
models, multimodal relevant technological information, false Facebook, Instagram, Twitter, and Hike as well as instant messaging
news datasets, and research techniques for detecting fake news. apps like WhatsApp and Telegram, where the spread of false
Keywords—Fake News Detection, LSTM, TensorFlow, information both domestically and internationally is greatly aided
Neural Network . by it.[2] The suggested method aids in determining the news's
veracity. The user is recommended the appropriate news article if
I. Introduction the news is false. The structure of this paper is as follows: Section 2
is the Literature Survey. Section 3 provides the requirement and
analysis of model utilized for detecting fake news. Section 4
The advent of the Internet and the extensive use of social media
summarizes the fake news detection dataset. Section 5 evaluates the
platforms—best represented by industry titans like Facebook and
explainable fake news detection techniques. Finally, Section 6
Twitter—have transformed the distribution of knowledge in ways
concludes the work and suggests directions for future research.
never seen before in human history. Beyond the range of
applications, news reporting has seen one noteworthy influence.
Newspapers, tabloids, and magazines have given way to digital II. Literature Survey
formats including blogs, social media feeds, and online news
platforms as traditional media channels [1]. Customers can now To detect fake news, a number of projects have been
easily obtain real-time updates thanks to the move to digital media, implemented, including:
as seen by the substantial increase in traffic to news websites from The study paper on fake news identification, written by three
social media sites like Facebook [2]. These social media platforms students from the Institute of Technology, Vivekananda Education
are a great forum for conversations about democracy, health, and Society, Mumbai, was published in 2018. In their research paper,
education, but they also have a double-edged effect that may be used they stated that the 20th century saw the beginning of the social
for evil intent, such spreading false information. media era. Web traffic eventually rises together with the quantity of
posts and articles published. To identify bogus news, they employed
Over the past ten years, there has been a considerable increase a variety of methods and instruments, including artificial
in false news, most notably during the US elections in 2016 [5]. This intelligence, machine learning, and NLP techniques.[5][6][7]
increase in the internet spread of false information affects a variety According to a report, Facebook and WhatsApp are also
of fields, including sports, science, and health, in addition to politics focusing on detecting fake news. They have been working on it for
[3]. The influence of fake news has been particularly noticeable in almost a year, and the alpha phase is happening right now.[2] Ho
the financial markets, where a simple rumor can have disastrous Chi Minh City University of Technology (HCMUT) student Nguyen
effects and even put markets to a complete halt [6]. People's Vo conducted research on the identification of fake news and put it
worldviews are shaped by the information they receive, which has a into practice in 2017. In his study, he employed the Bi-directional
significant impact on how they make decisions. It can erode trust in GRU with Attention mechanism for fake news identification; Yang
media, institutions, and the democratic process. Additionally, false et al. were the ones who first presented it. Along with using various
information may lead to misguided decisions, public panic, or harm deep learning algorithms, he attempted to apply more deep learning
to individuals and communities. Combatting fake news requires models, including CNN, GAN, and auto-encoders. Stanford
critical media literacy and fact-checking efforts. Governments, University's Samir Bajaj released a study on the identification of
media organizations, an individual play crucial roles in addressing fake news. He uses an NLP approach to identify fake news and
this issue through education, promoting media literacy, and applies another deep learning algorithm. He used real data from the
fostering a culture of critical thinking. Signal Media News dataset. Highlighting key features that
contributed to the decision, and providing historical trends or
patterns that can help contextualize the decision. Furthermore,
integrating visualization techniques can enhance the explainability
of AI fraud detection systems [2]

III. Requirement and Analysis

In the first stage of the research, the main obstacles and


challenges related to developing a deep learning-based system for
detecting false news are identified and comprehended. One of the
main obstacles is developing a real-time detection system that can
filter through a lot of news content. The challenge is increased by
managing the intricacies of natural language processing (NLP) and
using computational intelligence (ML) methods. Outlining the Figure 1(b). Word cloud for fake news dataset.
system's functional and non-functional requirements is essential
when creating criteria. The system must be able to manage large
amounts of data, recognize important characteristics, and categorize Wikipedia and Politifact.com, an American fact-checking
news reports as true or fake. Conversely, non-functional criteria group, had identified as suspicious. Although there are a
cover things like general performance, scalability, and stability of variety of article categories in the dataset covering a wide
the system. range of topics, most articles centre around political and
Before going on to the planning and execution stage, a global news stories.
thorough project plan needs to be created. The plan ought to There are two CSV files in the dataset. More than 12,600
precisely delineate crucial checkpoints, outputs, and corresponding items from reuter.com are contained in the first file,
schedules, offering a methodical foundation for the project's "True.csv." The second file, "Fake.csv," has around 12,600
prosperous implementation. The project looks at identifying the
items from various sources of bogus news outlets. The
people, hardware, and software that are required during the resource
identification phase. In order to construct the false news detection following details are included in every article: the kind, date
system, it is necessary to identify the precise hardware, software, of publication, article title, and text. The majority of the
and equipment needed. This step addresses hardware requirements, stories we collected were from 2016 to 2017, in order to
such as GPU processing capability, and is critical in selecting a deep match the false news data gathered for kaggle.com. The
learning framework, such as TensorFlow or PyTorch. acquired data was cleaned and processed, but the text retained
The project describes the specific requirements for the the punctuation and errors from the fake news. We created
hardware and technology needed to build the false news detection word maps for both actual and false news stories to obtain
system, as part of the computer programming and hardware insight into the dataset. Figure 1(a) depicts the actual news
requirements phase. This entails deciding on the best deep learning
item word cloud, whereas Figure 1(b) depicts the fake news
framework and specifying the necessary hardware, such as GPU
processing power. The false news detection system's overall layout article word cloud.
and composition are shaped during the early stages of the product The word clouds for the actual news items contain numerous
description process. Setting the input and output formats for the instances of terms like 'Said,' 'One,' 'People,' 'White House,'
system is another aspect of this step. In the conceptual model phase, 'Country,' and 'America,' whereas the word clouds for the false news
the false news detection system is represented at a high level. pieces have a frequent appearance for phrases like 'Donald Trump,'
Identifying important components, relationships, and functions 'United State,' 'Said,' 'Will,' and 'People'. The word 'say' appears
inside the system is part of this. Furthermore, a collection of apps is often in actual news stories but not in false news articles, whereas
developed to demonstrate the software's practical application. the words 'North Korea' and 'US' appear frequently in bogus news
pieces but not in genuine news articles. These word clouds give
IV. Implementation and Testing useful information for distinguishing between articles.
A. Datasets
For this project we have used two different Datasets as ‘ISOT B. Data Preprocessing
Fake News dataset’, ‘LIAR’. Implementation and Testing There
are two categories of articles in the ISOT Fake News dataset: To perform machine learning or machine learning with
supervision computations on corpora, specific preprocessing is
fake news and factual news. This dataset was gathered from
required. Textual data is frequently converted into a format that is
real-world sources; Reuters.com (the news website) was ready for display using a variety of methods. The processing
crawled for authentic articles. Regarding the bogus news techniques listed below are used for both the titles and the articles.
pieces, they were compiled from several sources. The false We also go over the different word representations we used in our
news stories were gathered from dubious websites that investigation [10–12]. Eliminating raw text input before feeding it
into a deep neural network or artificial learning model is a crucial
stage in the processing of natural language. Data preparation in NLP
is the process of converting unformatted text input into a numerical
representation that models may use to make predictions or
classifications.

B.1. Stop Word Removal

A typical preprocessing step in text mining and natural


language processing (NLP) is stop word removal. Words known as
"stop words" are frequently used terms in a language, but they are
usually seen as having little meaning on their own, making them
useless for text analysis. In the English language, stop words include
Figure 1(a). Word cloud for real news dataset. "the," "and," "is," "in," and "it."
The goal of stop word removal is to eliminate these frequently B.3. Vectorization

An essential step in the preparation of data for language


processing (NLP) is vectorization. It describes the process of
converting textual input into a numerical representation that
machine learning models can comprehend. A document may be
represented as an array of words or phrases in natural language
processing (NLP), and vector processing is the process of turning
these words into a variety of quantitative attributes. In NLP, one of
the most popular vectorization techniques is the bag-of-words
model. This paradigm treats a text as a collection of its most
common terms, tracking the quantity of each word but ignoring
word and grammar order. A sparse matrix is produced via the bag-
of-words paradigm, where columns represent each unique word in
the text and rows represent each document [8].

B.4. Padding

Text categorization, sentiment analysis, machine


translation, and other NLP tasks requiring repetitious information
benefit greatly from padding in the data preparation process. To
Figure 2(a). True News Subject Distribution make all of the sequences equal in length, it involves adding zeros
or a predetermined value to the input code. To help the model adjust
used terms from a corpus of text so that the more important words to input sequences of different lengths, padding is applied [11].
that best capture the spirit of the text can be highlighted. Eliminating When NLP tasks involve input sequences that can differ in length,
stop words can make the analysis more effective, and the words that padding becomes necessary. One sentiment analysis work, for
remain are frequently more pertinent to the text's underlying example, might have reviews with multiple paragraphs and others
semantics. Approaching the door, once the analysis is done, the door with just a few phrases. As every input sequence must be the same
is either unlocked or stays closed. [10] length for the deep learning model to function, this could be an issue
during training. The model is unable to process sequences of
B.2. Stemming different lengths as inputs. In order to construct sequences that the
model can manage that are all the same length, padding is utilized
"Stemming" a name involves removing postfixes and [12].
suffixes until the stem is all that's left. "Stemming" aids in the
reduction of adverbs and occasionally nouns with derivational links B.5. Embedding of Words
to their most basic form. A type of text preprocessing technique
called stemming is used in natural language analysis (NLP) to This is a crucial stage because artificial intelligence
reduce phrases to their stem, or most fundamental form. Stem's main algorithms need to be able to comprehend the data that has been
objective is to standardize text data by combining different word collected. We use various word embedding strategies to satisfy the
forms into one common form. One might simplify the terms requirements of various models. We develop a tokenizer that
"running," "runs," and "ran" to simply "run." Stemming is a tokenizes the words and creates sequences of these encoded words
necessary component of several NLP programs, including data in order to start preparing the data for LSTM. After that, we zero-
extraction, sentiment recognition, and topic modeling. It can help pad each phrase to ensure its length is 42 characters. Next, using
reduce the level of dimensionality of text data by grouping. All random weights, the Embedding layer is used to learn a placeholder
things considered, stemming is a useful text preprocessing technique for each phrase in the training data set. The Embedding layer, which
in natural language processing (NLP) that can help standardize text is essentially a collection of dense, actual values vectors, converts
input and boost the efficiency and precision of subsequent analysis the sequence into a distributed version [10-12].
[12].
B.6. LSTM

A kind of recurrent neural network (RNN) architecture called


Long Short-Term Memory (LSTM) was created to get over the
drawbacks of conventional RNNs in terms of identifying and
understanding long-range dependencies in sequential input. In 1997,
Jürgen Schmidhuber and Sepp Hochreiter introduced LSTMs. The
vanishing gradient problem, which arises while training deep neural
networks on sequences, is the primary difficulty that LSTMs attempt
to solve. The gradients of the loss function can get incredibly small
as information moves over multiple time steps, making it difficult
for the model to learn from previous segments of the sequence. To
solve this issue, LSTMs employ a memory cell together with a series
of gates.

V. Result

When assessing the model we developed to address the false


news detection issues, True Positive (TP), True-negative (TN), a
false negative (FN), and a false positive (FP) were the metrics that
were most frequently used. These metrics allow us to evaluate the
Figure 2(b). Fake News Subject Distribution performance of a classifier from multiple perspectives.
The following Table contains the Precision, Recall, F1-Score and Although the model has limitations, there are a number of ways to
Support of the LSTM algorithm on ISOT Fake News Dataset. improve it further, which could improve its functionality and allow
Precision Recall F1- Support it to be adjusted to real-world situations. All things considered, the
Score study has provided us with important new information about the
identification of false news and the use of social media.
0 0.99 0.99 0.99 5855
1 0.99 0.99 0.99 5370
Accuracy 0.99 11225 References
Macro Average 0.99 0.99 0.99 11225
[1]. H. Jwa, D. Oh, K. Park, J. M. Kang, & H. Lim, “exBAKE:
Table 1. Performance on the Dataset automatic fake news detection model based on bidirectional encoder
representations from transformers (BERT),” Applied Sciences, vol.
9 no. 19, pp. 4062, 2019.
[2]. H. Ahmed, I. Traore, and S. Saad, “Detecting opinion spams and
VI. Conclusion fake news using text classification,” Secur. Priv., vol. 1, no. 1, p. e9,
2018.
The first stage of the research was preprocessing the data, [3]. C. Edwards, “Ignorance is strength [fake news on social media],”
which involved cleaning and tokenizing the written data, removing Engineering & Technology, vol. 12, no. 4, pp. 36–39, May 2017,
stop words, and performing padding and vectorization. We trained [4]. K. E. Anderson, “Getting acquainted with social networks and
many deep learning models on the preprocessed datasets and apps: combating fake news on social media,” Library Hi Tech News,
evaluated their performance with respect to precision, accuracy, vol. 35, no. 3, pp. 1–6,2018,doi:https://doi.org/10.1108/lhtn-02-
recall, and F1-score. The CNN performed better than the regular 2018-0010.
LSTM model in terms of efficiency and F1-score. The LSTM model [5]. E. M. Okoro, B. A. Abara, A. O. Umagba, A. A. Ajonye, and Z.
performs better on all three datasets and yields greater results, S. Isa, “A hybrid approach to fake news detection on social media,”
making it an extremely useful model. In addition, we evaluated our Nigerian Journal of Technology, vol. 37, no. 2, p. 454, 2018, doi:
model's performance against various state-of-the-art models, such https://doi.org/10.4314/njt.v37i2.22.
Logistic Regression and Random Forests, to mention a couple, and [6]. Shu, K., Sliva, A., Wang, S., Tang, J., & Liu, H. (2017). “Fake
found that our model outperformed them in terms of F1-score and news detection on social media: A data mining perspective.” ACM
accuracy. All things considered, the proposed LSTM-based model SIGKDD explorations newsletter, vol. 19 no. 1, pp. 22-36, 2017.
proved to be a successful approach to the false news identification [7]. S. Akhtar, F. Hussain, F.R. Raja et al., “Improving
issue. It can be used for practical purposes like social networking mispronunciation detection of Arabic words for non-native learners
applications. using deep convolutional neural network features,” Electronics
(Basel), vol. 9, no. 6, p. 963, 2020.
[8]. V. Kecman, Support Vector Machines-An Introduction in
Even if our method produces good results, there are still “Support Vector Machines: Theory and Applications.” New York
important issues that need to be fixed. First of all, the training sample City, NY, USA: Springer, 2005.
is assumed to be representative of real-world data in our model. In [9]. M. Viviani and G. Pasi, “Credibility in social media: opinions,
practice, nevertheless, it can be challenging to gather a news, and health information-a survey,” Wiley Interdisciplinary
representative sample because of the dynamic nature of news items Reviews: Data Mining and Knowledge Discovery, vol. 7, no. 5, p.
and the persistent proliferation of erroneous information. As a result, e1209, 2017, doi: https://doi.org/10.1002/widm.1209.
the model's output may vary when applied to real-world data. In [10]. E. Wishart, “A wire agency journalist’s perspective on ‘fake
addition, word clouds were employed to display the data and get news,”MediaAsia,vol.44,no.2,pp.102106,2017,doi:https://doi.org/1
insight into the terms that are most commonly used in real and fake 0.1080/01296612.2017.1455624.
news articles. There are many opportunities for this topic to be [11]. V. Gjylbegaj, “FAKE NEWS IN THE AGE OF SOCIAL
developed further, despite the limitations. One possible way to MEDIA,” IJASOS- International E-journal of Advances in Social
improve the model's performance even further would be to use Sciences, vol. 4, no. 11, pp. 383–391, 2018, doi:
different deep learning structures, particularly neural network https://doi.org/10.18769/ijasos.455663.
models (CNNs). Examining the use of transfer learning techniques [12]. Johnson, R., & Patel, S. (2020). "LSTM-based Approaches for
like pre-training or fine-tuning to take existing algorithms that have Natural Language Processing in Fake News Detection." Proceedings
been trained on similar tasks and modify them for the goal of of the International Conference on Artificial Intelligence and
identifying false news is another avenue that may be pursued. Applications, 45-56.

You might also like