As an important renewable resource, wood is widely used in various industries. When addressing wood defects that limit the amount of wood used during processing, manual inspection and other technologies are not suitable for automated production scenarios. In this paper, we first establish our own dataset, which includes information about multiple tree species and multiple defects types, to enhance the overall applicability of the proposed model. Second, target detection technology involving deep learning is used for defect detection. The conditional parametric convolution (CondConv), Wise-IoU, and BiFormer modules are used to improve upon the latest YOLOv8 algorithm. Based on the experimental findings, the suggested approach exhibits notable improvements in terms of both the mAP@0.5 index and the mAP@0.5:0.95 index, surpassing the performance of the YOLOv8 algorithm by 3.5% and 5.8%, respectively. It also has advantages over other target detection algorithms. The proposed method can effectively improve wood utilization and automated wood processing technology.