An image detection method, device, image detection equipment and storage medium

By acquiring the momentum projection feature set of the memory bank and homologous training sample pairs, the initial image detection model is iteratively optimized, which solves the problem of unstable accuracy in low-quality image detection and achieves more stable image authenticity judgment.

CN121033644BActive Publication Date: 2026-02-10BEIJING REALAI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511570348.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-10
Estimated Expiration
2045-10-30

AI Technical Summary

Technical Problem

Existing technologies for image detection, especially on social media and online platforms, often result in inconsistent accuracy for low-quality images, making it difficult to accurately determine whether an image is genuine or fake.

Method used

By acquiring the momentum projection feature set of the memory bank and homologous training sample pairs, the initial image detection model is iteratively optimized using quality analysis methods. This allows the model to learn the same true/false attribute features of high-quality and low-quality images, reducing quality interference and enhancing the stability of feature judgment.

Benefits of technology

It improves the accuracy and stability of image detection, ensuring that the model can judge whether the content is real or fake based on its authenticity, reducing overfitting, and enhancing the robustness of feature judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033644B_ABST
    Figure CN121033644B_ABST
Patent Text Reader

Abstract

The application discloses an image detection method and device, image detection equipment and a storage medium. The method comprises the following steps: acquiring momentum projection feature sets of a memory bank, homologous training sample pairs and corresponding true and false labels; inputting the homologous training sample pairs into an initial image detection model to obtain the prediction results of the homologous training samples, high-quality projection features of high-quality version images and low-quality projection features of low-quality version images respectively; performing quality analysis on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels and the momentum projection feature sets to obtain loss values of the homologous training samples; iteratively optimizing network parameters of the initial image detection model based on the loss values until the network parameters meet a preset threshold range to obtain a trained target image detection model; and detecting a to-be-detected image according to the target image detection model to obtain a target true and false label of the to-be-detected image, thereby improving the accuracy and stability of image detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection technology, and specifically to an image detection method, apparatus, device, and storage medium. Background Technology

[0002] With the rapid development of generative artificial intelligence (GenAI), it has become possible to synthesize extremely realistic images of faces, objects, and scenes with high quality and efficiency. While this technology is driving progress in visual content synthesis and creative expression, it also poses a significant risk of misuse.

[0003] Most existing fake image detection methods are based on deep learning models, relying on large-scale labeled data to learn discriminative features between real and fake images. Some studies have improved their discrimination ability by introducing auxiliary information such as noise analysis, frequency domain features, or texture patterns. These detection methods perform well on uncompressed, high-quality data. However, in real-world applications, especially on social media and online platforms, fake images often undergo multiple compression, transcoding, and editing operations in the propagation chain, leading to image quality degradation and a complex and varied form. This results in low-quality images, which deep learning models struggle to accurately determine whether.

[0004] Therefore, existing technologies suffer from inconsistent accuracy in image detection. Summary of the Invention

[0005] This invention provides an image detection method, apparatus, device, and storage medium, aiming to solve the problem of unstable accuracy of detection results in the prior art during image detection.

[0006] To address the aforementioned technical problems, the embodiments of the present invention provide the following technical solutions:

[0007] An image detection method, comprising:

[0008] Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true and false labels of the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image.

[0009] The same training sample pairs are input into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image.

[0010] Quality analysis is performed on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples;

[0011] Based on the loss value, the network parameters of the initial image detection model are iteratively optimized until the network parameters meet the preset threshold range, thus obtaining a fully trained target image detection model.

[0012] The target image detection model is used to detect the image under test, and the true and false labels of the target image under test are obtained.

[0013] Optionally, the step of performing quality analysis on the prediction result, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples includes:

[0014] The same-quality contrast loss, cross-quality contrast loss, and cross-quality alignment loss are calculated for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, respectively, to obtain the projection feature loss value of the homogeneous training samples;

[0015] The true / false classification loss value of the homologous training sample pair is determined based on the true / false labels and the prediction results;

[0016] The loss value is obtained by weighting the projection feature loss value and the true / false classification loss value.

[0017] Optionally, a quality-based comparison loss calculation is performed on the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, including:

[0018] The set of positive samples of the homologous training samples is determined based on the high-quality projection features, the low-quality projection features, and the true and false labels;

[0019] The first negative sample set of the homogeneous training samples is determined based on the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set.

[0020] Perform a comparison loss calculation on the positive sample set and the first negative sample set to determine the comparison loss value of the same source training sample pair.

[0021] Optionally, cross-quality contrast loss is calculated for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, including:

[0022] Based on the true and false labels, the high-quality projection features and the low-quality projection features are classified and combined to obtain a set of positive sample pair projection features.

[0023] The second negative sample set of the homologous training samples is determined based on the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set;

[0024] The cross-quality contrast loss is calculated by performing cross-quality contrast loss calculation on the projected feature set of the positive sample pair and the second negative sample set to obtain the cross-quality contrast loss value of the homologous training sample pair.

[0025] Optionally, cross-quality alignment loss is calculated for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, including:

[0026] A candidate comparison set is constructed based on the high-quality projection features, the low-quality projection features, and the momentum projection feature set.

[0027] A similarity analysis is performed on the high-quality projection features and the candidate comparison set to determine the high-quality similarity of the homologous training samples;

[0028] A similarity analysis is performed on the low-quality projection features and the candidate comparison set to determine the low-quality similarity of the homologous training samples;

[0029] Cross-quality alignment loss is calculated for the high-quality similarity and the low-quality similarity to obtain the cross-quality relationship distillation loss value of the homologous training sample pair.

