Classification Algorithm of Class Imbalance Cocoon Images Based on Improved ResNet-50
In the process of silk reeling, the cocoons should be selected and classified one by one according to the re-quirements of reeling process before reeling.Aiming at the problems of large intra-class differences, small inter-class differences and class imbalance in cocoon image data, this paper proposes a classification algorithm of class imbalance cocoon images based on improved ResNet-50.Based on the ResNet-50 feature extraction network, this algorithm ob-tained the attention map from the feature map and divided it into regions.The feature value of the region with the largest attention intensity was halved to suppress the features of the most significant region.The most significant region feature was then extracted for feature fusion, so as to increase the defect attention distribution and improve the ability of network representation.The decoupling representation learning and classifier learning were introduced for training.The class bal-anced sampling was used to fine tune the classifier, and low-frequency class parameter optimization loss was introduced to further adjust the classifier decision boundary in the parameter space.The results showed that the classification accuracy of the algorithm on the test set of cocoon images reached 96.203%, and the weigh-ted-F1 score reached 96.196%, which was 1.243 per-centage points and 1.279 percentage points higher than that of the ResNet-50 classification algorithm.The impro-ved algorithm promoted the classification accuracy of silkworm cocoon images in low and medium frequency categories by 0.77 to 9.32 percentage points.The application of the algorithm to the vision module of the cocoon sorting system can effectively improve the efficiency of cocoon sorting.