Skip to main content

Truth Lens: A Multi-Layer AI-Powered Fake News and Spam Detection System Using Machine Learning Wiki

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

Truth Lens: A Multi-Layer AI-Powered Fake News and Spam Detection System Using Machine Learning Wikipedia Cross-Verification, and Large Language Models

¹²³´ Department of Computer Science and Engineering, CMR University, Bengaluru, Karnataka, India µ Assistant Professor, Department of Computer Science and Engineering, CMR University, Bengaluru, Karnataka, India ***

Abstract In the modern digital information environment, the rapid spread of fake news and spam messages creates significant risks to public communication, financial security, and trust in institutions. Many existing detection systems rely on single-layer approaches that limit accuracy and adaptability. This paper proposes TruthLens, a multi-layer artificial intelligence framework that integrates Machine Learning (ML), Wikipedia-based fact verification, and Large Language Model (LLM) analysis for reliable misinformation detection. The machine learning layer employs a Logistic Regression model trained on TFIDF features extracted from 44,898 labeled news articles. Experimental evaluation achieves 97.2% accuracy for fake news classification and 98.5% accuracy for spam detection. A Wikipedia API layer performs real-time fact validation using cosine similarity, while the Groq LLaMA-3.3-70B modelgenerateshuman-readableexplanationsfordetection results. Results from all detection modules are aggregated through a confidence-based decision process to produce the final system verdict. The system is implemented as a Flaskbased web application supporting REST APIs, PDF report generation, search history, and GDPR-compliant data handling.

Keywords Fake News Detection, Machine Learning, Natural Language Processing, Spam Detection, Artificial Intelligence.

1. INTRODUCTION

News consumption has significantly transitioned from traditional printandbroadcastmediatodigital platforms, greatly increasing the speed and scale of information dissemination. Although this transformation improves global access to information, it also enables the rapid circulationoffake,misleading,andintentionallyfabricated content. Empirical studies consistently demonstrate that false information spreads faster and reaches wider audiencesthanverifiednews,primarilybecauseitexploits emotionaltriggerssuchasoutrage,fear,andconfirmation bias[1].

This issue becomes particularly serious during major societal events such as elections, public health crises, and

social movements, where misinformation can influence public perception, trigger social unrest, and produce realworld consequences. Concurrently, spam SMS messages contribute to financial fraud worth billions of dollars annually, targeting mobile users with deceptive promotionsandphishingcampaigns.

Mostexistingautomateddetectionsystemsrelyonasingle analysis layer, which limits their ability to handle adversarial content and complex contextual information. TruthLens addresses this gap by integrating three independent,complementarydetectionmechanismsintoa unified,production-readypipeline.

1.1 Key Contributions

ThemaincontributionsoftheproposedTruthLenssystem aresummarizedbelow:

 Multi-Layer Detection: A three-layer architecture integrating machine learning classification, real-time Wikipediafactverification,andlargelanguagemodel–generated explanations, fused by a confidenceweightedcombinationengine.

 High Accuracy Without GPU: 97.2% fake news accuracy and 98.5% spam accuracy using Logistic Regression and TF-IDF, deployable on standard CPU hardwareinunder5ms.

 ExplainableVerdicts:GroqLLaMA3.370Bgeneratesa natural language explanation for every detection decision, resolving the black-box limitation of traditionalclassifiers.

 Full-Stack Deployment: Complete web application withFlaskRESTAPI,PDFreportexport,Search functionality, search history, usage analytics, and GDPRcompliantdatamanagement.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

2. LITERATURE REVIEW

2.1 Machine Learning for Fake News Detection

Initial studies in fake news detection applied traditional machine learning techniques, including Naïve Bayes and Support Vector Machines, with bag-of-words feature representations, achieving performance ranging from 85% to 93% accuracy on benchmark datasets [2]. The introduction of TF-IDF representations improved results by assigning discriminative weights to terms rare across the corpus. Wang [3] introduced the LIAR benchmarkdatasetanddemonstratedthattextual cues word choice, sentence complexity, and emotional tone serveasreliableindicatorsofmisinformation,establishing the foundational importance of linguistic feature engineering.

2.2 Knowledge-Base and Wikipedia Verification

Popat et al. [4] demonstrated the value of external knowledge bases for claim verification. Thorne et al. [5] formalised this in the FEVER shared task, showing that Wikipedia cross-referencing via retrieval and textual entailmentcanvalidatefactualclaimswithhighprecision. This directly motivates TruthLens’s Wikipedia cosine similarity layer, which extends these insights to real-time API-based verification without requiring a trained entailmentmodel.

2.3 Large Language Models

