Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLO Vision Lab: From Pixels to Precision

Hands-on Machine Learning / Computer Vision notebook, built to train a YOLO26 model from scratch and observe, in practice, the core concepts of neural network training: dataset splitting, epochs, learning rate, the ADAM optimizer, overfitting vs. underfitting, early stopping, and the Precision / Recall / F1-Score metrics.

Presented as Activity 2 at the Congresso Acadêmico Unifesp 2026, in a class on Artificial Intelligence and Computer Vision alongside the Black Bee Drones team.

Open In Colab

What this notebook covers

  • How to load a dataset in YOLO format (via Roboflow)
  • Splitting a dataset into train / validation / test (70/20/10) and why it matters
  • Training a YOLO26 model with every parameter explained (epochs, patience, lr0, optimizer)
  • Visualizing training batches (what the network is actually "seeing")
  • Reading the Learning Curve to spot overfitting and underfitting
  • Computing Precision, Recall, F1-Score, and reading the confusion matrix
  • Practical diagnosis: how to tell whether the problem is the model or the dataset, and how to fix it by retraining (with side-by-side result comparison)
  • Visual identification of detections, drawn manually with OpenCV

Dataset used

Malignant and Benign (breast ultrasound, ~2,150 images, classes benign/malignant) — via Roboflow Universe. Any other dataset in YOLO format also works.

How to run

  1. Open the notebook in Google Colab (button above) or locally with Jupyter.
  2. Run the cells in order, top to bottom.
  3. In Section 2, when prompted, paste your private Roboflow API key (app.roboflow.com/settings/api). The key is requested at runtime (getpass) and is never saved in the notebook — you can run and commit it without risk of leaking a credential.
  4. Recommended: enable GPU (Runtime > Change runtime type > GPU, if using Colab).

Running locally (outside Colab)

pip install -r requirements.txt
jupyter notebook Activity_2_Machine_Learning.ipynb

Security

  • No credentials are stored in the notebook — the Roboflow API key is requested via getpass on every run.
  • .gitignore already excludes training result folders (runs_activity/), model weights (.pt), and downloaded datasets, which shouldn't be pushed to the repository since they're heavy and specific to each run.
  • Before committing, double-check that no cell has saved output containing sensitive data (Cell > All Output > Clear in Jupyter, or Edit > Clear all outputs in Colab).

License

Feel free to use this material for educational purposes, with attribution. This license applies to the code and content of this repository only, not to the dataset, which has its own license on Roboflow Universe.

About

Hands-on Machine Learning notebook that trains a YOLO26 object detector from scratch — covering dataset splitting, epochs, learning rate, ADAM, overfitting vs. underfitting, and Precision/Recall/F1. Includes automatic diagnosis and retraining fixes with side-by-side comparisons. Presented at Congresso Acadêmico Unifesp 2026.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages