Inspiration

California’s coastline is a global hub for surfing, yet shark attacks continue to pose a serious safety concern for beachgoers and tourists. News of sightings or close encounters often causes panic and reduces confidence in beach safety. This inspired me to explore how artificial intelligence can help detect sharks in real-time, reducing human risk and increasing safety awareness near the shore.

What it does

In its current phase, SurfSafe AI is focused on automated shark detection through a machine learning model trained on aerial imagery. The system analyzes input images and identifies the presence of sharks with high accuracy. To test the detection in action, we built a Flask-based web application that allows users to upload drone footage and view the detection results. This provided an easy way to simulate real-time detection without deploying to physical hardware yet.

How we built it

We began by curating a custom dataset of aerial shark imagery, focused on ocean environments similar to those along the California coast. The detection model was built using the YOLOv8 architecture for its speed and accuracy in object detection tasks. Key steps included:

  • Training the model in Python using PyTorch
  • Applying data augmentation to handle various lighting, angles, and water conditions
  • Evaluating model performance using precision, recall, and mAP To demonstrate functionality, we developed a lightweight Flask web app where users can upload video files and view detection results frame-by-frame — simulating a real-world use case without requiring physical deployment.

Challenges we ran into

  • Limited training data: High-quality, labeled aerial shark footage was scarce, making model training difficult.
  • Visual ambiguity: Waves, reflections, and underwater shadows often led to false positives.
  • Environmental variation: Lighting, water clarity, and drone altitude heavily influenced detection performance.
  • Hardware limitations: Without a live drone setup, we couldn’t yet test the system in a real-time field scenario — but the web app served as a valuable stopgap.

Accomplishments that we're proud of

Successfully trained a robust deep learning model capable of identifying sharks in aerial imagery. Developed a functioning Flask app to demo the detection model on real-world video footage. Achieved promising precision and recall values during validation, demonstrating real-world potential. Laid the technical foundation for the broader SurfSafe AI system to be developed in the next phases.

What we learned

Deep learning is a powerful tool for visual detection in natural environments, but it requires careful data curation and extensive testing. Even small factors like lighting, water movement, and image resolution significantly impact detection results. Building even a single functional component (like the detection model) requires an iterative approach and thorough validation. Flask is a lightweight and effective framework to quickly prototype and validate AI models in a controlled test environment.

What's next for SurfSafe AI

The next phase of development includes

  • Integrating the detection model with autonomous drone systems for real-time coastal monitoring
  • Designing smart drone patrol patterns and on-device processing workflows
  • Building a live dashboard for alerts and visualization
  • Partnering with local lifeguards, beach patrol units, or marine researchers for field testing
  • Expanding the system to detect other dangerous marine life (e.g. jellyfish, stingrays)

Built With

Share this project:

Updates