Vegetable and fruit type pattern recognition method combined with visual target detection
Patent Information
- Application Number
- CN202410697001.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2044-05-31
AI Technical Summary
[0004]针对上述现有技术,本发明提供一种结合视觉目标检测的蔬果种类模式识别算法,以解决现有技术中由于泛化能力差,评估耗时长等而导致的对蔬果种类识别结果差,搜索效率低的问题
[0031]In the method of this invention, the acquired vegetable and fruit type identification data is used as the mathematical model for establishing vegetable and fruit type identification. The vegetable and fruit type identification design is quantitatively calculated, and the vegetable and fruit type inference accuracy is used as the objective function. A deep learning optimization algorithm is adopted to improve the ability to extract global information in the image space, thus solving the problem of poor globality in the existing technology when solving the vegetable and fruit type identification problem.
Smart Images

Figure CN118570794B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to two major fields: pattern recognition and agricultural technology, and mainly to a pattern recognition algorithm for fruit and vegetable varieties that combines visual target detection. Background Technology
[0002] In recent years, with the development of technology and the diversification of consumer demand, the retail industry has faced many challenges and opportunities. For example, in terms of fruit and vegetable identification, how to accurately and quickly identify the type and quality of fruits and vegetables and process checkout is a problem that new retail models such as unmanned supermarkets urgently need to solve. However, fruit and vegetable identification is a complex problem, with low accuracy and low efficiency, making it difficult to achieve effective identification.
[0003] Traditional pattern recognition algorithms are a common and effective means of solving complex recognition problems, and have been widely applied in various image recognition problems. For the problem of identifying fruit and vegetable varieties, they can find the optimal recognition model from a global perspective. However, these algorithms face some challenges in fruit and vegetable classification. First, they usually require manual feature extraction, such as color, shape, and texture, which requires specialized knowledge and may fail to extract effective features in complex environments. Second, these methods are sensitive to image lighting, angle, and scale; changes in environmental conditions may affect recognition results. Third, traditional pattern recognition methods have high computational complexity and may not be able to handle large-scale fruit and vegetable classification problems in real time. Finally, due to their reliance on manually extracted features and specific classifiers, traditional pattern recognition methods may have poor generalization ability and may fail to accurately identify unfamiliar fruit and vegetable varieties. Therefore, how to use traditional pattern recognition algorithms to accurately identify fruit and vegetable varieties within an acceptable timeframe while overcoming their sensitivity to image noise and lighting changes remains a problem to be solved. Summary of the Invention
[0004] In view of the above-mentioned prior art, the present invention provides a vegetable and fruit type pattern recognition algorithm that combines visual target detection, so as to solve the problems of poor vegetable and fruit type recognition results and low search efficiency caused by poor generalization ability and long evaluation time in the prior art.
[0005] To address the aforementioned technical problems, this invention proposes a method for vegetable and fruit type pattern recognition that combines visual object detection. This method solves the problems of poor generalization ability and long evaluation time in existing vegetable and fruit type recognition methods, leading to poor identification results and low search efficiency. The visual neural network, constructed based on a convolutional neural network, includes two convolutional layers, two pooling layers, one fully connected layer, and one linear classification layer. The two convolutional layers and two pooling layers are arranged alternately, and each pooling layer is followed by a nonlinear layer. The sequentially connected convolutional and pooling layers extract local features from the image and reduce the tensor dimension. The fully connected layer handles complex internal relationships in latent variables. The linear classification layer obtains the estimated probabilities of various classes corresponding to the image. The visual neural network utilizes historical data from vegetable and fruit type recognition as an auxiliary training method, replacing manual feature extraction and saving feature processing time. A gradient optimization strategy is used as the optimization operator. During algorithm optimization, the generated image features are used to predict the type, and the classification results of the visual neural network drive the gradient optimizer to optimize the visual neural network.
[0006] Furthermore, the vegetable and fruit type pattern recognition method of the present invention mainly includes a training process and an inference process.
[0007] The training process of the vegetable and fruit type pattern recognition method of the present invention includes:
[0008] Step 1-1) Database initialization: retrieve historical data for fruit and vegetable image recognition from the database. The database contains information about fruit and vegetable images and the types of fruits and vegetables corresponding to the images. The types of fruits and vegetables are category tags.
[0009] Steps 1-2) Preprocess the image data and category information to obtain image data with a uniform shape and preprocess the category tags corresponding to the image data to convert the category tags into one-hot encoded forms.
[0010] Steps 1-3) After processing the fruit and vegetable images using the aforementioned visual neural network, image features are obtained. A linear classification layer is used to identify the image features and obtain the estimated probabilities of various classes for the fruit and vegetable images. The optimization objective is to minimize the cross-entropy between the model's class output and the actual class. The cross-entropy between the estimated probability and the label is calculated as the loss. The gradient of the loss is calculated, and the network parameters are updated. The steps after image feature extraction are repeated until the model converges. Thus, a visual neural network model that can effectively extract image information and classify fruits and vegetables is trained. In this invention, the visual neural network feature extraction strategy uses historical data of fruit and vegetable class identification to train the visual neural network. During the algorithm optimization process, the generated image features are used to predict the class, replacing the step of manually extracting features and saving algorithm optimization time.
[0011] Furthermore, the specific steps of steps 1-3) include:
[0012] 1-3-1) The preprocessed image data is used as the input of the convolutional neural network model. After processing, an embedding vector representing the fruit and vegetable image is obtained, and the embedding vector represents the image features.
[0013] 1-3-2) Use the embedding vector corresponding to each image data as the input of the linear classification layer to obtain the estimated probability of each class corresponding to the image data;
[0014] 1-3-3) Based on the one-hot encoding of the image data and the estimated probability, calculate the cross-entropy between the two as the loss;
[0015] 1-3-4) Differentiate the loss to obtain the gradients of the visual neural network and the linear classification layer;
[0016] 1-3-5) Based on the gradients of each parameter, the adaptive moment estimator Adam is used to optimize the parameters of the model and calculate the updated values of each parameter;
[0017] 1-3-6) Update the parameters of the visual convolutional neural network and the linear classification layer based on the updated values;
[0018] 1-3-7) Repeat steps 1-3-1) to 1-3-6) until the visual neural network and the linear classification layer converge, indicating that the loss fluctuates within a stable range, and then end the training.
[0019] In steps 1-3-5), the acquired fruit and vegetable type identification data is used as the basis for establishing a mathematical model for fruit and vegetable type identification. The design for fruit and vegetable type identification is quantitatively calculated, with the accuracy of fruit and vegetable type inference as the objective function. Based on deep learning, the model is optimized using the adaptive moment estimator (Adam), and its parameters are optimized using the following formula: Where θ represents the parameters of the model. The gradient of the loss function is represented; the update strategy is as follows:
[0020] h=W1(W2(Pool1(Conv1(Pool2(Conv2(I))))))
[0021]
[0022]
[0023] Where I represents the input image, W represents a fully connected layer, Pool represents a pooling layer followed by a non-linear layer, Conv represents a convolutional layer, softmax represents the softmax function, L represents the loss function, CE represents the cross-entropy function, and θ represents the model parameters. denoted by , the gradient of the loss function is represented, and Adam represents the adaptive moment estimator optimizer.
[0024] The reasoning process of the vegetable and fruit type pattern recognition method of the present invention includes:
[0025] Step 2-1) Database initialization: retrieve historical data on fruit and vegetable image recognition from the database, which contains information on fruit and vegetable images.
[0026] Step 2-2) Preprocess and crop the input fruit and vegetable images to the same size as those in the training process;
[0027] Steps 2-3) The preprocessed image information is used as the input of the visual neural network. After processing, the embedding vector representing the image information is obtained. The embedding vector corresponding to each image is used as the input of the linear classification layer of the trained visual neural network model. The linear classification layer is used to identify the image features and obtain the estimated probability of each class of the fruit and vegetable image.
[0028] Steps 2-4) Determine whether the estimated probability of each category reaches the threshold; if no category's estimated probability value reaches the threshold, the image classification result is considered to have low credibility and an error is reported; otherwise, use the category with the highest probability as an index to retrieve the unit price corresponding to that category of fruit and vegetable as the output result; return the unit price corresponding to that category.
[0029] Steps 2-5) Repeat steps 2-1) to 2-4) until you get the unit price corresponding to all the fruit and vegetable pictures.
[0030] Compared with the prior art, the beneficial effects of the present invention are:
[0031] In the method of this invention, the acquired vegetable and fruit type identification data is used as the mathematical model for establishing vegetable and fruit type identification. The vegetable and fruit type identification design is quantitatively calculated, and the vegetable and fruit type inference accuracy is used as the objective function. A deep learning optimization algorithm is adopted to improve the ability to extract global information in the image space, thus solving the problem of poor globality in the existing technology when solving the vegetable and fruit type identification problem.
[0032] In this invention, a visual neural network is trained using historical data for fruit and vegetable identification as an aid. The neural network replaces most of the fruit and vegetable feature extraction process in the traditional pattern recognition algorithm, saving performance simulation and analysis time and solving the problem that existing technologies cannot obtain results in real time when solving fruit and vegetable identification problems.
[0033] In this invention, the classification characteristics of visual neural networks are combined with the optimization characteristics of deep learning algorithms. The classification results drive deep learning optimization, thereby improving the ability to identify different types of fruits and vegetables. This solves the problems of poor optimization results and low search efficiency in existing technologies when solving the problem of identifying different types of fruits and vegetables. Attached Figure Description
[0034] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0035] Figure 1 This is an algorithm flowchart of an embodiment of the vegetable and fruit type pattern recognition method of the present invention;
[0036] Figure 2 This is a flowchart of an embodiment of the vegetable and fruit type pattern recognition method of the present invention;
[0037] Figure 3 This is a schematic diagram of a visual neural network for an embodiment of the vegetable and fruit type pattern recognition method of the present invention. Detailed Implementation
[0038] The design concept of this invention, a method for vegetable and fruit type pattern recognition combining visual target detection, aims to address the problems of poor generalization ability and long evaluation time in existing vegetable and fruit type recognition methods, resulting in poor identification results and low search efficiency. This invention utilizes convolutional neural networks and deep learning algorithms, employing a visual neural network as a feature extractor. It trains a model using historical data of vegetable and fruit images containing type information, replacing manual feature extraction with a neural network to save feature processing time. The classification results drive a gradient optimizer to optimize both the visual neural network and the feature extractor. The visual neural network uses historical data for vegetable and fruit type recognition as an aid in training. During algorithm optimization, it predicts the type of image features generated, replacing manual feature extraction with a neural network to save feature processing time. Gradient optimization is used as an optimization operator, with the classification results of the visual neural network driving the gradient optimizer to optimize the visual neural network.
[0039] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] In this embodiment, fruit and vegetable type recognition can be applied to different types of fruits and vegetables, such as apples, bananas, and oranges. The goal is to accurately and quickly identify the type of fruit and vegetable and return its unit price. This embodiment implements a deep learning optimization algorithm based on a visual neural network. Through deep learning, a set of optimized visual neural network parameters for fruit and vegetable type recognition is found.
[0041] Figure 1 A flowchart illustrating an embodiment of the vegetable and fruit type pattern recognition method of the present invention is shown, including the following steps:
[0042] S1: Obtain historical data for fruit and vegetable image recognition, including image file data and corresponding fruit and vegetable type information;
[0043] S2: Preprocess the image file data and vegetable and fruit type information to obtain unique hot codes for image data and type information with uniform shape;
[0044] S3: Adopt a vegetable and fruit type pattern recognition algorithm that combines visual object detection, with the optimization objective of minimizing the cross-entropy between the model's type output and the actual type, to train a convolutional neural network model that can effectively extract image information and classify vegetables and fruits.
[0045] S4: Using a trained visual neural network, extract information from unlabeled fruit and vegetable images and output an estimate of the types of fruits and vegetables in the image. After obtaining the estimated types, output the unit price of the corresponding types of fruits and vegetables.
[0046] In this embodiment, the fruit and vegetable type recognition can be applied to different types of fruits and vegetables, such as apples, bananas, and oranges. The goal is to accurately and quickly identify the type of fruit and vegetable and return its unit price. In Embodiment 1, a deep learning optimization algorithm based on a visual neural network is implemented. Through deep learning, a set of optimized visual neural network parameters for fruit and vegetable type recognition is found.
[0047] See Figure 2 The method steps implemented in this embodiment include: First, initializing the database: for the inference process, the database contains vegetable and fruit image information; for the training process, it also contains vegetable and fruit types. Preprocessing the data involves cropping the images into square images with the same side length and converting the type labels into one-hot encoding. Using a convolutional neural network to process the images, image features are obtained. A linear classification layer is used to identify the image features and obtain estimated probabilities for each class of the image. In the training process, the cross-entropy between the estimated probability and the label is calculated as the loss; the gradient of the loss is calculated, and the network parameters are updated. The steps following image feature extraction are repeated until the model converges. In the inference process, it is determined whether the estimated probabilities of each class reach a threshold. If no class estimate reaches the threshold, the image classification result is considered to have low credibility, and an error is reported. If a class reaches the threshold, the class with the highest probability is used as an index to retrieve the unit price corresponding to that type of vegetable and fruit as the output result.
[0048] In this embodiment, S2 preprocesses the image file data and vegetable / fruit type information to obtain one-hot encodings of image data and type information with uniform shapes, including:
[0049] S21: Process the image file data and convert it into a square image x with the same side length;
[0050] S22: Obtain the total number of all fruit and vegetable varieties as the encoding length N, and give each image a corresponding one-hot encoding as the variety label y;
[0051] In this embodiment, S3: A vegetable and fruit type pattern recognition algorithm combining visual object detection is adopted, with the optimization objective of minimizing the cross-entropy between the model's type output and the actual type, to train a convolutional neural network model that can effectively extract image information and classify vegetables and fruits; the specific steps of the training process include:
[0052] S31: The preprocessed image information is used as the input to the convolutional neural network, and the resulting embedding vector h represents the information.
[0053] S32: Use the embedding vector h corresponding to each image as the input of the linear classification layer to obtain the estimated probability ˉy of each class corresponding to the image;
[0054] S33: Calculate the cross-entropy between the image label y and the estimated probability as the loss l;
[0055] S34: Take the derivative of the loss to obtain the gradients of the convolutional neural network and the linear classification layer;
[0056] S35: Calculate the updated values of each parameter using the optimizer based on the gradient of each parameter;
[0057] S36: Update the parameters of the convolutional neural network and the linear classification layer based on the updated values;
[0058] S37: Repeat steps S31 to S36 until the convolutional neural network and the linear classification layer converge, i.e., the loss fluctuates within a stable range.
[0059] In this embodiment, S4: Combining the trained visual neural network, information is extracted from the unlabeled fruit and vegetable images, and an estimate of the types of fruits and vegetables in the image is output. After obtaining the estimated types, the unit price of the corresponding types of fruits and vegetables is output. The specific steps of the inference process include:
[0060] S41: Preprocess the input image and crop it into a rectangular image x of the same size as the one used during training;
[0061] S42: The preprocessed image information is used as the input to the convolutional neural network, and the resulting embedding vector h represents the information.
[0062] S43: Use the embedding vector h corresponding to each image as the input of the linear classification layer to obtain the estimated probability y of each class corresponding to the image;
[0063] S44: Determine if any species probability exceeds the threshold. If none exceed the threshold, prompt an error; otherwise, output the species with the highest probability.
[0064] S45: Return the unit price corresponding to the type;
[0065] S46: Repeat steps S41 to S45 until the algorithm reaches the termination condition, that is, all images have been processed.
[0066] See Figure 2 This embodiment provides a flowchart of a vegetable and fruit type pattern recognition algorithm that combines visual target detection. Specifically, it includes the following steps:
[0067] 1) Database initialization: The database of this invention mainly consists of two parts:
[0068] The category labels used in the training process are Y = {y_i | i = 1, 2, ..., N; y_i = 1, 2, ..., D};
[0069] Where N represents the number of tags and D represents the number of categories;
[0070] The input images of fruits and vegetables are I = {x_i | i = 1, 2, ..., N; x_i ∈ R^(H × W × C)};
[0071] Where H and W represent the length and width of the image, and C represents the number of channels in the image;
[0072] 2) Data preprocessing: The labels are preprocessed to transform them into one-hot vectors Y^'={y_i^'|y_(i,j)^'=1if y_i=j,else y_(i,j)^'=0,i=1,2,…,N,j=1,2,…,D}; The images are cropped to obtain square images of the same size I^'={x_i|i=1,2,…,N;x_i∈R^(S×S×C)};
[0073] Where S represents the size of the converted image.
[0074] 3) Using neural networks to extract image features: See Figure 3 This embodiment illustrates a visual neural network based on a convolutional neural network. The visual neural network consists of two convolutional layers, two pooling layers, one fully connected layer, and one linear classification layer. Each pooling layer is followed by a non-linear processing step (not shown in the diagram). The convolutional layers are used to extract local features from the image. The pooling layers, following the convolutional layers, efficiently extract local features and reduce the tensor dimension. The fully connected layer handles the complex internal relationships in the latent variables and obtains the image's feature vector. The linear classification layer obtains the estimated probabilities of each class corresponding to the image. The formula for the entire feature extraction process is as follows:
[0075] h=W_1(W_2(〖Pool〗_1(〖Conv〗_1(〖Pool〗_2(〖Conv〗_2(I^'))))))
[0076] Where W represents a fully connected layer, Pool represents a pooling layer with a tail nonlinear layer, and Conv represents a convolutional layer;
[0077] 4) Predicting Class Probabilities: This invention utilizes a linear classification layer to map image features to estimated probabilities of various classes, as described by the following formula:
[0078] ˉY=softmax(W(h))
[0079] Where W represents the linear classification layer, and softmax represents the softmax function.
[0080] 5) Loss calculation: This invention uses the cross-entropy between the one-hot vector of the label and the model prediction probability as the loss function, and its formula is expressed as follows: L=CE(Y^',ˉY);
[0081] Where L represents the loss and CE represents the cross-entropy function.
[0082] 6) Parameter Update: This invention utilizes the Adam optimizer to optimize the model's parameters, using the following formula:
[0083] Where θ represents the parameters of the model, The gradient of the loss function is represented by , and Adam represents the adaptive moment estimator optimizer.
[0084] 7) Probability threshold judgment and result selection: The maximum selection probability p_max = max(ˉY) is compared with the threshold ∈. If p_max < ∈, it means that the model is uncertain about the image type. There may be no known types of fruits and vegetables, or multiple types of fruits and vegetables may exist at the same time. In this case, the model will prompt an error. Otherwise, the model will output y = argmax(ˉY) as an estimate of the image type and output the corresponding unit price.
[0085] In summary, the method of this invention uses the acquired fruit and vegetable type identification data as the basis for establishing a mathematical model for fruit and vegetable type identification. It quantitatively calculates the fruit and vegetable type identification design, uses the fruit and vegetable type inference accuracy as the objective function, and employs a deep learning optimization algorithm to improve the ability to extract global information from the image space. This solves the problem of poor globality in existing technologies when solving fruit and vegetable type identification problems. This invention utilizes historical data from fruit and vegetable type identification to train a visual neural network as an aid, replacing most of the fruit and vegetable type feature extraction process in traditional pattern recognition algorithms. This saves performance simulation and analysis time, improves the ability to identify fruit and vegetable types, and solves the problems of poor optimization results and low search efficiency in existing technologies when solving fruit and vegetable type identification problems.
[0086] The method of this invention can accurately and quickly identify the types and quality of fruits and vegetables and complete the checkout process. It has great potential for transformation, especially in new retail models such as unmanned supermarkets, to meet the needs of consumers in the retail industry, save human resources, and enhance market competitiveness.
[0087] Although the present invention has been described above in conjunction with the accompanying drawings, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many improvements and changes under the guidance of the present invention without departing from the spirit of the present invention, and these improvements and changes are all within the protection scope of the present invention.
Claims
1. A method for recognizing vegetable and fruit types by combining visual target detection, characterized in that, include: A visual neural network is constructed based on a convolutional neural network. The visual neural network includes two convolutional layers, two pooling layers, one fully connected layer, and one linear classification layer. The two convolutional layers and two pooling layers are arranged alternately. All of the pooling layers are followed by nonlinear layers. The convolutional layers and pooling layers connected in sequence are used to extract local features of the image and reduce the tensor dimension. The fully connected layer is used to process the complex internal relationships in the latent variables. The linear classification layer is used to obtain the estimated probabilities of each class corresponding to the image; The visual neural network is trained using historical data for fruit and vegetable identification as an aid, and employs a gradient optimization strategy as an optimization operator. During the algorithm optimization process, the generated image features are used to predict the types of the neural network. The classification results of the visual neural network drive the gradient optimizer to optimize the visual neural network. This method includes a training process and an inference process, wherein: The training process includes: Step 1-1) Database initialization: retrieve historical data for fruit and vegetable image recognition from the database. The database contains information about fruit and vegetable images and the types of fruits and vegetables corresponding to the images. The types of fruits and vegetables are category tags. Steps 1-2) Preprocess the image data and category information to obtain image data with a uniform shape and preprocess the category tags corresponding to the image data to convert the category tags into one-hot encoded forms. Steps 1-3) After processing the fruit and vegetable images using the aforementioned visual neural network, image features are obtained. A linear classification layer is used to identify the image features and obtain the estimated probabilities of each class in the fruit and vegetable image. The optimization objective is to minimize the cross-entropy between the model's class output and the actual class. The cross-entropy between the estimated probability and the label is calculated as the loss. The gradient of the loss is calculated and the network parameters are updated. The steps after image feature extraction are repeated until the model converges. Thus, a visual neural network model that can effectively extract image information and classify fruits and vegetables is trained. The reasoning process includes: Step 2-1) Database initialization: retrieve historical data on fruit and vegetable image recognition from the database, which contains information on fruit and vegetable images; Step 2-2) Preprocess and crop the input fruit and vegetable images to the same size as those in the training process; Steps 2-3) The preprocessed image information is used as the input of the visual neural network. After processing, the embedding vector representing the image information is obtained. The embedding vector corresponding to each image is used as the input of the linear classification layer of the trained visual neural network model. The linear classification layer is used to identify the image features and obtain the estimated probability of each class of the fruit and vegetable image. Steps 2-4) Determine whether the estimated probability of each category reaches the threshold; if no category's estimated probability value reaches the threshold, the image classification result is considered to have low credibility and an error is reported; otherwise, use the category with the highest probability as an index to retrieve the unit price corresponding to that category of fruit and vegetable as the output result; return the unit price corresponding to that category. Steps 2-5) Repeat steps 2-1) to 2-4) until you get the unit price corresponding to all the fruit and vegetable pictures.
2. The method for recognizing vegetable and fruit varieties according to claim 1, characterized in that, The specific steps in steps 1-3) include: 1-3-1) The preprocessed image data is used as the input of the convolutional neural network model. After processing, an embedding vector representing the fruit and vegetable image is obtained, and the embedding vector represents the image features. 1-3-2) Use the embedding vector corresponding to each image data as the input of the linear classification layer to obtain the estimated probability of each class corresponding to the image data; 1-3-3) Based on the one-hot encoding of the image data and the estimated probability, calculate the cross-entropy between the two as the loss; 1-3-4) Differentiate the loss to obtain the gradients of the visual neural network and the linear classification layer; 1-3-5) Based on the gradients of each parameter, the adaptive moment estimator Adam is used to optimize the parameters of the model and calculate the updated values of each parameter; 1-3-6) Update the parameters of the visual convolutional neural network and the linear classification layer based on the updated values; 1-3-7) Repeat steps 1-3-1) to 1-3-6) until the visual neural network and the linear classification layer converge, indicating that the loss fluctuates within a stable range, and then end the training.
3. The method for recognizing vegetable and fruit varieties according to claim 2, characterized in that, In steps 1-3-5), the acquired fruit and vegetable category identification data is used as the basis for establishing a mathematical model for fruit and vegetable category identification. The design for fruit and vegetable category identification is quantitatively calculated, with the accuracy of fruit and vegetable category inference as the objective function. Based on deep learning, the model is optimized using the adaptive moment estimator (Adam), with the formula: θ ← Adam(θ, ), where θ represents the parameters of the model, The gradient of the loss function is represented; the update strategy is as follows: Where I represents the input image, W represents a fully connected layer, Pool represents a pooling layer followed by a non-linear layer, Conv represents a convolutional layer, softmax represents the softmax function, L represents the loss function, and CE represents the cross-entropy function. Represents the parameters of the model. denoted by , the gradient of the loss function is represented, and Adam represents the adaptive moment estimator optimizer.