Defect inspection is indispensable process in manufacturing, and automatic optical inspection (AOI) has been rapidly applied to various areas. In AOI, artificial intelligence (AI) based deep learning methods are more and more advantageous in many fields. However, obtainment of high-performance deep learning algorithms always requires a large amount of training data, while defect samples are often scarce. So small sample has become one of the key problems in the industrial application of deep learning algorithms. Transfer learning enable us to utilize the knowledge of source domains to improve performance on target domain, which could be used to tackle the small sample problem intuitively. Therefore, this paper proposes a defect inspection network which is based on one of the transfer learning techniques: domain adaptation. We name the network as multi-source and multi-scale weighted domain adaptation network which is based on adversarial learning. Firstly, three adversarial domain adaptation modules are proposed to align feature distributions between multi-source domains and target domain under three scales, which make the backbone extract domain-invariant features. Simultaneously, the weights of domain adaptation module under each scale are set reasonably. Secondly, in order to reduce the effect of negative transfer, a novel similarity weight is proposed, which is applied on domain adaptation modules. Finally, experiments are carried out to prove the effectiveness of our method. The results show that our method can improve the mean average precision(mAP) from 62.3 to 78.5 in the case of 40 samples available for 4 defect categories, which surpasses other counterparts.