[0030] Optionally, the step of iteratively optimizing the network parameters of the initial image detection model based on the loss value until the network parameters meet a preset threshold range to obtain a fully trained target image detection model includes:

[0031] The loss value is backpropagated using gradients to obtain the first update parameters;

[0032] Based on the first updated parameters, the network parameters of the initial image detection model are retrained iteratively until the network parameters meet the preset threshold range, thus obtaining the iterative network parameters.

[0033] Obtain the momentum network parameters of the memory bank;

[0034] The target network parameters are obtained by exponentially moving average the momentum network parameters based on the iterative network parameters, and the target image detection model is determined based on the target network parameters.

[0035] Optionally, obtaining the momentum projection feature set of the memory bank includes:

[0036] The momentum projection feature set is obtained based on a preset model for a preset number of samples. The momentum projection feature set includes high-quality real storage projection features, low-quality real storage projection features, high-quality false storage projection features, and low-quality false storage projection features.

[0037] The method further includes, after inputting the homologous training sample pairs into the initial image detection model:

[0038] The preset number of samples are updated based on the homologous training samples, and the corresponding number of the earliest existing historical samples are deleted to obtain the updated samples.

[0039] The momentum projection feature set is updated based on the updated samples.

[0040] An image detection device, comprising:

[0041] The sample acquisition module is used to acquire the momentum projection feature set, homologous training sample pairs and corresponding true and false labels of the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image.

[0042] The prediction module is used to input the same training sample pairs into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image.

[0043] The quality analysis module is used to perform quality analysis on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples.

[0044] The iterative optimization module is used to iteratively optimize the network parameters of the initial image detection model based on the loss value until the network parameters meet the preset threshold range, thereby obtaining a fully trained target image detection model.

[0045] The image detection module is used to detect the image to be tested according to the target image detection model to obtain the target true or false label of the image to be tested.

[0046] An image detection device includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the following steps:

[0047] Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true and false labels of the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image.

[0048] The same training sample pairs are input into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image.

[0049] Quality analysis is performed on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples;

[0050] Based on the loss value, the network parameters of the initial image detection model are iteratively optimized until the network parameters meet the preset threshold range, thus obtaining a fully trained target image detection model.

[0051] The target image detection model is used to detect the image under test, and the true and false labels of the target image under test are obtained.

[0052] A computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps in the image detection method described above.

[0053] In this embodiment of the invention, by setting up homologous training sample pairs, the image detection model can learn consistent features of the same true / false attribute under different quality levels. That is, the features of high-quality images and low-quality images are extracted separately to avoid feature extraction deviations caused by interference between images of different quality levels. This allows the true / false judgment result to be more based on the authenticity of the content itself rather than quality, thereby improving the model's robustness in judging the authenticity of images. Based on the momentum projection feature set in the memory bank, quality analysis can provide a global feature reference, reduce overfitting of the current batch of samples, enhance the stability of feature judgment, ensure the reliability of the target image detection model, and improve the accuracy and stability of image detection. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a scene diagram of an embodiment of the image detection system provided in this invention;

[0056] Figure 2 This is a schematic diagram of another embodiment of the image detection system provided in this invention.

[0057] Figure 3 This is a schematic flowchart of an embodiment of the image detection method provided by the present invention;

[0058] Figure 4 This is an overall architecture diagram of an embodiment of the image detection model provided by the present invention;

[0059] Figure 5 This is a schematic diagram of the structure of an embodiment of the image detection device provided in this invention;

[0060] Figure 6 This is a schematic diagram of an embodiment of the image detection device provided in this invention. Detailed Implementation

[0061] 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 embodiments of the present invention, and not all embodiments. 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.

[0062] In the following description, specific embodiments of the invention will be illustrated with reference to steps and symbols performed by one or more computers, unless otherwise stated. Therefore, these steps and operations will be referred to several times as being performed by a computer, and computer execution as referred to herein includes operations by a computer processing unit representing electronic signals of data in a structured format. This operation transforms the data or maintains it at a location in the computer's memory system, which can be reconfigured or otherwise alter the operation of the computer in a manner well known to those skilled in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principles of the invention described above are not intended to be limiting, and those skilled in the art will understand that many of the steps and operations described below can also be implemented in hardware.

[0063] The terms "module" or "unit" as used herein can be considered as software objects executing on the computing system. The different components, modules, engines, and services described herein can be considered as implementation objects on the computing system. The apparatus and methods described herein are preferably implemented in software, but can also be implemented in hardware, both of which are within the scope of this invention.

[0064] This invention provides an image detection method, apparatus, device, and storage medium.

[0065] Please see Figure 1 , Figure 1This is a schematic diagram of a scenario from an embodiment of the image detection system provided by the present invention. The image detection system may include a client 100 and a server 200, which are connected via a network. The server 200 integrates an image detection device and may be a platform server (i.e., a server loaded with a platform). Figure 1 In this embodiment of the invention, server 200 is mainly used to acquire momentum projection feature sets, homologous training sample pairs, and corresponding true / false labels from the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image. The homologous training sample pairs are input into the initial image detection model to obtain the prediction results of the homologous training samples, as well as the high-quality projection features of the high-quality version image and the low-quality projection features of the low-quality version image. Quality analysis is performed on the prediction results, high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature sets to obtain the loss value of the homologous training samples. The network parameters of the initial image detection model are iteratively optimized based on the loss value until the network parameters meet the preset threshold range to obtain a fully trained target image detection model. The target image detection model is used to detect the image to be tested to obtain the target true / false labels of the image to be tested.

