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:
-
- Upload an Image
The user uploads a picture of the currency note in JPEG, PNG, or JPG format.
- Upload an Image
-
- 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
-
- Image Processing + AI Prompt
-
- AI Response Displayed
The response from Gemini AI is shown on the screen and also spoken aloud.
- AI Response Displayed
-
- Safety & Moderation
Safety settings are applied to block inappropriate content, ensuring a secure and ethical user experience.
- Safety & Moderation
📦 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.
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,
Post Comment