A dish recognition network construction method based on deep learning and application thereof

By improving the YOLOv4 network structure, the problems of low accuracy and slow speed in food recognition were solved, and an efficient food recognition network suitable for self-service restaurants and canteens was constructed, achieving fast and accurate food recognition.

CN115829003BActive Publication Date: 2026-11-24NINGBO CHAOFANXINGWU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211513670.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2026-11-24
Estimated Expiration
2042-11-29

AI Technical Summary

Technical Problem

Existing food identification technologies suffer from low accuracy, slow speed, and poor robustness, making them particularly difficult to meet the rapid identification needs during peak hours, especially in self-service restaurants and canteens.

Method used

By improving the YOLOv4 network structure, replacing the Mish activation function with the LeakyReLU activation function, pruning the convolutional layers, adding the SPP module, and performing data augmentation and transfer learning to optimize the prior box parameters, a dish recognition network was constructed.

Benefits of technology

It improves the accuracy and speed of identifying subtle features of dishes, enhances the robustness of the network, and is suitable for real-time dish recognition in self-service restaurants and canteens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115829003B_ABST
    Figure CN115829003B_ABST
Patent Text Reader

Abstract

This invention discloses a method for constructing a deep learning-based food recognition network and its application. The method involves establishing a food dataset, manually labeling the dataset to obtain annotation information, and dividing the labeled dataset into a training set and a validation set according to a preset ratio. The YOLOv4 network structure is improved to obtain an improved YOLOv4 network structure, which serves as the food target recognition network. The training set is input into the food target recognition network for training and optimization. During training, the validation set is used to cross-validate the food target recognition network, resulting in a trained food target recognition network, which is then used as the food recognition network, thus completing the construction of the food recognition network. The advantages are that the constructed food recognition network not only improves the accuracy of recognizing subtle features of the food but also increases the recognition speed and exhibits good robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and digital image recognition technology, and in particular to a method for constructing a deep learning-based food recognition network and its application. Background Technology

[0002] Currently, most canteens operate using window queuing and card payment methods. However, due to the concentrated time after get off work or school, canteens become overcrowded during peak hours, requiring long queues for food and payment, resulting in low efficiency, long average dining times, and a poor user experience. Food recognition, as a key technology in nutrition and health application devices, directly impacts service efficiency across various application areas. In self-service restaurants and smart canteens, food recognition technology can quickly identify different categories of food placed in front of cameras, automatically calculating prices based on the items. This effectively solves the problems of queuing for food and payment, as well as uneven portion sizes served by staff, significantly improving the user experience. Furthermore, users can use food recognition technology to learn about the nutritional value and calories of food, supporting the development of healthy eating plans.

[0003] Traditional food image recognition typically employs machine learning classification methods. However, due to variations in ingredients, cooking methods, and shooting angles, food images exhibit significant differences even within the same category of dishes, while different types of dishes may appear quite similar. This results in traditional machine learning classification methods being insufficient in extracting food features. Furthermore, the classifiers used in these methods do not learn comprehensively for complex and variable food images, ultimately leading to low accuracy in food recognition and failing to meet practical needs. With the development of artificial intelligence technology, deep learning techniques, represented by convolutional neural networks, have powerful feature extraction capabilities, significantly improving the accuracy of ordinary object recognition. However, food images contain numerous fine-grained features, which general-purpose recognition networks rarely consider. Therefore, directly using general-purpose recognition networks for food recognition can easily lead to insufficient feature extraction, resulting in missed detections, false detections, unsatisfactory recognition results, and poor robustness. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a method for constructing a dish recognition network based on deep learning and its application, which not only improves the accuracy of recognizing minute features of dishes, but also improves the recognition speed.

[0005] The technical solution adopted by this invention to solve the above-mentioned technical problems is as follows: a method for constructing a dish recognition network based on deep learning, comprising the following steps:

[0006] ① Establish a sample dataset, collect different types of dishes, collect dish images under different lighting conditions for each type of dish to obtain the corresponding dish image subset, and store all dish image subsets into the sample dataset;

[0007] ② Data augmentation techniques were used to augment the sample dataset to obtain the dish dataset;

[0008] ③ Manually label the food dataset and obtain the labeling information. Divide the labeled food dataset into a training set and a validation set according to a preset ratio.

[0009] ④ The YOLOv4 network structure is improved to obtain the improved YOLOv4 network structure, which is then used as the target recognition network for food items to be trained.

[0010] ⑤ Input the training set into the food target recognition network to be trained for training and optimization. During the training process, use the validation set to cross-validate the food target recognition network to be trained, and obtain the trained food target recognition network.

[0011] ⑥ Use the trained food target recognition network as the food recognition network to complete the construction of the food recognition network.

[0012] In step ①, the sample dataset includes at least 2,600 food images; the different lighting conditions include natural daytime lighting and fluorescent lighting at night.

[0013] In step ②, the data augmentation technique is used to expand the sample dataset to obtain the dish dataset. This includes rotating each dish image in the sample dataset clockwise, counterclockwise, and mirroring it sequentially, and retaining the dish image after each change to obtain the dish dataset.

[0014] In step ③, the category and location of the dishes are marked using the Label Img annotation tool, and the annotation information is obtained and saved; the annotation information includes the category label of the dish and the location information of the actual frame of the dish;

[0015] The preset ratio is 7:3, which means that the labeled dish dataset is divided into a 70% training set and a 30% validation set.

[0016] Step ④, which involves improving the YOLOv4 network structure, includes:

[0017] Replace the Mish activation function used in the original backbone network CSPDarknet53 with the LeakyReLU activation function;

[0018] The convolutional layer pruning method is used to prune the convolutional layers after feature splicing in the original PANet network four times, with each pruning removing 5 convolutional layers.

[0019] Add an SPP module before each original output prediction layer;

[0020] The output consists of feature maps at three different scales: 76×76, 38×38, and 19×19. Each feature map outputs adjustment parameters for the center coordinates of the detection box, the width and height of the detection box, the confidence score, and the probability of the corresponding dish category. The SPP (Spatial Pyramid Pooling) module effectively avoids incomplete cropping and distortion caused by image cropping and scaling operations, and reduces the problem of repetitive feature extraction by the convolutional neural network during image downsampling, thus saving computational costs.

[0021] Before step ⑤, the K-means++ algorithm is used to perform dimensional clustering on the dish dataset obtained in step ②, selecting the number and size of prior boxes: dimensional clustering of the dish dataset obtained in step ② is performed using the formula d(box, center) = 1 - IOU(box, center), resulting in nine prior box sizes: (26, 12), (57, 23), (82, 38), (106, 23), (126, 68), (141, 42), (206, 97), (235, 62), and (321, 102), where d(box, center) represents the distance between the ground truth box and the cluster center, and IOU(bo×, center) represents the intersection-union ratio (IU) between the ground truth box and the cluster center. Dimensional clustering of the dish dataset optimizes the anchor point parameters of the prior boxes, improving the localization accuracy of the predicted dish boxes.

[0022] Step ⑤ includes the following steps:

[0023] ⑤-1 Use a model that has been fully trained on the Pascal VOC public dataset for transfer learning, and use the pre-trained weights of the Pascal VOC public dataset as the initial weights of the dish object recognition network to be trained.

[0024] ⑤-2 Set the number of iterations to 5000, set the initial learning rate to 0.001, read the food images in the training set, and start the iteration;

[0025] ⑤-3 Calculate the training loss value in each iteration. Use the training loss value to judge the convergence of the dish target recognition network. When the dish target recognition network converges, stop training the dish target recognition network and execute step ⑤-5. The training loss value includes the loss of the center point coordinates, the loss of the width and height of the detection box, the confidence loss, and the category probability loss of the dish.

[0026] ⑤-4 When the set number of iterations is reached, stop training the food object recognition network and proceed to step ⑤-5;

[0027] ⑤-5 Complete the training of the food target recognition network, obtain the trained food target recognition network, and record the parameters of the food target recognition network at this time.

[0028] Before the end of each iteration, the parameters of the food target recognition network are updated using gradient descent.

[0029] Each iteration also requires calculating the classification accuracy and using label smoothing techniques to penalize the classification accuracy.

[0030] After each iteration, the food target recognition network is cross-validated using the hold-out method.

[0031] The deep learning-based food recognition network constructed by the above method is applied in canteens and self-service restaurants to perform real-time classification and recognition of food images taken on site.

[0032] Compared with existing technologies, the advantages of this invention lie in its improvement of the original YOLOv4 network. Specifically, the Mish activation function used in the backbone network CSPDarknet53 is replaced with the LeakyReLU activation function, reducing overfitting and improving network convergence. The convolutional layer pruning method performs four prunings on the convolutional layers after feature concatenation in the PANet network, removing five convolutional layers each time, simplifying the network structure and achieving lightweight model processing. An SPP module is added before each output prediction layer to enhance the receptive field of the feature map, thereby improving the detection effect of small-scale food targets. This not only improves the accuracy of recognizing minute features of food but also increases the recognition speed and exhibits good robustness. Attached Figure Description

[0033] Figure 1 This is a schematic diagram of the overall process of the present invention;

[0034] Figure 2 This is a schematic diagram of the original YOLOv4 structure;

[0035] Figure 3 This is a schematic diagram of the food target recognition network in this invention. Detailed Implementation

[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0037] like Figure 1 As shown, a method for constructing a dish recognition network based on deep learning includes the following steps:

[0038] ① Establish a sample dataset, collect different types of dishes, collect dish images under different lighting conditions for each type of dish to obtain the corresponding dish image subset, and store all dish image subsets into the sample dataset;

[0039] In step ①, the sample dataset includes at least 2600 food images; different lighting conditions include natural daytime lighting conditions and fluorescent lighting conditions at night.

[0040] ② Data augmentation techniques were used to augment the sample dataset to obtain the dish dataset;

[0041] In step ②, data augmentation techniques are used to expand the sample dataset to obtain the dish dataset. This includes rotating each dish image in the sample dataset clockwise, counterclockwise, and mirroring it sequentially, and retaining the dish image after each change to obtain the dish dataset. In other words, the dish image after each change is put into the dish dataset.

[0042] ③ Manually label the food dataset and obtain the labeling information. Divide the labeled food dataset into a training set and a validation set according to a preset ratio.

[0043] In step ③, the category and location of the dishes are labeled using the Label Img annotation tool, and the annotation information is obtained and saved; the annotation information includes the category label of the dish and the actual position information of the dish's frame;

[0044] In this embodiment, the preset ratio is 7:2:1, that is, the labeled dish dataset is divided into 70% training set, 20% validation set and 10% test set;

[0045] ④ The YOLOv4 network structure is improved to obtain the improved YOLOv4 network structure, which is then used as the target recognition network for food items to be trained.

[0046] Step ④ involves improving the YOLOv4 network structure, including:

[0047] Replace the Mish activation function used in the original backbone network CSPDarknet53 with the LeakyReLU activation function;

[0048] The convolutional layer pruning method is used to prune the convolutional layers after feature splicing in the original PANet network four times, with each pruning removing 5 convolutional layers.

[0049] Add an SPP module before each original output prediction layer;

[0050] The output consists of three feature maps of different scales: 76×76, 38×38, and 19×19. Each feature map outputs the adjustment parameters for the center point coordinates of the detection box, the adjustment parameters for the width of the detection box, the adjustment parameters for the height of the detection box, the confidence score, and the probability of the category of the dish to which it belongs.

[0051] ⑤ Input the training set into the food target recognition network to be trained for training and optimization. During the training process, use the validation set to cross-validate the food target recognition network to be trained, and obtain the trained food target recognition network.

[0052] Before step ⑤, the K-means++ algorithm is used to perform dimensional clustering on the dish dataset obtained in step ②, selecting the number and size of prior boxes: Dimensional clustering of the dish dataset obtained in step ② is performed using the formula d(box, center) = 1 - IOU(box, center), resulting in nine prior box sizes: (26, 12), (57, 23), (82, 38), (106, 23), (126, 68), (141, 42), (206, 97), (235, 62), and (321, 102), where d(box, center) represents the distance between the ground truth box and the cluster center, and IOU(box, center) represents the intersection-union ratio (IU) between the ground truth box and the cluster center. Dimensional clustering of the dish dataset optimizes the anchor point parameters of the prior boxes, improving the localization accuracy of the predicted dish boxes.

[0053] Step ⑤ includes the following steps:

[0054] ⑤-1 Use a model that has been fully trained on the Pascal VOC public dataset for transfer learning, and use the pre-trained weights of the Pascal VOC public dataset as the initial weights of the dish object recognition network to be trained.

[0055] ⑤-2 Set the number of iterations to 5000, set the initial learning rate to 0.001, read the food images in the training set, and start the iteration;

[0056] ⑤-3 In each iteration, the training loss value is calculated based on the loss function. The convergence of the dish target recognition network is judged by the training loss value. When the dish target recognition network converges, the training of the dish target recognition network is stopped and step ⑤-5 is executed. The training loss value includes the loss of the center point coordinates, the loss of the width and height of the detection box, the confidence loss, and the probability loss of the category of the dish.

[0057] In this embodiment, the loss function used is: LOSS = Loss1 (positive sample coordinate loss) + Loss2 (positive sample confidence loss) + Loss3 (negative sample confidence loss) + Loss4 (positive sample classification loss); where the original Loss4 is improved as follows: Where α and γ are two hyperparameters, α is a balancing factor, whose function is to balance the uneven proportion of positive and negative samples and prevent the loss function of easily classified categories from being too small, and γ is to reduce the loss of easily classified samples, so that the loss function pays more attention to difficult-to-classify and misclassified samples. α and γ work together to achieve relative balance, α∈[0,1], γ∈[0,5] (in this embodiment α=0.25, γ=2), P i (c) represents the probability of belonging to the category of the dish. This indicates the tag value of the dish.

[0058] ⑤-4 When the set number of iterations is reached, stop training the food object recognition network and proceed to step ⑤-5;

[0059] ⑤-5 Complete the training of the food target recognition network, obtain the trained food target recognition network, and record the parameters of the food target recognition network at this time (generate a separate file to save the weights and bias parameters);

[0060] Before the end of each iteration, the parameters of the food target recognition network are updated using the gradient descent method.

[0061] Each iteration also requires calculating the classification accuracy and using label smoothing techniques to penalize the classification accuracy to prevent overfitting.

[0062] After each iteration, the food target recognition network is cross-validated using the hold-out method.

[0063] Mosaic was used for data augmentation during training: four food images were read from the training set each time to enrich the background of the detected objects. The four food images were flipped, scaled and color gamut transformed respectively. The food images were then placed to correspond to the positions of the four food images. Mosaic enriched the image data and indirectly increased the batch size, reducing the dependence on the batch size.

[0064] The learning rate adjustment strategy during training is cosine simulated annealing. The learning rate is adjusted according to the cosine function, so that the learning rate changes periodically. Within a cycle, it first decreases and then increases. It starts by slowly decreasing the large learning rate, and then rapidly decreases the learning rate in the middle, and finally the learning rate slowly decreases to a small value.

[0065] ⑥ Use the trained food object recognition network as the food recognition network to complete the construction of the food recognition network;

[0066] The application of the deep learning-based food recognition network obtained by the construction method in this embodiment in canteens and self-service restaurants: the food recognition network can be downloaded to an embedded terminal, and the food images taken on site can be input into the food recognition network for real-time classification and recognition;

[0067] In this embodiment, the original YOLOv4 structure is as follows: Figure 2 As shown, the structure of the food target recognition network is as follows: Figure 3 As shown;

[0068] The original YOLOv4 network includes a feature extraction part, a feature enhancement part, and a prediction part. The original YOLOv4 uses CSPDarkNet53 as the backbone feature extraction network, which contains one CBM module and five CSP modules. The CBM module is the smallest component in the YOLOv4 network structure, consisting of 2D-Convolution, Batch Normalization, and Mish activation function. Each CSP module consists of three convolutional layers and some repeated residual networks.

[0069] The feature enhancement part of the original YOLOv4 network consists of the CBL component, the SPP module, and the PANet network. The CBL component is composed of three activation functions: 2D-Convolution, Bach Normalization, and Leaky ReLU. The 19×19×1024 feature map output from the fifth CSP module is fed into the CBL component for processing. The SPP module uses max pooling with 1×1, 5×5, 9×9, and 13×13 for multi-scale fusion. The PANet network uses FPN+PAN for feature fusion. The FPN layer conveys strong semantic features from top to bottom, while the PAN layer conveys strong localization features from bottom to top. The two layers are combined to output three feature maps for prediction.

[0070] The prediction part of the original YOLOv4 network is a decoding process. After the three feature maps output by the feature enhancement network are convolved and CBL operations, three different scale detection results of 76×76, 38×38 and 19×19 are generated. The 76×76 feature map is used for the prediction of small targets, the 38×38 feature map is used for the prediction of medium targets, and the 19×19 feature map is used for the prediction of large targets.

[0071] In this embodiment, the test set is input into the dish recognition network for identification:

[0072] S1 inputs the test set into the dish recognition network to obtain the adjustment parameters for the center point coordinates of the detection boxes, the adjustment parameters for the width and height of the detection boxes, the confidence score, and the probability of the corresponding dish category. It then calculates all detection boxes using these parameters, along with the confidence score and the probability of the corresponding dish category. Each detection box displays the dish category, confidence score, and the location information of the detection box.

