32. π AI for Marine Ecosystems (AI4ME) API#
π AI-powered API for Marine Ecosystem Research
AI4ME API provides low-code APIs for machine learning-based image analysis tools focused on marine research.
π GitHub Repository: [AI4ME API Link(https://connect.fisheries.noaa.gov/ai4me)
π© Contact: Michael.Akridge@noaa.gov
32.1. πΉ Features#
π Platform-Agnostic: Low-code and accessible via Python, R, shell, or any HTTP client.
π Secure: Requires an API key for restricted endpoints.
π Scalable & Fast: Leverages optimized YOLO models for rapid predictions.
πΌοΈ Supports Image Uploads: Accepts images up to 20MB.
π Research-Focused: Designed for marine ecosystem analysis.
32.2. π‘ Advantages of AI4ME API#
32.2.1. πΉ 1. Low Code & Platform-Agnostic#
Works with Python, R, JavaScript, cURL, commandline and any HTTP client.
Accessible from desktop, cloud, or mobile.
32.2.2. πΉ 2. Secure & Scalable#
Uses API key authentication for controlled access.
Supports high-throughput requests.
32.2.3. πΉ 3. Research-Oriented#
Designed for marine ecosystem monitoring.
Helps scientists analyze coral health & urchin populations.
32.2.4. πΉ 4. Fast & Efficient#
Uses optimized YOLO models for real-time predictions.
Processes images in milliseconds.
32.3. π οΈ How It Works#
32.3.1. 1οΈβ£ Input Data (Image)#
Users upload an image via API request (local file or URL).
The image is processed by YOLO-based models trained for specific tasks.
32.3.2. 2οΈβ£ API Processing#
The API validates the file (size, format).
The coral bleaching classifier or urchin detector model processes the image.
Predictions are filtered based on a confidence threshold.
32.3.3. 3οΈβ£ Output Response#
The API returns structured JSON containing:
πΉ Predicted class (e.g.,
"coral_bl"for bleached coral)πΉ Confidence score (e.g.,
0.85= 85% confidence)πΉ Bounding boxes (for object detection)
32.4. β‘ API Request Flow#
32.4.1. 1οΈβ£ User Submits Image#
POST /predict/coral (or /predict/urchin)
π€ Request:
User uploads an image (JPEG/PNG).
API validates file size & format.
32.4.2. 2οΈβ£ Model Processes Image#
The YOLO model classifies the image.
Predictions are filtered by confidence threshold.
32.4.3. 3οΈβ£ API Returns JSON Output#
π₯ Response:
For Coral: Class label & confidence (e.g.,
"coral_bl" 85%).For Urchins: Bounding boxes + confidence scores.
32.5. π API Security & Access#
Public Endpoints:
/health,/infoRestricted Endpoints:
/predict/coral,/predict/urchin(API key required)
32.5.1. π How to Authenticate#
Every request to /predict/* must include:
X-API-KEY: your_api_key
Example in Python:
headers = {"X-API-KEY": "your_api_key"}
response = requests.post(url, headers=headers, files=files)
32.6. π Endpoints & Usage#

32.6.1. πΉ β Health Check (Public)#
πΉ Check if the API is live
GET /health
32.6.1.1. Response#
{
"status": "OK",
"message": "API is running"
}
32.6.2. Coral Bleaching Classification#
πΉ Endpoint:
POST /predict/coral
πΉ Required Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
Image File |
Coral reef image (max 20MB) |
|
Float (default=0.5) |
Confidence threshold for filtering predictions |
32.6.2.1. Example Request (Python)#
import requests
url = "https://connect.fisheries.noaa.gov/ai4me/predict/coral"
headers = {"X-API-KEY": "your_api_key"}
files = {"file": open("example_coral.jpg", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())
32.6.2.2. Response Example#
{
"model": "coral_bleaching_classifier",
"predictions": [
{"class": "coral_bl", "confidence": 0.85},
{"class": "coral", "confidence": 0.12}
]
}
32.6.3. Sea Urchin Detection#
πΉ Endpoint:
POST /predict/urchin
πΉ Required Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
Image File |
Underwater image (max 20MB) |
|
Float (default=0.4) |
Minimum confidence for detections |
32.6.3.1. Example Request (Python)#
import requests
url = "https://connect.fisheries.noaa.gov/ai4me/predict/urchin"
headers = {"X-API-KEY": "your_api_key"}
files = {"file": open("example_urchin.jpg", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())
32.6.3.2. Response Example#
{
"model": "sea_urchin_detector",
"detections": [
{
"class": "urchin",
"confidence": 0.85,
"bbox": [2974.38, 765.22, 3528.17, 1394.35]
},
{
"class": "urchin",
"confidence": 0.73,
"bbox": [4257.12, 2783.82, 4684.24, 3146.24]
}
]
}
32.7. π Get Started#
1οΈβ£ Request API access from Michael Akridge.
2οΈβ£ Use Python, R, or cURL to send requests.
3οΈβ£ Upload images and get AI-powered insights!
For full documentation, visit:
π API Docs
π GitHub Repository
π Backend Systems via FASTAPI