Product Identification Method and Device
Through the product identification method of faster R-CNN network and attention RPN structure, the problem of low recognition accuracy of products with few samples is solved, and efficient identification and reduced labor costs are achieved.
Patent Information
- Application Number
- CN202111581665.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-12-22
AI Technical Summary
The prior art has low accuracy in the identification of small sample products and requires a lot of manpower to participate in management.
Using multi-scale feature detection and attention RPN structure based on faster R-CNN network, products are identified through initial prediction, convolution processing and overlap analysis.
It improves the recognition accuracy and recognition speed of products with few samples and reduces labor costs.
Smart Images

Figure CN114255248B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology and can be applied to the financial field or other fields. Specifically, it relates to a product recognition method and device. Background Art
[0002] Currently, shopping malls generally use recognition algorithms to perform object detection on products to improve product management efficiency. However, existing recognition algorithms need to be constructed with a large number of samples, and it is difficult for shopping malls to provide a large number of product samples. In the case where there are only a small number of product samples, it is difficult for the existing technology to accurately recognize products, resulting in a large amount of human resources being required for product recognition management. Summary of the Invention
[0003] The main purpose of the embodiments of the present invention is to provide a product recognition method and device to improve the recognition accuracy and speed of few-sample products and reduce labor costs.
[0004] To achieve the above purpose, the embodiments of the present invention provide a product recognition method, including:
[0005] Performing initial prediction on each sampled image of the original product image to obtain each product feature map;
[0006] Performing convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map; wherein, the target product recognition feature map includes a recognition region and corresponding region pixel values;
[0007] Determining a target product recognition region according to the overlap degree between each recognition region and each region pixel value to recognize the product.
[0008] The embodiments of the present invention further provide a product recognition device, including:
[0009] An initial prediction module, configured to perform initial prediction on each sampled image of the original product image to obtain each product feature map;
[0010] A convolution module, configured to perform convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map; wherein, the target product recognition feature map includes a recognition region and corresponding region pixel values;
[0011] A recognition module, configured to determine a target product recognition region according to the overlap degree between each recognition region and each region pixel value to recognize the product.
[0012] The embodiments of the present invention further provide a computer device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the product recognition method are implemented.
[0013] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the product identification method are implemented.
[0014] The product identification method and device according to the embodiment of the present invention first perform initial prediction on each sampled image of the original product image to obtain each product feature map, then perform convolution processing on each product feature map according to convolution parameters to obtain each target product identification feature map, and finally determine the target product identification area according to the overlap degree between each identification area and the pixel values of each area to identify the product, which can improve the identification accuracy and speed of few-sample products and reduce the labor cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0016] Figure 1 It is a flowchart of the product identification method in the embodiment of the present invention;
[0017] Figure 2 It is a flowchart of S101 in the embodiment of the present invention;
[0018] Figure 3 It is a flowchart of S102 in the embodiment of the present invention;
[0019] Figure 4 It is a flowchart of S103 in the embodiment of the present invention;
[0020] Figure 5 It is a flowchart of determining the convolution parameters in the embodiment of the present invention;
[0021] Figure 6 It is a flowchart of S503 in the embodiment of the present invention;
[0022] Figure 7 It is a structural block diagram of the product identification device in the embodiment of the present invention;
[0023] Figure 8 It is a structural block diagram of the computer device in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0025] Those skilled in the art know that the implementation manner of the present invention can be realized as a system, device, equipment, method, or computer program product. Therefore, the present disclosure can be specifically realized in the following forms: completely hardware, completely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0026] In view of the fact that it is difficult to accurately identify products in the prior art when there are only a small number of product samples, and a large amount of manpower is required to participate in the identification and management of products, the embodiments of the present invention provide a product identification method, which can improve the identification accuracy and speed of few-sample products and reduce the labor cost. The present invention will be described in detail below with reference to the accompanying drawings.
[0027] Figure 1 is a flowchart of the product identification method in the embodiments of the present invention. As Figure 1 shown, the product identification method includes:
[0028] S101: Perform initial prediction on each sampled image of the original product image to obtain each product feature map.
[0029] Before executing S101, it also includes: performing multiple downsamplings on the original product image to obtain each scale sampled image with different sizes.
[0030] Figure 2 is a flowchart of S101 in the embodiments of the present invention. As Figure 2 shown, S101 transmits the product image into the faster R-CNN network (Fast Region-based Convolutional Neural Network) for multi-scale feature detection, including:
[0031] S201: Divide each sampled image into a first sampled image and a second sampled image according to the image scale, and divide the products into a first type of product and a second type of product according to the product category.
[0032] For example, the first sampled image is a large-scale sampled image, the second sampled image is a small-scale sampled image; the first type of product is a large product, such as furniture and electrical appliances, etc.; the second type of product is a small product, such as food and toiletries, etc.
[0033] S202: Obtain respective first product recognition maps by recognizing the first type of product on each second sampled image according to the recognition model parameters, and obtain respective second product recognition maps by recognizing the second type of product on each first sampled image according to the recognition model parameters.
[0034] S203: Obtain respective product feature maps based on the respective first product recognition maps and the respective second product recognition maps.
[0035] S102: Perform convolution processing on each product feature map according to the convolution parameters to obtain respective target product recognition feature maps.
[0036] Among them, the target product recognition feature map includes a recognition region and corresponding region pixel values.
[0037] Figure 3 is the flowchart of S102 in the embodiments of the present invention. As Figure 3 shown, S102 includes:
[0038] S301: Perform pooling processing on each product feature map to obtain respective first product recognition feature maps.
[0039] Specifically in implementation, after performing global average pooling on the product feature map, output the first product recognition feature map through the relu function and the fully connected layer.
[0040] S302: Perform convolution processing and pooling processing on each product feature map according to the convolution parameters to obtain respective second product recognition feature maps.
[0041] Specifically in implementation, first perform average pooling of 3×3×4096, convolution of 1×1×512, convolution of 3×3×512, convolution of 1×1×2048, and average pooling of 3×3×2048 on each product feature map in sequence according to the convolution parameters, then perform global pooling, and finally input the feature map after global pooling into two layers of fully connected layers to obtain the second product recognition feature map.
[0042] S303: Obtain respective target product recognition feature maps based on the respective first product recognition feature maps and the respective second product recognition feature maps.
[0043] Specifically in implementation, the respective target product recognition feature maps can be obtained by calculating the average value of the respective first product recognition feature maps and the respective second product recognition feature maps.
[0044] S103: Determine the target product recognition region based on the overlap degree between the respective recognition regions and the respective region pixel values to recognize the product.
[0045] Among them, the target product recognition feature map includes a large number of candidate boxes and the recognition regions of the candidate boxes. By executing S103, the calculation speed can be accelerated and redundancy can be reduced.
[0046] Figure 4 is the flowchart of S103 in an embodiment of the present invention. As Figure 4 shown, S103 includes:
[0047] S401: Determine the target recognition area according to the pixel values of each area, put the target recognition area into the target set, update the pixel values of each area according to the overlap degree between the target recognition area and each recognition area, and perform corresponding iterative calculations.
[0048] Specifically, when implementing, determine the recognition area corresponding to the maximum value of the pixel values of each area as the target recognition area, put the target recognition area into the target set. When the overlap degree between the target recognition area and one of the recognition areas is greater than the preset overlap value (for example, 0.6), recalculate the area pixel value of this recognition area and update the original area pixel value with the calculated value.
[0049] In one embodiment, it further includes: determining the overlap degree between the target recognition area and each recognition area according to the intersection of the target recognition area and each recognition area and the union of the target recognition area and each recognition area.
[0050] Specifically, when implementing, the overlap degree between the target recognition area and each recognition area is the quotient of the intersection of the target recognition area and each recognition area and the union of the target recognition area and each recognition area.
[0051] S402: When all recognition areas are put into the target set, screen the recognition areas according to the target pixel values in the target set to determine the target product recognition area.
[0052] Specifically, when implementing, send the recognition area corresponding to the target pixel value greater than the preset pixel value to the ROI pooling (region of interest pooling layer) to obtain the target product recognition area.
[0053] Figure 1 The execution subject of the product recognition method shown can be a computer. From Figure 1 the shown process, it can be seen that the product recognition method in the embodiment of the present invention first performs initial prediction on each sampled image of the original product image to obtain each product feature map, then performs convolution processing on each product feature map according to the convolution parameters to obtain each target product recognition feature map, and finally determines the target product recognition area according to the overlap degree between each recognition area and the pixel values of each area to recognize the product, which can improve the recognition accuracy and recognition speed of few-shot products and reduce the labor cost.
[0054] Figure 5 is the flowchart of determining the convolution parameters in an embodiment of the present invention. As Figure 5 shown, the product recognition method further includes:
[0055] Perform the following iterative processing:
[0056] S501: Perform initial prediction on each sampled image of the historical product image to obtain each historical product feature map; perform initial prediction on each sampled image of the recognized product image to obtain each recognized product feature map.
[0057] Before executing S501, it further includes: performing multiple downsamplings on the historical product image and the recognized product image respectively to obtain each sampled image of different sizes of the historical product image and each sampled image of different sizes of the recognized product image.
[0058] S501 includes:
[0059] 1. Divide each sampled image into a first sampled image and a second sampled image according to the image scale, and divide the products into a first type of product and a second type of product according to the product category. For example, the first sampled image is a large-scale sampled image, the second sampled image is a small-scale sampled image; the first type of product is a large product, such as furniture and electrical appliances, etc.; the second type of product is a small product, such as food and toiletries, etc.
[0060] 2. Obtain each first product recognition map by recognizing the first type of product on each second sampled image according to the original recognition parameters, and obtain each second product recognition map by recognizing the second type of product on each first sampled image according to the original recognition parameters.
[0061] 3. Obtain each product feature map according to each first product recognition map and each second product recognition map.
[0062] S502: Obtain each attention feature map according to each recognized product feature map and each historical product feature map.
[0063] Among them, each attention feature map can be obtained through an attention RPN (Region Proposal Network) structure; in specific implementation, performing global average pooling on each recognized product feature map can obtain a recognized product feature map with a size of 1×1, and multiplying the recognized product feature map after global average pooling by the corresponding historical product feature map can obtain the attention feature map.
[0064] S503: Perform convolution processing on each attention feature map according to the original parameters to obtain each historical product recognition feature map.
[0065] Among them, the historical product recognition feature map includes a historical recognition region and corresponding historical region pixel values.
[0066] Figure 6 is the flowchart of S503 in the embodiment of the present invention. As Figure 6 shown, executing S503 through multi-relationship detection includes:
[0067] S601: Concatenate each attention feature map and each sampled image of the corresponding recognized product image, and perform pooling processing on each concatenation result to obtain each first historical product recognition feature map.
[0068] In specific implementation, assume that the attention feature map with a size of 7×7×C is Fs, and the sampled image of the recognized product image with a size of 7×7×C is Fq. Concatenate Fs and Fq into the feature map Fc, then perform global average pooling on Fc to obtain a feature image of 1×1×2C, and finally output the first historical product recognition feature map through the relu function and the fully connected layer.
[0069] S602: Perform convolution processing and pooling processing on each concatenation result according to the convolution parameters to obtain each second historical product recognition feature map.
[0070] In specific implementation, first perform average pooling of 3×3×4096, convolution of 1×1×512, convolution of 3×3×512, convolution of 1×1×2048, and average pooling of 3×3×2048 on Fc in sequence according to the convolution parameters, then perform global pooling, and finally input the feature map after global pooling into two layers of fully connected layers to obtain the second historical product recognition feature map.
[0071] S603: Obtain each historical product recognition feature map according to each first historical product recognition feature map and each second historical product recognition feature map.
[0072] In specific implementation, each historical product recognition feature map can be obtained by calculating the average value of each first historical product recognition feature map and each second historical product recognition feature map.
[0073] S504: Determine the predicted product recognition region according to the overlap degree between each historical recognition region and each historical region pixel value.
[0074] In specific implementation, S504 includes:
[0075] 1. Determine the target historical recognition region according to each historical region pixel value, put the target historical recognition region into the target historical set, update each historical region pixel value according to the overlap degree between the target historical recognition region and each historical recognition region, and perform corresponding iterative calculations.
[0076] In specific implementation, the overlap degree iou between the target historical recognition region and each historical recognition region is the quotient of the intersection of the target historical recognition region and each historical recognition region and the union of the target historical recognition region and each historical recognition region. First, determine the historical recognition region corresponding to the maximum value of the pixel values of each historical region as the target historical recognition region bb, and then put the target historical recognition region bb into the historical target set B. When the overlap degree between the target historical recognition region bb and one of the historical recognition regions cc is greater than the overlap preset value (for example, 0.6), recalculate the historical region pixel value of this historical recognition region through the following formula:
[0077]
[0078] Wherein, Si1 is the recalculated historical region pixel value, Si is the original historical region pixel value of cc, and iou(bb, cc) is the overlap degree between bb and cc.
[0079] After that, update the original region pixel value Si with Si1.
[0080] 2. When all historical recognition regions are put into the target historical set, screen the historical recognition regions according to the target historical pixel values in the target historical set to determine the predicted product recognition region.
[0081] In specific implementation, send the historical recognition region corresponding to the target historical pixel value greater than the preset pixel value to ROIpooling (target pooling layer) to obtain the predicted product recognition region.
[0082] S505: Determine the loss function according to the predicted product recognition region and the corresponding recognized product image.
[0083] S506: Determine whether the loss function meets the preset threshold.
[0084] S507: When the loss function meets the preset threshold, determine the original parameters in the current iteration as the convolution parameters.
[0085] S508: When the loss function does not meet the preset threshold, update the original parameters according to the loss function, and continue to perform the iterative process.
[0086] In one embodiment, S508 further includes: updating the recognition model parameters according to the loss function.
[0087] The specific process of the embodiment of the present invention is as follows:
[0088] 1. Perform initial prediction on each sampled image of the historical product image according to the original recognition parameters to obtain each historical product feature map; perform initial prediction on each sampled image of the recognized product image according to the original recognition parameters to obtain each recognized product feature map.
[0089] 2. Obtain each attention feature map based on each recognized product feature map and each historical product feature map.
[0090] 3. Concatenate each attention feature map and each sampled image of the corresponding recognized product image, and perform pooling processing on each concatenation result to obtain each first historical product recognition feature map.
[0091] 4. Perform convolution processing and pooling processing on each concatenation result according to the convolution parameters to obtain each second historical product recognition feature map.
[0092] 5. Obtain each historical product recognition feature map based on each first historical product recognition feature map and each second historical product recognition feature map.
[0093] 6. Determine the predicted product recognition area according to the overlap degree between each historical recognition area and each historical area pixel value.
[0094] 7. Determine the loss function according to the predicted product recognition area and the corresponding recognized product image. When the loss function meets the preset threshold, determine the original parameters in the current iteration as the convolution parameters, and determine the original recognition parameters in the current iteration as the recognition model parameters; otherwise, update the original parameters and the original recognition parameters according to the loss function respectively, and return to step 1.
[0095] 8. Divide each sampled image into a first sampled image and a second sampled image according to the image scale, and divide the products into a first category of products and a second category of products according to the product category.
[0096] 9. Obtain each first product recognition map by recognizing the first category of products on each second sampled image according to the recognition model parameters, and obtain each second product recognition map by recognizing the second category of products on each first sampled image according to the recognition model parameters.
[0097] 10. Obtain each product feature map based on each first product recognition map and each second product recognition map.
[0098] 11. Perform pooling processing on each product feature map to obtain each first product recognition feature map, and perform convolution processing and pooling processing on each product feature map according to the convolution parameters to obtain each second product recognition feature map.
[0099] 12. Obtain each target product recognition feature map based on each first product recognition feature map and each second product recognition feature map.
[0100] 13. Determine the target recognition area according to each area pixel value, put the target recognition area into the target set, update each area pixel value according to the overlap degree between the target recognition area and each recognition area, and perform corresponding iterative calculations.
[0101] 14. When all the recognition regions are put into the target set, screen the recognition regions according to the target pixel values in the target set to determine the target product recognition region, and recognize the product based on the target product recognition region.
[0102] In summary, the product recognition provided by the embodiments of the present invention has the following beneficial effects:
[0103] (1) Use the few-shot object detection algorithm based on the faster R-CNN network to solve the defect in the prior art that a large number of product images need to be collected;
[0104] (2) Solve the defect that the recognition accuracy is low due to the too small target in object detection through multi-scale feature detection;
[0105] (3) Improve the recognition accuracy of few-shot product images through the attention RPN structure and multi-relationship detection;
[0106] (4) Reduce redundant candidate regions and improve the recognition accuracy and recognition speed of few-shot product images in object detection.
[0107] Based on the same inventive concept, the embodiments of the present invention also provide a product recognition device. Since the principle of this device to solve problems is similar to that of the product recognition method, the implementation of this device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0108] Figure 7 It is the structural block diagram of the product recognition device in the embodiments of the present invention. As Figure 7 shown, the product recognition device includes:
[0109] An initial prediction module, configured to perform initial prediction on each sampled image of the original product image to obtain each product feature map;
[0110] A convolution module, configured to perform convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map; wherein, the target product recognition feature map includes a recognition region and corresponding region pixel values;
[0111] A recognition module, configured to determine the target product recognition region according to the overlap degree between each recognition region and each region pixel value to recognize the product.
[0112] In summary, the product recognition device in the embodiments of the present invention first performs initial prediction on each sampled image of the original product image to obtain each product feature map, then performs convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map, and finally determines the target product recognition region according to the overlap degree between each recognition region and each region pixel value to recognize the product, which can improve the recognition accuracy and recognition speed of few-shot products and reduce the labor cost.
[0113] An embodiment of the present invention also provides a specific implementation manner of a computer device that can implement all steps in the product recognition method in the above embodiment. Figure 8 is a structural block diagram of the computer device in the embodiment of the present invention. Refer to Figure 8 The computer device specifically includes the following components:
[0114] A processor 801 and a memory 802.
[0115] The processor 801 is used to call a computer program in the memory 802. When the processor executes the computer program, all steps in the product recognition method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0116] Perform initial prediction on each sampled image of the original product image to obtain each product feature map;
[0117] Perform convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map; wherein, the target product recognition feature map includes a recognition region and corresponding region pixel values;
[0118] Determine the target product recognition region according to the overlap degree between each recognition region and each region pixel value to recognize the product.
[0119] In summary, the computer device in the embodiment of the present invention first performs initial prediction on each sampled image of the original product image to obtain each product feature map, then performs convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map, and finally determines the target product recognition region according to the overlap degree between each recognition region and each region pixel value to recognize the product, which can improve the recognition accuracy and recognition speed of few-shot products and reduce the labor cost.
[0120] An embodiment of the present invention also provides a computer-readable storage medium that can implement all steps in the product recognition method in the above embodiment. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, all steps in the product recognition method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0121] Perform initial prediction on each sampled image of the original product image to obtain each product feature map;
[0122] Perform convolution processing on each product feature map according to convolution parameters to obtain each target product recognition feature map; wherein, the target product recognition feature map includes a recognition region and corresponding region pixel values;
[0123] Determine the target product recognition area according to the overlap degree between each recognition area and the pixel values of each area to recognize the product.
[0124] In summary, the computer-readable storage medium according to the embodiment of the present invention first performs initial prediction on each sampled image of the original product image to obtain each product feature map, then performs convolution processing on each product feature map according to the convolution parameters to obtain each target product recognition feature map, and finally determines the target product recognition area according to the overlap degree between each recognition area and the pixel values of each area to recognize the product, which can improve the recognition accuracy and recognition speed of few-sample products and reduce the labor cost.
[0125] In the above specific embodiments, the purpose, technical solutions and beneficial effects of the present invention have been further described in detail. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0126] Those skilled in the art can also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention can be implemented by electronic hardware, computer software, or a combination of both. To clearly show the interchangeability of hardware and software, the above various illustrative components, units, and steps have been generally described in terms of their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art can use various methods to implement the described functions for each specific application, but such implementation should not be construed as exceeding the protection scope of the embodiments of the present invention.
[0127] The various illustrative logical blocks, or units, or devices described in the embodiments of the present invention can be implemented or operated with a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of the above designs to perform the described functions. The general-purpose processor can be a microprocessor. Optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller, or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.
[0128] In the embodiments of the present invention, the steps of the methods or algorithms described can be directly implemented in hardware, software modules executed by a processor, or a combination of both. The software modules can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be disposed in an ASIC, and the ASIC can be disposed in a user terminal. Optionally, the processor and the storage medium can also be disposed in different components of the user terminal.
[0129] In one or more exemplary designs, the above-described functions of the embodiments of the present invention can be implemented in hardware, software, firmware, or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium or transmitted in the form of one or more instructions or codes on a computer-readable medium. A computer-readable medium includes a computer storage medium and a communication medium that facilitates transfer of a computer program from one place to another. The storage medium can be any available medium accessible by a general or special purpose computer. For example, such a computer-readable medium can include, but is not limited to, RAM, ROM, EEPROM, CD-ROM, or other optical disk storage, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to carry or store program code in the form of instructions or data structures and other forms readable by a general or special purpose computer, or a general or special purpose processor. In addition, any connection can be properly defined as a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless means such as infrared, wireless, and microwave, it is also included in the defined computer-readable medium. The disks (disk) and discs (disc) include compact disks, laser disks, optical discs, DVDs, floppy disks, and Blu-ray discs. Disks typically reproduce data magnetically, while discs typically reproduce data optically with a laser. The above combinations can also be included in a computer-readable medium.
Claims
1. A product identification method, characterized in that, Including: Dividing each sampled image into a first sampled image and a second sampled image according to the image scale, and dividing the products into a first type of product and a second type of product according to the product category; Identifying the first type of product on each second sampled image according to the recognition model parameters to obtain each first product recognition map, and identifying the second type of product on each first sampled image according to the recognition model parameters to obtain each second product recognition map; Obtaining each product feature map according to each first product recognition map and each second product recognition map; Performing convolution processing on each product feature map according to the convolution parameters to obtain each target product recognition feature map; wherein, the target product recognition feature map includes a recognition region and corresponding region pixel values; Determining a target recognition region according to each region pixel value, putting the target recognition region into a target set, and updating each region pixel value according to the overlap degree between the target recognition region and each recognition region, and performing corresponding iterative calculations; When all the recognition regions are put into the target set, screening all the recognition regions according to the target pixel values in the target set to determine the target product recognition region.
2. The product identification method according to claim 1, wherein Performing convolution processing on each product feature map according to the convolution parameters to obtain each target product recognition feature map, including: Performing pooling processing on each product feature map to obtain each first product recognition feature map; Performing convolution processing and pooling processing on each product feature map according to the convolution parameters to obtain each second product recognition feature map; Obtaining each target product recognition feature map according to each first product recognition feature map and each second product recognition feature map.
3. The product identification method according to claim 1, wherein, Also including: Determining the overlap degree between the target recognition region and each recognition region according to the intersection of the target recognition region and each recognition region and the union of the target recognition region and each recognition region.
4. The product identification method according to claim 1, characterized in that, Also including: Performing the following iterative processing: Performing initial prediction on each sampled image of the historical product image to obtain each historical product feature map; performing initial prediction on each sampled image of the recognized product image to obtain each recognized product feature map; Obtaining each attention feature map according to each recognized product feature map and each historical product feature map; Performing convolution processing on each attention feature map according to the original parameters to obtain each historical product recognition feature map; wherein, the historical product recognition feature map includes a historical recognition region and corresponding historical region pixel values; Determining a predicted product recognition region according to the overlap degree between each historical recognition region and each historical region pixel value; Determining a loss function according to the predicted product recognition region and the corresponding recognized product image; When the loss function meets a preset threshold, determining the original parameter in the current iteration as the convolution parameter, otherwise updating the original parameter according to the loss function, and continuing to perform the iterative processing.
5. The product identification method according to claim 4, wherein Performing convolution processing on each attention feature map according to the original parameters to obtain each historical product recognition feature map, including: Stitching each attention feature map and each sampled image of the corresponding recognized product image, and performing pooling processing on each stitching result to obtain each first historical product recognition feature map; Performing convolution processing and pooling processing on each stitching result according to the convolution parameters to obtain each second historical product recognition feature map; Each historical product identification feature map is obtained based on each first historical product identification feature map and each second historical product identification feature map.
6. A product identification device, characterized in that, It includes: An initial prediction module, configured to perform initial prediction on each sampled image of the original product image to obtain each product feature map; A convolution module, configured to perform convolution processing on each product feature map according to convolution parameters to obtain each target product identification feature map; wherein, the target product identification feature map includes an identification region and corresponding region pixel values; An identification module, configured to determine a target product identification region to identify a product according to the overlap degree between each identification region and each region pixel value; The initial prediction module is specifically configured to: divide each sampled image into a first sampled image and a second sampled image according to the image scale, and divide the products into a first category of products and a second category of products according to the product category; Identify the first category of products on each second sampled image according to the identification model parameters to obtain each first product identification map, and identify the second category of products on each first sampled image according to the identification model parameters to obtain each second product identification map; Obtain each product feature map according to each first product identification map and each second product identification map; The identification module is specifically configured to: determine a target identification region according to each region pixel value, put the target identification region into a target set, update each region pixel value according to the overlap degree between the target identification region and each identification region, and perform corresponding iterative calculations; When all the identification regions are put into the target set, screen all the identification regions according to the target pixel values in the target set to determine the target product identification region.
7. A computer device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, the steps of the product identification method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the product identification method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Weed recognition method and device and terminal equipment
CN110135341A