Transformer-based modelssuchasBERTachieve nearhumanaccuracyonfakenewsbenchmarks;however,their GPU dependency and high inference latency (500 ms+) makethemimpracticalforreal-timewebAPIs.Lewisetal. [6] introduced Retrieval-Augmented Generation (RAG), demonstratingthatgroundingLLMresponsesinretrieved factual context prevents hallucinations. TruthLens combinesthespeedoftraditionalMLwithLLM-generated explanations via the Groq inference API, achieving the interpretability of modern LLMs without sacrificing latency.

3. PROPOSED SYSTEM

3.1

System Architecture

TruthLens is built upon a three-tier architecture ensuring modularity, scalability, and operational transparency. The architecture comprises a Presentation Layer (HTML/CSS/JavaScript frontend), an Application Layer (Python Flask REST API), and an Intelligence Layer (MLmodels,WikipediaAPI,GroqAI).

3.1.1 Presentation Layer

The client interface is developed using HTML5, CSS3, and JavaScript. Results are presented in a tabbed layout showing: (1) an overall verdict badge with confidence percentage, (2) ML analysis details, (3) Wikipedia verification evidence, and (4) the Groq AI narrative explanation. A PDF download button triggers server-side report generation. The interface is fully responsive for mobileaccess.

3.1.2

Application Layer

The Flask backend exposes 10 RESTful endpoints. The primary endpoint POST /api/analyze-full orchestrates all three intelligence layers and returns a fused verdict. Additional endpoints cover: fake-news-only detection, spam detection, Wikipedia-only verification, AI report generation, PDF export, history retrieval, usage statistics, and GDPR data deletion. All endpoints return JSON with consistentstatus,data,andmessagefields.

3.1.3 Data Layer

An SQLite database stores search history, session statistics,andPDFreportmetadata.Theschemaincludesa dedicatedprivacyendpoint(DELETE/api/privacy/deletedata) for GDPR compliance. Migration to PostgreSQL is plannedforproduction-scaleconcurrentdeployment.

Fig 1: ArchitectureoftheTruthLensDetectionModel

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

3.2 AI and Intelligent Features

3.2.1

Machine Learning Layer

Textpreprocessingapplieslowercaseconversion,URLand special-character removal via regex, and English stopword elimination. Title and article body are concatenated to maximise linguistic signal title-only models achieve ~89%accuracy;combinedtextachieves97.2%.

WeconfiguretheTF-IDFvectorizertoextractupto10,000 features, including single words and two-word combinations (ngram_range=(1,2)).Bigrams capture negation patterns (“not credible”) and compound phrases (“breaking news”) that unigrams miss. A Logistic Regression classifier (max_iter=1,000, solver=’lbfgs’) is trained on an 80/20 stratified split of 44,898 labelled articles. Because the spam messages form only 13.4% of the dataset, we set the spam classifier’s class_weight parameterto'balanced'tocorrectforthisimbalance.

Logistic Regression was selected over neural alternatives because it achieves competitive accuracy (97.2%) with sub-millisecond inference on CPU, produces calibrated probability outputs for confidence scoring, and is fully interpretableviacoefficientanalysis.

3.2.2 Wikipedia Cross-Verification Layer

The Wikipedialayervalidatesfactualclaimsagainstlive encyclopaedicknowledgeinfoursteps:

 Keyword Extraction: Up to four named entities are extracted via capitalisation heuristics, filtered by a skip-word set ({'Breaking', 'News', 'Today', ...}).

 Wikipedia Search: The Python wikipedia library calls the Wikipedia REST API to retrieve the first 500charactersofthetopresultperkeyword.

 Cosine Similarity: TF-IDF vectors are computed over the inputtext and Wikipedia content; cosine similarity is calculated between the two representations.

 Cosine similarity between the TF-IDF vector representations of the input text (A) and the retrievedWikipediacontent(B)iscomputedas:

 ThecosinesimilaritybetweenvectorsAandBis calculatedusingtheformula:

 Here, is the dot product of the two vectors, and and are their magnitudes.

 where (A · B) denotes the dot product of the two vectors and ||A|| and ||B|| represent their Euclideannorms

 Decision: Similarity ≥ 0.15 → Verified (factual alignment found). Similarity < 0.15 → Not Verified.

 The cosine similarity threshold of 0.15 was selected empirically after testing values between 0.05 and 0.30. A threshold below 0.10 produced excessive false positives, while values above 0.20 reduced recall for partially aligned factual content. The selected value of 0.15 provided the best precision–recall trade-off on validation samples.

3.2.3 Groq AI Language Model Layer

The Groq Cloud API (model: llama-3.3-70b-versatile) receives the preprocessed article text and returns a paragraph-length explanation identifying specific linguistic indicators of fake news (e.g., sensationalist language, lack of sourcing, emotional manipulation). This layerprovidestheinterpretabilitycomponentabsentfrom conventionalclassifiers[6].

