Model testing method, device, medium, and electronic device
By dividing the skin evaluation model into multiple sub-models and generating derived face images, and using metamorphic relationships to verify the sub-models, the problem of uncertain expected results in model testing is solved, and an efficient and accurate testing method is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- DOUYIN VISION CO LTD
- Filing Date
- 2021-07-06
- Publication Date
- 2026-05-01
AI Technical Summary
In model testing, it is difficult to determine the expected results in advance, especially in the testing of skin evaluation models, which leads to the inefficiency and inaccuracy of traditional testing methods.
The skin evaluation model is divided into multiple evaluation sub-models. Each sub-model is tested for specific variable features. By generating derived face images and establishing metamorphic relationships, the accuracy of the sub-models is verified using the metamorphic relationships. The test results of the overall model are then summarized.
By generating multiple derivative test cases from a small number of test cases, the difficulty of testing is reduced, the accuracy and precision of model testing are improved, the scope of application is broadened, and the need for manual judgment of expected results is reduced.
Smart Images

Figure CN115588215B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a model testing method, apparatus, medium, and electronic device. Background Technology
[0002] Typically, after model building and training, the model needs to be tested to further verify whether it meets the usage requirements. However, model testing differs from traditional functional testing. In traditional functional testing, testers usually know clearly in advance what the expected results should be, making it easy to determine whether the output results are accurate during the testing process.
[0003] However, during model testing, the expected results are usually unknowable in advance. For example, a skin evaluation model can be used to assess a user's skin texture. The user can take a full-face image using the front-facing camera, and the skin evaluation model can then detect the facial image to obtain an evaluation result, such as a skin texture score. During the testing of this model, it is typically impossible to determine the skin texture score for each facial image in advance, making it difficult to test. Summary of the Invention
[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] Firstly, this disclosure provides a model testing method, the method comprising:
[0006] An initial face image and the corresponding evaluation result for testing the skin evaluation model are obtained. The skin evaluation model is pre-divided into multiple evaluation sub-models. Each evaluation sub-model is used to evaluate the skin based on the relevant variable features corresponding to the evaluation sub-model, and the relevant variable features corresponding to each evaluation sub-model are different.
[0007] For each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image are generated based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model.
[0008] For each of the evaluation sub-models, each derived face image corresponding to the evaluation sub-model is input into the evaluation sub-model to obtain the evaluation result corresponding to each of the derived face images.
[0009] For each evaluation sub-model, the test result of the evaluation sub-model is determined based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship. The test result of the skin evaluation model is obtained by summing the test results of each evaluation sub-model.
[0010] Secondly, this disclosure provides a model testing apparatus, the apparatus comprising:
[0011] The acquisition module is used to acquire an initial face image for testing the skin evaluation model and the evaluation result corresponding to the initial face image. The skin evaluation model is pre-divided into multiple evaluation sub-models. Each evaluation sub-model is used to evaluate the skin based on the relevant variable features corresponding to the evaluation sub-model, and the relevant variable features corresponding to each evaluation sub-model are different.
[0012] The generation module is used to generate, for each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image, based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model.
[0013] The input module is used to input each derived face image corresponding to each evaluation sub-model into the evaluation sub-model to obtain the evaluation result corresponding to each derived face image.
[0014] The determination module is used to determine the test result of each evaluation sub-model based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, and to summarize the test results of the skin evaluation model based on the test results of each evaluation sub-model.
[0015] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0016] Fourthly, this disclosure provides an electronic device, comprising:
[0017] A storage device on which computer programs are stored;
[0018] A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.
[0019] In the above technical solution, the skin evaluation model is pre-divided into multiple evaluation sub-models. Based on the initial face image, derived face images are generated for each evaluation sub-model in the skin test model, and the corresponding metamorphic relationships are determined. Therefore, the evaluation sub-model can be tested based on the evaluation results and metamorphic relationships corresponding to these derived face images, thereby obtaining the test results of the skin evaluation model. Thus, this technical solution achieves two advantages: firstly, it automatically generates derived test cases based on a small number of test cases, reducing the difficulty of obtaining test cases; secondly, it allows for testing the accuracy of the model based on metamorphic relationships, eliminating the need for testers to determine the expected results for each test case. This effectively reduces the workload of testers and allows the method to be applied to scenarios where the expected results are difficult to determine, broadening its applicability. Furthermore, this solution allows for separate testing of each sub-model within the overall model, thereby improving the accuracy and precision of model testing.
[0020] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0022] Figure 1 This is a flowchart of a model testing method provided according to one embodiment of the present disclosure;
[0023] Figure 2 This is a schematic diagram of a skin evaluation model provided according to one embodiment of the present disclosure;
[0024] Figure 3 It is a flowchart of an exemplary implementation of generating a derived face image corresponding to the evaluation sub-model and the metamorphic relationship corresponding to the derived face image based on the target features corresponding to the evaluation sub-model and the initial face image;
[0025] Figure 4 This is a schematic diagram illustrating the transformation relationship between the initial face image, the derived face image, and the corresponding evaluation results;
[0026] Figure 5 This is a block diagram of a model testing apparatus provided according to one embodiment of the present disclosure;
[0027] Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation
[0028] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0029] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0030] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0031] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0034] Figure 1 As shown, this is a flowchart of a model testing method provided according to one embodiment of the present disclosure, as follows: Figure 1 As shown, the method may include:
[0035] In step 11, the initial face image used to test the skin evaluation model and the evaluation results corresponding to the initial face image are obtained.
[0036] In one possible embodiment, the initial face image can be a face image in a test case determined by the user, such as a face image taken by the user. The face image can then be input into the skin evaluation model to obtain the output result of the face image, that is, the evaluation result corresponding to the initial face image.
[0037] The skin evaluation model is pre-divided into multiple evaluation sub-models. Each evaluation sub-model is used to evaluate the skin based on the relevant variable features corresponding to it, and the relevant variable features corresponding to each evaluation sub-model are different. For example, by pre-analyzing the factors affecting skin evaluation, multiple features are identified, including but not limited to acne features, wrinkle features, pore features, dark spot features, and dark circle features. Then, an evaluation sub-model can be constructed for each feature, and that feature can be identified as the relevant variable feature corresponding to that evaluation sub-model. Figure 2 As shown, the skin evaluation model may include, but is not limited to, multiple sub-models such as: acne evaluation sub-model, wrinkle evaluation sub-model, pore evaluation sub-model, dark spot evaluation sub-model, and dark circle evaluation sub-model. Correspondingly, for the acne evaluation sub-model, its relevant variable features are the acne detection features extracted from the face image; for the wrinkle evaluation sub-model, its relevant variable features are the wrinkle detection features extracted from the face image. The setting of relevant variable features for other evaluation sub-models is similar and will not be elaborated further here.
[0038] In step 12, for each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image are generated based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model.
[0039] As an example, the target features corresponding to the evaluation sub-model can include relevant variable features of that evaluation sub-model, i.e., features used to determine the output result of that evaluation sub-model. For example, the relevant variable features corresponding to the acne evaluation sub-model can be acne detection features. The target features corresponding to the current evaluation sub-model can also include relevant variable features of other evaluation sub-models and image capture-related features, such as brightness, contrast, saturation, etc., which have no impact on the output result of the current evaluation sub-model. Unless otherwise specified, such features are referred to as irrelevant variable features corresponding to the current evaluation sub-model. For example, the irrelevant variable features corresponding to the wrinkle evaluation sub-model can be acne detection features, image brightness features, etc.
[0040] Therefore, in this step, for each evaluation sub-model, a derived face image can be constructed based on each target feature corresponding to that evaluation sub-model. For example, for the acne evaluation sub-model, the number of acne in the initial face image can be increased or decreased based on the acne detection features extracted from the initial face image to construct a derived face image, and the metamorphic relationship is determined based on the direction of feature adjustment. Metamorphic testing is a black-box testing method. Metamorphic relationship (MR) refers to the expected relationship between input and output when the target program is executed multiple times. In this disclosure, it is used to represent the expected relationship between evaluation results obtained from different input images.
[0041] In step 13, for each evaluation sub-model, each derived face image corresponding to the evaluation sub-model is input into the evaluation sub-model to obtain the evaluation result corresponding to each derived face image.
[0042] In this step, for each evaluation sub-model, its corresponding derived image can be directly input into the evaluation sub-model to obtain the evaluation result output by the evaluation sub-model.
[0043] In step 14, for each evaluation sub-model, the test result of the evaluation sub-model is determined based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship. The test result of the skin evaluation model is obtained by summing the test results of each evaluation sub-model.
[0044] The evaluation result of the initial face image can be the output result obtained by inputting the initial face image into the skin evaluation model. This evaluation result may include the evaluation result corresponding to the initial face image in each evaluation sub-model. In this embodiment, when determining the test result of each evaluation sub-model, it is only necessary to consider the evaluation result corresponding to the evaluation sub-model in the evaluation result of the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model. For example, after determining the test result of each evaluation sub-model, the test results of each evaluation sub-model can be output in parallel, so that the obtained skin evaluation model test result can indicate the test result of each evaluation sub-model, facilitating subsequent individual optimization of the evaluation sub-models.
[0045] The derived face image can be obtained directly or indirectly based on the initial face image, and it follows the corresponding metamorphic relationship. Therefore, in this embodiment, the test result of the evaluation sub-model can be determined based on the evaluation result and the metamorphic relationship, so as to ensure the accuracy and reliability of the test result.
[0046] In the above technical solution, the skin evaluation model is pre-divided into multiple evaluation sub-models. Based on the initial face image, derived face images are generated for each evaluation sub-model in the skin test model, and the corresponding metamorphic relationships are determined. Therefore, the evaluation sub-model can be tested based on the evaluation results and metamorphic relationships corresponding to these derived face images, thereby obtaining the test results of the skin evaluation model. Thus, this technical solution achieves two advantages: firstly, it automatically generates derived test cases based on a small number of test cases, reducing the difficulty of obtaining test cases; secondly, it allows for testing the accuracy of the model based on metamorphic relationships, eliminating the need for testers to determine the expected results for each test case. This effectively reduces the workload of testers and allows the method to be applied to scenarios where the expected results are difficult to determine, broadening its applicability. Furthermore, this solution allows for separate testing of each sub-model within the overall model, thereby improving the accuracy and precision of model testing.
[0047] In one possible embodiment, the target feature of the evaluation sub-model is the relevant variable feature corresponding to the evaluation sub-model, such as the target feature in the acne evaluation sub-model being the acne detection feature.
[0048] In step 12, based on the target features corresponding to the evaluation sub-model and the initial face image, an exemplary implementation of generating the derived face image corresponding to the evaluation sub-model and the metamorphic relationship corresponding to the derived face image is as follows: Figure 3 As shown, this step may include:
[0049] In step 21, the target attributes corresponding to the target features are determined. These target attributes characterize the dimensions used for evaluation based on the target features, and the target attributes corresponding to each target feature can be preset. For example, such as... Figure 2 As shown, in the acne evaluation sub-model, the target attributes corresponding to the acne detection features can be quantity and color. In the wrinkle evaluation sub-model, the target attributes corresponding to the wrinkle detection features can be quantity, location, depth, etc.
[0050] In step 22, for each target attribute, the value of the target attribute corresponding to the target feature in the target face image is adjusted according to the target adjustment direction to obtain a derived face image corresponding to the target face image.
[0051] For example, the target face image is initially the initial face image. As described above, the target attribute corresponding to the acne detection feature can be quantity and color. As an example, when the target attribute is quantity, the adjustment direction can be increase or decrease. Therefore, a derived face image can be obtained by increasing or decreasing the number of acne contained in the acne detection feature of the initial face image. As another example, when the target attribute is color, the adjustment direction can be enhancement or reduction. Therefore, a derived face image can be obtained by enhancing or reducing the color of the acne contained in the acne detection feature of the initial face image.
[0052] The following is a detailed explanation of how to generate derived face images.
[0053] In one possible embodiment, the target attribute is a quantity attribute; correspondingly, in step 22, the values of the target attributes corresponding to the target features in the target face image are adjusted according to the target adjustment direction to obtain a derived face image corresponding to the target face image. An exemplary implementation of this step may include:
[0054] When the target adjustment direction is increasing, a feature image corresponding to the target feature is obtained from a preset database, and the adjusted number of the feature images are added to the target region corresponding to the target feature in the target face image to obtain the derived face image.
[0055] For example, the target region is the area in the face image used to add feature images. Different target features may correspond to different target regions. For instance, when the target feature is a dark circle detection feature, its corresponding target region is usually the area around the eyes; when the target feature is a pimple detection feature, its corresponding target region can be the entire face image area. The target region corresponding to the target feature can be preset. It can be set directly, or it can be set by setting the region center and region extent. For example, the target region for the dark circle detection feature can be set as the region centered on the center point of the detected eye in the target face image.
[0056] When the target adjustment direction is to decrease, image recognition is performed on the target face image to obtain the feature image corresponding to the target feature in the target face image, and the feature image with the adjusted number is deleted in the target face image to obtain the derived face image.
[0057] The number of adjustments can be preset according to the actual usage scenario, and this disclosure does not limit it. The following detailed explanation uses acne detection features as the target feature.
[0058] When the target adjustment direction is to increase, feature images corresponding to the target features, i.e., acne images, can be obtained from a preset database. Then, a corresponding number of acne images can be added to the target region of the target face image to increase the number of acne in the target face image, thereby generating a corresponding derived face image. For example... Figure 4 As shown, A is the initial face image, and B1 is the derived face image obtained by adding a pimple image to A.
[0059] When the target adjustment direction is reduction, it is necessary to delete the corresponding feature images in the target face image. Therefore, in this embodiment, image recognition is required for the target face image to identify the image information corresponding to each target feature in the target face image, such as detecting the image, location, color, and other information of each pimple in the target face image. The image recognition method can employ commonly used recognition techniques in the field, which will not be elaborated upon here.
[0060] Accordingly, if the target adjustment direction is reduction, then a corresponding number of blemishes identified in the target face image can be deleted to reduce the number of blemishes in the target face image, generating a corresponding derived face image, such as... Figure 4 As shown, C1 is the derived face image obtained after deleting the pimple image in A. The above example is merely illustrative; the generation of derived face images for other evaluation sub-models is similar and will not be elaborated upon here.
[0061] Therefore, by using the above technical solution, when the target attribute is a quantity attribute, new derived face images can be generated by adding or subtracting the corresponding feature images in the target face image to simulate the image after changes in the user's skin texture. This can provide accurate and comprehensive test cases for model testing, effectively increase the number of test cases, and provide effective data support for improving the accuracy of model testing.
[0062] Accordingly, in one possible embodiment, the method may further include:
[0063] At least one feature image corresponding to the target feature in the obtained target face image is stored in the database.
[0064] For example, if five pimple images are detected in a target face image, all or part of the pimple images can be stored in a preset database. On the one hand, this can increase the candidate data of feature images in the database, and on the other hand, it can ensure the authenticity of the feature images in the database, thereby ensuring the authenticity of the derived face image constructed based on the feature image, and thus providing data support to ensure the accuracy of the test results of the skin evaluation model.
[0065] In one possible embodiment, the target attribute is a feature adjustment attribute, such as color, position, size, area, etc., which are not characterized by quantity. Therefore, in this case, it is not possible to adjust by increasing or decreasing the quantity as described above. Accordingly, this disclosure also provides the following embodiments.
[0066] Accordingly, in step 22, the values of the target attributes corresponding to the target features in the target face image are adjusted according to the target adjustment direction to obtain a derived face image corresponding to the target face image. An exemplary implementation of this step may include:
[0067] Image recognition is performed on the target face image to obtain the values of the target attributes corresponding to the target features in the target face image.
[0068] For example, if the target feature is a pimple detection feature and the target attribute is color, then in this step, image recognition can be performed on the target face image to obtain each pimple image in the target face image and the color of the pimple in each pimple image. The value of the target attribute can be any color representation, such as RGB, CMYK, etc., and this disclosure does not limit it.
[0069] The target attribute update value is determined based on the target adjustment direction, and the target attribute value corresponding to the target feature in the target face image is updated to the update value to obtain the derived face image.
[0070] Following the example above, the target adjustment direction can be enhancement or reduction. Then, image recognition is performed on the target face image to determine the color of its corresponding acne detection feature as S. By reducing the color S, color T1 is obtained, and by deepening the color S, color W1 is obtained. Then, the color of the acne detection feature in the target face image can be updated from S to T1 to obtain the reduced derivative face image. The color of the acne detection feature in the target face image can be updated from S to W1 to obtain the enhanced derivative face image.
[0071] For example, if the evaluation sub-model is a dark circle evaluation sub-model, the target feature is the dark circle detection feature, the target attribute is area, and the target adjustment direction can be enhancement or reduction, then image recognition is performed on the target face image to determine the area of the corresponding dark circle detection feature as F. By increasing this area F, we obtain area F1, and by decreasing this area, we obtain area F2. Then, we can update the area of the dark circle detection feature in the target face image from F to F1 to obtain the enhanced derivative face image, and update the area of the dark circle detection feature in the target face image from F to F2 to obtain the reduced derivative face image.
[0072] The method for determining the update value of the target attribute under different adjustment directions can be preset. Taking color adjustment as an example, it can be preset which channel values in the color need to be adjusted when adjusting the color, thereby enhancing or weakening the color. The setting of this adjustment method can be set according to different target characteristics or application scenarios, and this disclosure does not limit it.
[0073] Therefore, by using the above technical solution, when the target attribute is a feature adjustment attribute, a new derived face image can be generated by changing the value of the target attribute corresponding to the target feature in the target face image, so as to simulate the image after the user's skin texture changes. This can provide accurate and comprehensive test cases for model testing, effectively increase the number of test cases, and provide effective data support for improving the accuracy of model testing.
[0074] Turn back Figure 3 In step 23, based on the correlation between the target adjustment direction corresponding to the target attribute and the evaluation result, the transformation relationship of the evaluation results corresponding to the target face image and the derived face image is determined respectively. The correlation relationship is used to indicate whether the target adjustment direction and the evaluation result are positively or negatively correlated.
[0075] The correlation between the adjustment direction of the target attribute and the evaluation result can be preset. For example, if the target feature is to increase the number of pimples detected, and the target attribute is the quantity attribute, increasing the number of pimples in the pimple detection feature will worsen the evaluation result, while decreasing the number of pimples will improve the evaluation result. Similarly, enhancing the color of pimples in the pimple detection feature will worsen the evaluation result, while weakening the color of pimples will improve the evaluation result.
[0076] Thus, based on the target adjustment direction of the target attribute characterized by the values of the target attribute in the target face image and the derived face image, and the correlation between the target adjustment direction and the evaluation result, the superiority and inferiority relationship between the evaluation results corresponding to the target face image and the derived face image can be determined, that is, the metamorphosis relationship. As an example, when the target feature is the acne detection feature and the target attribute is the quantity attribute, if the target adjustment direction for generating the derived face image based on the target face image is to increase, the evaluation result R' corresponding to the derived face image should be worse than the evaluation result R of the target face image. When the evaluation result is represented by a score and the larger the score, the better the evaluation result, the metamorphosis relationship between the two can be expressed as: R' < R. Based on the above process, the metamorphosis relationship corresponding to the derived face image in the evaluation submodel can be determined, which is used to represent the superiority and inferiority relationship between the evaluation result corresponding to the derived face image and the image used to generate the derived face image. Correspondingly, as Figure 4 shown, for the derived images B1 and B2 determined for increasing the number of acne, the metamorphosis relationship between their corresponding evaluation results is: R(A) > R(B1) > R(B2), and for the derived images C1 and C2 determined for reducing the number of acne, the metamorphosis relationship between their corresponding evaluation results is: R(C2) > R(C1) > R(A).
[0077] As an example, when the stop condition is not met, the step of adjusting the value of the target attribute corresponding to the target feature in the target face image according to the target adjustment direction for each target attribute to obtain a derived face image corresponding to the target face image can be returned until the stop condition is met. It should be noted that in this step, the adjustment range of the target attribute can be different to obtain different derived face images. Thus, different derived face images can be further generated based on the initial face image.
[0078] As another example, when the stop condition is not met, the derived face image is used as the new target face image, and the step of adjusting the value of the target attribute corresponding to the target feature in the target face image according to the target adjustment direction for each target attribute to obtain a derived face image corresponding to the target face image is returned.
[0079] As another example, when the stop condition is met, the derived face image corresponding to the evaluation submodel and the metamorphosis relationship corresponding to the derived face image are obtained. Thus, new derived face images can be further generated based on the generated derived face images, ensuring the gradual change between the generated derived face images and making them more suitable for the possible change process of the user's skin texture.
[0080] Specifically, when generating a new derived face image based on the current derived face image, to ensure the gradual change in image generation, the direction can be adjusted according to the target adjustment direction corresponding to the generation of the current derived face image, thus obtaining the new derived face image. That is, as follows: Figure 4 As shown, the derived face image B1 is obtained by adding a pimple image to the initial face image A. Therefore, a new derived face image can be generated by adding a pimple image to B1. The resulting new derived face image is shown below. Figure 4 As shown in B2; the derived face image C1 is obtained by reducing the pimple image from the initial face image A. Then, by reducing the pimple image based on C1, a new derived face image can be generated. The obtained new derived face image is shown below. Figure 4 As shown in C2, this ensures the variability between the various derived face images.
[0081] As an example, the stopping condition could be that the number of generated derivative face images reaches a threshold, meaning that enough face images have been generated for model testing, and there is no need to continue generating them, thus avoiding unnecessary data processing.
[0082] Therefore, the above technical solution allows for the generation of derived face images corresponding to each evaluation sub-model based on the initial face image, improving the accuracy of the derived face images. This enables separate testing of each evaluation sub-model based on these derived face images, improving both the efficiency and accuracy of model testing. Furthermore, the iterative generation of derived face images, through multiple layers of derivation, allows for the acquisition of more effective derived images with a limited initial face image pool, thus expanding the scope of model testing.
[0083] In one possible embodiment, the target features corresponding to the evaluation sub-model further include the irrelevant variable features corresponding to the evaluation sub-model. These can be relevant variable features or image features used for evaluation in other evaluation sub-models, such as brightness, contrast, resolution, and saturation, as described above. They can also be non-skin features, such as decorative features like nose rings or lip rings, i.e., irrelevant variable features corresponding to the current evaluation sub-model. For example, in the acne evaluation sub-model described above, its corresponding irrelevant variable features can be relevant variable features corresponding to wrinkle evaluation sub-models, pore evaluation models, etc., or one or more of the aforementioned image features.
[0084] Accordingly, when the target feature corresponding to the evaluation sub-model is an irrelevant variable feature corresponding to the evaluation sub-model, in step 12, an exemplary implementation of generating the derived face image corresponding to the evaluation sub-model and the metamorphic relationship corresponding to the derived face image based on the target feature corresponding to the evaluation sub-model and the initial face image is as follows: This step may include:
[0085] Based on the target adjustment direction, the updated value of the target attribute corresponding to the target feature is determined, and the value of the target attribute corresponding to the target feature in the target face image is updated to the updated value to obtain the derived face image.
[0086] When the target feature is an image feature, a derived face image can be obtained by modifying the brightness and contrast values of the target face image. The specific implementation of this step is similar to the method described above for generating a derived face image when the target attribute is a feature and its attributes are adjusted, and will not be repeated here.
[0087] The transformation relationship is defined as the distance between the evaluation result corresponding to the derived face image and the evaluation result corresponding to the initial face image being less than a preset distance.
[0088] In this embodiment, the target feature is the irrelevant variable feature corresponding to the evaluation sub-model, that is, the feature in the skin evaluation model other than the relevant variable feature corresponding to the evaluation sub-model. Therefore, changes in the value of the target attribute of the target feature should not affect the evaluation result output by the evaluation sub-model. Figure 4 As shown, image A1 is the image corresponding to image A after rotation, and image A2 is the image corresponding to image A with a different expression. Based on this, the evaluation result of the derived face image generated in this embodiment should be similar to the evaluation result of the target face image. Therefore, in this embodiment, the distance between the evaluation result of the derived face image and the evaluation result of the initial face image being less than a preset distance can be defined as the metamorphic relationship. Figure 4 As described above, the evaluation results R(A1), R(A), and R(A2) corresponding to images A1, A, and A2, respectively, should be approximately the same. Specifically, the distance between the evaluation result corresponding to the derived face image and the evaluation result corresponding to the initial face image is less than a preset distance, indicating their similarity. This preset distance can be set according to the accuracy requirements of model testing in specific application scenarios, and this disclosure does not limit it.
[0089] Therefore, through the above technical solution, a derived face image corresponding to the evaluation sub-model can be generated based on irrelevant variable features that do not affect the evaluation result output by the current evaluation sub-model. This can effectively increase the testing range of the derived face image corresponding to the evaluation sub-model, ensure the comprehensiveness of the skin evaluation model test based on the derived face image, and further broaden the application scope of the model testing method.
[0090] In one possible embodiment, in step 14, the test result of the evaluation sub-model is determined based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship. An exemplary implementation of summarizing the test results of each evaluation sub-model to obtain the test result of the skin evaluation model is as follows, and this step may include:
[0091] For each evaluation sub-model, determine whether the evaluation results corresponding to the image pairs with the metamorphic relationship in the initial face image and the derived face images corresponding to the evaluation sub-model satisfy the metamorphic relationship.
[0092] As mentioned above, when generating a derived face image, it is based on adjusting a face image to obtain its corresponding derived face image, and the transformation relationship between the two face images can be determined. Thus, the image pair can contain the initial face image and a derived face image, or the image pair can contain two derived face images.
[0093] In this step, for each image pair, it can be determined whether the evaluation results of the two face images satisfy a corresponding relationship. For example, image pair M1 contains two face images K1 and K2, where K2 is generated based on K1 with the addition of an acne image. The corresponding metamorphic relationship is that the evaluation result of K2 should be less than the evaluation result of K1. Therefore, in this embodiment, if the evaluation result of K2 in the image pair is less than the evaluation result of K1, it is determined that the metamorphic relationship is satisfied; if the evaluation result of K2 is not less than the evaluation result of K1, it is determined that the metamorphic relationship is not satisfied.
[0094] For example, image pair M2 contains two face images K3 and K4, where K4 is generated by enhancing the brightness of image K3. The corresponding metamorphic relationship is that the distance between the evaluation results of K3 and K4 should be less than a preset distance. Therefore, in this embodiment, if the distance between the evaluation results of K3 and K4 in the image pair is less than the preset distance, it is determined that the metamorphic relationship is satisfied; if the distance between the evaluation results of K3 and K4 is not less than the preset distance, it is determined that the metamorphic relationship is not satisfied. The determination method for whether the evaluation results of other image pairs satisfy the metamorphic relationship is similar to the above and will not be repeated here.
[0095] For each evaluation sub-model, the ratio of the number of image pairs that satisfy the metamorphic relationship in the image pairs corresponding to the evaluation sub-model to the total number of image pairs corresponding to the evaluation sub-model is determined as the test result of the evaluation sub-model.
[0096] If the processing output of the evaluation sub-model is accurate, then the evaluation results of the image pairs corresponding to the evaluation sub-model should all satisfy the metamorphic relationship. Therefore, the accuracy of the evaluation sub-model can be characterized by the ratio of the number of image pairs that satisfy the metamorphic relationship to the total number of image pairs corresponding to the evaluation sub-model. The more image pairs that satisfy the metamorphic relationship, the larger the ratio, and the higher the accuracy of the evaluation sub-model.
[0097] The test results of the skin evaluation model are determined based on the test results of each of the evaluation sub-models.
[0098] As an example, the weighted average of the test results of each evaluation sub-model can be directly used as the test result of the skin evaluation model to characterize the overall accuracy of the skin evaluation model. The sum of the weights of the multiple evaluation sub-models in the skin evaluation model is 1. The weights of each evaluation sub-model can be the same or different; this disclosure does not impose any limitations on this and the weights can be set according to the weighting factors of relevant variable features in the specific application scenario.
[0099] As another example, the test results of each evaluation sub-model can be presented as a test set as the test results of the skin evaluation model. This allows users to clearly understand the accuracy of each evaluation sub-model based on the test results, facilitating subsequent corrections and improvements, and providing users with more refined test results.
[0100] Therefore, through the above technical solution, for each evaluation sub-model, the test result of the evaluation sub-model can be determined based on the image pairs with metamorphic relationships in the evaluation sub-model. By verifying the metamorphic relationships, the model can be tested without the expected results corresponding to the test cases, thereby effectively reducing the complexity of model testing and improving the application scenarios of the model testing method.
[0101] In one possible embodiment, the test results include accuracy test results and stability test results. In step 14, based on the evaluation results corresponding to the initial face image and the evaluation results corresponding to each derived face image in the evaluation sub-model, as well as the metamorphic relationship, the test results of the evaluation sub-model are determined to obtain the test results of the skin evaluation model. An exemplary implementation of this step may include:
[0102] For each evaluation sub-model, determine whether the evaluation results corresponding to the image pairs with the metamorphic relationship among the initial face image and the derived face images corresponding to the evaluation sub-model satisfy the metamorphic relationship. The specific implementation of this step has been described above and will not be repeated here.
[0103] For each evaluation sub-model, the accuracy test result of the evaluation sub-model is determined based on the first image pair corresponding to the first feature, and the stability test result of the evaluation sub-model is determined based on the second image pair corresponding to the second feature, wherein the first feature is the relevant variable feature corresponding to the evaluation sub-model, and the second feature is the irrelevant variable feature corresponding to the evaluation sub-model.
[0104] As an example, the ratio of the number of image pairs satisfying the metamorphic relationship in the first image pair corresponding to the first feature to the total number of the first image pairs can be determined as the accuracy test result of the evaluation sub-model, and the ratio of the number of image pairs satisfying the metamorphic relationship in the second image pair corresponding to the second feature to the total number of the second image pairs can be determined as the accuracy test result of the evaluation sub-model.
[0105] In this step, the first feature is the relevant variable feature corresponding to the evaluation sub-model, that is, the feature that affects the output result of the evaluation sub-model. Changes in the value of this feature should affect changes in the evaluation result output by the evaluation sub-model. Accordingly, the first image pair corresponding to the first feature can be an image pair formed by adjusting the value of the first feature in the image pair corresponding to the evaluation sub-model. For example, in the acne evaluation sub-model, an image pair formed by adjusting the value of the acne detection feature, such as adjusting the number or color of acne; in the wrinkle evaluation sub-model, an image pair formed by adjusting the value of the wrinkle detection feature, such as adjusting the number or color of wrinkles.
[0106] The second feature is a feature other than the relevant variable features corresponding to the evaluation sub-model, i.e., an irrelevant variable feature, such as a feature that does not affect the output of the evaluation sub-model. Changes in the value of this feature should not affect the evaluation result output by the evaluation sub-model. Accordingly, the second image pair corresponding to the second feature can be an image pair formed by adjusting the value of the second feature in the image pair corresponding to the evaluation sub-model. For example, in the acne evaluation sub-model, an image pair formed by adjusting the value of the wrinkle detection feature, such as adjusting the number or color of wrinkles, should not affect the output of the acne evaluation sub-model; similarly, an image pair formed by adjusting the brightness value of the image in the acne evaluation sub-model will not be elaborated further here.
[0107] In this embodiment, changes in the value of the first feature should affect changes in the evaluation result output by the evaluation sub-model. Therefore, the accuracy of the evaluation sub-model can be tested based on the first image corresponding to the first feature, i.e., to determine whether the evaluation sub-model can accurately analyze changes based on the influence of relevant variable features during calculation, thus possessing accuracy. On the other hand, changes in the value of the second feature should not affect the evaluation result output by the evaluation sub-model. Therefore, the stability of the evaluation sub-model can be tested based on the second image corresponding to the second feature, i.e., to determine whether the evaluation sub-model can avoid the influence of irrelevant variable features during calculation, thus possessing stability.
[0108] In one possible embodiment, the stability test results of the model can also be determined based on multiple initial face images taken by the same user at the same time period. For example, multiple face images of the same user can be input into the skin evaluation model to obtain an evaluation result for each face image. As an example, the mean of the standard deviations of the evaluation results corresponding to the multiple face images of each user can be used as the stability test result of the model to determine the stability of the output evaluation results when the input images have similar features.
[0109] Subsequently, the accuracy test result of the skin evaluation model can be determined based on the accuracy test result of each evaluation sub-model, and the stability test result of the skin evaluation model can be determined based on the stability test result of each evaluation sub-model.
[0110] This step can be implemented using the weighted average method or a test set containing multiple test results as described above, which will not be elaborated further here.
[0111] Therefore, the above technical solution can further test the accuracy and stability of the skin evaluation model. On the one hand, it can improve the accuracy of model testing, and on the other hand, it can provide effective data support for subsequent improvements, making it easier for users to identify problems in the test based on the test results and improve the user experience.
[0112] This disclosure also provides a model testing apparatus, such as Figure 5 As shown, the device 10 includes:
[0113] The acquisition module 100 is used to acquire an initial face image for testing the skin evaluation model and the evaluation result corresponding to the initial face image. The skin evaluation model is pre-divided into multiple evaluation sub-models. Each evaluation sub-model is used to evaluate the skin based on the relevant variable features corresponding to the evaluation sub-model, and the relevant variable features corresponding to each evaluation sub-model are different.
[0114] The generation module 200 is used to generate, for each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image, based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model.
[0115] The input module 300 is used to input each derived face image corresponding to each evaluation sub-model into the evaluation sub-model to obtain the evaluation result corresponding to each derived face image.
[0116] The determining module 400 is used to determine the test result of each evaluation sub-model based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, and to summarize the test results of the skin evaluation model based on the test results of each evaluation sub-model.
[0117] Optionally, the target feature of the evaluation sub-model is the relevant variable feature corresponding to the evaluation sub-model;
[0118] The generation module includes:
[0119] The first determining submodule is used to determine the target attribute corresponding to the target feature, wherein the target attribute is used to characterize the dimension of evaluation based on the target feature;
[0120] The adjustment submodule is used to adjust the value of the target attribute corresponding to the target feature in the target face image according to the target adjustment direction for each target attribute, so as to obtain a derived face image corresponding to the target face image;
[0121] The second determining submodule is used to determine the transformation relationship between the evaluation results corresponding to the target face image and the derived face image respectively, based on the correlation between the target adjustment direction corresponding to the target attribute and the evaluation result. The correlation relationship is used to indicate whether the target adjustment direction and the evaluation result are positively or negatively correlated.
[0122] Optionally, the target attribute is a quantity attribute;
[0123] The adjustment submodule includes:
[0124] The first processing submodule is used to, when the target adjustment direction is increasing, obtain a feature image corresponding to the target feature from a preset database, and add the adjusted number of the feature images to the target region corresponding to the target feature in the target face image to obtain the derived face image;
[0125] The second processing submodule is used to perform image recognition on the target face image when the target adjustment direction is decreasing, so as to obtain the feature image corresponding to the target feature in the target face image, and delete the feature image with the adjusted number in the target face image to obtain the derived face image.
[0126] Optionally, the target attribute is a feature adjustment attribute;
[0127] The adjustment submodule includes:
[0128] The recognition submodule is used to perform image recognition on the target face image to obtain the value of the target attribute corresponding to the target feature in the target face image;
[0129] The first update submodule is used to determine the update value of the target attribute according to the target adjustment direction, and update the value of the target attribute corresponding to the target feature in the target face image to the update value, so as to obtain the derived face image.
[0130] Optionally, the determined module includes:
[0131] The third determining submodule is used to determine, for each evaluation submodel, whether the evaluation result corresponding to the image pair with the metamorphic relationship in the initial face image and the derived face image corresponding to the evaluation submodel satisfies the metamorphic relationship.
[0132] The fourth determining submodule is used to determine the test result of the evaluation submodel by the ratio of the number of image pairs that satisfy the metamorphic relationship in the image pairs corresponding to the evaluation submodel to the total number of image pairs corresponding to the evaluation submodel.
[0133] The fifth determining submodule is used to determine the test results of the skin evaluation model based on the test results of each of the evaluation sub-models.
[0134] Optionally, the target feature corresponding to the evaluation sub-model may further include the irrelevant variable feature corresponding to the evaluation sub-model, in the case where the target feature corresponding to the evaluation sub-model is the irrelevant variable feature corresponding to the evaluation sub-model;
[0135] The generation module includes:
[0136] The second update submodule is used to determine the update value of the target attribute corresponding to the target feature according to the target adjustment direction, and update the value of the target attribute corresponding to the target feature in the target face image to the update value to obtain the derived face image;
[0137] The sixth determining submodule is used to determine the metamorphic relationship as the distance between the evaluation result corresponding to the derived face image and the evaluation result corresponding to the initial face image being less than a preset distance.
[0138] Optionally, the test results include accuracy test results and stability test results, and the determining module includes:
[0139] The seventh determining submodule is used to determine, for each of the evaluation sub-models, whether the evaluation result corresponding to the image pair with the metamorphic relationship in the initial face image and the derived face image corresponding to the evaluation sub-model satisfies the metamorphic relationship.
[0140] The eighth determining submodule is used to determine the accuracy test result of the evaluation submodel based on the first image corresponding to the first feature for each evaluation submodel, and to determine the stability test result of the evaluation submodel based on the second image corresponding to the second feature, wherein the first feature is the relevant variable feature corresponding to the evaluation submodel, and the second feature is the irrelevant variable feature corresponding to the evaluation submodel.
[0141] The ninth determining submodule is used to determine the accuracy test result of the skin evaluation model based on the accuracy test result of each of the evaluation sub-models, and to determine the stability test result of the skin evaluation model based on the stability test result of each of the evaluation sub-models.
[0142] The following is for reference. Figure 6 This diagram illustrates a structural schematic of an electronic device 600 suitable for implementing embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0143] like Figure 6As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0144] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0145] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0146] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0147] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0148] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0149] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire an initial face image for testing a skin evaluation model and an evaluation result corresponding to the initial face image, wherein the skin evaluation model is pre-divided into multiple evaluation sub-models, each evaluation sub-model is used to perform skin evaluation based on relevant variable features corresponding to the evaluation sub-model, and the relevant variable features corresponding to each evaluation sub-model are different; for each evaluation sub-model, generate a derived face image corresponding to the evaluation sub-model based on the target features corresponding to the evaluation sub-model and the initial face image. The evaluation sub-model includes the target features of the evaluation sub-model, including the relevant variable features of the evaluation sub-model. For each evaluation sub-model, each derived face image corresponding to the evaluation sub-model is input into the evaluation sub-model to obtain the evaluation result corresponding to each derived face image. For each evaluation sub-model, the test result of the evaluation sub-model is determined based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the transformation relationship. The test result of the skin evaluation model is obtained by summing the test results of each evaluation sub-model.
[0150] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0152] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules do not necessarily limit the module itself; for example, an acquisition module can also be described as "a module for acquiring an initial face image used to test a skin evaluation model and the corresponding evaluation result of the initial face image".
[0153] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0154] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0155] According to one or more embodiments of this disclosure, Example 1 provides a model testing method, wherein the method includes:
[0156] An initial face image and the corresponding evaluation result for testing the skin evaluation model are obtained. The skin evaluation model is pre-divided into multiple evaluation sub-models. Each evaluation sub-model is used to evaluate the skin based on the relevant variable features corresponding to the evaluation sub-model, and the relevant variable features corresponding to each evaluation sub-model are different.
[0157] For each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image are generated based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model.
[0158] For each of the evaluation sub-models, each derived face image corresponding to the evaluation sub-model is input into the evaluation sub-model to obtain the evaluation result corresponding to each of the derived face images.
[0159] For each evaluation sub-model, the test result of the evaluation sub-model is determined based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship. The test result of the skin evaluation model is obtained by summing the test results of each evaluation sub-model.
[0160] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein the target feature of the evaluation sub-model is the relevant variable feature corresponding to the evaluation sub-model;
[0161] The step of generating a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image based on the target features corresponding to the evaluation sub-model and the initial face image includes:
[0162] Determine the target attribute corresponding to the target feature, wherein the target attribute is used to characterize the dimension of evaluation based on the target feature;
[0163] For each target attribute, the value of the target attribute corresponding to the target feature in the target face image is adjusted according to the target adjustment direction to obtain a derived face image corresponding to the target face image;
[0164] Based on the correlation between the target adjustment direction corresponding to the target attribute and the evaluation result, the transformation relationship between the evaluation results corresponding to the target face image and the derived face image is determined. The correlation relationship is used to indicate whether the target adjustment direction and the evaluation result are positively or negatively correlated.
[0165] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein the target attribute is a quantity attribute;
[0166] The step of adjusting the values of the target attributes corresponding to the target features in the target face image according to the target adjustment direction to obtain a derived face image corresponding to the target face image includes:
[0167] When the target adjustment direction is increasing, a feature image corresponding to the target feature is obtained from a preset database, and the adjusted number of the feature images are added to the target region corresponding to the target feature in the target face image to obtain the derived face image;
[0168] When the target adjustment direction is to decrease, image recognition is performed on the target face image to obtain the feature image corresponding to the target feature in the target face image, and the feature image with the adjusted number is deleted in the target face image to obtain the derived face image.
[0169] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 2, wherein the target attribute is a feature adjustment attribute;
[0170] The step of adjusting the values of the target attributes corresponding to the target features in the target face image according to the target adjustment direction to obtain a derived face image corresponding to the target face image includes:
[0171] Image recognition is performed on the target face image to obtain the values of the target attributes corresponding to the target features in the target face image;
[0172] The updated value of the target attribute is determined according to the target adjustment direction, and the value of the target attribute corresponding to the target feature in the target face image is updated to the updated value to obtain the derived face image.
[0173] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein, based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, the test result of the evaluation sub-model is determined, and the test result of the skin evaluation model is obtained by summing the test results of each evaluation sub-model, including:
[0174] For each evaluation sub-model, determine whether the evaluation results corresponding to the image pairs with the metamorphic relationship in the initial face image and the derived face images corresponding to the evaluation sub-model satisfy the metamorphic relationship;
[0175] For each evaluation sub-model, the ratio of the number of image pairs that satisfy the metamorphic relationship in the image pairs corresponding to the evaluation sub-model to the total number of image pairs corresponding to the evaluation sub-model is determined as the test result of the evaluation sub-model.
[0176] The test results of the skin evaluation model are determined based on the test results of each of the evaluation sub-models.
[0177] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 1, wherein the target feature corresponding to the evaluation sub-model further includes the irrelevant variable feature corresponding to the evaluation sub-model, in the case where the target feature corresponding to the evaluation sub-model is the irrelevant variable feature corresponding to the evaluation sub-model;
[0178] The step of generating a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image based on the target features corresponding to the evaluation sub-model and the initial face image includes:
[0179] The updated value of the target attribute corresponding to the target feature is determined according to the target adjustment direction, and the value of the target attribute corresponding to the target feature in the target face image is updated to the updated value to obtain the derived face image;
[0180] The transformation relationship is defined as the distance between the evaluation result corresponding to the derived face image and the evaluation result corresponding to the initial face image being less than a preset distance.
[0181] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 6, wherein the test results include accuracy test results and stability test results, and the step of determining the test results of the evaluation sub-model based on whether the evaluation results corresponding to the initial face image and the evaluation results corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, and summarizing the test results of the skin evaluation model based on the test results of each evaluation sub-model, includes:
[0182] For each evaluation sub-model, determine whether the evaluation results corresponding to the image pairs with the metamorphic relationship in the initial face image and the derived face images corresponding to the evaluation sub-model satisfy the metamorphic relationship;
[0183] For each evaluation sub-model, the accuracy test result of the evaluation sub-model is determined based on the first image pair corresponding to the first feature, and the stability test result of the evaluation sub-model is determined based on the second image pair corresponding to the second feature, wherein the first feature is the relevant variable feature corresponding to the evaluation sub-model, and the second feature is the irrelevant variable feature corresponding to the evaluation sub-model;
[0184] The accuracy test result of the skin evaluation model is determined based on the accuracy test result of each evaluation sub-model, and the stability test result of the skin evaluation model is determined based on the stability test result of each evaluation sub-model.
[0185] According to one or more embodiments of this disclosure, Example 8 provides a model testing apparatus, wherein the apparatus includes:
[0186] The acquisition module is used to acquire an initial face image for testing the skin evaluation model and the evaluation result corresponding to the initial face image. The skin evaluation model is pre-divided into multiple evaluation sub-models. Each evaluation sub-model is used to evaluate the skin based on the relevant variable features corresponding to the evaluation sub-model, and the relevant variable features corresponding to each evaluation sub-model are different.
[0187] The generation module is used to generate, for each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image, based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model.
[0188] The input module is used to input each derived face image corresponding to each evaluation sub-model into the evaluation sub-model to obtain the evaluation result corresponding to each derived face image.
[0189] The determination module is used to determine the test result of each evaluation sub-model based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, and to summarize the test results of the skin evaluation model based on the test results of each evaluation sub-model.
[0190] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processing device, implements the steps of the method described in any of Examples 1-7.
[0191] According to one or more embodiments of this disclosure, Example 10 provides an electronic device comprising:
[0192] A storage device on which computer programs are stored;
[0193] A processing device for executing the computer program in the storage device to implement the steps of the method described in any of the examples 1-7.
[0194] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0195] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0196] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A model testing method, characterized in that, The method includes: An initial face image and the corresponding evaluation result for testing a skin evaluation model are obtained. The skin evaluation model is pre-divided into multiple evaluation sub-models. Multiple features that pre-determine the influence of skin evaluation correspond one-to-one with the multiple evaluation sub-models. Each feature is used as a relevant variable feature corresponding to the evaluation sub-model. Each evaluation sub-model is used to perform skin evaluation based on the relevant variable feature corresponding to the evaluation sub-model, and the relevant variable feature corresponding to each evaluation sub-model is different. For each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image are generated based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model. The metamorphic relationship is used to represent the expected relationship between the evaluation results obtained from different input images. For each of the evaluation sub-models, each derived face image corresponding to the evaluation sub-model is input into the evaluation sub-model to obtain the evaluation result corresponding to each of the derived face images. For each evaluation sub-model, the test result of the evaluation sub-model is determined based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship. The test result of the skin evaluation model is obtained by summing the test results of each evaluation sub-model.
2. The method according to claim 1, characterized in that, The target feature of the evaluation sub-model is the relevant variable feature corresponding to the evaluation sub-model; The step of generating a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image based on the target features corresponding to the evaluation sub-model and the initial face image includes: Determine the target attribute corresponding to the target feature, wherein the target attribute is used to characterize the dimension of evaluation based on the target feature; For each target attribute, the value of the target attribute corresponding to the target feature in the target face image is adjusted according to the target adjustment direction to obtain a derived face image corresponding to the target face image; Based on the correlation between the target adjustment direction corresponding to the target attribute and the evaluation result, the transformation relationship between the evaluation results corresponding to the target face image and the derived face image is determined. The correlation relationship is used to indicate whether the target adjustment direction and the evaluation result are positively or negatively correlated.
3. The method according to claim 2, characterized in that, The target attribute is a quantity attribute; The step of adjusting the values of the target attributes corresponding to the target features in the target face image according to the target adjustment direction to obtain a derived face image corresponding to the target face image includes: When the target adjustment direction is increasing, a feature image corresponding to the target feature is obtained from a preset database, and the adjusted number of the feature images are added to the target region corresponding to the target feature in the target face image to obtain the derived face image; When the target adjustment direction is to decrease, image recognition is performed on the target face image to obtain the feature image corresponding to the target feature in the target face image, and the feature image with the adjusted number is deleted in the target face image to obtain the derived face image.
4. The method according to claim 2, characterized in that, The target attribute is a feature adjustment attribute; The step of adjusting the values of the target attributes corresponding to the target features in the target face image according to the target adjustment direction to obtain a derived face image corresponding to the target face image includes: Image recognition is performed on the target face image to obtain the values of the target attributes corresponding to the target features in the target face image; The updated value of the target attribute is determined according to the target adjustment direction, and the value of the target attribute corresponding to the target feature in the target face image is updated to the updated value to obtain the derived face image.
5. The method according to claim 1, characterized in that, The step of determining the test result of the evaluation sub-model based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, and summarizing the test results of the skin evaluation model based on the test results of each evaluation sub-model, includes: For each evaluation sub-model, determine whether the evaluation results corresponding to the image pairs with the metamorphic relationship in the initial face image and the derived face images corresponding to the evaluation sub-model satisfy the metamorphic relationship; For each evaluation sub-model, the ratio of the number of image pairs that satisfy the metamorphic relationship in the image pairs corresponding to the evaluation sub-model to the total number of image pairs corresponding to the evaluation sub-model is determined as the test result of the evaluation sub-model. The test results of the skin evaluation model are determined based on the test results of each of the evaluation sub-models.
6. The method according to claim 1, characterized in that, The target feature corresponding to the evaluation sub-model also includes the irrelevant variable feature corresponding to the evaluation sub-model, in the case where the target feature corresponding to the evaluation sub-model is the irrelevant variable feature corresponding to the evaluation sub-model; The step of generating a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image based on the target features corresponding to the evaluation sub-model and the initial face image includes: The updated value of the target attribute corresponding to the target feature is determined according to the target adjustment direction, and the value of the target attribute corresponding to the target feature in the target face image is updated to the updated value to obtain the derived face image; The transformation relationship is defined as the distance between the evaluation result corresponding to the derived face image and the evaluation result corresponding to the initial face image being less than a preset distance.
7. The method according to claim 6, characterized in that, The test results include accuracy test results and stability test results. The test results of the evaluation sub-model are determined based on whether the evaluation results corresponding to the initial face image and the evaluation results corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship. The test results of the skin evaluation model are then obtained by summing the test results of each evaluation sub-model, including: For each evaluation sub-model, determine whether the evaluation results corresponding to the image pairs with the metamorphic relationship in the initial face image and the derived face images corresponding to the evaluation sub-model satisfy the metamorphic relationship; For each evaluation sub-model, the accuracy test result of the evaluation sub-model is determined based on the first image pair corresponding to the first feature, and the stability test result of the evaluation sub-model is determined based on the second image pair corresponding to the second feature, wherein the first feature is the relevant variable feature corresponding to the evaluation sub-model, and the second feature is the irrelevant variable feature corresponding to the evaluation sub-model; The accuracy test result of the skin evaluation model is determined based on the accuracy test result of each evaluation sub-model, and the stability test result of the skin evaluation model is determined based on the stability test result of each evaluation sub-model.
8. A model testing device, characterized in that, The device includes: The acquisition module is used to acquire an initial face image for testing the skin evaluation model and the evaluation result corresponding to the initial face image. The skin evaluation model is pre-divided into multiple evaluation sub-models. Multiple features that pre-determine the influence of skin evaluation correspond one-to-one with the multiple evaluation sub-models. Each feature is used as a relevant variable feature corresponding to the evaluation sub-model. Each evaluation sub-model is used to perform skin evaluation based on the relevant variable feature corresponding to the evaluation sub-model, and the relevant variable feature corresponding to each evaluation sub-model is different. The generation module is used to generate, for each evaluation sub-model, a derived face image corresponding to the evaluation sub-model and a metamorphic relationship corresponding to the derived face image, based on the target features corresponding to the evaluation sub-model and the initial face image. The target features corresponding to the evaluation sub-model include the relevant variable features corresponding to the evaluation sub-model, and the metamorphic relationship is used to represent the expected relationship between the evaluation results obtained from different input images. The input module is used to input each derived face image corresponding to each evaluation sub-model into the evaluation sub-model to obtain the evaluation result corresponding to each derived face image. The determination module is used to determine the test result of each evaluation sub-model based on whether the evaluation result corresponding to the initial face image and the evaluation result corresponding to each derived face image in the evaluation sub-model satisfy the metamorphic relationship, and to summarize the test results of the skin evaluation model based on the test results of each evaluation sub-model.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by the processing device, the program implements the steps of the method described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Firmness evaluation device, method for calculating firmness evaluation value, and firmness evaluation program
CN107847136A
Skin type detection method, skin type grade classification method and skin type detection apparatus
WO2020207423A1