| Tomatoes are rich in nutrients and have a special flavor.As a common crop in my country,its yield is often affected by diseases such as yellowing disease,late blight,and brown spot.If the disease can be accurately classified and identified during the tomato seedling period,and corresponding methods and methods can be adopted to treat the disease,then the yield of tomatoes can be increased to a certain extent,and its loss can be reduced.However,the difficulty lies in how to diagnose tomato diseases as accurately as possible.The traditional detection and diagnosis of tomato diseases relies on professional and technical personnel,who use their knowledge and experience to diagnose tomato diseases.However,traditional detection methods have certain limitations in terms of the number of experts,detection efficiency,prevention scope,and detection accuracy,etc.,and cannot meet the development needs of modern agriculture.In order to solve the above problems and achieve the goal of precise prevention and control of agricultural diseases and agricultural modernization,this paper is based on the deep learning theory and constructs a convolutional neural network to identify and classify 9 kinds of tomato leaves.This article first analyzes and explains 9 tomato leaf disease images that need to be identified and classified,namely,yellowing disease,late blight,spot blight,health,brown spot,early blight,leaf mold,and bacterial spot.Disease,mosaic disease,analyzed the distribution of these 9 data sets,and pointed out the problem of the uneven number of samples in the data sets.Later,in order to study the impact of the imbalance of the sample data of the data set on the model,this paper uses the method based on transfer learning to train and identify four classic CNN models such as VGG16,Inception V3,Res Net50,Mobile Net V2,etc.The experiment shows that when the class is A good recognition effect can be achieved when the number of samples is small and the sample distribution is balanced;but after adding some other categories with unbalanced sample sizes,the recognition effect of the model drops sharply,indicating that the unbalanced number of samples in the data set will make the model performance Decrease,reduce the recognition rate.Therefore,in response to this problem,this paper proposes a method of using data enhancement and improving the loss function.Then the data enhancement technology is used to expand the small number of samples in the original data set to ensure that the number of samples for each category is around 3000,that is,to ensure the balance.Due to the expansion of the data volume,only the number of training rounds is increased under other conditions unchanged.Training and testing on four kinds of neural networks,the experimental results show that the use of data augmentation technology can improve the accuracy of model recognition to a certain extent,increase the F1 value of difficult-to-classify categories,and improve the recognition accuracy to a certain extent,making the model The performance is optimized.Among them,Mobile Net V2 has the highest recognition accuracy,reaching 94.87%.Finally,a weighted loss function is used to replace the traditional cross-entropy function.Keeping other conditions unchanged,training and testing are performed on the four neural networks.The analysis of the experimental results shows that the improved weighted loss function can improve the recognition accuracy and F1 value to a certain extent.Among them,Mobile Net V2 still maintains the highest accuracy rate of 95.53%. |