The measurement of the moisture content of the stored grain in the silos provides the opportunity to take the necessary precautions to store the grain without spoiling. Since it is not possible to obtain all the moisture information of the stored grain with the current methods, in this study, a new method is proposed to determine the moisture content of the grain in real time during the loading processes. For this purpose, popular machine learning (ML) algorithms, i.e., KNN, SVR, and ANN, are used to predict the moisture content of the flowing grain. In order to measure the moisture content of the grain, a free-space electromagnetic measurement setup is constructed. Reflection and transmission coefficients are measured at 103 different frequency points between 1 and 2.48 GHz using a vector network analyzer (VNA) for three different grain types (Bulgur wheat, durum wheat, and corn silage kernel) with moisture content varying between 8% and 25%. In this way, three datasets are constituted as datasets 1-3 corresponding to each grain type. The k-fold cross-validation (k-CV) technique is used to train and test the ML algorithms and the performance of the algorithms is evaluated with five different metrics. In addition, for each grain type, the error rates corresponding to each moisture content are evaluated separately and the relationship between moisture content and performance of algorithms is revealed. While the best results are obtained with KNN for durum wheat and corn silage kernel, SVR method gives the best results for bulgur wheat. This study reveals that the moisture content of flowing grain can he determined, thanks to proper modeling of ML algorithms and measurement setup.