In this paper,we consider to learn the inherent probability distribution of types via knowledge transfer in a two-player repeated Bayesian game,which is a basic model in network security.In the Bayesian game,the attacker's distribution of types is unknown by the defender and the defender aims to reconstruct the distribution with historical actions.It is difficult to calculate the distribution of types directly since the distribution is coupled with a prediction function of the attacker in the game model.Thus,we seek help from an interrelated complete-information game,based on the idea of transfer learning.We provide two different methods to estimate the prediction function in different concrete conditions with knowledge transfer.After obtaining the estimated prediction function,the defender can decouple the inherent distribution and the prediction function in the Bayesian game,and moreover,reconstruct the distribution of the attacker's types.Finally,we give numerical examples to illustrate the effectiveness of our methods.