Abstract:Barreled mineral water needs to be tested before leaving the factory to see if there are foreign bodies in it to reduce safety risks. The foreign body detection of mineral water based on computer vision technology is a kind of common method.However, barreled mineral water data is difficult to obtain, and directly deploying models trained on bottled mineral water data to barreled mineral water for detection will result in a sharp performance decline due to domain shift.In order to solve the above problems, a domain adaptive foreign body detection method based on adversarial learning was proposed.To be specific, an automatic device is designed to produce foreign body detection data set of barreled mineral water.Then, a foreign body detection model was trained on a bottled mineral water sample, taking into account its easy availability.Secondly, in order to improve the generalization ability of the model, a domain classifier is designed by introducing the idea of adversarial learning, and the bottled and bottled mineral water are confused and classified by adversarial training to learn domain invariant features.Finally, the effectiveness and superiority of the proposed method are proved by experiments.