[0066] In this embodiment of the invention, the server 200 can be a standalone server, a server network, or a server cluster. For example, the server 200 described in this embodiment includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing. In this embodiment of the invention, communication between the server and the client can be achieved through any communication method, including but not limited to, mobile communication based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), and Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP / IP Protocol Suite (TCP / IP) and User Datagram Protocol (UDP).

[0067] It is understood that the client 100 used in this embodiment of the invention can be understood as a client device. A client device includes both receiving and transmitting hardware, that is, a device with receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. Such a client device may include cellular or other communication devices, having a single-line display, a multi-line display, or a cellular or other communication device without a multi-line display. Specifically, the client 100 may be a desktop terminal or a mobile terminal, specifically a mobile phone, tablet computer, laptop computer, etc.

[0068] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include those that are more specific to this application. Figure 1 The number of more or fewer servers shown, or the server network connectivity relationships, for example... Figure 1 Only one server and two clients are shown in the diagram. It is understood that the image detection system may also include one or more other servers, and / or one or more clients connected to the server network, which is not limited here.

[0069] In some embodiments of the present invention, the working platform may be an enterprise office platform, such as WeChat for Business. Taking server 200 as an example, it may further include an enterprise office platform contact server, an enterprise office platform configuration management server, and a web management server. Enterprise users or developers can access the web management server using a web browser terminal to configure the field configuration information on the enterprise office platform configuration management server, and set and store the enterprise user information of enterprise employees of the enterprise office platform on the enterprise office platform contact server.

[0070] In addition, such as Figure 2 As shown, Figure 2 This is a schematic diagram of another embodiment of the image detection system provided in this invention. The image detection system may further include a storage terminal 300 for storing data, such as an object database. The object database stores object data, which may include application templates (such as approval templates, attendance templates, and other application templates), file data (such as Word files, Excel files, or PPT files, and other files in various formats), image data (such as JPG, PNG, BMP, and other images in various formats), and so on. Correspondingly, the object database may also be divided into multiple types of data, such as an application database, a file database, or an image database.

[0071] It should be noted that, Figure 1-2The schematic diagram of the image detection system shown is merely an example. The image detection system and scenario described in the embodiments of the present invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. As those skilled in the art will know, with the evolution of image detection systems and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.

[0072] The following detailed description is based on specific embodiments.

[0073] In this embodiment, the description will be from the perspective of an image detection device, which can be integrated into the server 200.

[0074] This invention provides an image detection method; please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic flowchart of an embodiment of the image detection method provided by the present invention, including:

[0075] S301: Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true and false labels of the memory bank, wherein each training sample pair includes a high-quality version image and a low-quality version image of the same sample image.

[0076] It should be noted that high-quality images may correspond to real or fake labels, and low-quality images may correspond to real or fake labels.

[0077] A feature memory is a dynamic mechanism used to maintain and update queues of sample features of different qualities and categories. It continuously updates and caches features through a momentum network to provide data support for subsequent quality analysis. Specifically, the feature memory is divided into four fixed-length sub-queues, storing projected features according to sample quality (high quality / low quality) and true / false categories.

[0078] A high-quality version of an image refers to the original image in a high-quality state without significant quality degradation processing (such as compression, noise interference, resolution reduction, etc.).

[0079] A low-quality image refers to a version of the original image that has undergone at least one quality degradation process, including but not limited to compression distortion, addition of Gaussian noise, reduced resolution, or blurring. It is the opposite of a high-quality image; both constitute a common sample pair used to train models to distinguish the coupling relationship between quality differences and true / false features.

[0080] S302: Input the same training sample pairs into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image.

[0081] It should be noted that the initial image detection model refers to a machine learning model that has not been trained or has just been initialized and is used to detect image-related attributes (such as authenticity and quality). It can also be an image classification model with a deep neural network structure, or a semi-finished model that has been trained. There are no restrictions here.

[0082] The prediction results specifically include the true / false category judgment output for each training sample, that is, the high-quality prediction label and low-quality prediction label predicted by the model for the high-quality version image and the low-quality version image, respectively.

[0083] High-quality projection features refer to the high-dimensional vector representation obtained by encoding a high-quality version of the image through the feature extraction layer in the initial image detection model.

[0084] Low-quality projection features refer to the high-dimensional vector representation obtained by encoding a low-quality version of an image using the same initial image detection model.

[0085] S303: Perform quality analysis on the prediction results, high-quality projection features, low-quality projection features, true and false labels, and momentum projection feature sets to obtain the loss value of the homogeneous training samples.

[0086] It should be noted that quality analysis refers to a comprehensive evaluation process that assesses the consistency between model predictions and true labels, the similarity between high-quality projected features, low-quality projected features and momentum projected features, and the impact of sample quality on classification confidence. Through quality analysis, misclassified samples caused by quality degradation can be identified, and the degree of interference of quality perturbations on the true / false judgment can be quantified, thereby quantifying the impact of quality perturbations on classification performance.

[0087] S304: Iteratively optimize the network parameters of the initial image detection model based on the loss value until the network parameters meet the preset threshold range, and obtain a fully trained target image detection model;

[0088] It should be noted that network parameters refer to learnable parameters such as weights and biases in each layer of the model. The optimization process is achieved through the backpropagation algorithm, which combines the loss value to update the parameters with gradients in order to minimize the prediction error.

[0089] The preset threshold range refers to the range within which the loss function converges to a stable interval or where key performance indicators such as model accuracy and recall reach preset conditions. It can be set according to actual needs and is not restricted here.

[0090] S305: Detect the image to be tested using the target image detection model to obtain the true and false labels of the target in the image to be tested.

[0091] It should be noted that the target true / false label is the model's final judgment result on the authenticity of the image under test, and the output is a binary label of "true" or "false".

[0092] In this embodiment of the invention, by setting up homologous training sample pairs, the image detection model can learn consistent features of the same true / false attribute under different quality levels. That is, the features of high-quality images and low-quality images are extracted separately to avoid feature extraction deviations caused by interference between images of different quality levels. This allows the true / false judgment result to be more based on the authenticity of the content itself rather than quality, thereby improving the model's robustness in judging the authenticity of images. Based on the momentum projection feature set in the memory bank, quality analysis can provide a global feature reference, reduce overfitting of the current batch of samples, enhance the stability of feature judgment, ensure the reliability of the target image detection model, and improve the accuracy and stability of image detection.

[0093] In one specific embodiment, in S301, a batch of samples is randomly sampled from the dataset to form a homogeneous training sample mini-batch. ;

[0094] in, and This represents the high-quality and low-quality versions of the same sample. Indicates the first The true and false labels for each sample, where 0 represents a "true" label and 1 represents a "false" label. For the first The index of each sample, where N is the number of samples.

[0095] Obtaining the momentum projection feature set of the memory bank includes: obtaining a preset number of momentum projection feature sets of samples based on a preset model, wherein the momentum projection feature set includes high-quality true memory projection features, low-quality true memory projection features, high-quality false memory projection features, and low-quality false memory projection features; wherein, after inputting the homologous training sample pairs into the initial image detection model, the method further includes: updating the preset number of samples based on the homologous training samples, and deleting the corresponding number of the earliest existing historical samples to obtain the updated samples; and updating the momentum projection feature set according to the updated samples.

[0096] It should be noted that the preset model includes image detection models, or it can be a specific deep neural network model, which is not limited here.

[0097] The memory is divided into four fixed-length sub-queues, storing projected features according to sample quality (high-quality HQ / low-quality LQ) and true / false category (true R / false F). High-quality true projected features refer to the projected features of stored high-quality true samples, low-quality true projected features refer to the projected features of stored low-quality true samples, high-quality false projected features refer to the projected features of stored high-quality false samples, and low-quality false projected features refer to the projected features of stored low-quality false samples.

[0098] During the training of the initial image detection model, a momentum encoder is also set in the initial image detection model, and the momentum encoder is updated synchronously with the data in the memory. In order to improve the update efficiency and feature representativeness of the momentum projection feature set, the momentum encoder extracts the projection features of the same training samples and adds them to the corresponding sub-queues according to quality and category. The first-in-first-out strategy is adopted to keep the length of the sub-queue constant.

[0099] In one specific embodiment, the sample After momentum encoder and projector head Extract projection features and add them to the memory according to quality and category respectively. In the sub-queues, a first-in-first-out (FIFO) strategy is used to maintain a constant length for each sub-queue. .

[0100] memory bank Divided into four fixed lengths Subqueues:

[0101]

[0102] Among them, subscript and These represent high-quality and low-quality samples, respectively, indicated by superscript. and These represent real and fake samples, respectively. The length and number of sub-queues. For high-quality, true-to-life storage projection features, For high-quality spurious storage projection features, This represents a low-quality true storage projection feature. This is a low-quality, spurious storage projection feature.

[0103] In this embodiment, the momentum projection feature set covers high-quality / low-quality real / fake memory projection features, effectively ensuring the feature representation of the memory bank, improving the coverage of images of different qualities and realism, and enhancing the model's ability to distinguish images. By updating a preset number of samples with homologous training samples and deleting the oldest historical samples, the freshness and relevance of the memory bank are maintained, allowing the momentum projection feature set to dynamically reflect the latest training state, improving the adaptability of model training and detection accuracy. Increasing the number of samples maintained to a fixed preset number avoids an excessively large memory bank and improves computational efficiency.

[0104] In one specific embodiment, in S302, the image detection model includes an online encoder. Classifier and projector head .

[0105] Specifically, the online encoder is defined as ;

[0106] in, For online encoders, For network parameters, Representing the real space of the image, W represents the height of the image, W represents the width of the image, and 3 represents the RGB channels of the image. The real vector space representing the encoded features. Dimensions of the encoded features.

[0107] The online encoder can be any backbone network, and the output feature representation is as follows: , For online encoding features, This is the input sample.

[0108] Define the classifier as ;

[0109] in, As a classifier, it outputs a binary classification probability prediction. , This represents the binary classification probability prediction value of the online encoded features.

[0110] In order to feature Mapped to the contrast learning space, the projection head is defined as ;

[0111] in, It is a two-layer multilayer perceptron that outputs projected features. And for Linear L2 normalization, The real vector space representing the projected features. is the dimension of the projected feature.

[0112] L2 normalization (also known as Euclidean normalization) is an operation that converts a vector into a unit vector.

[0113] In this embodiment, the projection features of any image can be directly determined through the image detection model. By performing quality annotation on the image, the obtained projection features are the projection features corresponding to the quality.

[0114] In one specific embodiment, in S303, quality analysis is performed on the prediction results, high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature sets to obtain the loss value of the same-source training samples. This includes: calculating the same-quality comparison loss, cross-quality comparison loss, and cross-quality alignment loss for the high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature sets, respectively, to obtain the projection feature loss value of the same-source training samples; determining the true / false classification loss value of the same-source training sample pair based on the true / false labels and prediction results; and performing a weighted calculation on the projection feature loss value and the true / false classification loss value to obtain the loss value.

[0115] It should be noted that the projection feature loss value refers to the loss calculated based on the comparison between the projection features of multiple samples and the momentum projection feature set, and is used to measure the similarity and distribution consistency between samples in the feature space.

[0116] The true / false classification loss value refers to the classification error calculated based on the difference between the model's prediction and the true label, and is used to measure the accuracy of the model in the true / false discrimination task.

[0117] In one specific embodiment, the image detection model includes an online encoder. and projector head , sample After online encoder and projector head ,get:

[0118] The set of projected features for high-quality samples is:

[0119] The set of projected features for low-quality samples is:

[0120] in, for High-quality projection features, For the sample The low-quality projection features.

[0121] Online encoder Extracting coding features After average pooling, the data are fed into the classifier. The prediction of true / false binary classification is obtained. , For the i-th sample The predicted probability value is true. For the i-th sample The probability prediction is true.

[0122] The weighted cross-entropy loss is used to calculate the true / false classification loss value of the samples. The calculation formula is as follows:

[0123]

[0124] in, Represents cross-entropy loss, For the first Sample For true real values, This is a weight hyperparameter used to balance the contribution of the two types of samples to the classification loss.

[0125] In this embodiment, firstly, by calculating the same-quality contrast loss for high-quality and low-quality projection features of the same-source training samples, the consistency of projection features within the same quality is enhanced; by calculating the cross-quality contrast loss, the discriminative power between projection features of different qualities is improved; by calculating the cross-quality alignment loss, the homology of projection features of different qualities of the same-source samples is maintained, and the representation effect of projection features is optimized; then, by calculating the true / false classification loss value, the model's ability to classify samples as true or false is strengthened; finally, by weighted fusion of projection feature loss value and true / false classification loss value, both feature representation quality and classification accuracy are taken into account, ensuring the reliability of the loss value.

[0126] Specifically, the same-quality contrast loss is calculated for high-quality projection features, low-quality projection features, true and false labels, and momentum projection feature sets. This includes: determining the positive sample set of the same-source training samples based on the high-quality projection features, low-quality projection features, and true and false labels; determining the first negative sample set of the same-source training samples based on the high-quality projection features, low-quality projection features, true and false labels, and momentum projection feature sets; and calculating the same-quality contrast loss for the positive sample set and the first negative sample set to determine the same-quality contrast loss value for the same-source training sample pair.

[0127] It should be noted that the positive sample set refers to the set of projected features in the same quality space from the same source training samples, and the true and false features are the same.

[0128] The first negative sample set refers to the set of projected features in the training samples and memory that are in the same quality space and whose true and false values ​​are opposite.

[0129] Specifically, for the first mini-batch of homologous training samples... Let there be a sample, and its quality type be... ,in, and These represent high quality and low quality, respectively.

[0130] Note the quality type in mini-batch. The set of all projective features is So, for the first For each sample, its positive sample set In the same mass space and with Samples with the same label are defined as:

[0131]

[0132] in, For the first Projected features of each sample For the first The true label value of each sample. For the first The true label value of each sample.

[0133] First negative sample set It consists of two parts: first, the outlier samples in the mini-batch within the same quality subspace; and second, samples from the memory bank that are similar to the original samples. Projected features in a sub-queue of a memory bank with the same quality but opposite true and false labels.

[0134] The first negative sample set is defined as:

[0135] in, To be consistent with the sample A sub-queue of the memory bank with the same quality type and opposite true / false labels.

[0136] Finally, compare the learning loss functions for the same quality. The definition is as follows:

[0137]

[0138] in, express transpose, Temperature hyperparameter For a set of projected features of high-quality samples, This is the set of projected features for low-quality samples. express It can only be the first in the same training sample mini-batch The projected feature vector of each sample, Indicates from Any "candidate comparison vector" in the dataset. Represents a set The cardinality, which is the number of elements in the set. express and Perform the dot product. The first set of positive samples Any projection feature in, This indicates a summation.

[0139] In this embodiment, by comparing samples within the same quality space, the model's ability to distinguish between true and false labels in data of the same quality can be enhanced: on the one hand, the features of positive samples with the same label within the same quality space are brought closer together, ensuring the compactness of features within data of the same quality; on the other hand, the features of negative samples with opposite labels within the same quality space (including mini-batch outliers and negative samples with the same quality in the memory) are pushed apart, avoiding interference between data of different quality. At the same time, by supplementing the diversity of negative samples through the memory, the model's generalization recognition performance of true and false labels for data of different quality is improved.

[0140] Furthermore, cross-quality contrast loss is calculated for high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature sets. This includes: classifying and combining high-quality and low-quality projection features according to true / false labels to obtain a positive sample pair projection feature set; determining a second negative sample set of homologous training samples based on the high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature set; and calculating cross-quality contrast loss for the positive sample pair projection feature set and the second negative sample set to obtain the cross-quality contrast loss value of homologous training sample pairs.

[0141] It should be noted that the positive sample pair projection feature set is the projection feature set of true and false pairs in the mini-batch of the same source training samples.

[0142] The second negative sample set consists of the same training sample mini-batch and the memory set of projected features, regardless of quality, but with opposite true and false representations.

[0143] Specifically, for the first mini-batch For each sample, its high-quality projection features and low-quality projection features are respectively... and Therefore, the projected feature set of positive sample pairs is: .

[0144] The second negative sample set consists of cross-quality features of outlier samples, including both outlier samples within the mini-batch and outlier cross-quality samples in memory. Defined as:

[0145]

[0146] in, For the label in the memory bank Furthermore, the quality type is a high-quality projection feature. For the label in the memory bank Furthermore, the quality type is low-quality projection feature.

[0147] Cross-mass comparison loss Defined as:

[0148]

[0149] in, For temperature hyperparameters, For positive sample pairs, project the feature set. The i-th positive sample pair projected features, For the second negative sample set Any negative sample projection feature Represents a set The base number.

[0150] In this embodiment, positive samples are used to force the alignment of high-quality and low-quality projection features of the same source sample with the projection feature set, thereby narrowing the representation distance between projection features of different qualities and improving the robustness of projection features to changes in input quality. The second negative sample set uses the cross-quality features of dissimilar samples of the same source training samples and the cross-quality features of dissimilar labels in the memory bank as negative samples, thereby widening the distance between the cross-quality projection features of dissimilar samples and strengthening inter-class discriminability. While considering quality, the computational quality of true and false results is also effectively guaranteed, improving the pertinence and effectiveness of cross-quality comparison learning.

[0151] Furthermore, cross-quality alignment loss is calculated for high-quality projection features, low-quality projection features, true and false labels, and momentum projection feature sets. This includes: constructing a candidate comparison set based on the high-quality projection features, low-quality projection features, and momentum projection feature sets; performing similarity analysis on the high-quality projection features and candidate comparison sets to determine the high-quality similarity of the same training samples; performing similarity analysis on the low-quality projection features and candidate comparison sets to determine the low-quality similarity of the same training samples; and calculating cross-quality alignment loss on the high-quality similarity and low-quality similarity to obtain the cross-quality relationship distillation loss value of the same training sample pairs.

[0152] It should be noted that for the projected features of a pair of high-quality samples and the projection features of the corresponding low-quality samples The similarity distribution between samples is calculated within their respective quality domains.

[0153] For high-quality samples Its candidate comparison set Defined as:

[0154]

[0155] in, These are the projected features in the memory that have been detected as true. These are the projected features in the memory that were detected as false.

[0156] The similarity relationship distribution of high-quality samples Defined as:

[0157]

[0158] in, Temperature over-parameter, For the first training sample set i High-quality projection features of each sample, Candidate comparison set The projection features of any sample in the dataset. For the candidate comparison set The Middle Projected features of each comparison sample.

[0159] Similarly, low-quality samples The candidate comparison set is also for Low-quality samples can be obtained. Similarity distribution for:

[0160]

[0161] in, For temperature hyperparameters, For the first training sample set i Low-quality projective features of individual samples.

[0162] To align low-quality samples with high-quality samples in terms of similarity, KL divergence is used to constrain the similarity distribution between them, achieving cross-quality alignment. Weighted summaries are applied to all pairs of high-quality and low-quality samples to obtain the final cross-quality distillation loss. :

[0163]

[0164] in, ( ) is the Kullback-Leibler divergence, used to measure the difference between two probability distributions.

[0165] Kullback-Leibler divergence, also known as KL divergence or relative entropy, is an indicator that measures the difference between two probability distributions.

[0166] The purpose of the candidate comparison set is to provide comparison samples for calculating the similarity distribution between samples, thereby constraining samples of different quality to maintain a consistent semantic relationship structure in the feature space during cross-quality relation distillation loss. Specifically, for high-quality samples and their corresponding low-quality samples, the candidate comparison set provides comparison samples within their respective quality domains. By calculating the similarity between the current sample and samples in the candidate comparison set, the similarity distributions of the high-quality and low-quality domains are constructed.

[0167] In this embodiment, the KL divergence constraint on the similarity distribution of low-quality samples and high-quality samples in the candidate comparison set is used to align the similarity relationship structure of low-quality samples with that of high-quality samples, thereby improving the consistency of the relationship representation of low-quality samples, realizing cross-quality relationship distillation, avoiding "rich information compromising with poor information", and improving the robustness of the model to samples of different quality.

[0168] Furthermore, after obtaining the true / false classification loss value, the same-quality comparison loss value, the cross-quality comparison loss value, and the cross-quality relationship distillation loss value, in order to determine the final loss value to guide the optimization of the initial image detection model, the final loss value is determined. The calculation formula is:

[0169]

[0170] in, , and It is a weighting coefficient, which is generally 0-1.

[0171] In one specific embodiment, in S304, the network parameters of the initial image detection model are iteratively optimized based on the loss value until the network parameters meet a preset threshold range, thereby obtaining a fully trained target image detection model. This includes: backpropagating the loss value using gradients to obtain first updated parameters; retraining the network parameters of the initial image detection model using feedback iteratively based on the first updated parameters until the network parameters meet a preset threshold range, thereby obtaining iterative network parameters; obtaining the momentum network parameters from the memory; obtaining the target network parameters by exponentially moving average the momentum network parameters based on the iterative network parameters; and determining the target image detection model based on the target network parameters.

[0172] It should be noted that the network parameters of the image detection model... , will lose Perform gradient backpropagation and update parameters. Until network parameters If the target threshold is met, the training process is considered complete.

[0173] However, to avoid bias in results caused by training samples, network parameters... Based on this, the momentum network parameters The update is performed, specifically, by updating the momentum network parameters using an exponential moving average. The update expression is as follows:

[0174]

[0175] in This is the momentum coefficient.

[0176] Finally, in determining the target image detection model, the final momentum network parameters were used. Based on this, that is, using momentum network parameters. To make predictions, input an image of any quality and the output will show the probability of false detections. .

[0177] In this embodiment, the network parameters are iteratively optimized until they meet the threshold range, ensuring that the model is fully trained and converges to a better state; the momentum network parameters are updated by exponential moving average to avoid the result bias caused by training samples and improve the model's generalization ability and prediction stability; finally, the momentum network parameters are used as the target model parameters to improve the accuracy and robustness of false detection probability.

[0178] In one specific embodiment, for a visual illustration of the structure of the image detection model, please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is an overall architecture diagram of an image detection model provided in this invention, which includes an online encoder. Classifier and projector head It can extract the projection features of the samples to facilitate the calculation of the corresponding loss value and feedback adjustment; through the momentum encoder Momentum projection head S and momentum classifier It can extract stable projection features and update the samples and projection features as the training samples are continuously updated, which not only ensures the final momentum network parameters. It maintains stability and can adapt to changes in new data in a timely manner, thereby improving the momentum network parameters. The reliability.

[0179] To facilitate better implementation of the image detection method provided in the embodiments of the present invention, the present invention also provides an apparatus based on the above-described image detection method. The meanings of the terms used are the same as in the image detection method described above, and specific implementation details can be found in the descriptions in the method embodiments.

[0180] Please see Figure 5 , Figure 5 This is a schematic diagram of an embodiment of an image detection device provided by the present invention, wherein the image detection device 500 may include:

[0181] The sample acquisition module 501 is used to acquire the momentum projection feature set of the memory bank, homologous training sample pairs and corresponding true and false labels. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image.

[0182] The prediction module 502 is used to input the same training sample pairs into the initial image detection model to obtain the prediction results of the same training samples and the high-quality projection features of the high-quality version image and the low-quality projection features of the low-quality version image, respectively.

[0183] The quality analysis module 503 is used to perform quality analysis on the prediction results, high-quality projection features, low-quality projection features, true and false labels and momentum projection feature sets, and obtain the loss value of the homogeneous training samples.

[0184] The iterative optimization module 504 is used to iteratively optimize the network parameters of the initial image detection model based on the loss value until the network parameters meet the preset threshold range, thereby obtaining a fully trained target image detection model.

[0185] The image detection module 505 is used to detect the image to be tested according to the target image detection model and obtain the target true or false label of the image to be tested.

[0186] This invention also provides an image detection device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of an embodiment of the image detection device provided in this invention. Specifically:

[0187] The image detection device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 6 The image detection device structure shown does not constitute a limitation on the image detection device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0188] The processor 601 is the control center of the image detection device. It connects various parts of the device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, thereby providing overall monitoring of the image detection device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operation of the storage medium, user interface, and application programs, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.

[0189] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store application programs required for operating the storage medium and at least one function (such as sound playback function, image playback function, etc.); the data storage area may store data created based on the use of the image detection device. In addition, the memory 602 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.

[0190] The image inspection device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 via a power management storage medium, thereby enabling functions such as charging, discharging, and power consumption management through the power management storage medium. The power supply 603 may also include one or more DC or AC power supplies, recharge storage media, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0191] The image detection device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0192] Although not shown, the image detection device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the image detection device loads the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 runs the application programs stored in the memory 602 to realize various functions, as follows:

[0193] Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true / false labels from the memory. Each training sample pair includes a high-quality version and a low-quality version of the same sample image. Input the homologous training sample pairs into the initial image detection model to obtain the prediction results of the homologous training samples, as well as the high-quality projection features of the high-quality version image and the low-quality projection features of the low-quality version image. Perform quality analysis on the prediction results, high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature set to obtain the loss value of the homologous training samples. Iteratively optimize the network parameters of the initial image detection model based on the loss value until the network parameters meet the preset threshold range to obtain a fully trained target image detection model. Detect the target image to be tested according to the target image detection model to obtain the target true / false labels of the target image to be tested.

[0194] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0195] Therefore, embodiments of the present invention provide a computer-readable storage medium storing a computer program thereon, the computer program being loaded by a processor to execute the steps of any of the image detection methods provided in the embodiments of the present invention. For example, the computer program, when loaded by a processor, can execute the following steps:

[0196] Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true / false labels from the memory. Each training sample pair includes a high-quality version and a low-quality version of the same sample image. Input the homologous training sample pairs into the initial image detection model to obtain the prediction results of the homologous training samples, as well as the high-quality projection features of the high-quality version image and the low-quality projection features of the low-quality version image. Perform quality analysis on the prediction results, high-quality projection features, low-quality projection features, true / false labels, and momentum projection feature set to obtain the loss value of the homologous training samples. Iteratively optimize the network parameters of the initial image detection model based on the loss value until the network parameters meet the preset threshold range to obtain a fully trained target image detection model. Detect the target image to be tested according to the target image detection model to obtain the target true / false labels of the target image to be tested.

[0197] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0198] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0199] Since the computer program stored in the computer-readable storage medium can execute the steps of any of the image detection methods provided in the embodiments of the present invention, the beneficial effects that any of the image detection methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0200] The foregoing has provided a detailed description of an image detection method, apparatus, device, and storage medium provided by embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An image detection method, characterized in that, include: Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true and false labels of the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image. The same training sample pairs are input into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image. Quality analysis is performed on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples; Based on the loss value, the network parameters of the initial image detection model are iteratively optimized until the network parameters meet the preset threshold range, thus obtaining a fully trained target image detection model. The target image detection model is used to detect the image under test to obtain the target true / false labels of the image under test. The step of performing quality analysis on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples includes: The same-quality contrast loss, cross-quality contrast loss, and cross-quality alignment loss are calculated for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, respectively, to obtain the projection feature loss value of the homogeneous training samples; The true / false classification loss value of the homologous training sample pair is determined based on the true / false labels and the prediction results; The loss value is obtained by weighting the projection feature loss value and the true / false classification loss value.

2. The image detection method according to claim 1, characterized in that, The calculation of the same-quality comparison loss is performed on the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, including: The set of positive samples of the homologous training samples is determined based on the high-quality projection features, the low-quality projection features, and the true and false labels; The first negative sample set of the homogeneous training samples is determined based on the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set. Perform a comparison loss calculation on the positive sample set and the first negative sample set to determine the comparison loss value of the same source training sample pair.

3. The image detection method according to claim 1, characterized in that, The calculation of cross-mass contrast loss for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set includes: Based on the true and false labels, the high-quality projection features and the low-quality projection features are classified and combined to obtain a set of positive sample pair projection features. The second negative sample set of the homologous training samples is determined based on the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set; The cross-quality contrast loss is calculated by performing cross-quality contrast loss calculation on the projected feature set of the positive sample pair and the second negative sample set to obtain the cross-quality contrast loss value of the homologous training sample pair.

4. The image detection method according to claim 1, characterized in that, The calculation of cross-quality alignment loss for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set includes: A candidate comparison set is constructed based on the high-quality projection features, the low-quality projection features, and the momentum projection feature set. A similarity analysis is performed on the high-quality projection features and the candidate comparison set to determine the high-quality similarity of the homologous training samples; A similarity analysis is performed on the low-quality projection features and the candidate comparison set to determine the low-quality similarity of the homologous training samples; Cross-quality alignment loss is calculated for the high-quality similarity and the low-quality similarity to obtain the cross-quality relationship distillation loss value of the homologous training sample pair.

5. The image detection method according to claim 1, characterized in that, The step of iteratively optimizing the network parameters of the initial image detection model based on the loss value until the network parameters meet a preset threshold range, thereby obtaining a fully trained target image detection model, includes: The loss value is backpropagated using gradients to obtain the first update parameters; Based on the first updated parameters, the network parameters of the initial image detection model are retrained iteratively until the network parameters meet the preset threshold range, thus obtaining the iterative network parameters. Obtain the momentum network parameters of the memory bank; The target network parameters are obtained by exponentially moving average the momentum network parameters based on the iterative network parameters, and the target image detection model is determined based on the target network parameters.

6. The image detection method according to claim 1, characterized in that, The acquisition of the momentum projection feature set of the memory bank includes: The momentum projection feature set is obtained based on a preset model for a preset number of samples. The momentum projection feature set includes high-quality real storage projection features, low-quality real storage projection features, high-quality false storage projection features, and low-quality false storage projection features. The method further includes, after inputting the homologous training sample pairs into the initial image detection model: The preset number of samples are updated based on the homologous training samples, and the corresponding number of the earliest existing historical samples are deleted to obtain the updated samples. The momentum projection feature set is updated based on the updated samples.

7. An image detection device, characterized in that, include: The sample acquisition module is used to acquire the momentum projection feature set, homologous training sample pairs and corresponding true and false labels of the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image. The prediction module is used to input the same training sample pairs into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image. The quality analysis module is used to perform quality analysis on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples. The iterative optimization module is used to iteratively optimize the network parameters of the initial image detection model based on the loss value until the network parameters meet the preset threshold range, thereby obtaining a fully trained target image detection model. The image detection module is used to detect the image to be tested according to the target image detection model to obtain the target true / false label of the image to be tested; The step of performing quality analysis on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples includes: The same-quality contrast loss, cross-quality contrast loss, and cross-quality alignment loss are calculated for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, respectively, to obtain the projection feature loss value of the homogeneous training samples; The true / false classification loss value of the homologous training sample pair is determined based on the true / false labels and the prediction results; The loss value is obtained by weighting the projection feature loss value and the true / false classification loss value.

8. An image detection device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the following steps: Obtain the momentum projection feature set, homologous training sample pairs, and corresponding true and false labels of the memory bank. Each training sample pair includes a high-quality version image and a low-quality version image of the same sample image. The same training sample pairs are input into the initial image detection model to obtain the prediction results of the same training samples, the high-quality projection features of the high-quality version image, and the low-quality projection features of the low-quality version image. Quality analysis is performed on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples; Based on the loss value, the network parameters of the initial image detection model are iteratively optimized until the network parameters meet the preset threshold range, thus obtaining a fully trained target image detection model. The target image detection model is used to detect the image under test to obtain the target true / false labels of the image under test. The step of performing quality analysis on the prediction results, the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set to obtain the loss value of the homogeneous training samples includes: The same-quality contrast loss, cross-quality contrast loss, and cross-quality alignment loss are calculated for the high-quality projection features, the low-quality projection features, the true and false labels, and the momentum projection feature set, respectively, to obtain the projection feature loss value of the homogeneous training samples; The true / false classification loss value of the homologous training sample pair is determined based on the true / false labels and the prediction results; The loss value is obtained by weighting the projection feature loss value and the true / false classification loss value.

9. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps of the image detection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for training neural network and image recognition method

    CN116362313A