3.2.4 Smart Combination Engine

Theengineappliesconfidence-weightedfusionlogic:(1) ML confidence 40–60%: Wikipedia verdict receives dominantweight;(2)MLconfidence>80%andWikipedia agrees:finalconfidenceiselevated;(3)MLandWikipedia disagree:confidenceisreducedandbothexplanationsare surfaced to the user. The Groq AI narrative is always includedregardlessofconfidencestate.

4. RESULTS AND PERFORMANCE ANALYSIS

The proposed TruthLens system was implemented using machine learning and natural language processing techniques to detect fake news and spam content. The proposed TruthLens system was implemented using machine learning and natural language processing techniques to detect fake news and spam content. The system processes input text through multiple analysis layers including machine learning classification, Wikipedia-based fact verification, and large language model explanation. Experimental evaluation shows that themodelachieveshighaccuracyinidentifyingmisleading newsarticlesandspammessages.Theintegrationofthese three independent components improves reliability by cross-verifying information before producing the final verdict. The results demonstrate that the system is capableofprovidingaccuratepredictionsalongwithclear explanations, making it suitable for real-time web applicationsandpublicuse.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

Fig 2(a): UserInterface-Part1

Fig 2(b): UserInterface-Part2

Fig 2(c): UserInterface-Part3

Fig 3(a): FakeNewsDetection-Part1

Fig 3(b): FakeNewsDetectionwithWikipediacross verification-Part2

Fig 4(a): SpamDetection-Part1

Fig 4(b): FakeNewsDetection-Part2

Fig 5: DetailedAnalysisOutputwithDownloadableReport

© 2026, IRJET | Impact Factor value: 8.315 | ISO 9001:2008 Certified Journal | Page2250

International Research Journal of Engineering and

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

4.1 Classification Performance

Table I presents classification metrics for both tasks on held-out test sets (20% split, stratified). Fake news evaluation: 8,979 test samples from the combined Fake and Real News dataset [8]. Spam evaluation: 1,114 SMS messagesfromtheUCISpamCollection[9].

requirements. Neural networks (LSTM, BERT) achieve marginallyhigheraccuracybutrequireGPUinfrastructure and 500 ms+ inference, making them unsuitable for realtimeRESTAPIdeployment.

4.3 API Latency Performance

Table III summarises average endpoint latency across 1,000simulatedrequests.

TABLE III APILatencyPerformance(Avgof1000 Requests)

The fake news confusion matrix records 4,521 true positives, 4,209 true negatives, 118 false positives, and 132falsenegatives confirmingbalancedbehaviourwith no systematic class bias. The near-equal false positive / falsenegativedistributioniscriticalforapublic-facingtool where both over- and under-flagging carry reputational consequences.

4.2 Algorithm Comparison

Table II compares five candidate algorithms on the fake newsdataset.

TABLE II AlgorithmComparisononFakeNewsDataset

No No

Logistic Regression achieves the optimal trade-off across accuracy, inference speed, interpretability, and hardware

Standard ML inference (< 5 ms model time) is dominated by network I/O in the 85 ms reported figure. Wikipedia verification (320 ms) reflects real-time external API calls. Groq AI inference (850 ms) is acceptable for an asynchronous result tab. Full three-layer analysis (1,100 ms) remains within interactive response thresholds for a moderation-focusedtool.

4.4 Layer Ablation Study

To analyse the contribution of each component, incremental ablation experiments were conducted. The standalone ML classifier achieves 97.2% accuracy on the full-length Fake and Real News dataset consisting of complete article body and title text. However, when evaluatedonshort-textinputsandheadline-onlysamples, theMLlayeraccuracyreducestoapproximately75%,due to limited contextual information. The Wikipedia layer alone achieves approximately 60% alignment accuracy as it relies solely on lexical similarity with external knowledge. Combining ML and Wikipedia improves robustness to approximately 85%. The complete threelayerTruthLensarchitectureachieves97.2%+accuracyby integrating probabilistic classification, factual verification, and LLM-based explanation, demonstrating complementarysignalcontributionfromeachlayer.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

5. DISCUSSION

TruthLens demonstrates that a carefully engineered ensemble of lightweight, interpretable components can match or exceed the accuracy of computationally expensive deep learning systems on this task. The architecture prioritises three real-world requirements that academic benchmarks often overlook: inference speed (< 5 ms ML core), hardware accessibility (CPUonly), and output transparency (confidence scores + naturallanguageexplanations).

TheWikipedialayerprovedparticularlyeffectiveforshort orambiguousinputs.Whenarticlecontentcontainsfewer than 30 words, the ML model produces borderline confidence scores due to insufficient linguistic patterns; the Wikipedia layer provides reliable secondary verification grounded in factual encyclopaedic content, partiallycompensatingforthisknownMLlimitation.

