Commodity identification system based on unbalanced data learning
Through the product identification system based on non-balanced data learning, the multi-dimensional features in the product image are analyzed, the feature weights of low-proportion category samples are adjusted, the fit between the image embedding value and the database sample is calculated, and the relationship between the sample feature weights and category mapping is dynamically adjusted, which solves the problems of insufficient feature extraction, imbalance in classification performance, low matching accuracy and insufficient model update capabilities in the existing technology, and high-precision product identification and long-term reliability are achieved.
Patent Information
- Application Number
- CN202510200277.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-06-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has insufficient extraction of detailed features of specific products, and it is difficult to capture the shape, texture and color characteristics of complex products, resulting in low classification accuracy, lack of feature enhancement methods for low proportion categories when processing uneven samples, resulting in imbalance in classification performance, and the sample matching method cannot dynamically identify the slight differences between embedded features, affecting the matching accuracy, and the model update method lacks dynamic response ability to change the new sample feature, reducing the long-term reliability of the identification results.
The product identification system based on non-balanced data learning is adopted, and the multi-dimensional features in the product image are analyzed through the image feature extraction module. The non-balanced sample learning module adjusts the feature weights of the low-proportion category samples, the fine-grained classification module performs local feature classification, intelligent matching and recommendation module calculates the fit between the image embedding value and the database sample, and the model dynamic optimization module dynamically adjusts the sample feature weights and category mapping relationship.
By enhancing the meticulousness of feature extraction, balancing data distribution differences, improving the accuracy of classification models, significantly improving the accuracy of category division, ensuring adaptability and real-time learning ability to complex samples, and improving the long-term reliability of identification results.
Smart Images

