đź’ˇ Inspiration

We built CrimeLens after realizing how hard it is for people—especially students and late-night commuters—to understand how safe an area really is. Traditional crime maps just show raw data points without context, leaving users to interpret complex statistics on their own. We wanted to create a tool that transforms confusing crime reports into clear, actionable safety insights that help people make informed decisions about where they go and when.

The idea came from personal experience: late-night study sessions, uncertain walks home, apartment hunting in unfamiliar neighborhoods, and the constant question "Is this area safe?" We realized that the data exists, but it's scattered, inconsistent, and difficult to understand. CrimeLens bridges that gap.


🔍 What it does

CrimeLens is an AI-powered safety analysis platform that helps users understand the real safety profile of any location. Here's what makes it special:

Interactive Crime Mapping: Visualizes crime incidents with severity-based color coding, making it easy to spot high-risk areas at a glance AI-Powered Insights: Uses Gemini AI to analyze crime patterns and generate personalized safety recommendations based on time of day, crime trends, and location-specific risks Smart Search: Quickly find safety information for addresses, campuses, transit hubs, or neighborhoods Time-Based Safety Scoring: Shows how safety varies throughout the day, helping late-night commuters and students plan safer routes Trend Analysis: Displays crime statistics with historical comparisons, so users can see if an area is improving or declining in safety Contextual Recommendations: Provides specific, actionable advice like "Crime increases by 35% after 10 PM - consider traveling in groups"


🛠️ How we built it

Tech Stack: Frontend: React with TypeScript and Tailwind CSS for a responsive, modern interface Mapping: Google Maps API integration for accurate location visualization and geocoding AI Analysis: Gemini API for natural language safety insights and pattern recognition Data Sources: Open crime datasets from municipal police departments and public safety databases UI Components: Shadcn/ui component library for polished, accessible interface elements Icons: Lucide React for consistent, modern iconography

Architecture: Users search for a location via address or select from popular areas The app queries open crime datasets for incidents within the past 30-90 days Crime data is plotted on Google Maps with severity-based color coding Raw incident data is sent to Gemini AI for analysis Gemini generates contextual safety insights, time-based recommendations, and trend analysis Results are displayed in an intuitive dashboard with visual safety scores and actionable advice


đźš§ Challenges we ran into

  1. Inconsistent Crime Data Formats Different cities and police departments use wildly different data schemas. Some use crime codes, others use plain text descriptions. Dates, locations, and severity classifications varied dramatically. We had to build robust data normalization pipelines to handle this inconsistency.

  2. Real-Time Map Integration Syncing dynamic crime data with Google Maps markers while maintaining smooth performance was challenging. We implemented clustering algorithms for areas with high incident density and optimized re-rendering to keep the map responsive.

  3. AI Prompt Engineering Getting Gemini to generate useful, actionable safety insights (rather than generic warnings) required extensive prompt engineering. We had to provide structured context about crime types, frequencies, time patterns, and demographic data to get meaningful recommendations.

  4. Balancing Safety Information with Fear We wanted to inform users without creating unnecessary panic. Finding the right tone and presentation—showing risks while highlighting improvements and providing constructive advice—was a delicate balance.

  5. Data Privacy and Ethics Crime data can be sensitive. We had to carefully consider how to present information without stigmatizing neighborhoods or revealing personally identifiable information from incident reports.

Built With

Share this project:

Updates