Controllo verde
Link copiato negli appunti

SharkEye uses Ultralytics YOLOv8 for object detection

Understand how SharkEye, presented at YOLO Vision 2024, leverages Ultralytics YOLOv8 for real-time object detection and beach safety.

Monitoring animals in their natural habitats, whether it’s cattle grazing on a farm or sharks moving near the shore, has always been important for their safety and well-being. However, manually observing them isn’t easy. It can often involve hours of patience and careful focus, as observers have to watch closely for any changes in behavior or movement. Even then, it’s easy to miss subtle but important signs.

Thanks to artificial intelligence (AI) stepping in, this process is becoming faster, smarter, and far more efficient, reducing the strain on human observers while improving accuracy. In particular, computer vision can be used to track animals, spot dangers, and make decisions in real-time. Tasks that once took hours can now be done in minutes, opening up new ways to understand animal behavior.

At YOLO Vision 2024 (YV24), an annual hybrid event hosted by Ultralytics, experts and innovators gathered to explore how AI is tackling everyday challenges. Some of the showcased topics included advancements in real-time object detection and animal monitoring, demonstrating how AI is enhancing safety and efficiency across various fields.

One of the event’s highlights was a talk by Jim Griffin, Founder of AI Master Group, where he demonstrated how Vision AI is making beaches safer by detecting sharks before they come too close to shore. He explained how they used Ultralytics YOLOv8, a cutting-edge computer vision model, to accurately identify sharks in real-time, even in challenging conditions like choppy waves, glare, and underwater obstacles.

In this article, we’ll take a closer look at the SharkEye project and share interesting insights from Jim’s talk.

Getting to know SharkEye: A computer vision application

Jim began his talk by introducing Padaro Beach, a well-known surfing destination in California where surfers and sharks often share the same waters. Highlighting the real challenge of shark detection, he shared, “Of course, it’s easy to detect a shark if it bites you, so what we wanted to do is identify the sharks beforehand.”

Fig 1. Jim onstage at YOLO Vision 2024.

SharkEye was created to tackle this issue, with support from the University of California, Santa Barbara. Jim described how drones with high-resolution AI cameras were used to fly about 200 feet above the water, scanning the ocean in real-time.

If a shark is detected, SMS alerts reach about 80 people, including lifeguards, surf shop owners, and anyone who signed up for updates. Jim pointed out how these instant notifications allow quick responses, keeping beachgoers safer when a shark is near the shore.

Jim also mentioned that SharkEye features a live dashboard where users can see shark detection stats. For instance, over 12 weeks, the system identified two large sharks and 15 smaller ones, averaging just over one shark per week.

He then introduced Neil Nathan, the scientist who led the efforts behind SharkEye. Despite having a background in environmental studies rather than computer science, Nathan successfully spearheaded the project. Jim emphasized how modern AI tools, like those used in SharkEye, are designed to be accessible, enabling individuals from non-technical backgrounds to develop impactful solutions.

Using Ultralytics YOLOv8 to detect sharks

Going further into the details, Jim elaborated on what’s under the hood of SharkEye and how the shark detection solution didn’t just involve a simple object detection task. It had to deal with dynamic, unpredictable conditions like floating seaweed that could easily be mistaken for sharks. Unlike spotting a stationary object, identifying a shark requires precision and adaptability, making YOLOv8 an ideal choice.

Another advantage of YOLOv8 was that it could be deployed on a drone without relying on cloud servers. Jim explained how this approach made it possible for SharkEye to send immediate alerts - an essential part of ensuring timely responses in unpredictable ocean conditions.

Object detection with just six lines of code

After highlighting how SharkEye works and the collaborative effort behind it, Jim showcased a live demo.

Jim Griffin started his live demo by walking the audience through a familiar example - a "hello world" code snippet for Ultralytics YOLO models. With just six lines of Python code, he exhibited how a pre-trained Ultralytics YOLOv8 model could effortlessly detect a bus in an image. 

Fig 2. A demo by Jim at YOLO Vision 2024.

His demo used the YOLOv8 Nano model, a lightweight version for low-power devices like drones. The same model was used in SharkEye for real-time shark detection. 

To provide more context, Jim mentioned that the model in the demo was being trained on COCO128, a smaller subset of the widely used COCO dataset. The COCO dataset contains over 20,000 images across 80 different object categories. While COCO128 works well for quick demonstrations, he pointed out that SharkEye needed something more robust - an application-specific shark detection dataset that could handle the complexities of real-world scenarios.