[0073] Each grid in the feature map at each scale predicts three bounding boxes. Each bounding box contains a (4+1+N) dimensional vector, representing the center coordinates, width, height, and confidence score of the bounding box. N represents the number of classes in the sample dataset. The formulas for calculating the center coordinates and size information of the bounding boxes are as follows:

[0074]

[0075]

[0076]

[0077]

[0078] p r (object)*IOU(b, object)=σ(t o )

[0079]

[0080] b x b y These represent the coordinates of the center point of the detection box, t and t respectively. x and t y These represent the x-coordinate offset and y-coordinate offset of the predicted center of the detection box, respectively, where σ is the Sigmoid function and scale. xy The scaling factor (scale in this embodiment) xy =2), c x It corresponds to the x-coordinate of the top-left corner of the grid, c y It corresponds to the y-coordinate of the top-left corner of the grid, b w and b h Let p represent the width and height of the normalized detection box, respectively. w and p h These represent the width and height of the prior bounding box, respectively. and σ(t) represents the ratio of the predicted width and height of the detection box, respectively. o p represents the offset of the predicted score for the dish. r(object) represents the probability of belonging to the category of the dish, IOU(b, object) represents the intersection-union ratio between the detection box and the ground truth box, area(b) represents the area of ​​the detection box, and area(g) represents the area of ​​the ground truth box.

[0081] S2 sets the confidence threshold score_threshold to 0.37, the maximum number of detection boxes selected by non-maximum suppression max_output_size to 12, and the DIou threshold Diou_threshold to 0.46;

[0082] S3 first removes detection boxes with a confidence level lower than score_threshold; then it performs a first screening of the detection boxes using non-maximum suppression selection method, removing detection boxes with a DIoU value greater than Diou_threshold. When the number of retained detection boxes reaches the set value of max_output_size, all remaining detection boxes are removed.

[0083] The formula for calculating DIoU is as follows: -1≤DIoU≤1; where b represents the center point of the detection box, b gt ρ(b, b) represents the center point of the true bounding box. gt The ') represents the Euclidean distance between the center point of the detection box and the center point of the ground truth box, and 'c' represents the diagonal distance of the smallest closure region that can simultaneously contain both the detection box and the ground truth box; the formula for calculating IoU is: Where A represents the remaining detection boxes, B represents the detection boxes that have been retained, and area() represents the area of ​​the detection boxes;

[0084] S4 uses the retained detection boxes as the recognition result;

[0085] To evaluate the performance of the algorithm in detecting food objects, mAP and FPS were used to assess the recognition results on the test set. mAP represents the average accuracy across all categories, and FPS is the number of images the network model can detect per second. The calculation method for average accuracy AP is given first, followed by the formula for calculating the average accuracy mAP:

[0086] The formula for calculating accuracy P is: The formula for calculating recall R is: Where, N tp N represents the number of correctly detected food samples. fp N represents the number of dish samples that were incorrectly detected. fn This indicates the number of samples of dishes that were missed during inspection;

[0087] Through formula and The mean accuracy mAP is obtained, where AP represents the mean accuracy and N represents the number of all dish categories.

[0088] The FPS value is obtained using the formula FPS = NumFigure / Totaltime, where NumFigure is the total number of images detected and Totaltime is the total detection time.

[0089] Table 1 shows the performance comparison results of different networks for food image recognition. It can be seen that the food recognition network constructed in this invention has the smallest model capacity, the largest FPS (frames per second), the best average accuracy, and the fastest recognition speed. It not only improves the accuracy of recognizing small features of food, but also improves the recognition speed.

[0090] Table 1. Performance comparison of different networks for food image recognition

[0091]

[0092] In this embodiment, the loss function is referenced at: https: / / blog.csdn.net / qq_37619128 / article / details / 122448101. The hold-out method is referenced at: https: / / blog.csdn.net / weixin_43183872 / article / details / 117232207. The formula for calculating the detection box (i.e., the center point coordinates and size information of the detection box) is referenced at: https: / / blog.csdn.net / hgnuxc_1993 / article / details / 120724812.

Claims

