Comparison of the author's and selected deep neural network architectures in the image classification task
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
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.
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×3convolutional 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.
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.
![]() Gradual input stem |
![]() Dual-pooling classification head |
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, and333, - compared using macro metrics, balanced accuracy, model size, training time, inference latency, throughput, and GPU memory usage.
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 |
- 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 | 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.
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).
Python · PyTorch · PyTorch Lightning · Torchvision · TorchMetrics · scikit-learn · Pandas · Matplotlib · Jupyter · CUDA · HPC
M.Sc. thesis · Technical Computer Science · Systems Engineering
Wrocław University of Science and Technology



