| With the development of smart agriculture,the level of information technology in the production and circulation of vegetables has been increasing.Examples of this include vegetable grading,food traceability,and vegetable self-service shopping.Currently,the vegetable market circulation process is mainly done manually for vegetable grading,sales,etc.,which is easily influenced by experience and is inefficient.Therefore,introducing computer vision technology into the vegetable circulation process can promote the development of agricultural intelligence and has great practical value.There are currently two main methods for the technical research of vegetable image recognition.One is traditional image processing,which requires manually setting a large number of related parameters to extract vegetable features.The other is based on a deep learning Convolutional Neural Network(CNN),which extracts features through training rather than programming and has better flexibility and robustness.The diversity and similarity of vegetables make them difficult to identify.Therefore,this article proposes improvements to the CNN model based on deep learning methods to further improve the accuracy of the model’s vegetable recognition.The improved model is then deployed on a high-performance cloud server,and a vegetable recognition terminal system with a C/S(client/server)architecture is designed and implemented to improve the efficiency of vegetable market circulation.The main work of this article is as follows:(1)Propose a vegetable recognition model that combines the CNN and Transformer architectures.By analyzing the differences in feature extraction emphasis between CNN networks and Vision Transformer networks in the field of image classification,a hybrid network is constructed using a parallel structure to leverage the strengths of both networks,named Cc T(CNN coupling Transformer).The CNN branch consists of multiple residual modules,focusing on extracting local features from vegetable images.The Transformer branch consists of Transformer modules,focusing on extracting global features from vegetable images.The branch networks interactively couple their features,enhancing the overall feature extraction capability of the network.The model’s effectiveness in vegetable recognition is demonstrated by conducting experiments and comparing its performance with various classification models,using a self-built dataset consisting of 34 vegetable categories and conducting specific accuracy tests for each vegetable category.(2)Cloud deployment of vegetable recognition model based on Flask.First,analyze the deployment methods of deep learning models and choose the cloud deployment approach.Then,upload the trained Cc T vegetable recognition model to the Alibaba Cloud ECS server.Utilizing Flask framework as the foundation,along with stable communication provided by u WSGI and the powerful reverse proxy and load balancing capabilities of Nginx,the vegetable recognition service is deployed in the cloud.Additionally,a web page for online vegetable recognition is designed to showcase the functionality of the deployed service.Finally,the response time of the vegetable recognition service deployed in the cloud is tested,and the results indicate that the solution meets real-time requirements.(3)Design and implement a client-server(C/S)architecture vegetable recognition terminal system.The terminal system is analyzed and designed based on feasibility and actual requirements.The vegetable recognition terminal is built on the foundation of a vegetable sales electronic scale and includes functionalities such as image acquisition and cloud communication.The system backend is supported by cloud servers to enable vegetable recognition.Hardware platforms are constructed based on functional requirements,and the design of the system’s database and visual user interface is completed.Finally,the vegetable recognition terminal system is demonstrated for its real-world effectiveness,and its feasibility is validated through functionality and performance testing. |