A high-quality goods sample image database construction method
By adjusting the cluster radius of the leaf nodes and the adaptive node distribution in the BIRCH algorithm, the problem of poor clustering effect caused by the fixed number of samples in the traditional BIRCH algorithm is solved, realizing the construction of a more refined and scientific cargo sample image database, and improving retrieval efficiency and accuracy.
Patent Information
- Application Number
- CN202511270196.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-09-08
AI Technical Summary
The fixed number of samples in the leaf nodes of the existing BIRCH algorithm results in poor clustering of cargo sample images, with similar images being assigned to multiple categories, reducing retrieval efficiency and accuracy.
By adjusting the similarity between the bounding boxes of the image to be determined and the sample images within the leaf nodes, the cluster radius is dynamically determined. The BRICH algorithm is then used to insert the clustering feature tree to construct the cargo clustering feature tree, and the node distribution is adaptively adjusted.
This improved the classification precision and retrieval efficiency of the cargo sample image database, and enhanced the accuracy of the database.
Smart Images

Figure CN120763353B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image clustering, and particularly relates to a high-quality goods sample image database construction method. BACKGROUND
[0002] Constructing a goods sample image database is of great significance in improving management efficiency, promoting technology application and supporting business decision-making. Clustering goods sample images in the construction of a goods sample image database can not only improve image management efficiency, but also help to discover patterns and structures in images and provide strong support for subsequent image analysis and application.
[0003] Existing methods usually use the Balanced Iterative Reducing and Clustering using Hierarchies (BIRCH) algorithm to cluster goods sample images. Due to the large difference in the number of different types of goods samples, the fixed number of samples in the leaf node in the traditional BIRCH algorithm may cause similar images to be divided into different categories. If the maximum number of samples in the node is small, a large number of similar goods images may be allocated to multiple categories, and categories with fewer similar images may be mixed with images of other categories, resulting in poor clustering effect of goods sample images and reducing the retrieval efficiency and accuracy of the goods sample image database. SUMMARY
[0004] In order to solve the technical problem of the fixed number of samples in the leaf node in the BIRCH algorithm, which leads to poor clustering effect of goods sample images, the purpose of the present application is to provide a high-quality goods sample image database construction method, and the technical solution adopted is as follows:
[0005] The present application provides a high-quality goods sample image database construction method, which comprises the following steps:
[0006] Obtaining sample images of different categories of goods, wherein the sample images include boundary boxes;
[0007] Performing BIRCH hierarchical clustering on all sample images. In the BIRCH hierarchical clustering, the initial clustering feature tree is empty. A training set is formed by all sample images, and a sample image selected from the training set is denoted as a pending image. According to the number of layers of each leaf node of the clustering feature tree, the similarity between the pending image and the two boundary boxes of the sample images in each leaf node is adjusted, and the cluster radius of the pending image and each leaf node of the clustering feature tree is determined.
[0008] Based on the cluster radius, the pending image is inserted into the clustering feature tree by using the BRICH algorithm, and the clustering feature tree is updated; a new pending image is selected to continue updating the clustering feature tree, until all sample images in the training set are traversed, and the updated clustering feature tree obtained when all sample images in the training set are inserted into the clustering feature tree is taken as the cargo clustering feature tree;
[0009] Based on the cargo clustering feature tree, a cargo sample image database is constructed.
[0010] Further, the determination of the cluster radius of the pending image and each leaf node of the clustering feature tree comprises:
[0011] Obtain the target category of the different attribute data and the bounding box of the sample image of each category of cargo; according to the gradient information similarity and the target category information similarity of any two bounding boxes in the sample image, obtain the initial cargo similarity of the corresponding two bounding boxes;
[0012] Respectively, from any one bounding box in each sample image in the pending image and each leaf node of the clustering feature tree, a bounding box pair is formed; according to the number of layers of each leaf node in the clustering feature tree, the initial cargo similarity of the two bounding boxes in the bounding box pair and the attribute data difference of the target category of the two bounding boxes are adjusted respectively, to obtain the comprehensive cargo similarity of the bounding box pair;
[0013] Based on the comprehensive cargo similarity, the cluster radius of the pending image and each leaf node of the clustering feature tree is determined.
[0014] Further, the method for obtaining the initial cargo similarity comprises:
[0015] Respectively, the text information of the target category of each bounding box is subjected to word vector conversion and HOG feature extraction, to obtain category vectors and HOG feature vectors in turn;
[0016] The average value of the minimum values of the elements in the same dimension in the HOG feature vectors of any two bounding boxes in the sample image is calculated as the gradient similarity of the corresponding two bounding boxes; the category similarity of the category vectors of any two bounding boxes in the sample image is obtained;
[0017] According to the gradient similarity and the category similarity, the initial cargo similarity of any two bounding boxes in the sample image is obtained; the gradient similarity and the category similarity are positively correlated with the initial cargo similarity.
[0018] Further, the method for obtaining the comprehensive cargo similarity comprises:
[0019] Arrange all attribute data of the target category of the bounding box in sequence to obtain an attribute vector; calculate the distance between the attribute vectors of the two bounding boxes in the bounding box pair, denoted as an attribute difference degree;
[0020] Determine an adjustment coefficient of the corresponding leaf node based on the number of layers of each leaf node of the clustering feature tree;
[0021] Respectively take the adjustment coefficient as a weight of an initial cargo similarity of the two bounding boxes in the bounding box pair, take a difference value between the adjustment coefficient and the constant 1 as a weight of a result after negative correlation mapping of the attribute difference degree of the bounding box pair, and perform weighted summation on the initial cargo similarity and the attribute difference degree to obtain a comprehensive cargo similarity of the bounding box pair.
[0022] Further, the determination of the cluster radius of the to-be-determined image and each leaf node of the clustering feature tree based on the comprehensive cargo similarity comprises:
[0023] Select the maximum value in the comprehensive cargo similarity of all bounding box pairs of the to-be-determined image and each sample image in each leaf node of the clustering feature tree, perform negative correlation and normalization processing, and obtain a distance index of the to-be-determined image and each sample image in each leaf node of the clustering feature tree;
[0024] Calculate the average value of the distance index of the to-be-determined image and all sample images in each leaf node of the clustering feature tree, as the cluster radius of the to-be-determined image and each leaf node of the clustering feature tree.
[0025] Further, the category similarity is equal to the normalized result of the cosine similarity of the category vectors of any two bounding boxes in the sample image.
[0026] Further, the adjustment coefficient is equal to the result of negative correlation and normalization processing on the number of layers of each node of the clustering feature tree.
[0027] Further, the method for obtaining the target category of the bounding box of the sample image comprises:
[0028] Obtain the bounding box in the sample image and each category probability of each bounding box by using the YOLO algorithm, select the maximum value in all category probabilities of each bounding box as the target category of each bounding box.
[0029] Further, the method for converting the text information of the target category of each bounding box into a word vector is a BERT model.
[0030] Further, the gradient similarity and the category similarity are in a positive correlation relationship with the initial cargo similarity.
[0031] The present application has the following advantages:
[0032] In the embodiment of the present application, the number of layers of the leaf nodes of the cluster feature tree presents the attention of the BIRCH hierarchical clustering algorithm to the similarity of the sample images in the leaf nodes, and the similarity between the to-be-determined image and the two-to-two bounding boxes of the sample images in the leaf nodes is adjusted to determine the cluster radius of the leaf node; the sample number in the leaf node corresponding cluster is adaptively adjusted based on the similarity of the sample images in the formation process, so as to avoid the fixed sample number limitation in the traditional method, while ensuring the high similarity between the samples in the leaf node corresponding cluster; the sample images with high information similarity are gradually inserted into the same node, and the cluster feature tree will automatically adjust the node distribution based on the current structure, thereby constructing the cargo cluster feature tree, improving the accuracy of classifying and storing the sample images, and further making the classification of the cargo sample database more fine and scientific, and increasing the retrieval efficiency and accuracy of the cargo sample image database. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0034] Figure 1 The step flow chart of a high-quality cargo sample image database construction method provided by an embodiment of the present application;
[0035] Figure 2 The step flow chart of a cluster radius acquisition method provided by an embodiment of the present application;
[0036] Figure 3 The computer device schematic diagram of a high-quality cargo sample image database construction device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to further illustrate the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following combines the drawings and preferred embodiments to specifically and clearly explain the specific implementation, structure, features and effects of the high-quality cargo sample image database construction method according to the present application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0039] The application provides a high-quality goods sample image database construction method, which will be described in detail below with reference to the accompanying drawings.
[0040] Embodiment 1
[0041] The application provides a high-quality goods sample image database construction method, which will be described in detail below with reference to the accompanying drawings. Figure 1 It shows a high-quality goods sample image database construction method provided by an embodiment of the application, and the method comprises the following steps.
[0042] Step S1: Obtain sample images of different categories of goods, and the sample images comprise boundary boxes.
[0043] Before constructing the goods sample image database, an image acquisition device such as a camera is used to shoot initial sample images of different categories of goods, the initial sample images are subjected to grayscale and denoising processing, and sample images are obtained; the categories include electronic products, household supplies, clothes and food, etc. Data of multiple attributes of each category of goods are collected, and the attributes include weight, length, width and height.
[0044] Because the positions of goods in different sample images are different, the position information of the goods in the sample images needs to be determined.
[0045] In an implementation manner of the embodiment of the application, the YOLO algorithm is used to obtain the boundary boxes in the sample images and the respective category probabilities of the boundary boxes, and the category corresponding to the maximum value in all category probabilities of each boundary box is selected as the target category of each boundary box. It should be noted that the boundary box represents the position of the goods in the sample image, and each category probability represents the probability that the boundary box belongs to each category of goods. The YOLO algorithm is a known technology to those skilled in the art, and will not be described here.
[0046] It should be noted that the weighted average grayscale algorithm is selected for grayscale processing in the embodiment of the application, and the Gaussian filter is used for denoising processing, and the specific method will not be described here, which is a known technical means to those skilled in the art. The sample images of each category need to be diverse and representative, so as to ensure that different models, colors, sizes and angles of each category of goods are covered; the elements in the same dimension in the attribute vectors of different categories have the same attribute.
[0047] Step S2: BIRCH hierarchical clustering is performed on all sample images, in which an initial clustering feature tree is empty; a training set is formed by all sample images, a sample image selected from the training set is denoted as a to-be-determined image, and a cluster radius of the to-be-determined image and each leaf node of the clustering feature tree is determined according to a number of layers of each leaf node of the clustering feature tree and similarity between the to-be-determined image and each sample image in each leaf node.
[0048] The number of layers of the leaf node of the clustering feature tree reflects a focus of the BIRCH hierarchical clustering algorithm on similarity of sample images in the leaf node, and is used to adjust the similarity between the to-be-determined image and each sample image in the leaf node, and further determine the cluster radius of the leaf node; the leaf node considers similarity of sample images in a cluster formation process, rather than simply relying on a sample number limit, so that even if similar sample images have a large number difference, the similar sample images can be reasonably divided into a corresponding cluster. The fixed sample number limit in a traditional method is avoided, so that a sample number of the leaf node can be adaptively adjusted according to the similarity of sample images.
[0049] Referring to Figure 2 , a step flowchart of a cluster radius acquisition method provided by one embodiment of the present application is shown, and the method includes the following steps.
[0050] Step S210: Obtain target categories of different attribute data of each category of goods and a bounding box of a sample image; and obtain an initial goods similarity of two corresponding bounding boxes according to gradient information similarity and target category information similarity of any two bounding boxes in the sample image.
[0051] The bounding box represents a goods region in the sample image, and there can be multiple bounding boxes in the sample image. Before analyzing goods similarity of different sample images, goods similarity of the bounding boxes of different sample images needs to be analyzed in advance. The gradient information reflects texture and shape information in the bounding box, and the target category represents category information of goods in the bounding box. The similarity of the gradient information and the target category of the bounding boxes of different sample images is comprehensively considered to analyze the similarity degree of goods in the corresponding bounding boxes, and the initial goods similarity is obtained.
[0052] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the initial cargo similarity includes: performing word vector conversion and HOG feature extraction on the text information of the target category of each bounding box to obtain a category vector and a HOG feature vector in sequence; calculating the mean of the minimum values among the elements of the same dimension in the HOG feature vectors of any two bounding boxes in the sample image as the gradient similarity of the corresponding two bounding boxes; obtaining the category similarity of the category vectors of any two bounding boxes in the sample image; and obtaining the initial cargo similarity of any two bounding boxes in the sample image based on the gradient similarity and the category similarity.
[0053] The textual information of the categories refers to electronic products, household goods, clothing, and food, etc. Category similarity measures the degree of similarity between the categories of goods within two bounding boxes; the greater the category similarity, the greater the probability that the goods within the two bounding boxes belong to the same category. HOG feature vectors describe the local texture and shape information of the bounding boxes. The larger the minimum value among the elements of the same dimension of the HOG feature vectors of two bounding boxes, the more similar the texture or edge information of the two bounding boxes is in the corresponding gradient direction, and the greater the probability that the goods within the two bounding boxes belong to the same category. Therefore, both gradient similarity and category similarity are positively correlated with the initial goods similarity.
[0054] In one implementation of this invention, the cosine similarity of the category vectors of any two bounding boxes in the sample image is normalized to obtain the category similarity of the corresponding two bounding boxes.
[0055] In one implementation of this invention, the text information of the target category of the bounding box is transformed into word vectors using the Bidirectional Encoder Representations from Transformers (BERT) model, and the resulting word vectors are denoted as category vectors.
[0056] It should be noted that the HOG feature vectors of the bounding boxes in all sample images have the same dimension; the method for obtaining HOG feature vectors is a well-known technique to those skilled in the art and will not be described in detail here.
[0057] In one specific implementation of this invention, the initial cargo similarity between any two bounding boxes in a sample image is expressed by the formula:
[0058]
[0059]
[0060]
[0061] In the formula, an initial cargo similarity between the u-th bounding box and the v-th bounding box in the sample image; a category similarity between the u-th bounding box and the v-th bounding box in the sample image; a gradient similarity between the u-th bounding box and the v-th bounding box in the sample image; a category vector of the u-th bounding box in the sample image; a category vector of the v-th bounding box in the sample image; a category similarity between the u-th bounding box and the v-th bounding box in the sample image; M is a total number of elements in a HOG feature vector of each bounding box; an element in the m-th dimension of the HOG feature vector of the u-th bounding box in the sample image; an element in the m-th dimension of the HOG feature vector of the v-th bounding box in the sample image; Norm is a normalization function; and cos is a cosine function. is subjected to maximum-minimum value normalization processing.
[0062] Step S220: selecting a bounding box pair from each sample image in each leaf node of the clustering feature tree; adjusting an initial cargo similarity between the two bounding boxes in the bounding box pair and an attribute data difference of target categories of the two bounding boxes according to a layer number of each leaf node in the clustering feature tree, to obtain a comprehensive cargo similarity of the bounding box pair.
[0063] Preferably, in some possible implementation manners of the embodiment of the present application, the method for obtaining the comprehensive cargo similarity comprises: sequentially arranging all attribute data of the target category of the bounding box to obtain an attribute vector; calculating a distance between the attribute vectors of the two bounding boxes in the bounding box pair, denoted as an attribute difference degree; determining an adjustment coefficient of the corresponding leaf node based on the layer number of each leaf node of the clustering feature tree; taking the adjustment coefficient as a weight of the initial cargo similarity between the two bounding boxes in the bounding box pair, taking a difference between the constant 1 and the adjustment coefficient as a weight of a result after negative correlation mapping of the attribute difference degree of the bounding box pair, and performing weighted summation on the initial cargo similarity and the attribute difference degree to obtain the comprehensive cargo similarity of the bounding box pair.
[0064] If the number of layers of the leaf node of the clustering feature tree is smaller, the adjustment coefficient of the node is larger, and when analyzing the similarity between the to-be-determined image and the sample image in the leaf node, more attention is paid to the similarity between the goods categories; on the contrary, more attention is paid to the similarity between the attribute detail information of the two sample images, that is, more attention is paid to the weight and size and other detail attributes of the goods in the same category. In order to ensure the accuracy of the classification of the sample image, the similarity of the goods in the node with a higher number of layers is lower, and more attention should be paid to the slightly broader goods information, and the similarity of the goods in the sample image in the node with a lower number of layers is higher, and more attention should be paid to the more detailed attribute information. Therefore, in one implementation manner of the embodiment of the present application, the adjustment coefficient is equal to the result of negatively correlating and normalizing the number of layers of each node of the clustering feature tree. Adjustment coefficient wherein NL is the number of layers of the leaf node of the clustering feature tree, and exp is an exponential function with a natural constant as a base number.
[0065] In one specific implementation manner of the embodiment of the present application, for each leaf node of the clustering feature tree, the comprehensive goods similarity between the to-be-determined image and each sample image in the leaf node is expressed by a formula as follows:
[0066]
[0067] In the formula, Dd is the to-be-determined image, and is the comprehensive goods similarity of a bounding box pair composed of the xth bounding box in the bounding box set of the to-be-determined image and the yth bounding box in the bounding box set of the ath sample image in the leaf node, wherein the set composed of all the bounding boxes in each sample image is denoted as the bounding box set of the corresponding image, and Dd is the to-be-determined image; is the adjustment coefficient of the leaf node; is the initial goods similarity of the xth bounding box in the bounding box set of the to-be-determined image and the yth bounding box in the bounding box set of the ath sample image in the leaf node; is the attribute difference degree of the bounding box pair composed of the xth bounding box in the bounding box set of the to-be-determined image and the yth bounding box in the bounding box set of the ath sample image in the leaf node.
[0068] Step S230: determining the cluster radius of the to-be-determined image and each leaf node of the clustering feature tree based on the comprehensive goods similarity.
[0069] Preferably, in some possible implementation manners of the embodiment of the present application, the cluster radius acquisition method comprises: selecting the maximum value of the negative correlation and normalization processing of the comprehensive cargo similarity of all the bounding box pairs of each sample image in each leaf node of the clustering feature tree, to obtain the distance index of the sample image in each leaf node of the clustering feature tree; and calculating the average value of the distance indexes of all the sample images in each leaf node of the clustering feature tree as the cluster radius of the leaf node of the clustering feature tree.
[0070] There can be multiple categories of goods in the sample image. By analyzing the most similar bounding boxes in different sample images, the final similarity of different sample images is determined, and the greater the similarity, the smaller the distance between different sample images; and the overall level of the distance indexes of all the sample images in each leaf node of the clustering feature tree is comprehensively analyzed to obtain the cluster radius, which reflects the overall similarity of the sample image and all the sample images in the node.
[0071] In another implementation manner of the embodiment of the present application, the cluster radius of the sample image and the leaf node is equal to the distance index of the sample image of the cluster center point of the sample image and the leaf node.
[0072] For each leaf node of the clustering feature tree, the distance index of the sample image and each sample image in the leaf node is expressed by the following formula:
[0073]
[0074] In the formula, is the distance index of the sample image and the a-th sample image in the leaf node; is the bounding box set of the sample image; is the bounding box set of the a-th sample image in the leaf node; is the comprehensive cargo similarity of the bounding box pair composed of the x-th bounding box in the bounding box set of the sample image and the y-th bounding box in the bounding box set of the a-th sample image in the leaf node; and max is the maximum value function.
[0075] Step S3: based on the cluster radius, the BRICH algorithm is used to insert the sample image into the clustering feature tree, and the clustering feature tree is updated; a new sample image is selected to continue updating the clustering feature tree, until all the sample images in the training set are inserted into the clustering feature tree, and the updated clustering feature tree obtained when all the sample images in the training set are inserted into the clustering feature tree is taken as the cargo clustering feature tree.
[0076] The BIRCH hierarchical clustering is performed on all sample images by comprehensively considering the similarity of the goods attribute information and the category information of different sample images, sample images with high information similarity are gradually inserted into the same node, and the clustering feature tree is automatically adjusted based on the current structure to distribute the nodes, thereby constructing a goods clustering feature tree (CF Tree) and improving the accuracy of classifying and storing the sample images.
[0077] The traditional BIRCH clustering algorithm needs to set three hyperparameters to construct the clustering feature tree, specifically: the internal node balance factor B, the leaf node balance factor L, and the cluster radius threshold T. In order to avoid poor sample image clustering effect caused by fixed distance measurement and sample number, only the hyperparameters L and T are set to fixed values in this embodiment; meanwhile, the relationship between different level nodes in the clustering feature tree is considered, and the number of sample images in the leaf node of the clustering feature tree is adaptively adjusted, and the specific process is as follows:
[0078] The initial clustering feature tree Tree0 is empty, and the sample image P1 is selected from the training set and directly inserted into the root node of Tree0 to obtain a new clustering feature tree Tree1. When the sample image P2 is selected from the training set and inserted into the clustering feature tree Tree1, the cluster radius of the sample image P2 and the first leaf node of the clustering feature tree Tree1 is obtained. The root node of the clustering feature tree Tree1 is a leaf node; if , it indicates that the similarity of the sample images P1 and P2 is high, and the sample images P1 and P2 are induced into the same node; if , it indicates that the similarity of the sample images P1 and P2 is low, and a new node needs to be added in the clustering feature tree Tree1, and the sample images P1 and P2 are in a node, thereby updating Tree1 to obtain a new clustering feature tree Tree2, and the number of layers of the node where the sample images P1 and P2 are located is increased by 1. Therefore, the similarity of the goods in the sample images in the node with a higher number of layers of the clustering feature tree is low, and they may not be the same category of goods, and the similarity of the goods in the sample images in the node with a lower number of layers is high, and they may have similar weight and size.
[0079] By analogy, when a new pending image is inserted into the clustering feature tree, the cluster radius of the new pending image and each leaf node of the clustering feature tree is obtained in the order of node layer number from high to low, and is compared with T in sequence to determine the position of the new pending image inserted into the clustering feature tree, and the process is stopped until all sample images in the training set are inserted into the clustering feature tree.
[0080] In one implementation manner of the embodiment of the present application, T is set to 0.9, and B is set to 5, and the implementer can set them according to the specific situation.
[0081] It should be noted that the cluster radius acquisition method in the embodiment is used to replace the cluster radius acquisition method in the BIRCH clustering algorithm, and the restriction of the leaf node balance factor L is deleted, and other contents of the BIRCH clustering algorithm remain unchanged. The number of layers of the root node of the cluster feature tree in the embodiment is 1; a sample image is randomly selected from the training set as a pending image, and the selected sample image cannot be selected as a pending image again.
[0082] The improved BIRCH algorithm reasonably allocates the cargo category and detail attribute information when performing clustering analysis at different levels, and adaptively divides sample images with high similarity into the same node, effectively solves the problem of distributing similar images to different clusters, improves the clustering effect of sample images, avoids the limitation of fixed number of samples in the node, and further makes the classification of the database more fine and scientific.
[0083] Step S4: constructing a cargo image database based on the cargo cluster feature tree.
[0084] The patent document with the publication number CN116414804A in the prior art discloses a database construction method and device based on a tree structure and electronic equipment, specifically a database constructed based on a tree structure. The database construction method in the above patent document is used to construct a database based on a cargo cluster feature tree, which is referred to as a cargo image database. The cargo image database not only contains image information of the cargo, but also associates attribute information such as the type and size of the cargo, and similarity data obtained through clustering analysis, and the structure of the cargo image database is helpful for users to quickly search and manage a large amount of cargo image data.
[0085] Thus, the present application is completed.
[0086] Embodiment 2:
[0087] The present application also proposes a computer device schematic diagram of a high-quality cargo sample image database construction device, please refer to Figure 3 The computer device includes a memory 501, a processor 502, and a computer program 503 stored in the memory 501 and running on the processor 502, wherein when the processor 502 executes the computer program 503, the computer device can execute any one of the high-quality cargo sample image database construction methods introduced above.
[0088] In addition, the embodiments of the present application also protect a device, which can include a memory and a processor, wherein the memory stores executable program code, and the processor is used to call and execute the executable program code to execute the high-quality cargo sample image database construction method provided by the embodiments of the present application.
[0089] The embodiment can divide the functions of the device according to the method examples described above, for example, each function module can be divided, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware. It should be noted that the division of the modules in the embodiment is illustrative, and is only a logical function division. In actual implementation, another division method can be used.
[0090] In the case of dividing each module according to each function, the device can further include a communication module, a signal analysis module, a complexity analysis module, and a positioning module, etc. It should be noted that all related contents of each step involved in the method embodiments can be cited in the function description of the corresponding function module, and will not be repeated here.
[0091] It should be understood that the device provided by the embodiment is used to execute the high-quality goods sample image database construction method described above, and thus the same effect as the implementation method described above can be achieved.
[0092] In the case of using an integrated unit, the device can include a processing module and a storage module. When the device is applied to a device, the processing module can be used to control and manage the actions of the device. The storage module can be used to support the device to execute program codes and the like.
[0093] The processing module can be a processor or a controller, which can implement or execute various exemplary logical blocks, modules, and circuits included in the disclosure of the present application. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, a combination of digital signal processing (DSP) and microprocessor, and the like. The storage module can be a memory.
[0094] Embodiment 3:
[0095] The embodiment also provides a computer readable storage medium, which stores computer program codes. When the computer program codes run on a computer, the computer executes the related method steps to implement the high-quality goods sample image database construction method provided in the above embodiment.
[0096] Embodiment 4:
[0097] The embodiment also provides a computer program product, which makes the computer execute the related steps to implement the high-quality goods sample image database construction method provided in the above embodiment when the computer program product runs on the computer.
[0098] The apparatus, computer readable storage medium, computer program product or chip provided in the embodiment can achieve the beneficial effects of the corresponding method provided above, and thus the beneficial effects of the corresponding method provided above are not repeated here.
[0099] In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are only schematic. The division of the modules or units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0100] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0101] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments.
Claims
1. A method for constructing a high-quality cargo sample image database, characterized in that, The method includes: Obtain sample images of different categories of goods, wherein the sample images include bounding boxes; BIRCH hierarchical clustering is performed on all sample images. In BIRCH hierarchical clustering, the initial clustering feature tree is empty. The training set is composed of all sample images. Sample images selected sequentially from the training set are recorded as images to be determined. The similarity between the pairwise bounding boxes of the images to be determined and the sample images within each leaf node is adjusted according to the number of layers of each leaf node of the clustering feature tree. The cluster radius of the images to be determined and each leaf node of the clustering feature tree is determined. Based on the cluster radius, the BRICH algorithm is used to insert the undetermined image into the cluster feature tree and update the cluster feature tree; a new undetermined image is selected to continue updating the cluster feature tree until all sample images in the training set are traversed. The updated cluster feature tree obtained when all sample images in the training set are inserted into the cluster feature tree is used as the cargo cluster feature tree. A cargo sample image database is constructed based on cargo clustering feature trees; Determining the cluster radius of each leaf node of the image to be determined and the clustering feature tree includes: Obtain the target category of the bounding boxes of the sample images for different attribute data of each category of goods; obtain the initial goods similarity between the two bounding boxes based on the gradient similarity and target category similarity of any two bounding boxes in the sample image. Choose one bounding box from each sample image within each leaf node of the image to be determined and the cluster feature tree to form a bounding box pair; according to the layer number of each leaf node in the cluster feature tree, adjust the difference between the initial cargo similarity of the two bounding boxes in the bounding box pair and the attribute data of the target category of the two bounding boxes to obtain the comprehensive cargo similarity of the bounding box pair. Based on the comprehensive cargo similarity, the cluster radius of each leaf node of the image to be determined and the clustering feature tree is determined; The method for obtaining the initial cargo similarity includes: For each bounding box, the text information of the target category is transformed into word vectors and HOG features are extracted to obtain the category vector and HOG feature vector respectively. Calculate the mean of the minimum values among the elements of the same dimension in the HOG feature vectors of any two bounding boxes in the sample image, and use it as the gradient similarity of the corresponding two bounding boxes; obtain the class similarity of the class vectors of any two bounding boxes in the sample image; Based on the gradient similarity and the category similarity, the initial cargo similarity between any two bounding boxes in the sample image is obtained; The process of obtaining the comprehensive cargo similarity of bounding box pairs includes: Arrange all attribute data of the target category of the bounding box in order to obtain the attribute vector; calculate the distance between the attribute vectors of the two bounding boxes in the bounding box pair, and denot it as the attribute difference. Based on the number of layers of each leaf node in the clustering feature tree, determine the adjustment coefficient of the corresponding leaf node; The adjustment coefficient is used as the weight of the initial cargo similarity between the two bounding boxes in the bounding box pair, and the difference between the constant 1 and the adjustment coefficient is used as the weight of the result after negative correlation mapping of the attribute difference of the bounding box pair. The initial cargo similarity and the attribute difference are weighted and summed to obtain the comprehensive cargo similarity of the bounding box pair. The step of determining the cluster radius of each leaf node of the image to be determined and the clustering feature tree based on the comprehensive cargo similarity includes: The maximum value of the comprehensive cargo similarity among all bounding box pairs of each sample image within each leaf node of the clustering feature tree is negatively correlated and normalized to obtain the distance index between the image to be determined and each sample image within each leaf node of the clustering feature tree. The mean of the distance indices between the image to be determined and all sample images within each leaf node of the clustering feature tree is calculated and used as the cluster radius between the image to be determined and each leaf node of the clustering feature tree.
2. The method for constructing a high-quality cargo sample image database according to claim 1, characterized in that, The category similarity is equal to the normalized result of the cosine similarity of the category vectors of any two bounding boxes in the sample image.
3. The method for constructing a high-quality cargo sample image database according to claim 1, characterized in that, The adjustment coefficient is equal to the result of negatively correlated and normalized layers of each node in the cluster feature tree.
4. The method for constructing a high-quality cargo sample image database according to claim 1, characterized in that, The method for obtaining the target category of the bounding box of the sample image includes: The YOLO algorithm is used to obtain the bounding boxes and the class probabilities of each bounding box in the sample image. The class with the maximum value among all class probabilities of each bounding box is selected as the target class of each bounding box.
5. The method for constructing a high-quality cargo sample image database according to claim 1, characterized in that, The method for converting the text information of the target category for each bounding box into word vectors is the BERT model.
6. The method for constructing a high-quality cargo sample image database according to claim 1, characterized in that, The gradient similarity and the category similarity are both positively correlated with the initial cargo similarity.
Citation Information
Patent Citations
Database construction method and device based on tree structure and electronic equipment
CN116414804A
Method and system for constructing perinatal medical research database
CN117520473A
System and method for browsing an image database
US20080118160A1