Fake Currency Detection Using AI and Python

Fake Currency Detection Using AI and Python


๐Ÿ’ต Fake Currency Detection Using AI and Streamlit

Have you ever wondered if that โ‚น500 note in your wallet is real or fake? Counterfeit currency is a growing concern worldwide, especially in countries like India where the economy relies heavily on cash transactions. Fortunately, with advancements in AI, we can now automate the detection of fake currency using smart image analysis techniques. In this blog post, weโ€™ll explore how to build a Fake Currency Detection app using Streamlit, Google’s Gemini AI, and a touch of Text-to-Speech magic!


๐Ÿ” What Does the App Do?

This web-based application allows users to upload an image of a currency note and instantly get a detailed analysis:

  • Identifies whether the note is original or counterfeit
  • Extracts the amount and serial number from valid notes
  • Provides insights in five Indian languages โ€“ English, Hindi, Marathi, Gujarati, and Kannada
  • Uses Google Gemini (Generative AI) for intelligent image interpretation
  • Reads out the result with pyttsx3 text-to-speech

๐Ÿง  Technologies Used

  • Python
  • Streamlit โ€“ for the web interface
  • Google Generative AI (Gemini) โ€“ for smart image analysis
  • Pyttsx3 โ€“ to convert the analysis into speech
  • Pathlib โ€“ to handle file operations

โš™๏ธ How It Works

Here’s a breakdown of how the app functions:

  1. Upload an Image
    The user uploads a picture of the currency note in JPEG, PNG, or JPG format.
  2. Image Processing + AI Prompt
    The image is sent to Google Gemini with a carefully crafted prompt. The prompt includes:
    • A request to analyze the note for authenticity
    • A multilingual breakdown (English, Marathi, Hindi, Gujarati, Kannada)
    • Extraction of the currency amount and serial number if the note is genuine
  3. AI Response Displayed
    The response from Gemini AI is shown on the screen and also spoken aloud.
  4. Safety & Moderation
    Safety settings are applied to block inappropriate content, ensuring a secure and ethical user experience.

๐Ÿ“ฆ Key Code Highlights

# Upload and analyze image
uploaded_file = st.file_uploader("Upload the currency note image", type=["png", "jpg", "jpeg"])
submit_button = st.button("Generate the Analysis")

if submit_button and uploaded_file is not None:
    image_data = uploaded_file.getvalue()
    image_parts = [{"mime_type": uploaded_file.type, "data": image_data}]
    
    # Prompt for AI model
    prompt_parts = [image_parts[0], system_prompt]
    response = model.generate_content(prompt_parts)
    
    # Display and speak the result
    analysis_text = response.text
    st.write(analysis_text)
    engine = pyttsx3.init()
    engine.say(analysis_text)
    engine.runAndWait()

๐Ÿ“ท A Glimpse of the UI

The app starts with a simple layout:

  • An image upload box
  • A submit button
  • An area to display AI-generated results

The currency analysis is powered by Gemini, ensuring high accuracy and efficiency.


This Fake Currency Detection tool demonstrates the power of combining AI and user-friendly web technologies to solve real-world problems. With just an image, users can verify currency and gain insights in multiple Indian languagesโ€”making it accessible and impactful.

Whether youโ€™re a developer or someone curious about AI applications, this project is a great start into the world of image-based generative intelligence.


image-10 Fake Currency Detection Using AI and Python
image-11-1024x857 Fake Currency Detection Using AI and Python

fake currency detection github,
fake currency detection using machine learning,
fake currency detection project,
fake currency detection dataset,
fake currency detection using image processing,
fake currency detection research papers,
fake currency detection using deep learning,
fake currency detection kaggle,
fake currency detection machine,
fake currency detection using matlab,
fake currency detection online,
free fake currency detection,
fake currency detection app,

Share this content: