A method, device, electronic device and storage medium for evaluating product quality

By introducing the regularization term of the enhanced cross-entropy loss function into the product quality assessment model, the problem of limited accuracy of traditional assessment systems under complex data sets is solved, and more accurate product quality assessment is achieved.

CN119760404BActive Publication Date: 2025-09-05DIGITAL HEALTH CHINA TECHNOLOGIES CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411923658.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-09-05
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

Traditional product quality assessment systems are unable to fully capture the subtle differences between data when processing complex data sets, resulting in limited assessment accuracy.

Method used

An enhanced cross-entropy loss function is adopted. By adding a regularization term to the cross-entropy loss function, the model is encouraged to output a predicted probability distribution that is closer to the actual quality assessment result, thereby improving the model accuracy.

Benefits of technology

The evaluation accuracy of the product quality evaluation model has been improved, and it can more accurately reflect the quality characteristics of the product.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760404B_ABST
    Figure CN119760404B_ABST
Patent Text Reader

Abstract

The present invention relates to a product quality assessment method, apparatus, electronic device, and storage medium. The method comprises: obtaining multi-source product information for a product to be assessed; extracting product quality features from the multi-source product information; and inputting the product quality features into a pre-trained quality assessment model to obtain a quality assessment result for the product to be assessed. The method of the present invention, based on the regularization term in an enhanced cross-entropy loss function, can encourage the model to output a predicted probability distribution that is closer to the true quality assessment result, thereby improving the model's accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning technology, and in particular to a product quality assessment method, device, electronic device, and storage medium. Background Art

[0002] The product quality assessment system is an intelligent evaluation tool based on big data and artificial intelligence technologies. It analyzes data from product production, sales, and usage to provide companies with comprehensive, objective, and accurate product quality evaluations. However, traditional product quality assessment systems typically use the standard cross-entropy loss function when dealing with classification problems. This function may not fully capture subtle differences in complex data sets, resulting in limited assessment accuracy. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a product quality assessment method, device, electronic device and storage medium, aiming to solve at least one of the above technical problems.

[0004] In a first aspect, the present invention provides a technical solution to the above-mentioned technical problem as follows: a method for evaluating product quality, comprising:

[0005] Obtain multi-source product information for the product to be evaluated;

[0006] extracting product quality features from the multi-source product information;

[0007] The product quality features are input into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0008] Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products;

[0009] Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products;

[0010] According to the predicted quality assessment results and the actual quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the actual quality assessment result.

[0011] The beneficial effect of the present invention is that the quality assessment model in the present application adopts an enhanced cross-entropy loss function. Based on the regularization term in the enhanced cross-entropy loss function, the model can be encouraged to output a predicted probability distribution that is closer to the true quality assessment result, thereby improving the accuracy of the model.

[0012] On the basis of the above technical solution, the present invention can also be improved as follows.

[0013] Furthermore, the enhanced cross entropy loss function is:

[0014]

[0015] Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

[0016] Furthermore, the extracting of product quality features from the multi-source product information includes:

[0017] Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer;

[0018] Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; the softmax layer is used to normalize the first feature to obtain the product quality feature.

[0019] Furthermore, the quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the quality features of the product to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

[0020] Furthermore, the step of obtaining multi-source product information of the product to be evaluated includes:

[0021] Obtaining a product quality evaluation request from a user on a user interaction interface for the product to be evaluated, wherein the product quality evaluation request includes a product identifier of the product to be evaluated;

[0022] Acquire multi-source commodity information of the commodity to be evaluated according to the commodity quality evaluation request.

[0023] In a second aspect, in order to solve the above technical problems, the present invention further provides a product quality assessment device, which includes:

[0024] An acquisition module is used to obtain multi-source product information of the product to be evaluated;

[0025] A feature extraction module, configured to extract product quality features from the multi-source product information;

[0026] The quality assessment module is used to input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0027] Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products;

[0028] Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products;

[0029] According to the predicted quality assessment results and the actual quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the actual quality assessment result.

[0030] In a third aspect, in order to solve the above-mentioned technical problems, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the product quality assessment method of the present application is implemented.

[0031] In a fourth aspect, in order to solve the above-mentioned technical problems, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the product quality assessment method of the present application is implemented.

[0032] Additional aspects and advantages of the present application will be given in part in the following description, which will become apparent from the following description, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments of the present invention.

[0034] Figure 1A flowchart of a product quality assessment method provided by one embodiment of the present invention;

[0035] Figure 2 A schematic structural diagram of a commodity quality assessment device provided by one embodiment of the present invention;

[0036] Figure 3 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0038] The following describes in detail the technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems using specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following embodiments of the present invention are described in conjunction with the accompanying drawings.

[0039] The solutions provided by the embodiments of the present invention can be applied to any application scenario requiring product quality assessment. The solutions provided by the embodiments of the present invention can be executed by any electronic device, for example, a user's terminal device, including at least one of the following: a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, smart TV, or smart car device.

[0040] The embodiment of the present invention provides a possible implementation method, such as Figure 1 As shown in FIG, a flowchart of a method for evaluating product quality is provided. The method can be executed by any electronic device, for example, a terminal device, or by a terminal device and a server. For ease of description, the method provided by the embodiment of the present invention will be described below using a terminal device as an example of the execution subject. Figure 1 As shown in the flowchart, the method may include the following steps:

[0041] S10, obtaining multi-source product information of the product to be evaluated;

[0042] S20, extracting product quality features from the multi-source product information;

[0043] S30: Input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0044] Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products;

[0045] Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products;

[0046] According to the predicted quality assessment results and the actual quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the actual quality assessment result.

[0047] The quality assessment model in this application adopts an enhanced cross-entropy loss function. Based on the regularization term in the enhanced cross-entropy loss function, the model can be encouraged to output a predicted probability distribution that is closer to the actual quality assessment result, thereby improving the accuracy of the model.

[0048] The solution of the present invention is further described below with reference to the following specific embodiments. In this embodiment, a product quality assessment method provided may include the following steps:

[0049] S10, obtaining multi-source product information of the product to be evaluated;

[0050] Among them, multi-source product information includes different product information, including but not limited to the basic attribute information of the product itself, the description, type, and comment information of the product.

[0051] Optionally, obtaining multi-source commodity information of the commodity to be evaluated includes:

[0052] Obtaining a product quality evaluation request from a user on a user interaction interface for the product to be evaluated, wherein the product quality evaluation request includes a product identifier of the product to be evaluated;

[0053] Acquire multi-source commodity information of the commodity to be evaluated according to the commodity quality evaluation request.

[0054] Among them, the product quality assessment request refers to a request for quality assessment of the product to be assessed. The request can be a request generated based on a user trigger operation on the client interface of the terminal device. The specific form of the trigger operation is configured as needed. For example, it can be a trigger action of a specific operation position of the user on the interface of the application of the terminal device. In actual use, the trigger operation can be a trigger selection operation for the relevant trigger identifier. Among them, the specific form of the trigger identifier can be configured according to actual needs. For example, it can be a designated virtual button or input box on the client interface. Specifically, for example, it can be a virtual button of "XXX product" displayed on the client interface. The user clicking the virtual button indicates that the user wants to perform a quality assessment on the "XXX product".

[0055] Before executing S20 , the multi-source product information may be pre-processed, including cleaning and normalization.

[0056] S20, extracting product quality features from the multi-source product information;

[0057] Optionally, in S20 above, extracting product quality features from the multi-source product information includes:

[0058] Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer;

[0059] Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; the softmax layer is used to normalize the first feature to obtain the product quality feature.

[0060] Using deep learning algorithms, we build a large model containing massive amounts of product information, known as the large model processing module. This model automatically learns and understands product-related information, providing a scientific basis for product quality assessment.

[0061] Specifically, the specific calculation process of the linear layer is:

[0062] x l =x*W T +b (1)

[0063] Among them, x represents the input multi-source product information, W represents the weight matrix of the linear layer, T represents the matrix transposition, b represents the bias weight matrix of the linear layer, x l is the final output of the linear layer, that is, a multidimensional vector.

[0064] The calculation process of the multi-head matrix calculation layer is:

[0065] x j =(x l *W1 T +b1)*(x l *W2 T +b2)*(x l *W2 T +b2) (2)

[0066] Among them, W1, W2, W3 are different weight matrices, b1, b2, b3 are different bias matrices, x j is the first feature corresponding to the j-th head in the multi-head matrix calculation layer, and j represents the j-th head in the multi-head matrix calculation layer.

[0067] The calculation process of the softmax layer is:

[0068]

[0069] Among them, Softmax(x i ) represents the final output of the softmax layer, i.e., the product quality feature, exp(x i ) represents x i An exponential function with the natural constant e as the base, i and j represent the i-th head and j-th head respectively, ∑ represents accumulation, n represents the total number of heads in the multi-head matrix calculation layer, x i The first feature corresponding to the i-th head in the multi-head matrix calculation layer.