1. A method for constructing a dish recognition network based on deep learning, characterized in that... Includes the following steps: ① Establish a sample dataset, collect different types of dishes, collect dish images under different lighting conditions for each type of dish to obtain the corresponding dish image subset, and store all dish image subsets into the sample dataset; ② Data augmentation techniques were used to augment the sample dataset to obtain the dish dataset; ③ Manually label the food dataset and obtain the labeling information. Divide the labeled food dataset into a training set and a validation set according to a preset ratio. ④ The YOLOv4 network structure is improved to obtain an improved YOLOv4 network structure, which is then used as the target recognition network for dishes to be trained. The improvements to the YOLOv4 network structure include: Replace the Mish activation function used in the original backbone network CSPDarknet53 with the LeakyReLU activation function; The convolutional layer pruning method is used to prune the convolutional layers after feature splicing in the original PANet network four times, with each pruning removing 5 convolutional layers. Add an SPP module before each original output prediction layer; The output consists of three feature maps of different scales: 76×76, 38×38, and 19×19. Each feature map outputs the adjustment parameters for the center point coordinates of the detection box, the adjustment parameters for the width of the detection box, the adjustment parameters for the height of the detection box, the confidence score, and the probability of the category of the dish to which it belongs. ⑤ Input the training set into the food target recognition network to be trained for training and optimization. During the training process, use the validation set to cross-validate the food target recognition network to be trained, and obtain the trained food target recognition network. ⑥ Use the trained food target recognition network as the food recognition network to complete the construction of the food recognition network.

2. The method for constructing a deep learning-based dish recognition network according to claim 1, characterized in that... In step ①, the sample dataset includes at least 2,600 food images; the different lighting conditions include natural daytime lighting and fluorescent lighting at night.

3. The method for constructing a deep learning-based dish recognition network according to claim 1, characterized in that... In step ②, the data augmentation technique is used to expand the sample dataset to obtain the dish dataset. This includes rotating each dish image in the sample dataset clockwise, counterclockwise, and mirroring it sequentially, and retaining the dish image after each change to obtain the dish dataset.

4. The method for constructing a deep learning-based dish recognition network according to claim 1, characterized in that... In step ③, the category and location of the dishes are marked using the Label Img annotation tool, and the annotation information is obtained and saved; the annotation information includes the category label of the dish and the location information of the actual frame of the dish; The preset ratio is 7:3, which means that the labeled dish dataset is divided into a 70% training set and a 30% validation set.

5. The method for constructing a dish recognition network based on deep learning according to claim 1, characterized in that... Before step ⑤, the method further includes using the K-means++ algorithm to perform dimensional clustering on the dish dataset obtained in step ②, and selecting the number and size of prior boxes: through the formula Dimensional clustering was performed on the dish dataset obtained in step ②, resulting in prior boxes of nine sizes: (26, 12), (57, 23), (82, 38), (106, 23), (126, 68), (141, 42), (206, 97), (235, 62), and (321, 102). This represents the distance between the true bounding box and the cluster center. This represents the intersection-union ratio (IU) between the actual bounding boxes and the cluster centers.

6. The method for constructing a dish recognition network based on deep learning according to claim 1, characterized in that... Step ⑤ includes the following steps: ⑤-1 Use a model that has been fully trained on the Pascal VOC public dataset for transfer learning, and use the pre-trained weights of the Pascal VOC public dataset as the initial weights of the dish object recognition network to be trained; ⑤-2 Set the number of iterations to 5000, set the initial learning rate to 0.001, read the food images in the training set, and start the iteration; ⑤-3 Calculate the training loss value in each iteration. Use the training loss value to judge the convergence of the dish target recognition network. When the dish target recognition network converges, stop training the dish target recognition network and execute step ⑤-5. The training loss value includes the loss of the center point coordinates of the detection box, the loss of the width and height of the detection box, the confidence loss, and the category probability loss of the dish. ⑤-4 When the set number of iterations is reached, stop training the food object recognition network and proceed to step ⑤-5; ⑤-5 Complete the training of the food target recognition network, obtain the trained food target recognition network, and record the parameters of the food target recognition network at this time.

7. The method for constructing a deep learning-based dish recognition network according to claim 6, characterized in that... Before the end of each iteration, the parameters of the food target recognition network are updated using gradient descent. Each iteration also calculates the classification accuracy and uses label smoothing techniques to penalize the classification accuracy. After each iteration, the food target recognition network is cross-validated using the hold-out method.

Citation Information

Patent Citations

  • Chinese Food Recognition and Search System

    AU2019100969A4

  • Video monitoring method and device based on deep learning

    CN113723361A