5.1 Limitations

Three limitations warrant acknowledgement. First, both training datasets are restricted to English-language content from 2016–2018, potentially limiting generalisation to multilingual content and post-2018 writing styles. Second, the Wikipedia cosine similarity threshold (0.15) was set empirically and may require domain-specific tuning. Third, SQLite is not suitable for high-concurrencyproductiondeployments.

6. CONCLUSION AND FUTURE SCOPE

ThispaperpresentedTruthLens,amulti-layerAI-powered system for fake news and spam detection that integrates classical machine learning, real-time knowledge-based verification,andlargelanguagemodel–drivenexplanation generation within a unified architecture. The proposed framework achieves 97.2% accuracy for fake news classification and 98.5% for spam detection while maintaininglow-latencyCPU-onlydeploymentsuitablefor real-timewebapplications.

Unlike single-layer detection systems, TruthLens demonstrates that combining probabilistic ML classification with external knowledge verification and natural language explanation significantly improves robustness and transparency. The confidence-weighted fusion mechanism enables balanced decision-making in ambiguous cases, reducing overconfidence while preservinginterpretability.

The experimental results confirm that lightweight models such as TF-IDF with Logistic Regression can achieve competitive performance without GPU-intensive deep learningmodels,makingthesystemaccessibleforscalable deploymentinacademicandindustrialsettings.

Future work will extend TruthLens toward proactive and large-scale misinformation monitoring. An automated detection mechanism will be developed to continuously analyse online news sources and social media streams, generating real-time notifications when high-confidence fakenewsorspamcampaignsareidentified.

Multilingual support, particularly for major Indian languages, will be incorporated to improve regional inclusivity. Additionally, training on larger and more recent datasets, including millions of news articles and social media posts, will enhance generalisation to emerging topics and evolving misinformation patterns. The hybrid architecture will be further optimised by strengthening the machine learning layer for recent and unknown content while refining Wikipedia-based verificationforhistoricalandestablishedfacts.

7. ACKNOWLEDGMENT

The authors sincerely thank the Department of Computer Science and Engineering, CMR University, Bengaluru, for providing the necessary support and infrastructure to carry out this research work. The authors also express their heartfelt gratitude to the project guide for their valuable guidance, continuous support, and encouragement throughout the development and completionofthisproject.Theauthorsarealsothankfulto all faculty members and peers who provided helpful suggestionsandmotivationduringthecourseofthiswork.

8. REFERENCES

[1] S. Vosoughi, D. Roy, and S. Aral, “The Spread of True and False News Online,” Science, vol. 359, no. 6380, pp.1146–1151,2018.

[2]K.Shu,A.Sliva,S.Wang,J.Tang,andH.Liu,"FakeNews Detection on Social Media: A Data Mining Perspective," ACM SIGKDD Explorations Newsletter, vol.19,no.1,pp.22–36,2017.

[3] W. Y. Wang, "Liar, Liar Pants on Fire: A New Benchmark Dataset for Fake News Detection," Proc. 55th Annual Meeting of the ACL, Vancouver, Canada, pp.422–426,2017introducedtheLIARdataset,which contains thousands of labeled short political statements used to evaluate fake news detection systems.

[4] K. Popat, S. Mukherjee, A. Yates, and G. Weikum, "DeClarE: Debunking Fake News and False Claims Using Evidence-Aware Deep Learning," Proc. EMNLP, pp.22–32,2018.

[5] J. Thorne et al., "The Fact Extraction and VERification (FEVER) Shared Task," Proc. First Workshop on FEVER,pp.1–9,2018.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 13 Issue: 03 | Mar 2026 www.irjet.net p-ISSN: 2395-0072

[6] P. Lewis et al., "Retrieval-Augmented Generation for Knowledge-IntensiveNLPTasks,"NeurIPS,2020.

[7] Scikit-learn Developers, "Scikit-learn: Machine Learning in Python," Journal of Machine Learning Research,vol.12,pp.2825–2830,2011.

[8] C. Bisaillon, “Fake and Real News Dataset,” Kaggle, 2020

[9] S. Vosoughi, D. Roy, and S. Aral, "The Spread of True and False News Online," Science, vol. 359, no. 6380, pp.1146–1151,2018.

[10]GroqInc.,“GroqCloudAPIDocumentation,”2025.

[11]T.A.Almeida,J.M.G.Hidalgo,andA.Yamakami,“SMS Spam Collection Data Set,” UCI Machine Learning Repository,2011.

2026, IRJET | Impact Factor value: 8.315 | ISO 9001:2008

Turn static files into dynamic content formats.

Create a flipbook
Truth Lens: A Multi-Layer AI-Powered Fake News and Spam Detection System Using Machine Learning Wiki by IRJET Journal - Issuu