[0070] S30: Input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0071] Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products;

[0072] Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products;

[0073] According to the predicted quality assessment results and the actual quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the actual quality assessment result.

[0074] Optionally, the quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality features to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

[0075] Specifically, the processing process of the above self-attention mechanism layer is:

[0076] Q=xWQ

[0077] V=xWV

[0078] K=xWK (4)

[0079] Where x represents the product quality feature, Q, V, and K represent the query vector, key vector, and value vector corresponding to the self-attention mechanism layer, respectively, and WQ, WK, and WK are weight matrices.

[0080] The above process is to linearly process the product quality features through the self-attention mechanism to obtain the third feature (including Q, V and K);

[0081] Then calculate the attention weight score Score for Q and K in the third feature:

[0082]

[0083] Where d_k is the dimension of the key vector, which is used to prevent the gradient vanishing problem caused by the dot product result being too large, and T represents the transpose operation of the matrix.

[0084] Next, the attention score is normalized into a probability distribution, and the calculation formula is:

[0085] α=Softmax(Score) (6)

[0086] Among them, α is a hyperparameter.

[0087] Next, the attention output is calculated, and the value vector V is weighted summed according to the attention weight:

[0088] O=αV (7)

[0089] Among them, O is the second feature.

[0090] The processing process of the above fully connected layer is:

[0091] p=W_D*O+b (8)

[0092] Among them, W_D is the weight matrix, b is the bias term, and p represents the quality assessment result.

[0093] Optionally, the enhanced cross entropy loss function is:

[0094]

[0095] Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, and λ is the regularization coefficient, which is used to control the strength of the regularization term. The larger λ is, the greater the contribution of the regularization term to the loss function. ||p i -y i || is the regularization term, specifically the square of the Euclidean distance between the predicted quality evaluation result and the true quality evaluation result of the i-th sample product. During model training, minimizing the regularization term can encourage the model to output a predicted probability distribution (predicted quality evaluation result) that is closer to the true quality evaluation result.

[0096] Optionally, the multi-source product information can be a picture or text. If the multi-source product information is a picture, in order to improve the diversity of the sample set during the training process of the large model processing module, the sample set can be expanded by an expansion method. The expansion method includes but is not limited to random flipping, random cropping, random color change, translation, rotation and scaling.

[0097] It should be further explained that, during the construction of the sample set, it is determined whether the number of sample data in the sample set meets the preset requirements. If so, the data in the sample set is directly used to train the large model processing module. If not, the sample set is expanded.

[0098] The following methods can be used to determine whether the number of sample data in the sample set meets the preset requirements:

[0099] S1, for each sample data, calculate in real time the similarity value between each sample data and the base image, where the base image is an image that can accurately and comprehensively express the quality of the sample product;

[0100] S2, sorting the sample data according to the similarity value from large to small;

[0101] S3, comparing the similarity values ​​with the preset similarity threshold from small to large, deleting the sample data corresponding to the similarity value less than the similarity threshold, and obtaining a candidate sample set;

[0102] S4, counting the number of sample data in the candidate sample set. If the number is less than the set value, the candidate sample set is further expanded.

[0103] S5, repeating the above processing steps S1 to S4 until the number of sample data in the candidate sample set is not less than the set value, and then the expansion of the candidate sample set is terminated.

[0104] Alternatively, if the multi-source product information is text, keywords can be used to extract product quality features from the text corresponding to the multi-source product information. The specific implementation method is as follows:

[0105] Using the product name as the keyword and the keyword as the search center, the method searches for candidate content from multiple sources of product information whose similarity to the search center exceeds a set similarity threshold. The greater the similarity, the greater the correlation between the candidate content and the keyword. Product quality features are then extracted from each candidate content.

[0106] The implementation process of using the keyword as the search center point and searching for candidate content whose similarity to the search center point is greater than a set distance from the text corresponding to the multi-source product information is as follows:

[0107] Split the text corresponding to the multi-source product information to obtain multiple paragraphs of text;

[0108] Taking the keyword as the search center point, calculate the similarity between the search center point and each text segment.

[0109] Furthermore, the text corresponding to the multi-source product information is split into multiple segments of text as follows:

[0110] The first method is to segment the text corresponding to multi-source product information into paragraphs. For each segmented paragraph, the sentence is segmented according to periods or semicolons. The length of the segmented sentences is determined in real time and associated with the corresponding sequence number identifier to generate a sentence length record table. According to the preset target length segmentation range, the sentence lengths in the sentence length record table are divided into levels. The sequence number identifier corresponding to each level is determined. According to the number of divisions corresponding to the level, the sentence corresponding to each sequence number identifier at that level is sliced ​​according to the number of divisions, and the slicing result corresponding to each sequence number identifier is obtained, that is, the number of segmented text segments.

[0111] The second method is to segment the text corresponding to the multi-source product information into paragraphs, and to segment any paragraph into at least two segments according to a preset fixed segmentation length. It should be further explained that during the segmentation process according to the fixed segmentation length, if there are commas or semicolons in the segments obtained during the segmentation process, the segments need to be re-segmented, that is, segmented according to the commas or semicolons, and after the segmentation, the segments are re-segmented starting from the first text content after the commas or semicolons according to the fixed segmentation length. For each segmentation result, the slicing process is performed according to the slicing method in the first method.

[0112] Based on Figure 1 Based on the same principle as the method shown in , the embodiment of the present invention further provides a product quality assessment device 20, such as Figure 2 As shown in , the product quality assessment device 20 may include an acquisition module 210, a feature extraction module 220 and a quality assessment module 230, wherein:

[0113] An acquisition module 210 is used to acquire multi-source commodity information of the commodity to be evaluated;

[0114] A feature extraction module 220 is configured to extract product quality features from the multi-source product information;

[0115] The quality assessment module 230 is configured to input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method:

[0116] Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products;

[0117] Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products;

[0118] According to the predicted quality assessment results and the actual quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the actual quality assessment result.

[0119] Optionally, the enhanced cross entropy loss function is:

[0120]

[0121] Among them, L represents the loss value, C is the total number of sample products, and yi is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

[0122] Optionally, the enhanced cross entropy loss function is:

[0123]

[0124] Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

[0125] Optionally, when extracting product quality features from the multi-source product information, the feature extraction module 220 is specifically configured to:

[0126] Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer;

[0127] Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; the softmax layer is used to normalize the first feature to obtain the product quality feature.

[0128] Optionally, the quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality features to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

[0129] Optionally, when acquiring multi-source product information of a product to be evaluated, the acquisition module 210 is specifically configured to:

[0130] Obtaining a product quality evaluation request from a user on a user interaction interface for the product to be evaluated, wherein the product quality evaluation request includes a product identifier of the product to be evaluated;

[0131] Acquire multi-source commodity information of the commodity to be evaluated according to the commodity quality evaluation request.

[0132] The product quality assessment device of the embodiment of the present invention can execute the product quality assessment method provided by the embodiment of the present invention. The implementation principle is similar. The actions performed by each module and unit in the product quality assessment device in each embodiment of the present invention correspond to the steps in the product quality assessment method in each embodiment of the present invention. For the detailed functional description of each module of the product quality assessment device, please refer to the description in the corresponding product quality assessment method shown in the previous text, and will not be repeated here.

[0133] The above-mentioned product quality assessment device can be a computer program (including program code) running in a computer device, for example, the product quality assessment device is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present invention.

[0134] In some embodiments, the product quality assessment device provided by the embodiment of the present invention can be implemented by a combination of software and hardware. As an example, the product quality assessment device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the product quality assessment method provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0135] In other embodiments, the commodity quality assessment device provided by the embodiment of the present invention can be implemented in software. Figure 2 A product quality assessment device stored in a memory is shown, which can be software in the form of a program and a plug-in, and includes a series of modules, including an acquisition module 210, a feature extraction module 220 and a quality assessment module 230, for implementing the product quality assessment method provided in an embodiment of the present invention.

[0136] The modules involved in the embodiments of the present invention may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.

[0137] Based on the same principle as the method shown in the embodiments of the present invention, an electronic device is also provided in the embodiments of the present invention, which may include but is not limited to: a processor and a memory; the memory is used to store computer programs; the processor is used to execute the method shown in any embodiment of the present invention by calling the computer program.

[0138] In an alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0139] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the present disclosure. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0140] Bus 4002 may include a path for transmitting information between the above components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0141] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0142] The memory 4003 is used to store application code (computer program) for executing the solution of the present invention, and is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.

[0143] Among them, the electronic device can also be a terminal device, Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.

[0144] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0145] According to another aspect of the present invention, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various implementations described above.

[0146] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0147] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0148] The computer-readable storage medium provided by the embodiments of the present invention may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.

[0149] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0150] The above description is merely a preferred embodiment of the present invention and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present invention is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the present invention.

Claims

1. A method for evaluating product quality, characterized in that: The following steps are involved: Obtain multi-source product information for the product to be evaluated; extracting product quality features from the multi-source product information; The product quality features are input into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method: Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products; Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products; Based on the predicted quality assessment results and the true quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, and the initial model is trained based on the loss value to obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the true quality assessment result; The sample data in the training data is a picture. Before training the initial model based on the training data, the method further includes: The following methods are used to determine whether the number of sample data in the sample set meets the preset requirements: S1, for each sample data, calculate in real time the similarity value between each sample data and the base image, where the base image is an image that fully expresses the quality of the sample product; S2, sorting the sample data according to the similarity value from large to small; S3, comparing the similarity values ​​with the preset similarity threshold from small to large, deleting the sample data corresponding to the similarity value less than the similarity threshold, and obtaining a candidate sample set; S4, counting the number of sample data in the candidate sample set. If the number is less than the set value, the candidate sample set is further expanded. S5, repeat the above processing steps S1 to S4 until the number of sample data in the candidate sample set is not less than the set value, and then end the expansion of the candidate sample set to obtain training data.

2. The method according to claim 1, characterized in that The enhanced cross entropy loss function is: Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

3. The method according to claim 1, characterized in that The extracting of product quality features from the multi-source product information includes: Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer; Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; the softmax layer is used to normalize the first feature to obtain the product quality feature.

4. The method according to any one of claims 1 to 3, characterized in that The quality assessment model includes a self-attention mechanism layer and a fully connected layer, wherein the self-attention mechanism layer is used to extract the product quality features to obtain a second feature, and the fully connected layer is used to obtain a quality assessment result of the product to be evaluated based on the second feature.

5. The method according to any one of claims 1 to 3, characterized in that The step of obtaining multi-source commodity information of the commodity to be evaluated includes: Obtaining a product quality evaluation request from a user on a user interaction interface for the product to be evaluated, wherein the product quality evaluation request includes a product identifier of the product to be evaluated; Acquire multi-source commodity information of the commodity to be evaluated according to the commodity quality evaluation request.

6. A product quality assessment device, characterized in that: The product quality assessment method according to claim 1 is adopted, wherein the device comprises: An acquisition module is used to obtain multi-source product information of the product to be evaluated; A feature extraction module, configured to extract product quality features from the multi-source product information; The quality assessment module is used to input the product quality features into a pre-trained quality assessment model to obtain a quality assessment result of the product to be assessed, wherein the quality assessment model is trained based on the following method: Acquire training data, wherein the training data includes a plurality of sample products and a true quality assessment result of each of the sample products; Training the initial model based on the training data to obtain a predicted quality assessment result for each of the sample products; According to the predicted quality assessment results and the actual quality assessment results of all sample products, an enhanced cross-entropy loss function is used to determine the loss value of the initial model, so as to complete the training of the initial model based on the loss value and obtain the quality assessment model, wherein the enhanced cross-entropy loss function is a function obtained by adding a regularization term to the cross-entropy loss function, and the regularization term is used to characterize the difference between the predicted quality assessment result and the actual quality assessment result.

7. The device according to claim 6, characterized in that The enhanced cross entropy loss function is: Among them, L represents the loss value, C is the total number of sample products, and y i is the true quality evaluation result of the i-th sample product, p i is the predicted quality evaluation result of the i-th sample product, λ is the regularization coefficient, ||p i -y i || is the regularization term.

8. The device according to claim 6, characterized in that When extracting product quality features from the multi-source product information, the feature extraction module is specifically configured to: Extracting product quality features from the multi-source product information through a pre-trained large model processing module, wherein the large model processing module includes a linear layer, a multi-head matrix calculation layer, and a softmax layer; Among them, the linear layer is used to convert the multi-source product information into a multi-dimensional vector; the multi-head matrix calculation layer is used to extract features from the multi-dimensional vector to obtain the first feature; the softmax layer is used to normalize the first feature to obtain the product quality feature.

9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Workshop product quality evaluation method based on deep learning

    CN111553557A

  • Tumor microenvironment analysis method for framework-assisted liver cancer tissue full slide

    CN115527204A

  • Online shopping assistant construction method for live marketing commodity quality perception analysis

    CN116703509A

  • Lane line detection method and device, electronic equipment and storage medium

    CN119049006A