Defects in coffee beans can significantly impact the quality of coffee production, which can lead to a decrease in the price of coffee beans in the global coffee market. Currently, coffee bean sorting is still conventionally done to separate defective and non-defective coffee beans, which is a time-consuming process and subject to subjective selection, potentially leading to a decline in the quality of the resulting coffee beans. The objective of this research is to design and measure the performance of deep learning algorithms, CNN MobilNetV2 and DenseNet201, using transfer learning methods where hyperparameter tuning grid search is employed to select the optimal combination of hyperparameters for the defective coffee bean classification model. The study began by collecting a dataset of images of abnormal and defective coffee beans, building a classification model using transfer learning methods that utilized pre-trained models and selecting the best hyperparameters, training the model, and finally testing the created classification model. The research results indicate that the pre-trained MobileNetV2 model with hyperparameter tuning achieved an accuracy of 90%, and the pre-trained DenseNet201 model achieved an accuracy of 93%. The research results indicate that this approach enables the model to achieve excellent performance in recognizing and classifying defective coffee beans with high accuracy