Figure CN120147840A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image pattern recognition, and particularly to a commodity authentication system based on unbalanced data learning. Background Art
[0002] The technical field of image pattern recognition includes technical methods for feature extraction and pattern analysis based on image data. Its core content lies in collecting image information of the target object and using computational methods to analyze and identify specific features in the image to achieve classification, recognition, or judgment of the image content. This technical field covers multiple links from image preprocessing to feature extraction, including processing image information through methods such as edge detection, texture analysis, and color segmentation, as well as classifying and identifying specific patterns through machine learning or manual training. The overall technical field systematically covers the entire process from image acquisition, data analysis to result output, and is widely applied in fields such as identity authentication, item recognition, and visual monitoring.
[0003] Among them, a commodity authentication system refers to a systematic method and device for feature extraction and image pattern analysis of specific categories of commodities. This patent theme mainly focuses on second-hand luxury goods such as handbags, and through the acquisition of image data, the analysis of feature points, and the construction of a feature classification model, it completes the identification of the authenticity or origin of the commodity. Specifically, this patent uses optical equipment to collect images of the commodity, extracts the shape features, texture features, and logo features of the commodity through feature extraction algorithms, and combines the constructed classification model to achieve the authentication of the commodity. The entire process strictly relies on the commodity feature data and gradually completes image analysis and commodity judgment through methods such as shape matching and image texture feature comparison.
[0004] The prior art does not extract sufficient detailed features of specific commodities, making it difficult to capture the shape, texture, and color features of complex commodities, which limits the classification accuracy. When dealing with uneven sample quantities, there is a lack of means to strengthen the features of low-proportion categories, resulting in an imbalance in classification performance. The sample matching method relies on simple and fixed rules and cannot dynamically identify the tiny differences between embedded features, affecting the matching accuracy. The model update method lacks the dynamic response ability to the changes in the features of new samples and is difficult to maintain adaptability to the new environment, reducing the long-term reliability of the authentication results. Summary of the Invention
[0005] The purpose of the present invention is to solve the deficiencies existing in the prior art, and a commodity authentication system based on unbalanced data learning is proposed.
[0006] To achieve the above purpose, the present invention adopts the following technical solutions: The commodity authentication system based on unbalanced data learning includes:
[0007] The image feature extraction module, based on the input of the product image, analyzes the edge distribution and contour pixel values of the LOGO position in the image, extracts the texture direction and gray-scale distribution of the zipper, calculates the color proportion and gray-scale value of the engraved area, performs normalization processing, and generates multi-dimensional feature vector values;
[0008] The unbalanced sample learning module, based on the multi-dimensional feature vector values, obtains the quantity ratio between the positive and negative categories of the samples, calculates the difference and extracts the proportion of the sample quantity, adjusts the feature weights of the low-proportion category samples, and generates a weighted sample distribution coefficient;
[0009] The fine-grained classification module, based on the weighted sample distribution coefficient, extracts the offset values and texture distributions of the LOGO edge and zipper texture, compares the similarity values and texture direction characteristics of the local gray scale of the zipper, judges the offset value of the gray-scale change in the engraved area, integrates the key feature data to complete the category division, and generates a local feature classification coefficient;
[0010] The intelligent matching and recommendation module, based on the local feature classification coefficient, calculates the fitting degree between the image embedding value and the database samples, screens the embedding samples with the smallest distribution difference for grouping, and generates a category fitting degree matching value;
[0011] The model dynamic optimization module, based on the category fitting degree matching value, extracts the change in the feature weights of the new samples, calculates the offset from the weights of the existing samples, adjusts the category weight mapping relationship, and establishes a dynamic sample optimization coefficient.
[0012] The multi-dimensional feature vector values include the edge distribution of the LOGO position, the contour pixel values, the texture direction of the zipper, the gray-scale distribution of the zipper, the color proportion of the engraved area, and the gray-scale value of the engraved area. The weighted sample distribution coefficient includes the quantity ratio between the positive and negative categories of the samples, the difference calculation value, the proportion of the sample quantity, and the feature weight adjustment value of the low-proportion category samples. The local feature classification coefficient includes the LOGO edge offset value, the zipper texture offset value, the similarity value of the local gray scale of the zipper, the texture direction characteristics, the offset value of the gray-scale change in the engraved area, and the key feature data. The category fitting degree matching value includes the image embedding value, the fitting degree of the database samples, and the grouping of the embedding samples with the smallest distribution difference. The dynamic sample optimization coefficient includes the change in the feature weights of the new samples, the offset from the weights of the existing samples, and the adjustment value of the category weight mapping relationship.
[0013] As a further solution of the present invention, the specific steps for obtaining the multi-dimensional feature vector values are as follows:
[0014] Based on the input of the product image, analyze the edge distribution of the LOGO area in the product image, call the edge pixel gradient values, extract the changing trend of the gradient values, and at the same time combine the edge direction gradient change amplitude, calculate the mean and variance of the direction and intensity, and comprehensively classify the edge characteristics using the mean and variance to generate the edge feature components of the LOGO area;
[0015] Use the direction and intensity parameters in the edge feature components of the LOGO area to perform classification calculations on the contour pixel values, extract the distribution ratios of the highlighted and low-light pixel points, call the change amplitude of the edge direction and the intensity weight, perform normalization processing, and at the same time extract the contour characteristics through classification weight adjustment and normalization to generate the LOGO contour feature vector;
[0016] Combine the normalized weight and the brightness distribution ratio in the LOGO contour feature vector, and combine the pixel gray level values in the lettering area, using the formula:
[0017]
[0018] Calculate the color proportion and gray level value of the lettering area to generate the lettering area feature matrix;
[0019] where, C k represents the color proportion and gray level value of the lettering area, w i represents the edge weight, g i represents the pixel gray level value, d i represents the texture direction gradient value, r j represents the brightness weight, t j represents the normalization factor, n represents the total number of edge pixels, and m represents the number of pixel categories;
[0020] Combine the color proportion, gray level value and texture direction in the lettering area feature matrix, analyze the texture direction and gray scale distribution of the zipper area, and through the direction consistency and gray scale change amplitude of the pixels in the zipper area, call the normalized weight and direction components of the lettering feature vector to comprehensively adjust the area feature vector to generate the multi-dimensional feature vector value.
[0021] As a further solution of the present invention, the specific steps for obtaining the weighted sample distribution coefficient are as follows:
[0022] Based on the multi-dimensional feature vector value, call the sample set and count the number of positive and negative categories, calculate the quantity ratio between the positive and negative categories according to the counting result, determine the ratio difference through the comparison of the positive and negative category quantities, and generate the positive and negative category ratio;
[0023] Using the positive and negative class ratios, through the analysis and calculation of the ratio differences, extract the proportion of the target class sample size, identify the low-proportion samples of the target class, classify and label them based on the quantity characteristics of the low-proportion samples, and generate low-proportion class sample information;
[0024] Adjust the feature weights in the low-proportion class sample information, using the formula:
[0025]
[0026] Adjust the distribution of the original weights through the absolute value difference and square root operations to generate a weighted sample distribution coefficient;
[0027] where, W adj represents the adjusted weight, W ori represents the original feature weight, P max represents the maximum proportion in the sample class, P min represents the minimum proportion in the sample class, P r represents the proportion of the sample size of the target class.
[0028] As a further solution of the present invention, the specific steps for obtaining the local feature classification coefficient are as follows:
[0029] Based on the weighted sample distribution coefficient, extract the gray-scale offset value of the LOGO edge and the direction distribution of the zipper texture in the image. By analyzing the change range of the gray-scale offset value and combining the central tendency of the texture direction statistics, calculate the texture offset feature of the LOGO and zipper regions to generate texture offset feature data;
[0030] Use the texture offset feature data to perform multiple comparison analyses on the local gray-scale similar values of the zipper. Based on the error interval of the gray-scale similar values for each comparison and combining the associated distribution of the texture direction characteristics, calculate the matching degree of the local gray-scale value and the texture direction to generate local gray-scale texture matching data;
[0031] Combined with the local gray-scale texture matching data, judge the offset value of the gray-scale level change in the lettering area. Through the collaborative analysis of the gray-scale offset value and the texture matching data, use the formula:
[0032]
[0033] Calculate the weighted sum of the gray-scale similar value and the texture direction offset value divided by the cumulative sum of the gray-scale levels to generate the local feature classification coefficient;
[0034] where, C lf represents the local feature classification coefficient, G i represents the gray-scale similar value of the i-th region, D i represents the offset value of the texture direction of the i-th region, is the average value of all texture direction offset values, T j represents the gray scale value of the lettering area j, n is the number of areas, and m is the number of lettering areas.
[0035] As a further solution of the present invention, the steps for obtaining the category fitness matching value are specifically as follows:
[0036] Based on the local feature classification coefficient, calculate the fitness between the image embedding value and multiple samples in the database. By evaluating the degree of difference between the feature embedding value of each sample and the image embedding value, and combining the correlation threshold to classify the difference results, obtain the preliminary fitness result data;
[0037] Use the preliminary fitness result data to perform sorting analysis on the fitness of all samples. Determine the highest fitness sample set through fitness sorting, and perform item-by-item calculation and analysis on the feature distribution differences of the set to obtain the minimum distribution difference sample set;
[0038] Based on the minimum distribution difference sample set, perform fitness optimization grouping on the target sample set, using the formula:
[0039]
[0040] Adjust the sample contribution through the ratio of the embedding value difference to the distribution standard deviation to generate the category fitness matching value;
[0041] where, M match represents the category fitness matching value, V img represents the image embedding value, V dbi represents the embedding value of the i-th sample in the database, S dbi represents the distribution standard deviation of the i-th sample, C var is an adjustment coefficient for adapting to the differential data distribution, γ is a regulation parameter for adjusting the contribution weight of the embedding value difference in the numerator, δ is a regulation parameter for adjusting the influence degree of the grouping weight in the denominator, n is the total number of samples, and m is the number of groups.
[0042] As a further solution of the present invention, the steps for obtaining the dynamic sample optimization coefficient are specifically as follows:
[0043] Based on the category fitness matching value, extract the feature weight data of the new sample and the existing sample set. By calling the feature vectors of the new sample weight and the existing sample weight, calculate the weight difference item by item and analyze the weight change trend. Combine the change trend to determine the fluctuation range of the sample weight and generate the preliminary weight offset data;
[0044] Using the preliminary weight offset data, evaluate the difference degree between the newly added samples and the existing class weights, analyze the numerical fluctuation range of each weight difference point one by one, and through weighted cumulative calculation of the difference fluctuation values, form an adjustment factor, map the existing sample weight relationship, and generate the adjusted class weight mapping data;
[0045] Combined with the adjusted class weight mapping data, dynamically adjust the optimization coefficient of the newly added samples, using the formula:
[0046]
[0047] Calculate the exponential function of the offset square value of the feature weights between the newly added samples and the existing samples, and combine the standard deviation normalization to adjust the influence degree of the offset amount to generate the dynamic sample optimization coefficient;
[0048] Among them, O dynamic represents the dynamic sample optimization coefficient, W new,i 、W exist,i respectively represent the feature weights of the i-th newly added sample and the existing samples, σ is the standard deviation adjustment factor of the weight offset, used to standardize the influence of the weight fluctuation on the optimization coefficient, n is the number of samples, used to average the optimization results to improve stability.
[0049] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0050] In the present invention, by analyzing the edge distribution of the logo, the contour pixel value, the texture direction and the gray distribution, as well as the color ratio and the gray scale value of the lettering area, the fineness of feature extraction is enhanced, and a high-dimensional feature expression form is constructed. The performance of low-ratio category samples is optimized by weight adjustment, the data distribution difference is balanced, and the accuracy of the classification model is improved. By refining the comparison of the texture distribution and the gray characteristics, and combining the comprehensive analysis of key features, the accuracy of category division is significantly improved. Dynamically adjust the sample feature weights and the category mapping relationship, continuously optimize the model performance, and ensure the adaptability to complex samples and the real-time learning ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is the system flow chart of the present invention;
[0052] Figure 2 is the flow chart of the acquisition steps of the multi-dimensional feature vector value of the present invention;
[0053] Figure 3 is the flow chart of the acquisition steps of the weighted sample distribution coefficient of the present invention;
[0054] Figure 4 is the flow chart of the acquisition steps of the local feature classification coefficient of the present invention;
[0055] Figure 5 Flow chart of the acquisition steps of the category fitness matching value of the present invention;
[0056] Figure 6 Flow chart of the acquisition steps of the dynamic sample optimization coefficient of the present invention. Specific embodiments
[0057] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0058] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, in the description of the present invention, "a plurality" means two or more unless otherwise specifically defined.
[0059] Embodiment 1
[0060] Please refer to Figure 1 , the commodity identification system based on unbalanced data learning includes:
[0061] Based on the input of the commodity image, the image feature extraction module analyzes the edge distribution and contour pixel values of the LOGO position in the image, extracts the texture direction and gray-scale distribution of the zipper, calculates the color proportion and gray-scale value of the engraved area, performs normalization processing, and generates a multi-dimensional feature vector value;
[0062] Based on the multi-dimensional feature vector value, the unbalanced sample learning module obtains the quantity ratio between the positive and negative categories of the samples, calculates the difference and extracts the proportion of the sample quantity, adjusts the feature weights of the samples in the low-proportion category, and generates a weighted sample distribution coefficient;
[0063] Based on the weighted sample distribution coefficient, the fine-grained classification module extracts the offset values and texture distributions of the LOGO edge and zipper texture, compares the similarity values and texture direction characteristics of the local gray scale of the zipper, judges the offset values of the gray-scale change in the engraved area, integrates the key feature data to complete the category division, and generates a local feature classification coefficient;
[0064] Based on the local feature classification coefficient, the intelligent matching and recommendation module calculates the fitness between the image embedding value and the database samples, screens the embedding samples with the smallest distribution difference for grouping, and generates a category fitness matching value;
[0065] Based on the category fitness matching value, the model dynamic optimization module extracts the change of feature weights of the newly added samples, calculates the deviation from the weights of the existing samples, adjusts the category weight mapping relationship, and establishes a dynamic sample optimization coefficient.
[0066] The multi-dimensional feature vector values include the edge distribution of the LOGO position, the contour pixel values, the texture direction of the zipper, the gray-scale distribution of the zipper, the color proportion of the engraved area, and the gray-scale value of the engraved area. The weighted sample distribution coefficients include the quantity ratio between the positive and negative categories of the samples, the difference calculation value, the sample quantity proportion, and the feature weight adjustment value of the samples in the low-proportion category. The local feature classification coefficients include the LOGO edge deviation value, the zipper texture deviation value, the similarity value of the local gray-scale of the zipper, the texture direction characteristics, the deviation value of the gray-scale change in the engraved area, and the key feature data. The category fitness matching value includes the image embedding value, the fitness of the database samples, and the embedded sample grouping with the minimum distribution difference. The dynamic sample optimization coefficient includes the change of feature weights of the newly added samples, the deviation of the weights of the existing samples, and the adjustment value of the category weight mapping relationship.
[0067] Please refer to Figure 2 , and the specific steps for obtaining the multi-dimensional feature vector values are as follows:
[0068] Based on the input of the commodity image, parse the edge distribution of the LOGO area in the commodity image, call the edge pixel gradient value, extract the change trend of the gradient value, and at the same time combine the change amplitude of the edge direction gradient, calculate the mean and variance of the direction and intensity, and use the mean and variance to comprehensively classify the edge characteristics to generate the edge feature component of the LOGO area;
[0069] By extracting the gray-scale values of all edge points in the LOGO area of the image, calculate the difference in gray-scale value change and the range of gradient direction change. For each edge point, quantify the gray-scale difference of its neighborhood pixels, classify according to the difference range, and calculate the proportion of edge points in each classification to the total edge points. Combine the proportion with the edge gradient direction, determine the significant direction gradient component through the direction value normalization weight, and extract the main feature distribution of the edge direction change in the LOGO area according to the calculation result of the significant direction gradient component. Generate the edge feature component of the LOGO area by integrating all the main feature distribution parameters.
[0070] Use the direction and intensity parameters in the edge feature component of the LOGO area to classify and calculate the contour pixel values, extract the distribution ratio of the high-brightness and low-brightness pixel points, call the change amplitude and intensity weight of the edge direction, perform normalization processing, and at the same time extract the contour characteristics through classification weight adjustment and normalization to generate the LOGO contour feature vector;
[0071] By extracting the maximum and minimum values within the range of pixel grayscale values of the LOGO contour, the classification criteria for high-brightness and low-brightness pixel points are determined. Pixel points within the image whose grayscale values fall within the classification criteria range are classified into the high-brightness class and the low-brightness class respectively. For each class of pixel points after classification, their average grayscale value and proportion weight are calculated. The proportion weight is combined with the edge intensity value for normalization processing. By unifying the distribution of the normalization result values and adding an adjustment factor for the classification proportion, the feature comparison value of high- and low-brightness pixel points is calculated, thereby generating the LOGO contour feature vector.
[0072] Combining the normalized weight and brightness distribution ratio in the LOGO contour feature vector, and combining the pixel gray scale values within the lettering area, using the formula:
[0073]
[0074] Calculate the color proportion and gray scale value of the lettering area to generate the lettering area feature matrix;
[0075] Among them, C k represents the color proportion and gray scale value of the lettering area, w i represents the edge weight, g i represents the pixel gray scale value, d i represents the texture direction gradient value, r j represents the brightness weight, t j represents the normalization factor, n represents the total number of edge pixels, and m represents the number of pixel categories;
[0076] Formula:
[0077]
[0078] The advantage of the formula is that by combining the weight coefficient and the gray scale value, the edge intensity, brightness weight, and direction gradient are unified and integrated into the same formula, enhancing the ability to depict details and perform comprehensive calculations on the lettering area;
[0079] Detailed explanation of the formula and the formula calculation derivation process:
[0080] w i = 0.75, 0.65, 0.8 (weight coefficients extracted by the edge detection tool);
[0081] g i = 120, 130, 110 (gray scale values extracted by the gray scale distribution histogram);
[0082] d i = 40, 45, 38 (direction gradient values extracted by texture analysis);
[0083] r j= 0.8, 0.6, 0.7 (weight values calculated from brightness distribution);
[0084] t j = 1.2, 1.3, 1.1 (adjustment factors for normalization);
[0085] Substitute into the formula:
[0086]
[0087]
[0088] The result shows that the combined feature of the color proportion and grayscale value in the engraved area is 110.14, and this value is used for the subsequent generation of the feature matrix and multi-dimensional feature extraction.
[0089] Combining the color proportion, grayscale value, and texture direction in the engraved area feature matrix, analyze the texture direction and grayscale distribution in the zipper area. Through the direction consistency and grayscale change amplitude of the pixels in the zipper area, call the normalized weight and direction components of the engraved feature vector, and comprehensively adjust the area feature vector to generate the multi-dimensional feature vector value.
[0090] By extracting the direction consistency of each texture in the zipper area, calculating the grayscale change range of each texture, determining the main direction of the area through the change rate of adjacent direction values in the direction consistency, obtaining the light and dark contrast of the texture through the difference between the upper and lower limits in the grayscale change range, and comprehensively calling the direction and intensity distribution parameters of the normalized feature vector in the engraved area to adjust the comprehensive feature weight of the zipper area to generate the multi-dimensional feature vector value.
[0091] Please refer to Figure 3 , and the specific steps for obtaining the weighted sample distribution coefficient are as follows:
[0092] Based on the multi-dimensional feature vector value, call the sample set and count the number of positive and negative classes. Calculate the quantity ratio between the positive and negative classes according to the counting result, and determine the ratio difference through the comparison of the positive and negative class quantities to generate the positive and negative class ratio;
[0093] By analyzing the class label distribution of the sample set, separately count the samples of the positive and negative classes one by one. In the statistical process, use the cumulative counting method to accumulate the number of samples of each class, obtain the total number of positive and negative class samples through the count value, calculate the quantity ratio of the two classes based on the total number, and according to the quantity ratio formula Calculate the positive and negative class ratio value through the ratio, and use this ratio for further analysis in the subsequent steps to generate the positive and negative class ratio.
[0094] Utilize the positive and negative class ratios, calculate through the analysis of the ratio differences, extract the proportion of the target class sample size, identify the low-proportion samples of the target class, classify and label them based on the quantity characteristics of the low-proportion samples, and generate low-proportion class sample information;
[0095] Through the formula Obtain the percentage of the target class samples, combine with the sample label distribution, divide all samples into multi-class sets according to their labels, calculate the proportion of the sample size of each class one by one, identify the samples of the low-proportion classes through these proportion values, mark them as "rare classes" based on the information of these low-proportion classes, record the quantity proportion information of the rare classes and the corresponding sample characteristics together for subsequent weight adjustment, and generate low-proportion class sample information.
[0096] Adjust the feature weights in the low-proportion class sample information, using the formula:
[0097]
[0098] Adjust the distribution of the original weights through the absolute value difference and square root operations to generate a weighted sample distribution coefficient;
[0099] Among them, W adj represents the adjusted weight, W ori represents the original feature weight, P max represents the maximum proportion in the sample class, P min represents the minimum proportion in the sample class, P r represents the proportion of the target class sample size.
[0100] Formula:
[0101]
[0102] The advantage of the formula is that by introducing the joint relationship between the target class proportion and the maximum and minimum proportions, the flexibility of the formula for weight adjustment is enhanced using the absolute value and square root operations, making the weight adjustment of rare classes more precise;
[0103] Detailed explanation of the formula and the formula calculation derivation process:
[0104] Let the proportion of the target class sample size P r = 0.05 (calculated from a total sample size of 10,000 and a target class sample size of 500), the maximum proportion P max = 0.4 (positive class samples), the minimum proportion P min = 0.05 (low-proportion class samples), and the original weight W ori = 1 (initially set as the mean).
[0105] Substitute into the formula for calculation:
[0106]
[0107] W adj ≈1.106;
[0108] This result indicates that the adjusted weight is 1.106, which is an increase compared to the original weight, reflecting that the target category is a low - proportion category. By adjusting the weight, the influence of rare categories can be more significantly enhanced in the subsequent sample distribution, generating a weighted sample distribution coefficient.
[0109] Please refer to Figure 4 , and the specific steps for obtaining the local feature classification coefficient are as follows:
[0110] Based on the weighted sample distribution coefficient, extract the gray - scale offset value of the LOGO edge and the direction distribution of the zipper texture in the image. By analyzing the variation range of the gray - scale offset value and combining the central tendency of the texture direction statistics, calculate the texture offset features of the LOGO and zipper regions, generating texture offset feature data;
[0111] The gray - scale offset value is calculated point - by - point for the gray - scale change of pixels in the LOGO region. The single - point offset value is calculated using the gray - scale gradient change formula, and the formula is ΔG = G i+1 -G i , where G i represents the gray - scale value of the i - th pixel point. By accumulating and calculating the gray - scale gradient change trend, the overall gray - scale offset value of the LOGO region is obtained. The distribution of the zipper texture direction is obtained by analyzing the pixel direction consistency in the texture region, using the variance calculation formula of the pixel gradient direction where θ i is the angle of the i - th pixel direction. By calculating the variance to analyze the consistency degree of the texture direction distribution, combining the consistency results of the gray - scale offset value and the texture direction distribution, local offset features are screened through the difference value, generating texture offset feature data.
[0112] Using the texture offset feature data, conduct multiple comparative analyses on the local gray - scale similar values of the zipper. Based on the error interval of the gray - scale similar values of each comparison and combining the associated distribution of the texture direction characteristics, calculate the matching degree of the local gray - scale value and the texture direction, generating local gray - scale texture matching data;
[0113] By segmenting the gray - scale distribution of the zipper region step - by - step, extract the gray - scale mean value of each segment, and the formula is where G i is the gray - scale value of the i - th pixel in this segment. By calculating the gray - scale mean value, the similarity between local regions is calculated. By comparing the gray - scale difference values of adjacent segments and combining the distribution characteristics of the texture direction, calculate the direction consistency formula where θi is the i-th texture direction angle. By analyzing the texture distribution pattern and gray-scale similarity through similarity and consistency data matching, local gray-scale texture matching data is generated.
[0114] Combined with the local gray-scale texture matching data, the offset value of the gray-scale change in the lettering area is judged. Through the collaborative analysis of the gray-scale offset value and the texture matching data, the formula is used:
[0115]
[0116] Calculate the weighted sum of the gray-scale similar values and the texture direction offset values divided by the accumulated sum of the gray-scale values to generate the local feature classification coefficient;
[0117] Among them, C lf represents the local feature classification coefficient, G i represents the gray-scale similar value of the i-th area, D i represents the offset value of the texture direction of the i-th area, is the average value of all texture direction offset values, T j represents the gray-scale value of the lettering area j, n is the number of areas, and m is the number of lettering areas.
[0118] Formula:
[0119]
[0120] The advantage of the formula is that through the collaborative analysis of the gray-scale similarity value and the texture direction offset value, the sensitivity to regional features is enhanced by calculation methods such as absolute value and square root, improving the classification accuracy;
[0121] Detailed explanation of the formula and the derivation process of the formula calculation:
[0122] 1. Set the gray-scale similarity value G i = 120, 130, 110, the texture direction offset value D i = 5, 6, 4, the average value of the texture direction
[0123] 2. Calculate the gray-scale offset product is 120·|5 - 5| + 130·|6 - 5| + 110·|4 - 5| = 0 + 130 + 110 = 240;
[0124] 3. Set the gray-scale value T j = 50, 60, 70, sum
[0125] 4. Substitute into the formula for calculation
[0126] The result shows that the local feature classification coefficient is 1.33, indicating that the classification significance of this area is relatively high in terms of gray-scale similarity and texture direction consistency, and it has a strong consistency with the target classification data in the steps.
[0127] Please refer to Figure 5 , and the specific steps for obtaining the category fitness matching value are as follows:
[0128] Based on the local feature classification coefficient, calculate the fitness between the image embedding value and multiple samples in the database. By evaluating the degree of difference between the feature embedding value of each sample and the image embedding value, and combining the correlation threshold to classify the difference results, the preliminary fitness result data is obtained;
[0129] By extracting the local feature classification coefficient, match its value with the embedded features of all samples in the database one by one. First, normalize the embedded value features of the samples, using the normalization formula to process each sample. After normalization, match the normalized embedded value of each sample with the target image embedded value item by item, calculate the difference between the image embedded value and the sample embedded value in the database, and use the absolute value formula of the difference |V img -V dbi | for quantization. Analyze the fitness between samples by comparing the distribution range of the embedded value differences. Set a threshold for the evaluation of fitness. By setting the standard that samples with a value lower than a certain threshold (such as 0.05) are high-fitness samples, select the samples that meet the conditions, record and analyze the distribution characteristics of these samples, and combine the calculated high-fitness sample set to generate the preliminary fitness result data.
[0130] Using the preliminary fitness result data, perform a sorting analysis on the fitness of all samples. Determine the highest-fitness sample set through fitness sorting, and perform item-by-item calculation and analysis on the difference in feature distribution of the set to obtain the minimum distribution difference sample set;
[0131] By extracting the numerical characteristics in the fitness result data, first classify the high-fitness samples. By sorting the fitness results of each sample from high to low, extract the upper and lower quartiles in the fitness distribution, and set the segmentation standard for the fitness value according to the quartiles. The segmentation formula is Q k =Q 1 +k(Q 3 -Q 1 ), where Q k represents the segmentation value, Q 1 and Q 3 are the first quartile and the third quartile of the fitness respectively. The segmented sample data is divided into three categories: high, medium, and low fitness. For the samples with high fitness, further analyze the mean and standard deviation of their feature distribution, using the mean deviation formula To determine the distribution difference of highly fitting samples, the sample set with smaller distribution differences is incorporated into the fitting degree optimization set to obtain the sample set with the smallest distribution difference.
[0132] Based on the sample set with the smallest distribution difference, the target sample set is subjected to fitting optimization grouping, using the formula:
[0133]
[0134] Adjust the sample contribution through the ratio of the embedding value difference to the distribution standard deviation to generate the category fitting degree matching value;
[0135] Among them, M match represents the category fitting degree matching value, V img represents the image embedding value, V dbi represents the embedding value of the i-th sample in the database, S dbi represents the distribution standard deviation of the i-th sample, C var is the adjustment coefficient used to adapt to the differential data distribution, γ is the adjustment parameter used to adjust the contribution weight of the embedding value difference in the numerator, δ is the adjustment parameter used to adjust the influence degree of the grouping weight in the denominator, n is the total number of samples, and m is the number of groups.
[0136] Formula:
[0137]
[0138] The advantage of the formula is that by combining the comprehensive operations of the embedding value difference, the sample distribution standard deviation, and the adjustment parameter, the flexibility of the fitting degree calculation is improved, and the discrimination ability for the target samples is enhanced.
[0139] Detailed explanation of the formula and the derivation process of the formula calculation:
[0140] M match : Represents the category fitting degree matching value, which is used to measure the overall matching degree between the target image and the sample category;
[0141] V img : Image embedding value, obtained through an image feature extraction tool, assuming the extraction value is 0.72;
[0142] V dbi : Embedding value of the i-th sample, and the sample values extracted from the database are 0.70, 0.68, 0.74 in sequence;
[0143] S dbi : Distribution standard deviation of the i-th sample, calculated through a distribution analysis tool, which are 0.03, 0.02, 0.04 in sequence;
[0144] C var : Adjustment coefficient, set to 0.01 according to the distribution range;
[0145] γ, δ: Adjustment parameters, with values of 2 and 1.5 respectively.
[0146] Calculation process:
[0147] 1. First, calculate the absolute value of the difference between each sample and the image embedding value. For example, |0.72 - 0.70| = 0.02, and the others are 0.04 and 0.02 in sequence;
[0148] 2. Calculate the denominator value In sequence, they are
[0149] 3. Calculate the embedding difference ratio In sequence, they are 0.02 / 0.20 = 0.1, 0.04 / 0.17 ≈ 0.235, 0.02 / 0.22 ≈ 0.091;
[0150] 4. Take the negative power of the difference ratio. In sequence, they are 0.1 -2 = 100, 0.235 -2 ≈ 18.1, 0.091 -2
[0151] ≈ 120.7;
[0152] 5. Sum the results to 100 + 18.1 + 120.7 ≈ 238.8;
[0153] 6. Denominator calculation Assume the grayscale values are 1.0, 0.9, 1.1 in sequence, and the result is 1.0 1.5 + 0.9 1.5 + 1.1 1.5 ≈ 3.07;
[0154] 7. Calculate M match = 238.8 / 3.07 ≈ 77.8.
[0155] This result indicates that the category fitness matching value is 77.8. The higher the value, the stronger the fitting degree between the target image and the sample category. This value can be used as an important basis for sample classification.
[0156] Please refer to Figure 6 , and the specific steps for obtaining the dynamic sample optimization coefficient are as follows:
[0157] Based on the category fitness matching value, extract the feature weight data of the new samples and the existing sample set. By calling the feature vectors of the new sample weights and the existing sample weights, calculate the weight differences item by item and analyze the weight change trend. Combine the change trend to determine the fluctuation range of the sample weights and generate preliminary weight offset data;
[0158] By extracting the weight values of each feature dimension in the new samples, comparing them item by item with the weight values of the corresponding feature dimensions in the existing samples, calculating the absolute offset of each weight value, accumulating and summing these offset values, combining the total number of features of the new samples, calculating the overall weight change trend of the new samples, further analyzing the weight fluctuation range, classifying the weight fluctuation values by setting upper and lower limit intervals, determining whether there are feature weight changes beyond the reasonable range, and integrating the weight change classification results into a weight offset matrix to generate preliminary weight offset data.
[0159] Using the preliminary weight offset data, evaluate the degree of difference between the new samples and the existing class weights, analyze the numerical fluctuation range of each weight difference point one by one, form an adjustment factor through weighted cumulative calculation of the difference fluctuation values, map the existing sample weight relationship, and generate adjusted class weight mapping data;
[0160] By extracting each value in the weight offset matrix one by one, combining the total amount of a specific weight dimension, calculating the influence degree of each value in the offset matrix on the overall weight mapping relationship, summarizing all offset influence values and calculating the average offset influence ratio, comparing the average ratio with the set standard offset ratio to determine whether the class weight mapping relationship needs to be adjusted. In the case of too high offset values, readjust the influence of the new samples on the existing weight mapping relationship, calculate the adjusted class weight values, and generate adjusted class weight mapping data by remapping the adjusted class weights to the original weight system.
[0161] Combined with the adjusted class weight mapping data, dynamically adjust the optimization coefficient of the new samples, using the formula:
[0162]
[0163] Calculate the exponential function of the offset squared value of the feature weights between the new samples and the existing samples, combine the standard deviation normalization to adjust the influence degree of the offset, and generate a dynamic sample optimization coefficient;
[0164] Among them, O dynamic represents the dynamic sample optimization coefficient, W new,i , W exist,i represent the feature weights of the i-th new sample and the existing samples respectively, σ is the standard deviation adjustment factor of the weight offset, used to standardize the influence of the weight fluctuation on the optimization coefficient, and n is the number of samples, used to average the optimization results to improve stability.
[0165] Formula:
[0166]
[0167] The advantage of the formula is that, by combining the exponential decay function with the standard deviation normalization operation, it effectively reduces the influence of data with large weight offsets on the overall dynamic sample optimization coefficient, thereby improving the adaptability and robustness of the system;
[0168] Detailed explanation of the formula and the derivation process of the formula calculation:
[0169] W new,1 = 0.45, W exist,1 = 0.35, W new,2 = 0.50, W exist,2 = 0.48, W new,3
[0170] = 0.60, W exist,3 = 0.62 (extracting each weight value through monitoring data);
[0171] σ = 0.05 (obtained through the formula for calculating the standard deviation of the weight fluctuations of the new samples and the existing samples);
[0172] Substitute into the formula:
[0173]
[0174] O dynamic ≈ 0.5741;
[0175] This result shows that the value of the dynamic sample optimization coefficient is 0.5741, which is consistent with the reference value (in the range of 0.5 to 0.8) of the optimization standard benchmark, indicating that the system adjusts the weights of the new samples relatively smoothly. Through further dynamic coefficient mapping, the stability of the weight distribution can be optimized and the system adaptability can be improved.
[0176] The above is only a preferred embodiment of the present invention, and it does not limit the present invention in other forms. Any person skilled in the art may use the disclosed technical content to make changes or modifications into equivalent embodiments with equivalent changes and apply them to other fields. However, as long as it does not depart from the technical content of the technical solution of the present invention, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A commodity identification system based on unbalanced data learning, characterized in that: The system comprises: Based on the input of the product image, the image feature extraction module analyzes the edge distribution and contour pixel value of the LOGO position in the image, extracts the texture direction and grayscale distribution of the zipper, calculates the color proportion and grayscale value of the lettering area, performs normalization processing, and generates a multi-dimensional feature vector value; The unbalanced sample learning module obtains the quantity ratio between the positive and negative categories of the sample based on the multi-dimensional feature vector value, calculates the difference and extracts the sample quantity ratio, adjusts the feature weights of the low-ratio category samples, and generates a weighted sample distribution coefficient; Based on the weighted sample distribution coefficient, the fine-grained classification module extracts the offset value and texture distribution of the LOGO edge and the zipper texture, compares the similarity value of the local grayscale of the zipper with the texture direction characteristics, determines the offset value of the grayscale change of the lettering area, integrates the key feature data to complete the category division, and generates the local feature classification coefficient; The intelligent matching and recommendation module calculates the fit between the image embedding value and the database sample based on the local feature classification coefficient, selects the embedding samples with the smallest distribution difference for grouping, and generates a category fit matching value; The model dynamic optimization module extracts the feature weight changes of the newly added samples based on the category fit matching value, calculates the offset from the existing sample weights, adjusts the category weight mapping relationship, and establishes a dynamic sample optimization coefficient.
2. The commodity identification system based on unbalanced data learning according to claim 1, characterized in that: The multidimensional feature vector value includes the edge distribution of the LOGO position, the contour pixel value, the texture direction of the zipper, the grayscale distribution of the zipper, the color proportion of the lettering area, and the grayscale value of the lettering area. The weighted sample distribution coefficient includes the quantity ratio between the positive and negative categories of the sample, the difference calculation value, the sample quantity proportion, and the feature weight adjustment value of the low proportion category sample. The local feature classification coefficient includes the LOGO edge offset value, the zipper texture offset value, the similarity value of the local grayscale of the zipper, the texture direction characteristics, the offset value of the grayscale change of the lettering area, and the key feature data. The category fit matching value includes the image embedding value, the fit of the database sample, and the embedded sample grouping with the minimum distribution difference. The dynamic sample optimization coefficient includes the feature weight change of the newly added sample, the offset of the existing sample weight, and the category weight mapping relationship adjustment value.
3. The commodity identification system based on unbalanced data learning according to claim 2, characterized in that: The steps for obtaining the multidimensional feature vector value are specifically as follows: Based on the input of the product image, the edge distribution of the LOGO area in the product image is analyzed, the edge pixel gradient value is called, the gradient value change trend is extracted, and the mean and variance of the direction and intensity are calculated in combination with the edge direction gradient change amplitude. The mean and variance are used to comprehensively classify the edge characteristics and generate the LOGO area edge feature component; Using the direction and intensity parameters in the edge feature component of the LOGO area, the contour pixel values are classified and calculated, the distribution ratio of highlight and low-brightness pixels is extracted, the change amplitude and intensity weight of the edge direction are called, and normalization is performed. At the same time, the contour characteristics are extracted through classification weight adjustment and normalization to generate a LOGO contour feature vector; Combined with the normalized weight and brightness distribution ratio in the LOGO contour feature vector and the pixel grayscale value in the lettering area, the formula is adopted: Calculate the color proportion and grayscale value of the lettering area to generate the lettering area feature matrix; Among them, C k Represents the color ratio and grayscale value of the lettering area, w i represents the edge weight, g i Represents the pixel grayscale value, d i Represents the texture direction gradient value, r j represents the brightness weight, t j represents the normalization factor, n represents the total number of edge pixels, and m represents the number of pixel categories; Combined with the color proportion, grayscale value and texture direction in the feature matrix of the lettering area, the texture direction and grayscale distribution of the zipper area are analyzed. Through the directional consistency and grayscale change amplitude of the pixels in the zipper area, the normalized weight and directional component of the lettering feature vector are called, and the regional feature vector is comprehensively adjusted to generate a multi-dimensional feature vector value.
4. The commodity identification system based on unbalanced data learning according to claim 3 is characterized in that: The steps for obtaining the weighted sample distribution coefficient are specifically as follows: Based on the multidimensional feature vector value, calling the sample set and counting the number of positive and negative categories, calculating the number ratio between the positive and negative categories according to the counting result, determining the ratio difference by comparing the number of positive and negative categories, and generating the positive and negative category ratio; By using the positive and negative category ratios, the sample volume ratio of the target category is extracted through analysis and calculation of the ratio difference, and low-proportion samples of the target category are identified. The low-proportion samples are classified and marked according to the quantity characteristics of the low-proportion samples to generate low-proportion category sample information; The feature weights in the sample information of the low-proportion category are adjusted using the formula: The distribution of the original weights is adjusted by absolute value difference and square root operations to generate weighted sample distribution coefficients; Among them, W adj Represents the adjusted weight, W ori Represents the original feature weight, P max Represents the maximum proportion of the sample category, P min Represents the minimum proportion of the sample category, P r Represents the sample size ratio of the target category.
5. The commodity identification system based on unbalanced data learning according to claim 4, characterized in that: The steps for obtaining the local feature classification coefficient are specifically as follows: Based on the weighted sample distribution coefficient, the grayscale offset value of the LOGO edge and the directional distribution of the zipper texture in the image are extracted, and the texture offset features of the LOGO and zipper areas are calculated by analyzing the variation range of the grayscale offset value and combining the central trend of the texture direction statistics to generate texture offset feature data; Using the texture offset feature data, multiple comparisons and analyses are performed on similar local grayscale values of the zipper, and the matching degree of the local grayscale value and the texture direction is calculated based on the error interval of the similar grayscale values compared each time and the associated distribution of the texture direction characteristics to generate local grayscale texture matching data; Combined with the local grayscale texture matching data, the offset value of the grayscale change in the lettering area is determined, and the grayscale offset value and the texture matching data are analyzed in coordination, using the formula: Calculate the weighted sum of the grayscale similarity value and the texture direction offset value divided by the cumulative sum of the grayscale values to generate a local feature classification coefficient; Among them, C lf represents the local feature classification coefficient, G i Represents the grayscale value of the i-th region, D i Represents the offset value of the texture direction of the i-th region, is the average value of all texture direction offset values, T j Represents the grayscale value of the lettering area j, n is the number of areas, and m is the number of lettering areas.
6. The commodity identification system based on unbalanced data learning according to claim 5, characterized in that: The steps for obtaining the category fit matching value are specifically as follows: Based on the local feature classification coefficient, the fit between the image embedding value and multiple samples in the database is calculated, and the difference between the feature embedding value and the image embedding value of each sample is evaluated, and the difference results are classified in combination with the correlation threshold to obtain preliminary fit result data; Using the preliminary fit result data, the fit of all samples is sorted and analyzed, the highest fit sample set is determined by fit sorting, and the characteristic distribution differences of the set are calculated and analyzed item by item to obtain the minimum distribution difference sample set; Based on the minimum distribution difference sample set, the target sample set is fitted and optimized and grouped using the formula: The sample contribution is adjusted by the ratio of the difference in embedded values to the standard deviation of the distribution to generate a category fit match value; Among them, M match Represents the category fit matching value, V img Represents the image embedding value, V dbi represents the embedding value of the i-th sample in the database, S dbi represents the standard deviation of the distribution of the i-th sample, C var is the adjustment coefficient used to adapt to the differentiated data distribution, γ is the adjustment parameter used to adjust the contribution weight of the embedded value difference in the numerator, δ is the adjustment parameter used to adjust the influence of the grouping weight in the denominator, n is the total number of samples, and m is the number of groups.
7. The commodity identification system based on unbalanced data learning according to claim 6, characterized in that: The steps for obtaining the dynamic sample optimization coefficient are specifically as follows: Based on the category fit matching value, feature weight data of the newly added sample and the existing sample set are extracted, and the weight difference is calculated item by item and the weight change trend is analyzed by calling the feature vector of the newly added sample weight and the existing sample weight. The fluctuation range of the sample weight is determined based on the change trend, and preliminary weight offset data is generated; Using the preliminary weight shift data, evaluate the difference between the newly added samples and the existing category weights, analyze the value fluctuation range of each weight difference point one by one, form an adjustment factor by weighted cumulative calculation of the difference fluctuation values, map the existing sample weight relationship, and generate adjusted category weight mapping data; Combined with the adjusted category weight mapping data, the optimization coefficient of the newly added samples is dynamically adjusted using the formula: Calculate the exponential function of the square value of the offset between the feature weights of the new samples and the existing samples, adjust the impact of the offset by normalizing the standard deviation, and generate the dynamic sample optimization coefficient; Among them, O dynamic represents the dynamic sample optimization coefficient, W new,i , W exist,i They represent the feature weights of the i-th newly added sample and the existing sample respectively. σ is the standard deviation adjustment factor of the weight offset, which is used to standardize the impact of weight fluctuations on the optimization coefficient. n is the number of samples, which is used to take the average of the optimization results to improve stability.
