CN114549938B - Model training method, image information management method, image recognition method and device - Google Patents
Model training method, image information management method, image recognition method and device Download PDFInfo
- Publication number
- CN114549938B CN114549938B CN202210436659.6A CN202210436659A CN114549938B CN 114549938 B CN114549938 B CN 114549938B CN 202210436659 A CN202210436659 A CN 202210436659A CN 114549938 B CN114549938 B CN 114549938B
- Authority
- CN
- China
- Prior art keywords
- commodity
- fingerprint
- branch
- model
- output result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000007726 management method Methods 0.000 title claims abstract description 19
- 238000000605 extraction Methods 0.000 claims abstract description 91
- 238000010276 construction Methods 0.000 claims abstract description 27
- 230000006870 function Effects 0.000 claims description 31
- 238000001514 detection method Methods 0.000 claims description 5
- 238000005516 engineering process Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 3
- 238000003709 image segmentation Methods 0.000 description 2
- 230000032683 aging Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/55—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2323—Non-hierarchical techniques based on graph theory, e.g. minimum spanning trees [MST] or graph cuts
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Databases & Information Systems (AREA)
- Library & Information Science (AREA)
- Discrete Mathematics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
- Collating Specific Patterns (AREA)
Abstract
The invention discloses a model training method, an image information management method, an image identification method and an image identification device. The model training method comprises the following steps: carrying out random initialization on the initial image processing model; the initial image processing model comprises a feature extraction branch and a prototype construction branch; fixing prototype construction branch parameters, inputting a training image set to an initial image processing model, and obtaining a first output result; determining a loss function according to the first output result, and updating the initialization parameters of the feature extraction branches by using the loss function; fixing the updated parameters of the feature extraction branches, and inputting the training image set into the initial image processing model to obtain a second output result; determining a loss function according to the second output result, and updating the initialization parameters of the prototype construction branch by using the loss function; and constructing a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches so that the commodity fingerprints output by the commodity fingerprint extraction model have better distinctiveness.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a model training method, an image information management method, an image identification method and an image identification device.
Background
The commodity fingerprint technology is a technology for expressing uniqueness and relation of commodities in a digital coding mode, effective expression of commodity pictures can be obtained through the commodity fingerprint modeling technology, and manual commodity distinguishing marks are not needed, so that the commodity fingerprint modeling technology can be rapidly popularized to commodity classification, similar commodity retrieval and other applications.
At present, when a commodity fingerprint matching technology is applied to commodity identification, a reference fingerprint of each commodity needs to be stored in a commodity fingerprint database so that a target commodity fingerprint can be searched and identified in a complete fingerprint database. However, in practical application scenarios, fast-selling industrial goods are often various and fast in aging, and the goods are easily affected by oblique shooting, placing posture, illumination and other environments during shooting, so that the standard fingerprints to be stored in the goods fingerprint database are large in scale, a large amount of memory is occupied, more time is spent on traversing and searching the fingerprint database during the matching process of the goods fingerprints, and the identification efficiency is low.
Disclosure of Invention
The invention aims to solve at least one of the technical problems in the prior art, and provides a model training method, an image information management method, an image identification method and an image identification device, which can improve the distinguishability of commodity fingerprints and reduce the number of stored fingerprints, and the technical scheme is as follows:
in a first aspect, the present invention provides a model training method, including:
carrying out random initialization on parameters of the initial image processing model; wherein the initial image processing model comprises a feature extraction branch and a prototype construction branch;
fixing the initialization parameters of the prototype building branch, and inputting a training image set to the initial image processing model to obtain a first output result;
determining a value of a loss function according to the first output result, and updating the initialization parameter of the feature extraction branch by using the value of the loss function;
fixing the updated parameters of the feature extraction branch, and inputting the training image set into the initial image processing model after the parameters of the feature extraction branch are updated to obtain a second output result;
determining the value of the loss function according to the second output result, and updating the initialization parameter of the prototype construction branch by using the value of the loss function;
and constructing a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches.
As a further improvement, the first output result and the second output result each include a commodity fingerprint output by the feature extraction branch and a fingerprint prototype output by the prototype-construction branch.
As a further refinement, the class loss is defined as:
in the formula,f x a fingerprint of the commodity representing the output of the feature extraction branch,erepresenting a fingerprint prototype of the prototype construction branch output, wherein T represents a temperature coefficient, and N represents the number of image samples;
the intra-class inter-class loss is defined as:
in the formula,indicating a boundary threshold,Z p The result which is the same as the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented,Z n and the result which is different from the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented.
In a second aspect, the present invention further provides an image information management method, including:
acquiring a scene image set, and acquiring a full commodity image in the scene image set by using an image detection model;
extracting the commodity fingerprint in the commodity image according to a commodity fingerprint extraction model to obtain a commodity fingerprint set; wherein,
the commodity fingerprint extraction model is a model trained by the model training method of the first aspect;
determining the commodity category of the commodity fingerprint set, and compressing the commodity fingerprint corresponding to each commodity category by using a clustering algorithm;
and storing the compressed commodity fingerprint into a commodity fingerprint database.
As a further improvement, the compressing the commodity fingerprint corresponding to each commodity category by using a clustering algorithm specifically comprises: determining the commodity category of each commodity fingerprint in the commodity fingerprint set; according to a preset quantity parameter N, sequentially compressing the commodity fingerprints under each commodity category into N categories by using a clustering algorithm, and setting the cluster centers of the N categories as target commodity fingerprints corresponding to the commodity categories; wherein N is a non-zero natural number; and storing the target commodity fingerprint of each commodity category in a commodity fingerprint database.
In a third aspect, the present invention further provides an image recognition method, including:
acquiring a target commodity image, and extracting a target commodity fingerprint of the target commodity image by using a commodity fingerprint extraction model;
traversing the reference fingerprint in the commodity fingerprint database based on the target commodity fingerprint, and determining the commodity category corresponding to the reference fingerprint with the highest similarity with the target commodity fingerprint as an identification result; wherein,
the commodity fingerprint extraction model is a model trained by adopting the model training method in the first aspect;
the commodity fingerprint database is obtained by the image information management method according to the second aspect.
In a fourth aspect, the present invention further provides a model training apparatus, including:
the initialization module is used for carrying out random initialization on the parameters of the initial image processing model; wherein the initial image processing model comprises a feature extraction branch and a prototype construction branch;
the first training module is used for fixing the initialization parameters of the prototype building branch, inputting a training image set to the initial image processing model and obtaining a first output result;
determining a value of a loss function according to the first output result, and updating the initialization parameter of the feature extraction branch by using the value of the loss function;
the second training module is used for fixing the updated parameters of the feature extraction branch, inputting the training image set into the initial image processing model after the parameters of the feature extraction branch are updated, and obtaining a second output result;
determining the value of the loss function according to the second output result, and updating the initialization parameter of the prototype construction branch by using the value of the loss function;
and the determining module is used for constructing a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches.
As a further improvement, the first output result and the second output result each include a commodity fingerprint output by the feature extraction branch and a fingerprint prototype output by the prototype construction branch.
Meanwhile, the present invention provides a data processing apparatus comprising a processor coupled with a memory, the memory storing a program, the program being executed by the processor, so that the data processing apparatus performs the model training method of the first aspect, or the image information management method of the second aspect, or the image recognition method of the third aspect.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the model training method according to the first aspect described above, or the image information management method according to the second aspect, or the image recognition method according to the third aspect.
Compared with the prior art, the technical scheme provided by the invention at least has the following beneficial effects:
1. by training a double-branch model comprising a feature extraction branch and a prototype construction branch, the commodity fingerprint output by the constructed commodity fingerprint extraction model can be ensured to have better distinguishability;
2. by utilizing the double-branch commodity fingerprint extraction model and the clustering method to extract and compress commodity fingerprints of commodity images in an application scene, the storage scale of a commodity fingerprint library can be effectively reduced on the premise of ensuring the commodity identification rate, so that the matching search time of the commodity fingerprints is reduced, and the commodity fingerprint identification efficiency is improved.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a model training method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an image information management method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a model training apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the present preferred embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like elements throughout.
In a first aspect, as shown in fig. 1, an embodiment of the present invention provides a model training method, including the following steps S101 to S104.
S101: carrying out random initialization on parameters of the initial image processing model; wherein the initial image processing model comprises a feature extraction branch and a prototype construction branch.
S102: fixing the initialization parameters of the prototype building branch, and inputting a training image set to the initial image processing model to obtain a first output result; and determining the value of a loss function according to the first output result, and updating the initialization parameter of the feature extraction branch by using the value of the loss function.
The training image set used in this embodiment is specifically a commodity image set, each commodity image is obtained by segmenting a large number of acquired real images of fast-selling scenes such as shelves, end frames, refrigerators and the like, and specifically, the commodity detection model can be used to perform image segmentation on the acquired real images.
S103: fixing the updated parameters of the feature extraction branch, and inputting the training image set into the initial image processing model after the parameters of the feature extraction branch are updated to obtain a second output result; and determining the value of the loss function according to the second output result, and updating the initialization parameter of the prototype construction branch by using the value of the loss function.
S104: and constructing a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches.
It should be noted that the first output result and the second output result both include the commodity fingerprint output by the feature extraction branch and the fingerprint prototype output by the prototype construction branch.
Specifically, the loss function includes two parts of category loss and intra-category inter-category loss, wherein the category loss is used for describing the similarity between the commodity fingerprint and the fingerprint prototype.
Specifically, the category loss is defined as:
in the formula,f x a fingerprint of the commodity representing the output of the feature extraction branch,erepresenting a fingerprint prototype of the prototype construction branch output, wherein T represents a temperature coefficient, and N represents the number of image samples;
the intra-class inter-class loss is defined as:
in the formula,indicating a boundary threshold,Z p The result which is the same as the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented,Z n and the result which is different from the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented.
In this embodiment, the loss function can be specifically expressed as:
wherein,αrepresenting the weight coefficients.
Illustratively, after a training image set is obtained, a feature extraction branch and a prototype construction branch in an initial image processing model are randomly initialized, and the following training steps are repeated until the model converges.
Inputting training image into initial image processing model, outputting commodity fingerprint via feature extraction branchf x . Firstly, keeping the parameters of the prototype construction branch unchanged, training the feature extraction branch, and specifically updating the parameters of the feature extraction branch through back propagation of a loss function until iteration is finished.
Further, the parameters of the prototype construction branch are updated based on the back propagation of the loss function while keeping the updated parameters of the feature extraction branch unchanged.
Specifically, the learning rate of the initial image processing model is exponentially decayed after each epoch is completed.
And after the training step is completed, storing the characteristic extraction branch parameters, and setting the characteristic extraction branch parameters as a final commodity fingerprint extraction model.
According to the embodiment of the invention, the double-branch model comprising the feature extraction branch and the prototype construction branch is trained, so that the fingerprints of the same type of commodities under different environmental influences are distributed around the same fingerprint prototype, and the prototype distances of the different types of commodities are simultaneously pulled, so that the commodity fingerprints output by the constructed commodity fingerprint extraction model have better distinguishability, and similar commodities and unseen commodities can be better identified.
As shown in fig. 2, in a second aspect, an embodiment of the present invention further provides an image information management method, including the following steps S201 to S203.
S201: and acquiring a scene image set, and acquiring the full commodity image in the scene image set by using an image detection model.
It can be understood that the scene image set specifically includes real images of fast selling scenes such as a shelf, an end frame and a refrigerator, and the full commodity images in the scene image set can be obtained by performing image segmentation on the real images through the commodity detection model.
S202: and extracting the commodity fingerprint in the commodity image according to the commodity fingerprint extraction model to obtain a commodity fingerprint set. The commodity fingerprint extraction model is obtained by training through the model training method in the embodiment.
S203: and determining the commodity category of the commodity fingerprint set, compressing the commodity fingerprint corresponding to each commodity category by using a clustering algorithm, and storing the compressed commodity fingerprint into a commodity fingerprint database.
In one example, when the commodity fingerprints corresponding to the commodity categories are compressed by using a clustering algorithm, the commodity categories of the commodity fingerprints in the commodity fingerprint set can be determined firstly; according to a preset quantity parameter N, sequentially compressing the commodity fingerprints under each commodity category into N clusters by using a clustering algorithm, and setting the cluster centers of the N clusters as target commodity fingerprints corresponding to the commodity categories; wherein N is a non-zero natural number; and finally, storing the target commodity fingerprints of all commodity categories into a commodity fingerprint database.
In particular, the clustering algorithm used may be the K-means algorithm.
Illustratively, the first one is obtained when the commodity fingerprint extraction model is used for extractioniCommodity fingerprint collection of categoriesS i At the same time, canFingerprint collection of commodities by K-means algorithmS i Clustering into N clusters, and taking the centers of the N clusters as the secondiN commodity fingerprints for the category commodity.
It should be noted that the quantity parameter N is smaller than the commodity fingerprint setS i The value of the number of the fingerprints of the medium commodities and the corresponding number parameters of different commodity types can be determined according to whether the outer packages of the commodities have a plurality of different surfaces or not.
Specifically, the N cluster centers can be calculated by the following formula:
wherein,,ya category of the article is represented,Mis shown asiThe number of commodity images of the Nth class cluster of the class commodity.
Further, N commodity fingerprints and corresponding commodity categories thereofiAnd writing the commodity fingerprint data into the commodity fingerprint data base until the commodity fingerprints of the full commodity category are stored in the commodity fingerprint data base.
According to the embodiment of the invention, the commodity fingerprint extraction and compression are carried out on the commodity image under the application scene by utilizing the double-branch commodity fingerprint extraction model and the clustering method, and commodities under each scene can be represented by fewer fingerprints on the premise of ensuring the commodity identification rate, so that the storage scale of the number of the reference fingerprints in the commodity fingerprint database is effectively reduced, the matching search time of the commodity fingerprints is reduced, and the commodity fingerprint identification efficiency is improved.
In a third aspect, an embodiment of the present invention further provides an image recognition method, which specifically includes: and acquiring a target commodity image, extracting the target commodity fingerprint of the target commodity image by using a commodity fingerprint extraction model, traversing the reference fingerprint in the commodity fingerprint database based on the target commodity fingerprint, and determining the reference fingerprint with the highest similarity to the target commodity fingerprint as an identification result.
The commodity fingerprint extraction model is a model trained by the model training method in the first aspect, and the commodity fingerprint library is obtained by the image information management method in the second aspect.
Specifically, when the target commodity image is a commodity of a known type, commodity fingerprint extraction can be directly performed on the commodity image, the cosine distance is used as a measurement function, and the commodity type corresponding to the reference fingerprint with the largest cosine similarity is extracted from the commodity fingerprint database and used as a final identification result.
On the other hand, when the target commodity image is an unseen commodity, firstly, randomly extracting M unseen commodity images for marking, namely, setting a commodity type label; and then fingerprint extraction is carried out on the commodity fingerprint by a commodity fingerprint extraction model, and the extracted commodity fingerprint and the corresponding commodity category are added into a commodity fingerprint database.
Further, the commodity category corresponding to the reference fingerprint with the largest cosine similarity is taken from the commodity fingerprint database as a final identification result.
Referring to fig. 3, another embodiment of the invention further provides a model training apparatus, which includes an initialization module 101, a first training module 102, a second training module 103, and a determination module 104.
The initialization module 101 is configured to perform random initialization on parameters of an initial image processing model; wherein the initial image processing model comprises a feature extraction branch and a prototype construction branch.
The first training module 102 is configured to fix the initialization parameters of the prototype-building branch, and input a training image set to the initial image processing model to obtain a first output result.
And determining the value of a loss function according to the first output result, and updating the initialization parameter of the feature extraction branch by using the value of the loss function.
The second training module 103 is configured to fix the updated parameters of the feature extraction branches, and input the training image set into the initial image processing model after the parameters of the feature extraction branches are updated, so as to obtain a second output result.
And determining the value of the loss function according to the second output result, and updating the initialization parameter of the prototype construction branch by using the value of the loss function.
The determining module 104 is configured to construct a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches.
Because the content of information interaction, execution process and the like among the modules in the device is based on the same concept as the embodiment of the model training method, the specific content can be referred to the description in the embodiment of the method of the invention, and the details are not repeated here.
The present invention provides a data processing apparatus comprising a processor, the processor being coupled to a memory, the memory storing a program, the program being executable by the processor to cause the data processing apparatus to perform the model training method of the first aspect described above, or the image information management method of the second aspect described above, or the image recognition method of the third aspect described above.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the model training method of the first aspect described above, or the image information management method of the second aspect, or the image recognition method of the third aspect.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and may include the processes of the embodiments of the methods when executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
Claims (9)
1. A method of model training, comprising:
carrying out random initialization on parameters of the initial image processing model; wherein the initial image processing model comprises a feature extraction branch and a prototype construction branch;
fixing the initialization parameters of the prototype building branch, and inputting a training image set to the initial image processing model to obtain a first output result;
determining a value of a loss function according to the first output result, and updating the initialization parameter of the feature extraction branch by using the value of the loss function; the loss function comprises a class loss and an intra-class inter-class loss; wherein,
the class loss is defined as(ii) a In the formula,f x a fingerprint of the commodity representing the output of the feature extraction branch,ea fingerprint prototype representing the prototype-building branch output,< , >the inner product is represented by the sum of the two,ithe commodity type is represented, T represents a temperature coefficient, and N represents the number of image samples;
the intra-class inter-class loss is defined as(ii) a In the formula,indicating a boundary threshold,z p The result which is the same as the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented,z n the result which is different from the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented;
fixing the updated parameters of the feature extraction branch, and inputting the training image set into the initial image processing model after the parameters of the feature extraction branch are updated to obtain a second output result;
determining the value of the loss function according to the second output result, and updating the initialization parameter of the prototype construction branch by using the value of the loss function;
and constructing a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches.
2. The model training method of claim 1, wherein the first output result and the second output result each comprise:
and the commodity fingerprint output by the branch is extracted by the characteristic extraction module and the prototype of the fingerprint output by the prototype construction module.
3. An image information management method characterized by comprising:
acquiring a scene image set, and acquiring a full commodity image in the scene image set by using an image detection model;
extracting the commodity fingerprint in the commodity image according to a commodity fingerprint extraction model to obtain a commodity fingerprint set; wherein,
the commodity fingerprint extraction model is a model trained by the model training method according to any one of claims 1-2;
determining the commodity category of the commodity fingerprint set, and compressing the commodity fingerprint corresponding to each commodity category by using a clustering algorithm;
and storing the compressed commodity fingerprint into a commodity fingerprint database.
4. The image information management method according to claim 3, wherein the compressing of the commodity fingerprint corresponding to each of the commodity categories by using a clustering algorithm is specifically:
determining the commodity category of each commodity fingerprint in the commodity fingerprint set;
according to a preset quantity parameter N, sequentially compressing the commodity fingerprints under each commodity category into N categories by using a clustering algorithm, and setting the cluster centers of the N categories as target commodity fingerprints corresponding to the commodity categories; wherein N is a non-zero natural number;
and storing the target commodity fingerprint of each commodity category in a commodity fingerprint database.
5. An image recognition method, comprising:
acquiring a target commodity image, and extracting a target commodity fingerprint of the target commodity image by using a commodity fingerprint extraction model;
traversing the reference fingerprints in the commodity fingerprint database based on the target commodity fingerprint, and determining the commodity category corresponding to the reference fingerprint with the highest similarity with the target commodity fingerprint as an identification result; wherein,
the commodity fingerprint extraction model is a model trained by the model training method according to any one of claims 1-2;
the commodity fingerprint database is obtained by the image information management method according to any one of claims 3 to 4.
6. A model training apparatus, comprising:
the initialization module is used for carrying out random initialization on the parameters of the initial image processing model; wherein the initial image processing model comprises a feature extraction branch and a prototype construction branch;
the first training module is used for fixing the initialization parameters of the prototype building branch, inputting a training image set to the initial image processing model and obtaining a first output result;
determining a value of a loss function according to the first output result, and updating the initialization parameter of the feature extraction branch by using the value of the loss function; the loss function comprises a class loss and an intra-class inter-class loss; wherein,
the class loss is defined as(ii) a In the formula,f x a fingerprint of the commodity representing the output of the feature extraction branch,ea fingerprint prototype representing the prototype-building branch output,< , >the inner product is represented by the sum of the two,ithe commodity type is represented, T represents a temperature coefficient, and N represents the number of image samples;
the intra-class inter-class loss is defined as(ii) a In the formula,indicating a boundary threshold,z p The result which is the same as the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented,z n the result which is different from the commodity fingerprint category output by the characteristic extraction branch in the first output result or the second output result is represented;
the second training module is used for fixing the updated parameters of the feature extraction branch, and inputting the training image set into the initial image processing model after the parameters of the feature extraction branch are updated to obtain a second output result;
determining the value of the loss function according to the second output result, and updating the initialization parameter of the prototype construction branch by using the value of the loss function;
and the determining module is used for constructing a commodity fingerprint extraction model according to the parameters updated by the feature extraction branches.
7. The model training apparatus of claim 6, wherein the first output result and the second output result each comprise:
and the commodity fingerprint output by the branch is extracted by the characteristic extraction module and the prototype of the fingerprint output by the prototype construction module.
8. A data processing apparatus, characterized by comprising:
a processor coupled to a memory, the memory storing a program for execution by the processor to cause the data processing apparatus to perform the model training method of any one of claims 1 to 2, or the image information management method of any one of claims 3 to 4, or the image recognition method of claim 5.
9. A computer storage medium storing computer instructions for performing the model training method according to any one of claims 1 to 2, or the image information management method according to any one of claims 3 to 4, or the image recognition method according to claim 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210436659.6A CN114549938B (en) | 2022-04-25 | 2022-04-25 | Model training method, image information management method, image recognition method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210436659.6A CN114549938B (en) | 2022-04-25 | 2022-04-25 | Model training method, image information management method, image recognition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114549938A CN114549938A (en) | 2022-05-27 |
CN114549938B true CN114549938B (en) | 2022-09-09 |
Family
ID=81667260
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210436659.6A Active CN114549938B (en) | 2022-04-25 | 2022-04-25 | Model training method, image information management method, image recognition method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114549938B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021087985A1 (en) * | 2019-11-08 | 2021-05-14 | 深圳市欢太科技有限公司 | Model training method and apparatus, storage medium, and electronic device |
CN112949780A (en) * | 2020-04-21 | 2021-06-11 | 佳都科技集团股份有限公司 | Feature model training method, device, equipment and storage medium |
CN114155388A (en) * | 2022-02-10 | 2022-03-08 | 深圳思谋信息科技有限公司 | Image recognition method and device, computer equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111382635B (en) * | 2018-12-29 | 2023-10-13 | 杭州海康威视数字技术股份有限公司 | Commodity category identification method and device and electronic equipment |
CN111104924B (en) * | 2019-12-31 | 2023-09-01 | 上海品览数据科技有限公司 | Processing algorithm for identifying low-resolution commodity image |
CN113505820B (en) * | 2021-06-23 | 2024-02-06 | 北京阅视智能技术有限责任公司 | Image recognition model training method, device, equipment and medium |
CN114333027B (en) * | 2021-12-31 | 2024-05-14 | 之江实验室 | Cross-domain novel facial expression recognition method based on combined and alternate learning frames |
CN114120430B (en) * | 2022-01-26 | 2022-04-22 | 杭州魔点科技有限公司 | Mask face recognition method based on double-branch weight fusion homology self-supervision |
-
2022
- 2022-04-25 CN CN202210436659.6A patent/CN114549938B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021087985A1 (en) * | 2019-11-08 | 2021-05-14 | 深圳市欢太科技有限公司 | Model training method and apparatus, storage medium, and electronic device |
CN112949780A (en) * | 2020-04-21 | 2021-06-11 | 佳都科技集团股份有限公司 | Feature model training method, device, equipment and storage medium |
CN114155388A (en) * | 2022-02-10 | 2022-03-08 | 深圳思谋信息科技有限公司 | Image recognition method and device, computer equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
基于SHN模型的商品图像检索方法;贺周雨 等;《计算机工程与科学》;20191130;第41卷(第11期);第1991-1999页 * |
Also Published As
Publication number | Publication date |
---|---|
CN114549938A (en) | 2022-05-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109587554B (en) | Video data processing method and device and readable storage medium | |
Zheng et al. | SIFT meets CNN: A decade survey of instance retrieval | |
CN111198959B (en) | Two-stage image retrieval method based on convolutional neural network | |
CN108694225B (en) | Image searching method, feature vector generating method and device and electronic equipment | |
US9020246B2 (en) | Systems and methods for visual object matching | |
CN111950728B (en) | Image feature extraction model construction method, image retrieval method and storage medium | |
CN107291825A (en) | With the search method and system of money commodity in a kind of video | |
CN110427517B (en) | Picture searching video method and device based on scene dictionary tree and computer readable storage medium | |
CA2922296A1 (en) | System and method for clustering data | |
CN111090763A (en) | Automatic picture labeling method and device | |
CN113254687B (en) | Image retrieval and image quantification model training method, device and storage medium | |
CN114494890B (en) | Model training method, commodity image management method and device | |
CN108805280B (en) | Image retrieval method and device | |
CN117743596A (en) | Knowledge graph data processing method and device | |
CN114168768A (en) | Image retrieval method and related equipment | |
CN113792594B (en) | Method and device for locating language fragments in video based on contrast learning | |
JP2002216132A (en) | Line based image matching method | |
CN110110120B (en) | Image retrieval method and device based on deep learning | |
CN113869264A (en) | Commodity identification method, commodity identification system, storage medium and server | |
CN111414952B (en) | Noise sample recognition method, device, equipment and storage medium for pedestrian re-recognition | |
CN114549938B (en) | Model training method, image information management method, image recognition method and device | |
CN116883740A (en) | Similar picture identification method, device, electronic equipment and storage medium | |
CN114818651A (en) | Text similarity determination method and device, storage medium and electronic device | |
CN113569982A (en) | Position identification method and device based on two-dimensional laser radar feature point template matching | |
CN112528905A (en) | Image processing method and device and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |