Inspiration

Every year, countless pets go missing, causing immense distress to their owners and straining the resources of animal shelters. Witnessing this widespread issue and understanding the deep bond between humans and their animal companions, I was inspired to leverage technology to make a tangible difference. The thought of a beloved pet being lost and unable to find its way home, or a shelter animal waiting longer than necessary for a loving family, motivated the creation of Peata. I wanted to build a tool that could enhance the chances of happy reunions and successful adoptions through a more accessible and intelligent approach.
This webapp uses real open source data/cats from my local animal shelter in my city, which connects the real issue at hand of finding lost pets and finding a home to adopt these little critters.

What it does

Peata is a community-focused web application designed to be a central hub for pet reunification and adoption. It allows users to:

  • Report Lost Pets: Owners can create detailed listings for their missing pets, including photos and descriptions.
  • Report Found Pets & AI Matching: Individuals who find a lost animal can upload its photo. Peata's core feature then uses a two-stage AI image matching engine (Perceptual Hashing and ORB feature analysis) to compare the found pet's image against a database of reported lost pets and known shelter animals, suggesting potential matches.
  • Browse Adoptable Animals: Users can view profiles of animals currently in shelters that are available for adoption.
  • Engage and Earn: A points and leaderboard system encourages community participation in reporting pets and sharing profiles.
  • Stay Organized: Users have a profile to track their activity and points.

Essentially, Peata aims to use technology to streamline the often chaotic process of finding a lost pet and to provide better visibility for animals awaiting adoption.

How we built it

