Yarn education is a crucial step in producing high-quality textile end products. Online yarn testing can reduce latency in necessary process control by providing rapid insights into yarn quality, leading to the production of superior quality yarns. This paper proposes the development and application of information resources for the education and teaching of yarn history based on fifth-generation (5G) network technologies. Initially, the yarn database is preprocessed using Grayscale transformation and image filtering methods. Secondly, yarn segmentation is implemented using a Multi-resolution Markov Random Field (MRMRF) model. The statistical and relative features are extracted using Fourier transform and two-scale attention model respectively. We propose Improved Support Vector Machine (ISVM) classification for classifying the yarn images. The 5G network is initialized and Transmission Control Protocol is used for data transfer. To enhance the performance we propose an Improved Particle Swarm Optimization (IPSO) algorithm. The performance of the suggested methodology is analyzed and compared with existing methodologies using the MATLAB simulation tool. The classification performance of the proposed algorithm indicates that the 5G framework might provide an accurate, fast, reliable, and cost-effective solution to industrial automation.