Abstract: Semi-supervised learning for image classification is an important research area in computer vision. These algorithms typically assume that both labeled and unlabeled datasets are class-balanced and share the same distribution. However, when there is an imbalance in the class distribution, it can significantly affect their performance. To address this issue, we propose MW-FixMatch, a novel approach that better adjusts the semi-supervised learning process in the presence of class imbalance. It utilizes a weight network to balance the contribution of labeled and unlabeled data, and the parameters of this network are learned from a class-balanced sampled set. We tested our approach on several publicly available image datasets with class imbalance and consistently achieved superior results across multiple experiments.