Skip to content
KiwiGrenadePublic

About

RybNet is a research project focused on fine-grained classification of underwater fish species. The central contribution is the design and evaluation of two custom convolutional neural networks—RybNet V1 and RybNet V2—against established CNN and transformer-based architectures.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

35 Commits

Folders and files

Repository files navigation

RybNet

Master's Thesis

Comparison of the author's and selected deep neural network architectures in the image classification task

Jakub Jaśków

Wrocław University of Science and Technology
Study programme: Technical Computer Science · Specialization: Systems Engineering

Custom CNN architecture · Computer Vision · Deep Learning · Fine-Grained Visual Classification · Underwater Fish Images Classification

Polska wersja · RybNet-Code · RybNet-Paper

Python PyTorch Lightning Computer Vision Thesis

Project at a glance

RybNet is a research project focused on fine-grained classification of underwater fish species. The central contribution is the design and evaluation of two custom convolutional neural networks—RybNet V1 and RybNet V2—against established CNN and transformer-based architectures.

The final model, RybNet V2, achieved the strongest mean test performance among all evaluated models:

Macro F1 Balanced accuracy Accuracy Evaluated models Training runs
0.905 0.902 0.973 5 3 seeds per model

Compared with ResNet-50, RybNet V2 improved mean macro F1 by +0.017 and balanced accuracy by +0.018.

Why RybNet V2 works

RybNet V2 extends a ResNet-50-style backbone with components selected for fine-grained recognition, where class-specific evidence may appear as subtle texture, coloration, fin shape, or local morphology.

Its main architectural elements are:

  • a gradual three-layer 3×3 convolutional stem,
  • Efficient Channel Attention (ECA) inside residual bottlenecks,
  • multi-scale feature fusion across intermediate and deep feature maps,
  • a dual Global Average Pooling + Global Max Pooling classification head.

Multi-scale feature fusion

RybNet V2 multi-scale feature fusion module

Feature maps from three backbone stages are projected to 256 channels, aligned spatially, concatenated, and fused into a shared representation. This gives the classifier access to both local detail and high-level semantic information.

Comparison of ResNet-50 and RybNet input stems
Gradual input stem
RybNet GAP and GMP classification head
Dual-pooling classification head

Experimental design

The experiments use the Fish4Knowledge dataset:

Dataset property Value
Images 27,370
Fish species 23
Data source Natural underwater video recordings
Split 70% train / 15% validation / 15% test

A critical methodological decision was to split the data by fish trajectory rather than by individual image. Consecutive frames of the same tracked fish were therefore assigned to only one subset, reducing near-duplicate leakage between training and evaluation data.

All architectures were:

  • trained from scratch under a common experimental protocol,
  • evaluated with the same preprocessing and data split,
  • repeated using seeds 42, 123, and 333,
  • compared using macro metrics, balanced accuracy, model size, training time, inference latency, throughput, and GPU memory usage.

Results

Values below are reported as mean ± standard deviation across three seeds.

Model Accuracy Macro F1 Balanced accuracy Parameters
ConvNeXt Tiny 0.954 ± 0.008 0.779 ± 0.017 0.773 ± 0.020 27.83M
ResNet-50 0.972 ± 0.003 0.888 ± 0.006 0.884 ± 0.008 23.61M
Swin Transformer V2 Tiny 0.959 ± 0.009 0.807 ± 0.021 0.802 ± 0.023 27.54M
RybNet V1 0.972 ± 0.006 0.880 ± 0.024 0.876 ± 0.023 25.72M
RybNet V2 0.973 ± 0.005 0.905 ± 0.021 0.902 ± 0.021 24.72M

Macro F1 compared with inference latency for evaluated models

Key findings

  • RybNet V2 ranked first in every reported mean test metric.
  • It outperformed ResNet-50 in macro F1 for each paired seed: +0.046, +0.002, and +0.012.
  • The improvement came from the combined architecture, especially multi-scale fusion—not from channel attention or the modified classifier alone.
  • ResNet-50 remained the fastest and smallest model, while RybNet V2 provided the best predictive quality.
  • ConvNeXt Tiny and Swin Transformer V2 Tiny did not outperform the residual models when trained from scratch on this dataset.

Repository ecosystem

Repository Scope
RybNet Project overview, architecture summary, benchmark results, and visual presentation.
RybNet-Code Source code, model implementations, training and evaluation pipeline, benchmarks, and reproducibility instructions.
RybNet-Paper LaTeX sources of the master's thesis, figures, tables, bibliography, and defense materials.

The code/ and paper/ directories in the parent repository are Git submodules linked to the independent repositories above.

Engineering scope

The project demonstrates practical experience in:

  • custom CNN architecture design and implementation,
  • PyTorch and PyTorch Lightning experimentation,
  • leakage-resistant dataset preparation,
  • reproducible GPU training and multi-seed evaluation,
  • per-class error analysis and confusion-matrix reporting,
  • inference and VRAM benchmarking,
  • running experiments on HPC infrastructure provided by the Wrocław Centre for Networking and Supercomputing (WCSS).

Technology stack

Python · PyTorch · PyTorch Lightning · Torchvision · TorchMetrics · scikit-learn · Pandas · Matplotlib · Jupyter · CUDA · HPC


Jakub Jaśków
M.Sc. thesis · Technical Computer Science · Systems Engineering
Wrocław University of Science and Technology

About

RybNet is a research project focused on fine-grained classification of underwater fish species. The central contribution is the design and evaluation of two custom convolutional neural networks—RybNet V1 and RybNet V2—against established CNN and transformer-based architectures.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors