Image detection model generalization performance evaluation method, device, equipment and medium
By constructing sample data sets, the differences in global and local feature distributions and the degradation of detection performance are quantified, which solves the problem of inaccurate generalization performance evaluation of image detection models in existing technologies and realizes accurate evaluation and optimization guidance in complex environments.
Patent Information
- Application Number
- CN202611156249.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, the evaluation of the generalization performance of image detection models relies on a single test dataset, which makes it difficult to fully reflect the multi-source data distribution shift problem of the model in complex real-world environments, resulting in inaccurate judgment of generalization ability.
By constructing a sample data set pair of reference and image data sets to be evaluated, the differences in global and local feature distributions are determined. Combined with the differences in detection performance attenuation, a comprehensive generalization performance evaluation index is constructed to achieve an objective and comprehensive evaluation of the model's generalization performance.
It improves the accuracy and reliability of model generalization performance evaluation, can accurately judge the generalization ability of the model in complex real-world environments, provides intuitive generalization performance information, and facilitates model selection and optimization.
Smart Images

Figure CN123161002A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing, and specifically relates to a method, apparatus, device, and medium for evaluating the generalization performance of an image detection model. Background Technology
[0002] In the development and application of image detection models, generalization performance is a key indicator of model practicality, referring to the model's ability to maintain stable detection accuracy under different data distribution scenarios. However, current technologies often rely on a single test dataset or a simple comparison of model performance on the training and test sets to evaluate model generalization performance, which fails to comprehensively reflect the multi-source data distribution shifts faced by the model in complex real-world environments. This evaluation method leads to inaccurate assessments of model generalization ability, potentially causing significant performance degradation in practical applications due to changes in data distribution, thus affecting the reliability of detection tasks. Therefore, how to objectively and comprehensively evaluate the generalization performance of image detection models is a pressing issue that needs to be addressed in current technologies. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, device and medium for evaluating the generalization performance of an image detection model that overcomes or at least partially solves the problem of how to objectively and comprehensively evaluate the generalization performance of an image detection model.
[0004] In a first aspect, embodiments of the present invention provide a method for evaluating the generalization performance of an image detection model, the method comprising: Based on the reference image dataset and the image dataset to be evaluated, at least one sample dataset pair is determined, wherein the sample dataset pair includes a reference sample dataset subset derived from the reference image dataset and an evaluation sample dataset subset derived from the image dataset to be evaluated; For each of the at least one sample data set pairs, determine the global feature distribution difference information and the local target feature distribution difference information between the reference sample data subset and the evaluation sample data subset; For each sample data set pair in the at least one sample data set pair, determine the detection performance degradation difference information, wherein the detection performance degradation difference information is the relative rate of change of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset; Based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance degradation difference information, a comprehensive generalization performance evaluation index is determined. Based on the comprehensive generalization performance evaluation index, the generalization performance information of the image detection model is determined. Optionally, determining at least one sample data set pair based on the reference image data set and the image data set to be evaluated includes: Obtain the category labels of each data point in the reference image dataset and the image dataset to be evaluated, respectively; Based on the category labels of each data in the reference image dataset and the category labels of each data in the image dataset to be evaluated, at least one common category label is determined; Based on the at least one shared category label, at least one sample data pair is determined in the reference image dataset and the image dataset to be evaluated, wherein the category label of the reference sample data subset and the category label of the evaluation sample data subset in each sample data pair belong to the same shared category label.
[0005] Optionally, determining the global feature distribution difference information and local target feature distribution difference information between the reference sample data subset and the evaluation sample data subset includes: The full-image visual feature distribution and target instance feature distribution of the reference sample data subset, and the full-image visual feature distribution and target instance feature distribution of the evaluation sample data subset are determined respectively. The global feature distribution difference is determined based on the full-image visual feature distribution of the reference sample data subset and the full-image visual feature distribution of the evaluation sample data subset; wherein, the global feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in the full-image visual features; Based on the target instance features of the reference sample data subset and the target instance feature distribution of the evaluation sample data subset, the local target feature distribution difference is determined, wherein the local target feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in terms of the target instance's own features.
[0006] Optionally, the full-image visual features include at least one of the overall color, texture, and structural features of the sample image, and the target instance's own features include at least one of the shape, local texture, and detailed structural features of the target region cropped based on the target bounding box coordinates.
[0007] Optionally, determining the comprehensive generalization performance evaluation index based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance degradation difference information includes: Based on the global feature distribution difference information and the local target feature distribution difference information, a comprehensive difference value is determined; Based on the comprehensive difference value and the detection performance attenuation difference information, a comprehensive generalization performance evaluation index is determined.
[0008] Optionally, determining the comprehensive generalization performance evaluation index based on the comprehensive difference value and the detection performance degradation difference information includes: Determine the average resolution of the images in the reference sample data subset and the evaluation sample data subset; The evaluation weights are determined based on the overall difference value and the average resolution. Based on the evaluation weights and the detection performance attenuation difference information, a comprehensive generalization performance evaluation index is determined.
[0009] Optionally, determining the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index includes: Obtain image detection business requirements; Based on the image detection service requirements, determine the generalization evaluation benchmark threshold; The generalization performance information of the image detection model is determined based on the comprehensive generalization performance evaluation index and the generalization evaluation benchmark threshold. Secondly, embodiments of the present invention provide an apparatus for evaluating the generalization performance of an image detection model, the apparatus comprising: The sample determination module is used to determine at least one sample data set pair based on a reference image data set and an image data set to be evaluated, wherein the sample data set pair includes a reference sample data subset derived from the reference image data set and an evaluation sample data subset derived from the image data set to be evaluated; The distribution difference value determination module is used to determine, for each of the at least one sample data set pair, global feature distribution difference information and local target feature distribution difference information between a reference sample data subset and an evaluation sample data subset; The attenuation difference value determination module is used to determine detection performance attenuation difference information for each sample data set pair in the at least one sample data set pair. The detection performance attenuation difference information is the relative change rate of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset. The performance evaluation index determination module is used to determine the comprehensive generalization performance evaluation index based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance decay difference information. The generalization performance information determination module is used to determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index. Optionally, the sample determination module includes: The category label determination submodule is used to obtain the category labels of each data in the reference image dataset and the image dataset to be evaluated, respectively. The common category label determination submodule is used to determine at least one common category label based on the category labels of each data in the reference image dataset and the category labels of each data in the image dataset to be evaluated; The sample data pair determination submodule is used to determine at least one sample data pair in the reference image data set and the image data set to be evaluated based on the at least one common category label, wherein the category label of the reference sample data subset and the category label of the evaluation sample data subset in each sample data pair belong to the same common category label.
[0010] Optionally, the distribution difference value determination module includes: The feature distribution determination submodule is used to determine the full-image visual feature distribution and target instance feature distribution of the reference sample data subset, as well as the full-image visual feature distribution and target instance feature distribution of the evaluation sample data subset, respectively. The global feature distribution difference determination submodule is used to determine the global feature distribution difference based on the full-image visual feature distribution of the reference sample data subset and the full-image visual feature distribution of the evaluation sample data subset; wherein, the global feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in the full-image visual features; The local target feature distribution difference determination submodule is used to determine the local target feature distribution difference based on the target instance features of the reference sample data subset and the target instance feature distribution of the evaluation sample data subset, wherein the local target feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in terms of the target instance's own features.
[0011] Optionally, the performance evaluation index determination module includes: The comprehensive difference value determination submodule is used to determine the comprehensive difference value based on the global feature distribution difference information and the local target feature distribution difference information; The comprehensive generalization performance evaluation index determination submodule is used to determine the comprehensive generalization performance evaluation index based on the comprehensive difference value and the detection performance attenuation difference information.
[0012] Optionally, the comprehensive generalization performance evaluation index determination submodule includes: An average resolution determination unit is used to determine the average resolution of images in the reference sample data subset and the evaluation sample data subset. The evaluation weight determination unit is used to determine the evaluation weight based on the comprehensive difference value and the average resolution; The comprehensive generalization performance evaluation index calculation unit is used to determine the comprehensive generalization performance evaluation index based on the evaluation weights and the detection performance attenuation difference information.
[0013] Optionally, the generalization performance information determination module includes: The business requirement acquisition submodule is used to acquire image detection business requirements; The benchmark threshold determination submodule is used to determine the generalization evaluation benchmark threshold based on the image detection service requirements. The performance level determination submodule is used to determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index and the generalization evaluation benchmark threshold. Thirdly, embodiments of the present invention provide an electronic device, the device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0014] Fourthly, embodiments of the present invention provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0015] In this embodiment of the invention, by determining at least one sample dataset to support multi-scenario comparative evaluation, and combining global feature distribution difference information and local target feature distribution difference information, the distribution offset is quantified from both the full image and target instance dimensions to comprehensively characterize the source of data differences. By determining the detection performance degradation difference information and associating the two-dimensional distribution differences to construct a comprehensive evaluation index, the precise correlation between data distribution offset and performance degradation is achieved, avoiding the limitations of single performance comparison. Finally, the generalization performance information is determined to transform the abstract index into an intuitive level label, which facilitates quick judgment of the model's generalization ability and improves the practicality of the evaluation results. This achieves an objective and comprehensive evaluation of the generalization performance of the image detection model, effectively improving the accuracy and reliability of judging the model's generalization ability in complex real-world environments. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the steps of an embodiment of the image detection model generalization performance evaluation method of the present invention; Figure 2 This is a flowchart illustrating the steps of another embodiment of the image detection model generalization performance evaluation method of the present invention; Figure 3 This is a structural block diagram of an embodiment of an image detection model generalization performance evaluation method device according to the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0019] The following description, in conjunction with the accompanying drawings, details the image detection model generalization performance evaluation method, apparatus, device, and medium provided by the embodiments of the present invention through specific examples and application scenarios.
[0020] Reference Figure 1 The flowchart illustrates an embodiment of the image detection model generalization performance evaluation method of the present invention, which may specifically include the following steps: Step 101: Based on the reference image data set and the image data set to be evaluated, determine at least one sample data set pair, wherein the sample data set pair includes a reference sample data subset derived from the reference image data set and an evaluation sample data subset derived from the image data set to be evaluated.
[0021] First, this step aims to construct the basic data units for evaluating the generalization performance of image detection models. The reference image dataset typically refers to the benchmark dataset used during model training; its image data has known distribution characteristics and annotation information, serving as a reference standard for measuring model performance. The image dataset to be evaluated refers to the target dataset whose generalization ability needs to be tested. Its data distribution may differ from the reference image dataset, for example, in terms of imaging conditions, scene type, target morphology, etc.
[0022] The core of this step lies in selecting and constructing sample dataset pairs from the two datasets mentioned above. This means that the reference sample dataset subset is not a simple cut from the reference image dataset, but rather needs to be specifically selected based on the characteristics of the evaluation target and the image dataset to be evaluated, to ensure comparability with the evaluation sample dataset subset. Similarly, the selection of the evaluation sample dataset subset must also consider its correspondence with the reference sample dataset subset on key evaluation dimensions. For example, if the image dataset to be evaluated contains images of a specific type of target or a specific scene, then the reference sample dataset subset should also contain images of the corresponding type of target or scene in order to accurately measure the model's generalization performance in these specific aspects.
[0023] The sample dataset consists of a reference sample dataset derived from the reference image dataset and an evaluation sample dataset derived from the image dataset to be evaluated. This definition clearly defines the source and correspondence of the two subsets. The reference sample dataset serves as the benchmark for model performance, and its data quality and representativeness directly affect the reliability of the evaluation results. The evaluation sample dataset serves as the test object for the model's generalization ability; the diversity of its data distribution and its differences from the reference dataset determine the comprehensiveness and challenge of the evaluation. By pairing these two subsets into a single sample dataset, a clear comparative basis can be provided for subsequent analysis of data distribution differences and model performance degradation.
[0024] Determining at least one sample dataset pair means that this step supports constructing multiple dataset pairs for different generalization evaluation needs. For example, when the image dataset to be evaluated contains multiple subsets with different distribution characteristics, a corresponding reference sample dataset subset can be constructed for each subset, forming multiple sample dataset pairs. This allows for separate evaluation of the model's performance under different generalization scenarios. This many-to-many evaluation approach can more comprehensively reveal the model's generalization ability boundaries and potential problems.
[0025] By screening and constructing sample data sets, a solid data foundation was laid for the entire image detection model generalization performance evaluation process, ensuring the accuracy of subsequent evaluation index calculations and the validity of evaluation results.
[0026] Step 102: For each sample data set pair in the at least one sample data set pair, determine the global feature distribution difference information and the local target feature distribution difference information between the reference sample data subset and the evaluation sample data subset.
[0027] First, this step aims to obtain a description of the differences in feature distribution between the two subsets of the sample data set. Global feature distribution difference information refers to the offset in feature distribution between the reference sample data subset and the evaluation sample data subset at the overall image level. It reflects the inconsistency in the overall visual characteristics of the image, such as statistical differences in macroscopic features like overall brightness, color style, and background texture. Local target feature distribution difference information, on the other hand, refers to the offset in feature distribution between the two subsets at the level of local regions of target instances in the image. It focuses on the characteristics of the target object itself, such as statistical differences in microscopic features like the target's shape, local texture, and detailed structure.
[0028] The core of this step lies in characterizing the differences in data distribution from both global and local dimensions. This means that for each sample dataset pair, it is necessary to independently acquire its global feature distribution difference information and local target feature distribution difference information. Acquiring global feature distribution difference information is typically based on feature extraction and statistical analysis of the entire image to capture the macroscopic distribution characteristics that influence the model's overall judgment. Acquiring local target feature distribution difference information usually requires first locating target instances in the image, and then performing feature extraction and statistical analysis on the target region to capture the microscopic distribution characteristics that influence the model's recognition of specific targets. This two-dimensional difference description allows for a more comprehensive revelation of the different sources of data distribution between the reference and evaluation subsets.
[0029] Processing is performed on each of the at least one sample data set pair, emphasizing the traversal of all constructed sample data pairs in this step. Whether it is a single sample data pair or multiple sample data pairs constructed to meet the needs of multi-scenario evaluation, the global and local feature distribution difference information must be obtained for each pair. This pairwise processing method ensures that the distribution characteristics of each set of comparative data are accurately described, providing data support for subsequent analysis of the model's performance under different data distribution conditions.
[0030] Determining the differences in global feature distribution and local target feature distribution can be achieved, but is not limited to, extracting high-dimensional features based on pre-trained deep neural networks and then using statistical methods (such as calculating the mean of the feature distribution, the difference in the covariance matrix, etc.) to quantify or qualitatively describe the distribution distance. The extraction range of global features covers the entire image region, while the extraction range of local target features is limited to the region occupied by the target instance in the image, such as the region determined by the target detection box or semantic segmentation mask.
[0031] By separately acquiring information on the differences in global and local feature distributions, a basis is provided for a deeper understanding of the impact of data distribution variations on model generalization performance. Information on differences in global feature distributions can explain the challenges the model faces in adapting to the overall scene, while information on differences in local target feature distributions can explain the difficulties the model encounters in recognizing specific targets. Together, they constitute the key data foundation for evaluating the model's generalization ability.
[0032] Step 103: For each sample data set pair in the at least one sample data set pair, determine the detection performance degradation difference information, wherein the detection performance degradation difference information is the relative rate of change of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset.
[0033] First, this step aims to obtain descriptive information on the performance degradation of the image detection model under different data distribution conditions. The performance data of the image detection model typically refers to quantitative metrics used to measure the model's detection effectiveness, such as accuracy, precision, recall, F1 score, or average precision (AP). These metrics objectively reflect the model's ability to identify and locate targets. The performance data on the reference sample subset serves as the benchmark for model performance, representing the model's expected performance on the known distribution data; the performance data on the evaluation sample subset represents the model's actual performance on the distribution data to be evaluated.
[0034] The core of this step is to determine the relative rate of change between the two types of performance data, and define this relative rate of change as the information for detecting performance degradation differences. The relative rate of change refers to the proportion of change in the model's performance data on the evaluation subset of data relative to its performance data on the reference subset of data. Its calculation formula is usually (benchmark performance data - evaluation performance data) / benchmark performance data, expressed as a percentage or decimal. This information directly reflects the extent to which the model's performance degrades with changes in data distribution. For example, if the model's AP value is 0.8 on the reference subset and 0.6 on the evaluation subset, then the relative rate of change is (0.8 - 0.6) / 0.8 = 0.25, meaning the detected performance degradation difference information indicates a performance degradation of 25%.
[0035] The processing involves each sample data set pair within the at least one sample data set pair, emphasizing that this step must correspond one-to-one with the sample data set pairs determined in step 102. For each sample data set pair, the model's performance data on its reference subset and evaluation subset must be independently determined, and the relative rate of change is further calculated as information to detect performance degradation differences. This one-to-one correspondence ensures that the model's performance degradation can be described individually under the specific distribution difference scenario represented by each sample data pair, providing refined performance indicator information for subsequent comprehensive evaluation of the model's performance in different generalization scenarios.
[0036] Determining differences in detection performance degradation hinges on ensuring the consistency and comparability of performance data. For instance, if average precision (AP) is chosen as the performance metric, the AP values of the model on the two subsets must be calculated separately under the same evaluation criteria (such as IOU threshold and confidence threshold), and then the relative rate of change must be solved. This consistency requirement avoids the problem of incomparable performance data due to different evaluation criteria, ensuring the accuracy of information regarding differences in detection performance degradation.
[0037] By identifying the differences in detection performance degradation, the model's performance degradation is quantified into a specific numerical form, providing a direct basis for analyzing the model's generalization ability. A larger relative rate of change indicates weaker generalization performance under the scenario of data distribution differences; conversely, a smaller rate of change indicates stronger generalization performance. This information, combined with the feature distribution difference information identified in step 102, establishes a correlation between data distribution differences and model performance degradation, laying the foundation for the subsequent construction of comprehensive generalization performance evaluation indicators.
[0038] Step 104: Determine the comprehensive generalization performance evaluation index based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance attenuation difference information.
[0039] First, this step aims to construct a comprehensive metric that fully reflects the generalization ability of an image detection model by integrating multi-dimensional evaluation parameters. Specifically, global feature distribution difference information and local target feature distribution difference information characterize the differences between the reference and evaluation sample subsets at the data distribution level, while detection performance degradation difference information reflects the impact of these distribution differences on the model's detection performance at the model performance level. The comprehensive generalization performance evaluation metric achieves a systematic assessment of the model's generalization ability by integrating these three types of metrics.
[0040] The core of this step lies in establishing a correlation mechanism between data distribution differences and model performance degradation, and quantifying this correlation into a unified evaluation metric. This means that constructing a comprehensive generalization performance evaluation metric is not simply a weighted sum of three types of metrics, but rather requires fusion based on their inherent logical relationships. For example, distribution difference values and performance degradation values can be mapped to the same dimension through certain mathematical transformations, and then a comprehensive metric can be calculated using preset fusion rules (such as product, exponential weighting, etc.) to reflect the evaluation logic that the greater the distribution difference and the more significant the performance degradation, the weaker the model's generalization performance.
[0041] The evaluation comprehensively calculates the differences in global feature distribution, local target feature distribution, and detection performance degradation, emphasizing the equal importance of these three types of indicators. The differences in global and local feature distributions together constitute a complete description of data distribution differences, while the differences in detection performance degradation directly reflect the impact of these differences on the model. Only by organically combining these three indicators can the limitations of single-indicator evaluation be avoided, and the generalization performance of the model under different data distribution scenarios be fully reflected. For example, if two sample data pairs have the same performance degradation value, but one has a larger global feature distribution difference while the other has a larger local target feature distribution difference, the comprehensive indicator can distinguish the subtle differences in the model's generalization ability under these two different scenarios.
[0042] The specific implementation method for determining the comprehensive generalization performance evaluation index needs to be designed based on the evaluation objectives and application scenarios. For example, the global feature distribution difference information and the local target feature distribution difference information can be fused into a comprehensive distribution difference value. Then, this comprehensive distribution difference value can be correlated with the detection performance decay difference information through some functional relationship (such as a logarithmic function or an exponential function), ultimately outputting a value that can intuitively reflect the strength of the model's generalization ability. The magnitude of the comprehensive index is usually positively or negatively correlated with the model's generalization performance. For example, a larger index value indicates stronger generalization performance, or a smaller index value indicates weaker generalization performance; the specific value needs to be determined according to the fusion rules.
[0043] By constructing a comprehensive generalization performance evaluation index, multi-dimensional evaluation parameters are integrated into a unified quantitative standard, providing an objective basis for comparing the generalization performance of different models or the same model under different optimization strategies. This index not only reflects the model's generalization ability in scenarios with different data distributions, but also reveals the overall trend and potential bottlenecks of the model's generalization performance through statistical analysis of the comprehensive evaluation results of multiple sample data pairs, thus providing direction for model optimization and improvement.
[0044] Step 105: Determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index.
[0045] First, this step aims to map the quantified comprehensive generalization performance evaluation index into meaningful generalization performance information, so as to intuitively reflect the generalization ability level of the image detection model. The generalization performance information is a qualitative or semi-quantitative description of the model's generalization ability, such as being categorized as "excellent," "good," "average," or "poor," or represented by numerical levels (e.g., level 1 to 5). The comprehensive generalization performance evaluation index is the quantified value obtained in step 104 used to measure the model's generalization ability; its magnitude directly reflects the strength of the model's generalization performance.
[0046] The core of this step lies in establishing the correspondence between the comprehensive generalization performance evaluation index and the generalization performance information. This means that it is necessary to pre-set the division criteria according to the evaluation objectives and actual application needs. For example, by setting multiple thresholds, the value range of the comprehensive generalization performance evaluation index can be divided into several intervals, with each interval corresponding to a type of generalization performance information. When the comprehensive index falls into a certain interval, the generalization performance of the model can be determined to belong to the information corresponding to that interval. This division criterion can be based on industry-recognized generalization ability evaluation criteria, or it can be customized according to the performance requirements of specific application scenarios. For example, if the value range of the comprehensive generalization performance evaluation index is [0, 10], an index value ≥ 8 can be set to correspond to "excellent", 6 ≤ index value < 8 to correspond to "good", 4 ≤ index value < 6 to correspond to "average", and index value < 4 to correspond to "poor". When the comprehensive index of a certain model is 7.5, its generalization performance information can be determined to be "good".
[0047] The determination of generalization performance information based on the comprehensive generalization performance evaluation index emphasizes the fundamental role of the evaluation index. This comprehensive generalization performance evaluation index integrates information from multiple aspects, including data distribution differences and model performance degradation; therefore, determining generalization performance information based on this index ensures the comprehensiveness and objectivity of the results. The determined generalization performance information provides intuitive guidance for model selection, application, and optimization: different generalization performance levels correspond to different applicable scenarios. For example, a "good" level model can be applied to critical tasks with complex and variable data distributions, while a "average" or "poor" level model may require further optimization or is only suitable for scenarios with relatively stable data distributions. Furthermore, the introduction of generalization performance information simplifies the comparison of generalization capabilities between different models, allowing users to quickly determine whether a model meets specific requirements.
[0048] This step improves the readability and practicality of the evaluation results by transforming abstract quantitative indicators into concrete generalization performance information. It not only provides a summary evaluation of the model's generalization ability but also offers a clear reference for subsequent model application deployment, performance improvement, and academic research.
[0049] By identifying at least one sample dataset to support multi-scenario comparative evaluation, and combining global feature distribution difference information and local target feature distribution difference information, the distribution offset is quantified from both the full image and target instance dimensions to comprehensively characterize the sources of data differences. By identifying detection performance degradation difference information and correlating the two-dimensional distribution differences to construct a comprehensive evaluation index, a precise correlation between data distribution offset and performance degradation is achieved, avoiding the limitations of single performance comparison. Finally, generalization performance information is determined, transforming abstract indicators into intuitive level labels, facilitating rapid judgment of the model's generalization ability and improving the practicality of the evaluation results. This enables an objective and comprehensive evaluation of the generalization performance of image detection models, effectively improving the accuracy and reliability of judging the model's generalization ability in complex real-world environments. Reference Figure 2 The flowchart illustrates another embodiment of the image detection model generalization performance evaluation method of the present invention, which may specifically include the following steps: Step 201: Based on the reference image dataset and the image dataset to be evaluated, determine at least one sample dataset pair, wherein the sample dataset pair includes a reference sample dataset subset derived from the reference image dataset and an evaluation sample dataset subset derived from the image dataset to be evaluated.
[0050] Since the content of step 201 is the same as that of step 101, both of which are to build a comparative data basis for evaluating the generalization performance of the image detection model, the overall explanation of step 201 can refer to the explanation of step 101, and will not be repeated here.
[0051] In one embodiment, step 201 includes the following sub-steps: Sub-step S11: Obtain the category labels of each data in the reference image data set and the image data set to be evaluated, respectively.
[0052] First, this step aims to obtain basic information for selecting samples. Category labels refer to the category identifiers of target objects contained in the image data, such as "aircraft," "ship," and "vehicle." These are typically generated manually or automatically and stored in association with the image data. Obtaining the category labels of the reference image dataset clarifies the range of target categories contained within it; obtaining the category labels of the image dataset to be evaluated clarifies the range of target categories contained within it. By obtaining the category labels of both datasets, a data foundation is provided for subsequently determining common category labels.
[0053] Sub-step S12: Based on the category labels of each data in the reference image dataset and the category labels of each data in the image dataset to be evaluated, determine at least one common category label.
[0054] First, this step aims to determine the common target categories between the reference image dataset and the image dataset to be evaluated. Common category labels refer to target category labels that exist in both the reference and evaluation datasets. For example, if the reference dataset contains the category labels {aircraft, ship, vehicle}, and the evaluation dataset contains the category labels {aircraft, ship, bridge}, then the common category label is {aircraft, ship}. The core of determining common category labels lies in performing an intersection operation on the category labels of the two datasets to filter out the target categories that exist in both datasets. This ensures that the subsequently selected subsets of sample data are comparable in terms of target categories, avoiding misjudgments in generalization performance due to evaluating non-common categories.
[0055] Sub-step S13: Based on the at least one common category label, determine at least one sample data pair in the reference image data set and the image data set to be evaluated, wherein the category label of the reference sample data subset and the category label of the evaluation sample data subset in each sample data pair belong to the same common category label.
[0056] First, this step aims to filter sample data pairs based on shared category labels. "Belonging to the same shared category label" means that the image data in both the reference and evaluation sample data subsets are limited to a single shared category label determined in sub-step S12. For example, if the shared category label is {airplane, ship}, two sample data pairs can be constructed: In the first sample data pair, the reference sample data subset consists of all samples in the reference set with the category label "airplane," and the evaluation sample data subset consists of all samples in the evaluation set with the category label "airplane"; in the second sample data pair, the reference sample data subset consists of all samples in the reference set with the category label "ship," and the evaluation sample data subset consists of all samples in the evaluation set with the category label "ship." In this way, each sample data pair corresponds to a specific shared target category, enabling targeted evaluation of the model's generalization ability to that target category. If the common category label contains only one category, a single sample data pair can be constructed; if it contains multiple categories, multiple sample data pairs can be constructed to evaluate the generalization performance of different target categories.
[0057] Step 202: For each sample data set pair in the at least one sample data set pair, determine the global feature distribution difference information and the local target feature distribution difference information between the reference sample data subset and the evaluation sample data subset.
[0058] Since the content of step 202 is the same as that of step 102, both of which are to build a comparative data basis for evaluating the generalization performance of the image detection model, the overall explanation of step 202 can refer to the explanation of step 102, and will not be repeated here.
[0059] In one embodiment, step 202 includes the following sub-steps: Sub-step S21: Determine the full-image visual feature distribution and target instance feature distribution of the reference sample data subset, and the full-image visual feature distribution and target instance feature distribution of the evaluation sample data subset, respectively.
[0060] First, this step aims to extract and model the feature distribution of the reference and evaluation sample subset across different dimensions. The full-image visual feature distribution refers to the statistical distribution of features obtained after feature extraction from the entire image, covering all pixel areas and reflecting the overall visual attributes of the image. The target instance feature distribution refers to the statistical distribution of features obtained after feature extraction from the region where the target instance is located in the image, limited to a local area of the target instance and reflecting the characteristic attributes of the target object itself.
[0061] Specifically, the process of determining the distribution of visual features across the entire image typically involves: inputting each image from a subset of reference sample data and a subset of evaluation sample data into a pre-trained feature extraction network (such as the Inception-v3 network); extracting the output of a certain layer of the network (such as the feature layer before the fully connected layer) as the visual features of the entire image; and then calculating their statistical distribution parameters (such as the mean vector and covariance matrix) based on these features to model the distribution of visual features across the entire image.
[0062] The process of determining the feature distribution of target instances typically includes: cropping the target instance region from each image in the reference sample data subset and the evaluation sample data subset based on the image annotation information (such as target bounding box coordinates); inputting the cropped target instance region into a pre-trained feature extraction network to extract its features; and then calculating its statistical distribution parameters (such as mean vector and covariance matrix) based on these target instance features to model the target instance feature distribution.
[0063] Sub-step S22: Determine the global feature distribution difference based on the full-image visual feature distribution of the reference sample data subset and the full-image visual feature distribution of the evaluation sample data subset; wherein, the global feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in the full-image visual features.
[0064] First, this step aims to quantify the differences between the reference and evaluation sample subsets in the overall visual feature distribution. The determination of global feature distribution differences is typically based on the two overall visual feature distributions obtained in sub-step S21 (usually assumed to be multivariate Gaussian distributions), achieved by calculating the distance between these two distributions. Commonly used distance metrics include the Fréchet distance, which involves the mean vectors and covariance matrices of the two distributions. For example, a typical expression for the visual feature distribution can be N(μx, Σx), where μx represents the mean vector of the feature matrix x, and Σx represents the covariance matrix of the feature matrix x. Then, assuming the overall visual feature distribution of the reference sample subset is N(μr, Σr) and the overall visual feature distribution of the evaluation sample subset is N(μg, Σg), the global feature distribution difference information can be obtained by calculating the Fréchet distance between these two Gaussian distributions. The larger the distance value, the greater the distributional shift between the two subsets in the overall visual features.
[0065] Sub-step S23: Based on the target instance feature distribution of the reference sample data subset and the target instance feature distribution of the evaluation sample data subset, determine the local target feature distribution difference, wherein the local target feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in terms of the target instance's own features.
[0066] First, this step aims to quantify the differences in target instance feature distributions between the reference and evaluation sample subsets. Similar to sub-step S22, the determination of local target feature distribution differences is based on the two target instance feature distributions obtained in sub-step S21 (usually assumed to be multivariate Gaussian distributions), achieved by calculating the distance between them (e.g., Fréchet distance). For example, if the target instance feature distribution of the reference sample data subset is N(μro, Σro), and the target instance feature distribution of the evaluation sample data subset is N(μgo, Σgo), then the local target feature distribution difference information can be obtained by calculating the Fréchet distance between these two Gaussian distributions. The larger the distance value, the greater the distribution offset of the two subsets in terms of the target instance's own features. Through sub-steps S22 and S23, the data distribution differences are quantified from both global and local dimensions, providing a crucial basis for subsequent comprehensive evaluation of the model's generalization performance.
[0067] In one example, suppose the reference sample data subset is the "airplane" category samples (1000 images) in a remote sensing training set Dtrain, and the evaluation sample data subset is the "airplane" category samples (500 images) in a remote sensing test set Dtest to be evaluated. All "airplane" category images in Dtrain and Dtest are input into a pre-trained Inception-v3 network (with the final classification layer removed), and the 2048-dimensional feature vector output from the second-to-last layer of the network is extracted. For Dtrain, the feature matrix is obtained. ; For Dtest, the feature matrix is obtained. Assuming these two feature matrices follow a multivariate Gaussian distribution, the mean vector of the full-image visual feature matrix of Dtrain is calculated. Covariance Matrix The full-image visual feature distribution of Dtrain can be obtained. Similarly, the full-image visual feature distribution of Dtest can also be obtained. ,in, Let be the mean vector of the full-image visual feature matrix of Dtest. Let be the covariance matrix of the full-image visual representation of Dtest; Based on the bounding boxes labeled "airplane" in Dtrain and Dtest, the airplane target region is cropped from each image. The cropped target region images are then input into the Inception-v3 network to extract a 2048-dimensional feature vector. For the target region in Dtrain, the feature matrix can be obtained. Assuming that the two target feature matrices follow a multivariate Gaussian distribution, calculate mean vector Covariance Matrix Obtain the target instance feature distribution of Dtrain Similarly, the feature distribution of the target instances in Dtest is obtained as follows: ,in for The mean vector, for The covariance matrix is used to determine the global feature distribution difference information, i.e., the global feature distribution difference value, based on the full-image visual feature distribution obtained in sub-step S21. The calculation formula is as follows: ,in, This represents the squared Euclidean distance of the mean vector. Similarly, the local target feature distribution difference information, i.e., the local target feature distribution difference value, can be calculated through the following steps:
[0068] .
[0069] In one embodiment, the full-image visual features include at least one of the overall color, texture, and structural features of the sample image; the target instance features include at least one of the shape, local texture, and detailed structural features of the target region cropped based on the target bounding box coordinates.
[0070] First, this embodiment aims to clarify the specific constituent elements of the overall image visual features and the target instance's own features, providing a clear object definition for feature extraction and distribution difference calculation. The overall image visual features are a comprehensive description of the overall visual attributes of the sample image, with feature extraction covering the entire pixel area of the image, aiming to capture macroscopic visual characteristics that influence the model's global judgment. The target instance's own features, on the other hand, are a refined description of the local region features of the target of interest in the image, with feature extraction limited to the area cropped by the target's bounding box, aiming to eliminate background interference and focus on the inherent attributes of the target object.
[0071] The overall color features in the overall visual characteristics of an image refer to the overall statistical properties of pixel colors, such as the mean and variance of the image in the RGB color space, or the hue and saturation distribution in the HSV color space. In remote sensing images, overall color features may vary significantly depending on the type of imaging sensor (e.g., visible light, infrared), atmospheric conditions (e.g., sunny days, foggy days), or land cover type (e.g., vegetation, bare soil). Overall texture features refer to the spatial repetition patterns of pixel grayscale or color in an image, such as uniform textures (e.g., calm water surfaces), directional textures (e.g., urban road networks), or irregular textures (e.g., mountainous terrain). These can be extracted using methods such as gray-level co-occurrence matrices and Gabor filters, reflecting the roughness or structural regularity of the image surface. Overall structural features refer to the spatial layout and macroscopic morphology of targets and backgrounds in an image, such as the outlines of large features (e.g., mountains, rivers), the density distribution of targets in the image, or their relative positional relationships. These features focus on the global geometric structure of the image rather than local details. The overall visual features can be one or more of the features mentioned above. The selection of these features should be determined based on the specific evaluation scenario and image type in order to fully reflect the overall visual distribution characteristics of the image.
[0072] Shape features, one of the intrinsic features of a target instance, refer to the geometric contour characteristics of the target region, such as the aspect ratio of the target's bounding rectangle, the perimeter-to-area ratio of the contour, and convex hull features. In remote sensing target detection, shape features are an important basis for distinguishing different types of targets; for example, the narrow contour of an aircraft differs significantly from the rectangular contour of a ship. Local texture features refer to the detailed texture patterns within the target region. Compared with full-image texture features, they focus more on the surface texture details of the target itself, such as the skin texture of an aircraft fuselage or the anti-slip texture of a ship's deck. These can be extracted using methods such as local binary patterns and histograms of oriented gradients to characterize the microscopic surface properties of the target. Detailed structural features refer to the key components or fine structural information within the target region, such as the wings, tail, and engine of an aircraft, and the radar and smokestacks of a ship. These require high spatial resolution and can reflect the fine structural differences of the target, serving as the core basis for the model to achieve high-precision target recognition. The extraction of intrinsic features of a target instance relies on accurate target bounding box annotation. By cropping the target region, background noise can be effectively isolated, allowing the features to more purely reflect the characteristics of the target itself.
[0073] By clarifying the specific composition of the visual features of the whole image and the features of the target instance itself, this embodiment provides a clear technical basis for modeling the "distribution of visual features of the whole image" and the "distribution of features of the target instance" in step 202, ensuring that the extracted features can accurately reflect the essential differences in data distribution, thereby laying the foundation for the subsequent quantification of the differences between global and local feature distributions.
[0074] Step 203: For each sample data set pair in the at least one sample data set pair, determine the detection performance degradation difference information, wherein the detection performance degradation difference information is the relative rate of change of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset.
[0075] Since the content of step 203 is the same as that of step 103, both of which are to build a comparative data basis for evaluating the generalization performance of the image detection model, the overall explanation of step 203 can refer to the explanation of step 103, and will not be repeated here.
[0076] In one example, suppose that for a sample dataset such as "airplane" category sample pairs, the image detection model is tested on a reference sample dataset subset (Dtrain_airplane) and an evaluation sample dataset subset (Dtest_airplane). First, the baseline performance data AP of the model is obtained on Dtrain_airplane. a (e.g., AP) a =0.85); then, obtain the model's test performance data AP on Dtest_airplane. bk(e.g., AP) bk =0.68). Based on the definition of relative change rate, the difference in detection performance degradation is calculated. The calculation formula is as follows:
[0077] Substituting the example data above, we can obtain = (0.85 - 0.68) / 0.85 ≈ 0.20, meaning the model's performance degrades by approximately 20% on the sample dataset compared to the corresponding subset of reference samples. This value directly reflects the degree of performance degradation caused by differences in data distribution, providing a key parameter for calculating subsequent comprehensive generalization performance evaluation metrics.
[0078] If there are multiple sample dataset pairs (such as those corresponding to multiple categories like "aircraft," "ship," and "vehicle," or to test subsets with different resolutions and weather conditions), then each sample dataset pair needs to be calculated independently. This is to comprehensively evaluate the performance degradation of the model under different generalization scenarios.
[0079] Step 204: Determine the comprehensive difference value based on the global feature distribution difference information and the local target feature distribution difference information.
[0080] First, this step aims to fuse global feature distribution difference information with local target feature distribution difference information to obtain a quantitative index that comprehensively reflects the degree of deviation of the sample data set from the overall distribution. Specifically, global feature distribution difference information characterizes the distribution difference between the reference and evaluation sample subsets at the whole-map level, while local target feature distribution difference information characterizes the distribution difference between the two at the target instance level. The comprehensive difference value is a unified measure of these two types of difference information to comprehensively characterize the overall degree of deviation in the data distribution.
[0081] The core of this step lies in establishing a fusion rule for global feature distribution difference information and local target feature distribution difference information. This means that determining the comprehensive difference value is not simply a weighted sum of the two, but requires selecting an appropriate mathematical method to integrate them into a unified value based on the evaluation objective and application scenario. For example, a linear superposition method can be used to directly add the quantified results of global feature distribution difference information and local target feature distribution difference information to reflect their equal contribution to the comprehensive distribution difference; alternatively, different weights can be assigned to the two according to actual needs, highlighting the impact of a certain dimension of difference information through weighted summation.
[0082] The comprehensive calculation based on the global feature distribution difference information and the local target feature distribution difference information emphasizes their indispensability in determining the comprehensive difference value. Global feature distribution difference information reflects changes in the overall image environment, while local target feature distribution difference information reflects changes in the target object itself. Only by combining the two can the data distribution shift be fully described. For example, if a sample dataset has a high global feature distribution difference information but a low local target feature distribution difference information, it indicates that the data distribution difference mainly stems from changes in the background environment; if both are high, it indicates that there is a significant distribution shift in both the background and the target.
[0083] The specific implementation method for determining the comprehensive difference value needs to be designed according to the characteristics of the evaluation scenario. In one example, the comprehensive difference value can be obtained by directly adding the quantized value of the global feature distribution difference information to the quantized value of the local target feature distribution difference information, that is: Comprehensive difference value = Quantized value of global feature distribution difference information + Quantized value of local target feature distribution difference information. For example, if the quantized value of the global feature distribution difference information is 90 and the quantized value of the local target feature distribution difference information is 60, then the comprehensive difference value is 90 + 60 = 150. The larger this value is, the more significant the overall distribution shift between the reference sample data subset and the evaluation sample data subset.
[0084] This step integrates the distribution differences between the global and local dimensions into a comprehensive difference value, laying the foundation for subsequent calculation of a comprehensive generalization performance evaluation index by combining model performance degradation differences. The introduction of the comprehensive difference value makes the description of the data distribution offset more concise and comprehensive, helping to improve the accuracy and efficiency of subsequent generalization performance evaluation.
[0085] Step 205: Determine the comprehensive generalization performance evaluation index based on the comprehensive difference value and the detection performance attenuation difference information; Since the content of step 205 is the same as that of step 104, both of which are to build a comparative data basis for evaluating the generalization performance of the image detection model, the overall explanation of step 205 can refer to the explanation of step 104, and will not be repeated here.
[0086] In one embodiment, step 205 includes the following sub-steps: Sub-step S31: Determine the average resolution of the images in the reference sample data subset and the evaluation sample data subset.
[0087] First, this step aims to obtain fundamental parameters for balancing the differences in data distribution. Image resolution typically refers to the pixel dimensions of an image (e.g., width × height, in pixels), reflecting the richness of detail. Average resolution is the arithmetic mean of the resolutions of all images in the reference and evaluation subsets of the data. It is calculated as follows: Calculate the resolution (e.g., width and height) of each image in both subsets, sum the resolutions of all images (by pixel area or single-side dimension), and then divide by the number of images to obtain the average resolution for each subset. Finally, the average of the two subsets can be used, or the average resolution of the evaluation subset can be directly used as the unified average resolution λ. For example, if the average resolution of the reference subset is 1024 × 768 and the average resolution of the evaluation subset is 512 × 384, then the average pixel area of both subsets can be calculated, or the average resolution of the evaluation subset can be directly used as λ. Sub-step S32: Determine the evaluation weight based on the comprehensive difference value and the average resolution.
[0088] First, this step aims to construct evaluation weights based on data distribution differences and image resolution to dynamically adjust the contribution of different sample datasets to the overall generalization performance evaluation. The core function of the evaluation weights is to balance the distribution differences at different resolutions, preventing high-resolution images from being overestimated due to inherent feature richness, or low-resolution images from being underestimated due to feature loss. The calculation formula is typically: evaluation weight wk equals the overall difference value (i.e., FIDk) divided by the average resolution λ, i.e., wk = FIDk / λ. For example, if the overall difference value FIDk is 150, and the average resolution λ (in pixel area, such as 1024×768≈786432 pixels), then the evaluation weight wk = 150 / 786432 ≈ 0.00019. This weight value characterizes the overall distribution difference per unit resolution, making the distribution differences of sample datasets at different resolutions comparable. Sub-step S33: Determine the comprehensive generalization performance evaluation index based on the evaluation weights and the detection performance attenuation difference information.
[0089] First, this step aims to obtain the final comprehensive generalization performance evaluation index by weighting and fusing the performance degradation differences based on evaluation weights. The logic for constructing the comprehensive generalization performance evaluation index is as follows: the larger the evaluation weight and the larger the performance degradation difference value, the weaker the model's generalization performance in the corresponding scenario for that sample dataset, and the lower the comprehensive index should be; conversely, the comprehensive index should be higher. Its calculation formula can be achieved by using a logarithmic function to weight and sum the evaluation weights and the reciprocals of the performance degradation difference values:
[0090] in Let be the difference in detection performance degradation for the k-th sample data set; considering that this scheme focuses on evaluating the degradation of model generalization performance, for Outliers < 0 are uniformly truncated and set to 0; when Δ When =0, the input is much smaller than normal. The minimum value ε of the order of magnitude avoids the division by zero problem. The selection of this value is a routine engineering implementation detail and will not be elaborated on here; K is the total number of sample data pairs.
[0091] Step 206: Determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index.
[0092] Since the content of step 206 is the same as that of step 105, both of which are to build a comparative data basis for evaluating the generalization performance of the image detection model, the overall explanation of step 206 can refer to the explanation of step 105, and will not be repeated here.
[0093] In one embodiment, step 206 may include the following sub-steps: Sub-step S41: Obtain image detection business requirements.
[0094] First, this step aims to clarify the specific application scenarios and performance requirements of the image detection model. Image detection business requirements refer to performance indicators set based on the model's actual application field (such as remote sensing monitoring, security surveillance, industrial quality inspection, etc.) and user expectations. Examples include "detection accuracy of no less than 80% for ship targets under complex weather conditions" and "generalization error tolerance of no more than 15% for small-sized remote sensing targets." Business requirements can be obtained through methods such as user needs surveys, industry standard reviews, and summaries of historical project experience. The content must be specific and quantifiable to serve as the basis for subsequently determining the generalization evaluation benchmark threshold.
[0095] Sub-step S42: Determine the generalization evaluation benchmark threshold based on the image detection service requirements.
[0096] First, this step aims to transform abstract business requirements into specific thresholds that can be used to determine generalization performance information. The generalization evaluation benchmark thresholds refer to the critical values used to classify generalization performance information, and their number corresponds to the expected number of generalization performance information categories (e.g., if divided into 4 categories, then 3 thresholds are needed). The determination of the thresholds must be closely integrated with the business requirements regarding the model's generalization ability. For example, if the business requirement is "the model's performance degradation in cross-domain scenarios must be controlled within 20%", then the critical value corresponding to the comprehensive generalization performance evaluation index can be set to a specific value (e.g., Score ≥ -5 corresponds to "performance degradation ≤ 20%"). Methods for determining the benchmark thresholds can include expert experience based on business requirements, statistical analysis based on historical data (e.g., 95% confidence intervals), or benchmarking based on industry standards, ensuring the reasonableness and practicality of the thresholds.
[0097] Sub-step S43: Determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index and the generalization evaluation benchmark threshold.
[0098] First, this step aims to qualitatively or semi-quantitatively describe the model's generalization ability by comparing the comprehensive generalization performance evaluation index with the generalization evaluation benchmark thresholds. Specifically, the value of the comprehensive generalization performance evaluation index is compared with several preset generalization evaluation benchmark thresholds, and the corresponding generalization performance information is determined based on the threshold range in which the index falls. For example, if the generalization evaluation benchmark thresholds are set to {-3, -5, -7}, and a larger value of the comprehensive generalization performance evaluation index indicates stronger generalization performance, then the classification rules for generalization performance information can be set as follows: when the index ≥ -3, the generalization performance information is "excellent"; when -5 ≤ index < -3, the generalization performance information is "good"; when -7 ≤ index < -5, the generalization performance information is "average"; and when the index < -7, the generalization performance information is "poor". In this way, the quantified index is transformed into generalization performance information with practical business significance, providing intuitive guidance for model selection, optimization, and application.
[0099] By identifying at least one sample dataset to support multi-scenario comparative evaluation, and combining global feature distribution difference information and local target feature distribution difference information, the distribution offset is quantified from both the full image and target instance dimensions to comprehensively characterize the sources of data differences. By identifying detection performance degradation difference information and correlating the two-dimensional distribution differences to construct a comprehensive evaluation index, a precise correlation between data distribution offset and performance degradation is achieved, avoiding the limitations of single performance comparison. Finally, generalization performance information is determined, transforming abstract indicators into intuitive level labels, facilitating rapid judgment of the model's generalization ability and improving the practicality of the evaluation results. This enables an objective and comprehensive evaluation of the generalization performance of image detection models, effectively improving the accuracy and reliability of judging the model's generalization ability in complex real-world environments. It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0100] Reference Figure 3 The diagram shows a structural block diagram of an embodiment of an image detection model generalization performance evaluation method device according to the present invention. The specific details are as follows: The sample determination module 301 is used to determine at least one sample data set pair based on the reference image data set and the image data set to be evaluated, wherein the sample data set pair includes a reference sample data subset from the reference image data set and an evaluation sample data subset from the image data set to be evaluated. The distribution difference value determination module 302 is used to determine, for each of the at least one sample data set pair, global feature distribution difference information and local target feature distribution difference information between a reference sample data subset and an evaluation sample data subset; The attenuation difference value determination module 303 is used to determine detection performance attenuation difference information for each sample data set pair in the at least one sample data set pair. The detection performance attenuation difference information is the relative change rate of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset. The performance evaluation index determination module 304 is used to determine the comprehensive generalization performance evaluation index based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance decay difference information. The generalization performance information determination module 305 is used to determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index. In one embodiment, the sample determination module includes: The category label determination submodule is used to obtain the category labels of each data in the reference image dataset and the image dataset to be evaluated, respectively. The common category label determination submodule is used to determine at least one common category label based on the category labels of each data in the reference image dataset and the category labels of each data in the image dataset to be evaluated; The sample data pair determination submodule is used to determine at least one sample data pair in the reference image data set and the image data set to be evaluated based on the at least one common category label, wherein the category label of the reference sample data subset and the category label of the evaluation sample data subset in each sample data pair belong to the same common category label.
[0101] In one embodiment, the distribution difference value determination module includes: The feature distribution determination submodule is used to determine the full-image visual feature distribution and target instance feature distribution of the reference sample data subset, as well as the full-image visual feature distribution and target instance feature distribution of the evaluation sample data subset, respectively. The global feature distribution difference determination submodule is used to determine the global feature distribution difference based on the full-image visual feature distribution of the reference sample data subset and the full-image visual feature distribution of the evaluation sample data subset; wherein, the global feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in the full-image visual features; The local target feature distribution difference determination submodule is used to determine the local target feature distribution difference based on the target instance features of the reference sample data subset and the target instance feature distribution of the evaluation sample data subset, wherein the local target feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in terms of the target instance's own features.
[0102] In one embodiment, the performance evaluation metric determination module includes: The comprehensive difference value determination submodule is used to determine the comprehensive difference value based on the global feature distribution difference information and the local target feature distribution difference information; The comprehensive generalization performance evaluation index determination submodule is used to determine the comprehensive generalization performance evaluation index based on the comprehensive difference value and the detection performance attenuation difference information.
[0103] In one embodiment, the comprehensive generalization performance evaluation index determination submodule includes: An average resolution determination unit is used to determine the average resolution of images in the reference sample data subset and the evaluation sample data subset. The evaluation weight determination unit is used to determine the evaluation weight based on the comprehensive difference value and the average resolution; The comprehensive generalization performance evaluation index calculation unit is used to determine the comprehensive generalization performance evaluation index based on the evaluation weights and the detection performance attenuation difference information.
[0104] In one embodiment, the generalization performance information determination module includes: The business requirement acquisition submodule is used to acquire image detection business requirements; The benchmark threshold determination submodule is used to determine the generalization evaluation benchmark threshold based on the image detection service requirements. The performance level determination submodule is used to determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index and the generalization evaluation benchmark threshold.
[0105] The image detection model generalization performance evaluation method apparatus in this embodiment of the invention can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This embodiment of the invention does not impose specific limitations.
[0106] The image detection model generalization performance evaluation method apparatus in this embodiment of the invention can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment of the invention does not specifically limit the specific operating system used.
[0107] The image detection model generalization performance evaluation method and apparatus provided in this embodiment of the invention can achieve Figures 1 to 2 The various processes implemented by the image detection model generalization performance evaluation method device in the method embodiment will not be described again here to avoid repetition.
[0108] By identifying at least one sample dataset to support multi-scenario comparative evaluation, and combining global feature distribution difference information and local target feature distribution difference information, the distribution offset is quantified from both the full image and target instance dimensions to comprehensively characterize the sources of data differences. By identifying detection performance degradation difference information and correlating the two-dimensional distribution differences to construct a comprehensive evaluation index, a precise correlation between data distribution offset and performance degradation is achieved, avoiding the limitations of single performance comparison. Finally, generalization performance information is determined, transforming abstract indicators into intuitive level labels, facilitating rapid judgment of the model's generalization ability and improving the practicality of the evaluation results. This enables an objective and comprehensive evaluation of the generalization performance of image detection models, effectively improving the accuracy and reliability of judging the model's generalization ability in complex real-world environments.
[0109] This invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described embodiment of the image detection model generalization performance evaluation method and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0110] This invention also provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the various processes of the above-described embodiment of the image detection model generalization performance evaluation method and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0111] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0112] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0113] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0114] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
Claims
1. A method for evaluating the generalization performance of an image detection model, characterized in that, The method includes: Based on the reference image dataset and the image dataset to be evaluated, at least one sample dataset pair is determined, wherein the sample dataset pair includes a reference sample dataset subset derived from the reference image dataset and an evaluation sample dataset subset derived from the image dataset to be evaluated; For each of the at least one sample data set pairs, determine the global feature distribution difference information and the local target feature distribution difference information between the reference sample data subset and the evaluation sample data subset; For each sample data set pair in the at least one sample data set pair, determine the detection performance degradation difference information, wherein the detection performance degradation difference information is the relative rate of change of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset; Based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance degradation difference information, a comprehensive generalization performance evaluation index is determined. Based on the comprehensive generalization performance evaluation index, the generalization performance information of the image detection model is determined.
2. The image detection model generalization performance evaluation method according to claim 1, characterized in that, The step of determining at least one sample data set pair based on the reference image data set and the image data set to be evaluated includes: Obtain the category labels of each data point in the reference image dataset and the image dataset to be evaluated, respectively; Based on the category labels of each data point in the reference image dataset and the category labels of each data point in the image dataset to be evaluated, at least one common category label is determined; Based on the at least one shared category label, at least one sample data pair is determined in the reference image dataset and the image dataset to be evaluated, wherein the category label of the reference sample data subset and the category label of the evaluation sample data subset in each sample data pair belong to the same shared category label.
3. The image detection model generalization performance evaluation method according to claim 1, characterized in that, The determination of global feature distribution difference information and local target feature distribution difference information between the reference sample data subset and the evaluation sample data subset includes: The full-image visual feature distribution and target instance feature distribution of the reference sample data subset, and the full-image visual feature distribution and target instance feature distribution of the evaluation sample data subset are determined respectively. The global feature distribution difference is determined based on the full-image visual feature distribution of the reference sample data subset and the full-image visual feature distribution of the evaluation sample data subset; wherein, the global feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in the full-image visual features; Based on the target instance features of the reference sample data subset and the target instance feature distribution of the evaluation sample data subset, the local target feature distribution difference is determined, wherein the local target feature distribution difference refers to the degree of distribution offset between the reference sample data subset and the evaluation sample data subset in terms of the target instance's own features.
4. The image detection model generalization performance evaluation method according to claim 3, characterized in that, The full-image visual features include at least one of the overall color, texture, and structural features of the sample image; the target instance features include at least one of the shape, local texture, and detailed structural features of the target region cropped based on the target bounding box coordinates.
5. The image detection model generalization performance evaluation method according to claim 1, characterized in that, The step of determining a comprehensive generalization performance evaluation index based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance attenuation difference information includes: Based on the global feature distribution difference information and the local target feature distribution difference information, a comprehensive difference value is determined; Based on the comprehensive difference value and the detection performance attenuation difference information, a comprehensive generalization performance evaluation index is determined.
6. The image detection model generalization performance evaluation method according to claim 5, characterized in that, The step of determining the comprehensive generalization performance evaluation index based on the comprehensive difference value and the detection performance attenuation difference information includes: Determine the average resolution of the images in the reference sample data subset and the evaluation sample data subset; The evaluation weights are determined based on the overall difference value and the average resolution. Based on the evaluation weights and the detection performance attenuation difference information, a comprehensive generalization performance evaluation index is determined.
7. The image detection model generalization performance evaluation method according to claim 1, characterized in that, The step of determining the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index includes: Obtain image detection business requirements; Based on the image detection service requirements, determine the generalization evaluation benchmark threshold; The generalization performance information of the image detection model is determined based on the comprehensive generalization performance evaluation index and the generalization evaluation benchmark threshold.
8. A device for evaluating the generalization performance of an image detection model, characterized in that, The device includes: The sample determination module is used to determine at least one sample data set pair based on a reference image data set and an image data set to be evaluated, wherein the sample data set pair includes a reference sample data subset derived from the reference image data set and an evaluation sample data subset derived from the image data set to be evaluated; The distribution difference value determination module is used to determine, for each of the at least one sample data set pair, global feature distribution difference information and local target feature distribution difference information between a reference sample data subset and an evaluation sample data subset; The attenuation difference value determination module is used to determine detection performance attenuation difference information for each sample data set pair in the at least one sample data set pair. The detection performance attenuation difference information is the relative change rate of the performance data of the image detection model on the reference sample data subset and the performance data on the evaluation sample data subset. The performance evaluation index determination module is used to determine the comprehensive generalization performance evaluation index based on the global feature distribution difference information, the local target feature distribution difference information, and the detection performance decay difference information. The generalization performance information determination module is used to determine the generalization performance information of the image detection model based on the comprehensive generalization performance evaluation index.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the image detection model generalization performance evaluation method as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the image detection model generalization performance evaluation method as described in any one of claims 1-7.
