| Green beans are a valuable agricultural product that can be used as food for markets and as industrial raw materials to make various products,which have economic and environmental protection value.However,green beans are a crop that is susceptible to disease and deep learning can be used for green bean disease recognition to quickly respond to disease outbreaks,reducing losses and impact.In this study,based on existing domestic and foreign research,we proposed an improved K-means and morphology combined leaf segmentation algorithm which solved the problem of interference information in the background of green bean leaf images.An intelligent optimization algorithm,squirrel search algorithm,was used to select the initial clustering center of K-means,to avoid the problem of traditional Kmeans possibly falling into the local optimal solution.The clustering accuracy of the algorithm was improved by 2.26%and the standard deviation was decreased by 0.3113 compared to the original K-means algorithm.After clustering,the interference of the background and other parts was reduced using morphological operation,and then the leaf segmentation was implemented using Suzuki to extract the contour of the leaf.To solve the problem of interference information in the green bean leaf segmentation method based on the improved K-means and morphology combined algorithm,a green bean leaf segmentation method based on the semantic segmentation network U-Net was used to achieve more accurate leaf segmentation,and the segmentation accuracy reached 93.1%.To evaluate the severity of green bean disease,we used a disease lesion segmentation algorithm based on the CIVE index and Otsu algorithm on the basis of leaf segmentation.The algorithm firstly calculated the CIVE index,then used the Otsu algorithm to divide the image into a disease lesion region and a background region,and set the lesion pixel point as 1 and the vegetation pixel point as 0 to achieve accurate lesion segmentation.Finally,the ratio K of the lesion area to the leaf area was calculated to classify the disease level,successfully evaluating the severity of green bean disease.For the problem of green bean disease recognition,a lightweight VGG16 model was designed by using global average pooling instead of fully connected layers to reduce the number of model parameters,introducing Ghost convolutional kernels to replace standard convolutional kernels to reduce model computation,and integrating lightweight SA-NET attention mechanisms to enhance the model’s representation ability.These modifications reduced the model parameters by 28 times and reduced the number of computations by 50.12%.The recognition time was decreased by 48.6%,although the recognition accuracy slightly decreased by 1.4%.The designed green bean disease recognition algorithm was lightweight and efficient,suitable for real-time and high-accuracy recognition.Finally,based on the aforementioned algorithm designs,a green bean disease recognition system was developed using PyQt5 and Uniapp frameworks for both PC and mobile terminals.The system includes leaf segmentation,level classification,disease recognition,and agricultural encyclopedia functionality.The disease recognition module is fast and accurate,helping agricultural practitioners save time and labor costs.The system structure is simple and easy to use and both versions of the system are user-friendly,practical,and efficient,catering to the demands of users for different platforms.. |