Custom-training YOLOv8 for SharkEye 

According to Jim, the hardest part of the SharkEye project wasn’t training the AI model but gathering the right data. He commented, “The main work of this project wasn’t AI. The main work of this project was flying those drones over for five years, culling the images out of those videos, and tagging them appropriately.”

He described how the team collected 15,000 images at Padaro Beach. Each image had to be manually labeled to differentiate between sharks, seaweed, and other objects in the water. While the process was slow and demanding, it laid the foundation for everything that followed.

Fig 3. Using drones to capture images of sharks for real-time object detection.

Once the dataset was ready, Ultralytics YOLOV8 was custom-trained on it. Jim said, "The actual training wasn’t the hard part - it only took 20 hours on T4 GPUs [Graphics processing units].” He also added that the time could have been reduced to as little as five hours with more powerful hardware, such as A100 GPUs.

Evaluating SharkEye: Precision over recall

Then, Jim discussed how SharkEye’s performance was evaluated. He illustrated that the key metric was precision - how accurately the system identified actual sharks. With SharkEye achieving an impressive 92% precision, the model proved highly effective in accurately identifying sharks amidst the complex ocean environment.

Diving deeper into the importance of precision, Jim clarified why precision mattered more than recall in this case. “Most of the time, people are interested in recall, especially in areas like healthcare where missing a positive case can be critical. But in this case, we didn’t know how many sharks were out there, so what we cared about was precision,” he explained. SharkEye ensured that false alarms were minimized by focusing on precision, making it easier for lifeguards and other responders to take action fast.

Fig 4. Jim showcasing SharkEye at YOLO Vision 2024.

He concluded his talk by comparing AI to human performance, noting that SharkEye’s 92% precision far surpassed the 60% accuracy of human experts. He emphasized this gap, saying, “It’s because we’re human. No matter how expert you or I might be, if we have to sit in front of a screen all day long looking for sharks, eventually, we’re going to let our minds wander.” Unlike people, AI models don’t tire or get distracted, making it a reliable solution for tasks requiring continuous monitoring.

Ultralytics YOLO11: The latest YOLO

An intriguing quote from Jim Griffin’s talk, “Six lines of code could save your life one day,” perfectly captures how advanced yet accessible AI has become. The Ultralytics YOLO models have been created with this in mind, making cutting-edge computer vision technology accessible to developers and businesses of all sizes. Ultralytics YOLO11 builds on this with faster inferences and higher accuracy. 

Here’s a quick glance at what sets YOLO11 apart:

  • Redesigned architecture: Its enhanced backbone and neck architecture enable better feature extraction and improved precision.
  • Ease of use: It can be accessed through Python coding or no-code tools like Ultralytics HUB.
  • Flexibility across tasks: YOLO11 supports computer vision tasks like object detection, instance segmentation, image classification, tracking, pose estimation, and oriented bounding boxes (OBB).
  • Improved accuracy: YOLO11 achieves 22% higher mean average precision (mAP) compared to YOLOv8m on the COCO dataset, delivering more precise detections.

These features make YOLO11 a great fit for animal behavior tracking in dynamic environments, whether on a farm or in the wild.

Punti di forza

Advancements in Vision AI are making it easier to tackle real-world challenges by providing practical tools for various fields. For instance, computer vision models like YOLO11 can be used for the real-time monitoring and tracking of animals, even in tough conditions. 

Jim Griffin’s keynote at YV24 illustrated how YOLOv8 can be used to solve complex problems with minimal coding. The SharkEye project, which combines drones with AI for real-time shark detection, showcased how technology can improve beach safety. 

It was a fascinating case study of how accessible AI empowers people from different backgrounds to create effective solutions. As AI continues to evolve, it is transforming industries and making it possible for individuals to harness its potential to make the world a safer, smarter, and more efficient place.

Become part of our community and explore our GitHub repository to dive deeper into AI. From computer vision in agriculture to AI in self-driving cars, see how these technologies are driving innovation. Check out our licensing options to begin your AI projects today!

Logo di FacebookLogo di TwitterLogo di LinkedInSimbolo di copia-link

Leggi tutto in questa categoria

Costruiamo insieme il futuro
di AI!

Inizia il tuo viaggio nel futuro dell'apprendimento automatico