Discord: chrisxxc

✨ Tide Sense Inspiration

Every beachgoer’s nightmare: a calm morning by the ocean turns deadly when a hidden riptide pulls someone beneath the surface.

Each year, these invisible currents claim around a hundred lives in the United States alone and trigger more than 80% of all lifeguard rescues. Yet, most of these tragedies are preventable with just a moment’s awareness.

We asked ourselves: in a world where everyone carries a camera and a phone, why can’t technology help spot danger before it strikes? Why should a family’s day at the beach depend on what they can’t see beneath the waves?

Traditional beach safety signs and forecasts are important, but they can’t detect the unique and ever-changing conditions of a single shoreline. They’re static, while the ocean is anything but.

That’s when we came up with Tide Sense, an idea to give beachgoers a simple, yet life-saving tool. By using a quick photo and the power of computer vision, we can help people recognize riptides in real time, making every swim a little safer and every shoreline a little smarter.

πŸ’‘What it does

TideSense is an AI-powered mobile safety companion that transforms your smartphone into a riptide detection tool. Simply point your camera at the ocean, and our app instantly analyzes the water conditions to detect dangerous riptide currents.

πŸ› οΈ Core Features:

  1. 🎯 Real-Time Riptide Detection - Advanced computer vision analyzes wave patterns, foam channels, and water discoloration to identify riptides with confidence scores
  2. πŸ—ΊοΈ Safety Map - Interactive map showing lifeguard stations, danger zones, and safe swimming areas with real-time GPS tracking
  3. 🌊 Live Weather & Ocean Conditions - Integration with NOAA APIs for current temperature, wind speed, wave height, water temperature, UV index, and 5-day forecasts
  4. πŸ€– AI Safety Assistant - Powered by Google Gemini 2.5 Flash, providing personalized safety advice, answering beach safety questions, and generating audio summaries with ElevenLabs TTS
  5. πŸ“Š Analytics Dashboard - Track your beach visits with trend charts, risk distribution analysis, and safety insights
  6. πŸ“œ Detection History - SQLite database storing all scans with timestamps, locations, and confidence scores
  7. 🚨 Emergency Actions Panel - Quick access to emergency services (911, Coast Guard, Lifeguard hotline) with one-tap calling
  8. πŸ“± Share Alerts - Instantly notify friends and family of dangerous conditions

The app provides three risk levels (HIGH, MODERATE, LOW) with visual indicators, recommendations, and location-specific hazard warnings. Every feature is designed with one goal: keep people safe at the beach.

πŸ“Š How we built it

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚        Frontend (React Native + Expo, TypeScript)                 β”‚
 β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
 β”‚  β”‚React Nav β”‚  β”‚Expo SDK    β”‚  β”‚TensorFlow Liteβ”‚  β”‚SQLite DB   β”‚  β”‚
 β”‚  β”‚UI/UX     β”‚  β”‚Camera API  β”‚  β”‚On-Device Modelβ”‚  β”‚Scan Historyβ”‚  β”‚
 β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
 β”‚        β”œβ”€ History & Analytics Screens                             β”‚
 β”‚        β”œβ”€ Weather & Safety Map Screens                            β”‚
 β”‚        β”œβ”€ Emergency Panel & Alerts                                β”‚
 β”‚        └─ AI Chatbot Overlay                                      β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                Backend API (FastAPI, Python)                     β”‚
 β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
 β”‚  β”‚Endpoints β”‚  β”‚Pydantic    β”‚  β”‚SQLite Bridgeβ”‚  β”‚NWS API      β”‚  β”‚
 β”‚  β”‚Image/AI  β”‚  β”‚Validation  β”‚  β”‚Data Access  β”‚  β”‚Weather Feed β”‚  β”‚
 β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
 β”‚       β”œβ”€ Handles Riptide Detections & Summaries                  β”‚
 β”‚       β”œβ”€ Syncs Local History with Analytics Data                 β”‚
 β”‚       └─ Connects to External APIs for Forecasting               β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚                 AI & Service Integrations                    β”‚
 β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
 β”‚  β”‚Gemini API    β”‚  β”‚ElevenLabs API    β”‚  β”‚National Weatherβ”‚  β”‚
 β”‚  β”‚- Risk Summaryβ”‚  β”‚- Voice Playback  β”‚  β”‚- Rip Current   β”‚  β”‚
 β”‚  β”‚- Chat Q&A    β”‚  β”‚                  β”‚  β”‚  & Forecasts   β”‚  β”‚
 β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
 β”‚       β”œβ”€ AI Summaries of Detection Results                   β”‚
 β”‚       β”œβ”€ Conversational Assistant                            β”‚
 β”‚       └─ Real-Time Conditions Data                           β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

❓ Challenges we ran into

  1. Model Consistency & Accuracy The biggest challenge was making the riptide detection reliable and realistic. Initial tests showed wild fluctuations between HIGH and LOW risk on identical images. We solved this by:

    *Implementing top-K averaging (taking the average of top 5 confidence scores instead of just the max) *reating a weighted confidence system (70% average + 30% max) to balance stability and responsiveness

  2. React Hooks Violations We encountered a persistent "Rendered more hooks than during the previous render" error when viewing detection history. The issue was hooks being declared after conditional returns. Fixed by:

Moving ALL hooks (useState, useEffect, useRef, useMemo) to the top of the component Placing the loading guard AFTER all hook declarations Adding null checks in useMemo and callback functions

  1. Gemini API Compatibility Integrating Google's Gemini AI was frustrating due to rapidly changing model names and availability. We tried multiple models (gemini-pro, gemini-1.5-flash-latest, gemini-2.0-flash-exp) before discovering gemini-2.5-flash was the stable option. Created a model discovery script to list all available models.

  2. Network Configuration Getting the mobile app to communicate with the local backend server required careful network setup. Android emulators use 10.0.2.2, iOS simulators need the local network IP, and real devices need proper routing. Implemented platform-specific API URLs with fallbacks.

  3. TensorFlow Lite Model Integration Loading and running the TFLite model on the server had compatibility issues with different interpreter packages. Created fallback logic to try tensorflow.lite first, then tflite_runtime, ensuring the server works in different environments.

πŸ† Accomplishments that we're proud of

🧠 Intelligent AI Integration Successfully integrated three AI services (Gemini for conversation, ElevenLabs for voice, TensorFlow for vision) into one cohesive experience. The AI chatbot doesn't just answer questionsβ€”it provides contextual safety advice based on your specific detection.

πŸ“š What we learned

Computer Vision is Hard (but Solvable) We learned that raw ML model outputs are noisy and unreliable. Real-world deployment requires post-processing techniques like temporal smoothing, weighted averaging, and dynamic thresholding. Understanding your model's behavior is just as important as training it. And when you train it, it makes it easier for us to get what we desired.

What's next for TideSense?

πŸ“‘ Community Safety Network

Enable users to share real-time hazard reports with others nearby Build a crowdsourced safety database of beach conditions Create heatmaps showing aggregated risk levels across regions Add social features: beach check-ins, safety badges, group notifications

πŸ—ΊοΈ Advanced Mapping Features

Partner with beach authorities to get official lifeguard schedules and station data Add AR overlays showing safe swimming zones directly on camera view Integrate tide predictions and current flow visualizations Show historical incident data on safety maps

Built With

+ 7 more
Share this project:

Updates