Peata was developed as a solo project using a Python-centric stack, prioritizing rapid development and a functional user experience:

  • Core Framework: Streamlit was used for building the entire interactive web application, handling both frontend UI components and backend logic.
  • AI Image Matching:
    • OpenCV (cv2): For image loading, preprocessing (like resizing), and ORB (Oriented FAST and Rotated BRIEF) feature detection, description, and brute-force matching.
    • imagehash library: For Perceptual Hashing (pHash) as a fast initial filter for image similarity.
    • Pillow (PIL): For image manipulation tasks, particularly resizing.
    • NumPy: For efficient numerical operations on image data.
  • Data Storage (Prototype): JSON files are currently used to store user credentials, leaderboard information, lost pet reports, and the precomputed image features database for shelter animals.
  • User Interface:
    • Custom styling was achieved by injecting CSS via Streamlit's st.markdown(unsafe_allow_html=True).
    • Interactive elements include Streamlit widgets, embedded base64 videos for login/signup pages, and a sticky SVG logo.
  • Backend Logic: All application logic, including user authentication, data management, AI integration, and view routing, is handled in Python within the Streamlit framework.
  • Image Management: Local image folders (assets/, img/Cats_Q1_2025/, img/Cats_Q2_2025/, img/other/) store media assets.
  • Version Control: Git & GitHub.
  • Deployment: Streamlit Community Cloud (https://peata-sao.streamlit.app/).
  • Secrets Management: Streamlit Secrets (secrets.toml) for API keys (e.g., Formspree).
  • External Services: Formspree for handling user feedback form submissions.
  • Initial Cloud AI Setup: Google Cloud Platform (GCP) Vertex AI SDK was initialized, setting the stage for future integration of more advanced cloud-based AI models and MLOps capabilities.

Challenges we ran into

Building Peata as a solo developer came with several challenges:

  1. AI Matching Accuracy vs. Performance: Balancing the accuracy of the image matching (getting meaningful results) with the processing speed, especially for a web application, was a key challenge. Initial ORB matching on raw uploaded images was too slow, leading to application freezes. This was mitigated by implementing image resizing before feature extraction and adding user feedback with spinners.
  2. UI State Management in Streamlit: Ensuring a smooth and intuitive user experience, particularly with dynamic elements like file uploads, image displays, and match confirmations, required careful management of Streamlit's session state and understanding its rerun behavior. We had to iterate on clearing stale UI elements (Mishaps 1 & 2 from testing).
  3. Application Stability: Early versions experienced unexpected crashes and redirects to the login page. This was addressed by implementing comprehensive try-except error handling throughout the main application view to catch exceptions gracefully and provide better diagnostics.
  4. Data Persistence for a Prototype: Choosing JSON files for data storage was a quick way to get started for a hackathon but came with the understanding of its limitations in terms of scalability and concurrent access. Managing the structure and updates to this "database" (especially the animals list and image paths after reorganization) required meticulous attention.
  5. Scope Management: As a solo developer, deciding which features to prioritize and implement to a functional level within the hackathon timeframe was a constant balancing act.

Accomplishments that we're proud of

Despite the challenges, I'm proud of several key accomplishments with Peata:

  1. Functional End-to-End Prototype: Building a complete, deployable web application with user authentication, a core AI feature, data handling, and multiple user flows as a solo developer.
  2. AI Image Matching Implementation: Successfully implementing a two-stage image matching system using pHash and ORB features from scratch, which forms the innovative core of Peata.
  3. Improved User Experience through Iteration: Addressing user feedback to refine UI elements, such as the responsive videos, sticky logo, and the reset behavior in the image upload workflow.
  4. Problem Solving & Resilience: Overcoming technical hurdles like application freezes, syntax errors, and state management complexities to deliver a more stable and robust application.
  5. Clear Vision for Social Impact: Creating a project with a clear and positive real-world application – helping pets and their owners.
  6. Learning and Applying New Techniques: Gaining deeper experience with Streamlit, OpenCV, image processing, and managing a full-stack (albeit simplified) application.

What we learned

This project was a significant learning experience:

  1. The Importance of Robust Error Handling: Early implementation of comprehensive try-except blocks is crucial for application stability, especially in a framework like Streamlit where unhandled exceptions can disrupt the user session.
  2. Performance Considerations in Image Processing: AI and image processing tasks can be computationally intensive. Optimizations like image resizing before feature extraction are vital for acceptable performance in a web app.
  3. Streamlit State Management Nuances: Gained a deeper understanding of how st.session_state works, how widget interactions trigger reruns, and techniques (like dynamic keys for widgets) to control UI behavior more explicitly.
  4. Iterative Development and User Feedback: The user testing phase, even with its "mishaps," was invaluable in identifying critical areas for improvement that might not have been obvious during initial development.
  5. Pragmatism in a Hackathon Setting: Making practical choices about technology (like using JSON for data initially) and feature scope is key to delivering a working prototype within a tight timeframe, especially as a solo participant.
  6. The Power of Python and its Ecosystem: The availability of libraries like OpenCV, Streamlit, and imagehash made it feasible to build a relatively complex application with AI features quickly.

What's next for Peata

Peata has a strong foundation, and there are many exciting directions for its future development:

  1. Scalable Backend: Migrate from JSON files to a robust database system (e.g., PostgreSQL, Firestore) to handle more users, pets, and data efficiently.
  2. Enhanced AI Models:
    • Explore and integrate more advanced deep learning models (e.g., Siamese Networks, Triplet Loss with CNNs) for even better image matching accuracy, potentially trained on a larger, more diverse dataset of animal images.
    • Incorporate matching based on other reported features (breed, color, markings, location) alongside image analysis.
    • Fully leverage GCP Vertex AI for model training, deployment, and MLOps.
  3. Direct Shelter & Rescue Group Integration: Develop features or APIs allowing shelters to directly manage their animal listings, receive found pet notifications, and streamline their adoption process through Peata.
  4. Geolocation Features: Implement location-based services for reporting lost/found pets and searching within a specific radius.
  5. Mobile-First Enhancements & PWA: Further optimize the user interface for mobile devices and explore Progressive Web App (PWA) capabilities for an improved app-like experience.
  6. Advanced Community Features: User notifications for new potential matches, secure messaging between users (e.g., finder and owner, with privacy safeguards), and expanded profiles.
  7. Data Analytics & Insights: Provide shelters with anonymized data and insights into lost/found trends to help improve their services.

Peata aims to grow into a comprehensive and indispensable tool for animal welfare in the community.


Author:

  • This project, Peata, was conceived and developed by [Gaston Dana: GH - gastondana627] as a solo endeavor.

Built With

Share this project:

Updates