Optimization of SSL neural networks using relational and vector databases
DOI:
https://doi.org/10.31673/2412-9070.2026.045302Abstract
The modern development of computer vision systems and the widespread adoption of advanced deep learning architectures, particularly Vision Transformers (ViTs), require access to massive labeled datasets. This reliance creates a severe "annotation bottleneck," limiting the scalability of artificial intelligence projects due to the prohibitive cost and time required for manual labeling. Self-Supervised Learning (SSL) offers a robust solution by enabling models to learn rich semantic representations from unlabeled data. However, the practical deployment of SSL faces a critical infrastructural barrier: traditional file-centric storage approaches generate severe Input/Output (I/O) bottlenecks. Reading thousands of small files directly from disk overloads the CPU and leads to GPU starvation, drastically reducing hardware efficiency. This paper proposes an innovative, data-centric architecture that fundamentally shifts the paradigm of SSL data preparation. Instead of exporting data into external Python environments, we propose embedding the training pair generation logic directly within the Database Management System (DBMS). The core component of this solution is the integration of vector databases and hierarchical indexing algorithms (specifically HNSW graphs) to perform dynamic Approximate Nearest Neighbor search. This allows the system to instantaneously generate high-quality "hard negatives," which are crucial for the effective contrastive training of ViTs. The findings demonstrate that this in-database approach eliminates the I/O bottleneck, reducing CPU overhead by 60-70% through continuous block reading. The dynamic generation of hard negatives via database indices drastically improves the loss landscape, forcing self-attention mechanisms to focus on relevant features. Consequently, this leads to accelerated model convergence and a substantial increase in final accuracy without requiring additional GPU power. The proposed architecture proves that optimizing data infrastructure is just as vital as refining neural networks, paving the way for scalable computer vision pipelines in modern enterprise environments.
Keywords: self-supervised learning, computer vision, Vision Transformers, vector databases, in-database machine learning, HNSW, data-centric approach.