A training method of a low-quality image representation model

CN118397388BActive Publication Date: 2026-10-27CHANGSHA RES INST OF MINING & METALLURGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410420560.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2026-10-27
Estimated Expiration
2044-04-09

AI Technical Summary

Technical Problem

[0004]首先,传统训练方法对大量标注数据的依赖使得其在低质图像场景下应用困难

Benefits of technology

[0052]本发明的低质图像表征模型训练方法采用了自适应GAN随机生成策略来构建自监督训练数据集,以实现基于对比学习的大规模无监督训练。该方法不仅在提高模型的鲁棒性和泛化性方面具有重要意义,而且确保了训练过程的高效性。所述自适应GAN随机生成策略利用预训练的图像生成器GAN,通过动态调整噪声向量,生成原始图像的近似低质图像,极大地提高了训练样本的多样性,为模型的全面训练提供了更加丰富的数据基础,使得表征模型能够更好地适应各种复杂场景和条件,从而提高了其在真实世界中的鲁棒性和泛化性。本发明的训练方法还通过自适应机制,在生成近似图像时自动过滤掉噪声图像,减少了训练数据中的无效样本,提升了训练数据集的质量,使得构建的训练数据集更具代表性和有效性,降低了模型学习的噪声干扰,使其更加专注于学习更有意义的样本,从而进一步提升了模型训练的高效性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004782309180000071
    Figure BDA0004782309180000071
  • Figure BDA0004782309180000083
    Figure BDA0004782309180000083
  • Figure BDA0004782309180000084
    Figure BDA0004782309180000084
Patent Text Reader

Abstract

The application provides a training method of a low-quality image representation model, and belongs to the technical field of visual representation learning, which effectively solves the challenge that current low-quality images are difficult to represent. The training method comprises the following steps: constructing a self-supervised training data set by using an adaptive GAN random generation strategy, and dividing the training data set into a training set and a validation set; constructing an initial low-quality image representation model; inputting the constructed training set into the low-quality image representation model to output the feature representation of the image; calculating the training loss of the low-quality image representation model according to the feature representation of the image, and optimizing the model parameters; inputting the constructed validation set to verify the performance of the optimized low-quality image representation model, and saving the model; iteratively optimizing the low-quality image representation model; and selecting the best model from the saved models as the final low-quality image representation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of visual representation learning technology, and particularly relates to a training method for an image representation model. Background Technology

[0002] The continuous improvement of camera pixels and image resolution has led to the widespread availability of high-quality images. However, due to the uncertainty of daily shooting environments, we also face the problem of a large influx of low-quality images. These low-quality images differ from images previously affected by various noise interferences, such as cropping, rotation, partial magnification, translation, Gaussian noise, and salt-and-pepper noise. They may be generated under uncontrollable conditions encountered during the shooting process, such as shooting through objects or shooting while moving. Although low-quality images exhibit image distortion, blurring, and foreground occlusion, they have sufficient applications in the real world, including image similarity retrieval and image source tracing.

[0003] Machine learning plays a crucial role in current image representation learning. With the rise of deep learning technology, image representation models based on deep neural networks have achieved remarkable results in processing high-quality or noisy images, such as image classification and object detection. However, traditional training methods face a series of challenges when dealing with large-scale low-quality images.

[0004] First, the reliance of traditional training methods on large amounts of labeled data makes them difficult to apply in low-quality image scenarios. Because low-quality images have relatively low image quality, involving issues such as blurred foreground and background, distortion, and partial occlusion, obtaining a sufficient number of high-quality labels using traditional annotation methods becomes extremely difficult, thus making it difficult for supervised training methods to achieve ideal results in such environments.

[0005] Secondly, the unique challenges of low-quality images, such as blurring and partial occlusion, can easily lead to distortion in the feature representation of image models obtained through traditional training methods. This distortion not only affects the quality of image representation but also weakens the model's robustness to low-quality images, making it difficult to adapt to the diversity and complexity of the real world in applications. Summary of the Invention

[0006] This invention provides a training method for a low-quality image representation model, which not only enables large-scale unsupervised training, but also effectively improves the generalization and robustness of the representation model. The model trained by this method can effectively learn high-quality feature representations from low-quality images, thus effectively solving the current challenge of representing low-quality images.

[0007] The technical solution of the present invention is as follows:

[0008] A method for training a low-quality image representation model includes the following steps:

[0009] S100. An adaptive GAN random generation strategy is used to construct a self-supervised training dataset, and the self-supervised training dataset is divided into a training set and a validation set.

[0010] S200. Construct an initial low-quality image representation model consisting of a deep encoder, a hash layer network, and a binary network.

[0011] S300: Input the training set constructed in step S100 into the low-quality image representation model, and output the feature representation of the image;

[0012] S400. Based on the feature representation of the obtained image, calculate the training loss of the low-quality image representation model, optimize the model parameters, and obtain the optimized low-quality image preservation model.

[0013] The validation set constructed from S500 and input S100 validates the performance of the low-quality image representation model optimized by S400, and the model is saved.

[0014] S600, repeat steps S300, S400 and S500 to iteratively optimize the low-quality image representation model until the conditions for termination of optimization are met;

[0015] S700 selects the best-performing model from the saved models as the final low-quality image representation model.

[0016] The process involves several steps: step S100 prepares the training data; step S200 constructs the initial model; steps S300, S400, S500, and S600 are the formal training processes; and step S700 is the final model selection process. Before formal model training, the hyperparameters and optimizer are set, including the number of training epochs and the learning step size.

[0017] Furthermore, the specific steps for constructing the self-supervised training dataset in step S100 include:

[0018] S110. Given the original image, generate an approximate low-quality image similar to the original image using a pre-trained GAN-based image generator.

[0019] S120. Divide the original image and the near low-quality image into samples, construct self-supervised training sample units, and form a complete self-supervised training dataset from all the self-supervised training sample units.

[0020] Furthermore, step S110 specifically includes:

[0021] S111. Given an original dataset consisting of original images, a pre-trained image semantic feature extractor, and a pre-trained GAN-based image generator;

[0022] S112. Select an original image from the original dataset and use the image semantic feature extractor to extract the semantic feature vector of the image;

[0023] S113. Set the noise vector of the image generator and combine it with the semantic feature vector obtained in step S112 to control the generation of a low-quality image that approximates the original image;

[0024] S114. Using a similarity measurement method, calculate the similarity between the generated low-quality image and the original image, and compare it with a preset similarity threshold. If the similarity meets the requirements, the generated approximate low-quality image is retained for subsequent steps. Otherwise, dynamically adjust the value of the noise vector input to the GAN and continue to generate a low-quality image that is similar to the original image, and continue to compare it with the similarity threshold. Repeat this process until the similarity meets the requirements.

[0025] S115. For each original image in the original dataset, repeat steps S112, S113, and S114 to generate the corresponding low-quality image.

[0026] Furthermore, step S120 specifically includes:

[0027] S121. Select the approximately low-quality images generated in step S110 without repeating them, and designate them as anchor samples;

[0028] S122. From the original dataset, find the original image corresponding to the anchor sample selected in step S121 and define it as a positive sample;

[0029] S123. Find other images besides the positive sample from the original dataset and designate them as negative samples;

[0030] S124. A self-supervised training sample unit is constructed from the above set of anchor samples, positive samples, and negative samples.

[0031] S125. Repeat steps S121, S122, S123 and S124 until all the approximate low-quality images generated in S110 have been selected. Generate a self-supervised training sample unit through each approximate low-quality image. All these self-supervised training sample units constitute a complete self-supervised training dataset.

[0032] Furthermore, the initial image representation model consists of a deep encoder, a hash layer network, and a binary network, wherein,

[0033] The deep encoder uses a feature pyramid network to encode deep features of the image, wherein the bottom feature extractor uses ResNet-50 as the backbone network.

[0034] The hash layer network is implemented by a fully connected layer;

[0035] The binary network employs a deterministic nonlinear binary function, such as the Sign function.

[0036] Furthermore, step S300 specifically includes:

[0037] S310. Input the images in the training set one by one into the depth encoder for depth encoding to obtain the image depth feature representation;

[0038] S320. Input the image depth feature representation into a hash layer network to obtain a real-valued hash code;

[0039] S330. Given a binary network constructed from a nonlinear binary function, the obtained real-valued hash code is input into the binary network, and the binary network outputs a quantized binary hash code. Due to the non-differentiability of the nonlinear binary function, gradients cannot be propagated during backpropagation to optimize model parameters. Therefore, this invention employs a mature pass-through estimator technique to approximate surrogate differentiation, thereby achieving the goal of optimizing model parameters.

[0040] Furthermore, step S310 specifically includes:

[0041] S311. Input an image and open the image handle, and generate a PILImage object. Then, perform image transformation operations on the PILImage object to abstract the high-dimensional feature data of the image in the supervised training sample unit.

[0042] S312. Input the high-dimensional feature data into the feature pyramid network's bottom-level feature extractor to extract image features, and then output the feature map after convolution calculation.

[0043] S313. The feature map is subjected to nearest neighbor upsampling calculation to obtain a larger feature map, and the upsampled feature map is passed down.

[0044] S314. Perform a convolution operation on the feature map output in step S312 to reduce its dimensionality and output a low-dimensional feature map. Add this low-dimensional feature map to the feature map obtained in step S313 to obtain a fused feature map. Finally, perform convolution and flattening operations on the fused feature map to obtain the image depth feature representation.

[0045] Furthermore, the specific steps in step S500 for verifying the performance of the optimized low-quality image representation model include:

[0046] S510. The binary hash representation of the positive samples in all self-supervised training sample units in the validation set is obtained by deep encoding and hash code quantization, and is written into the database as a retrieval item in index order.

[0047] S520. Select an anchor sample from the self-supervised training sample unit in the validation set, and obtain the binary hash code of the anchor sample after learning it through the low-quality image representation model.

[0048] S530. Calculate the cosine similarity between the binary hash code of the anchor sample and the binary hash code in the database constructed in step S410. At this time, a cosine similarity array is obtained. Sort the array from high to low similarity.

[0049] S540. Find the image index of the positive sample corresponding to the query item in the sorted similarity array, and take the reciprocal of the index to get the accuracy of this nearest neighbor search task.

[0050] S550. Select another anchor sample from the self-supervised training sample unit in the validation set as the query term. Repeat steps S520, S530 and S540 to calculate the accuracy of the next nearest neighbor retrieval task. Continue in this manner until all anchor samples in the self-supervised training sample unit in the validation set have been calculated. Finally, take the average of the retrieval accuracies of all anchor samples as the performance of the image representation model.

[0051] Beneficial effects:

[0052] The low-quality image representation model training method of this invention employs an adaptive GAN random generation strategy to construct a self-supervised training dataset, enabling large-scale unsupervised training based on contrastive learning. This method not only significantly improves the robustness and generalization of the model but also ensures the efficiency of the training process. The adaptive GAN random generation strategy utilizes a pre-trained image generator (GAN) to dynamically adjust the noise vector, generating approximate low-quality images of the original image. This greatly increases the diversity of training samples, providing a richer data foundation for comprehensive model training. This allows the representation model to better adapt to various complex scenarios and conditions, thereby improving its robustness and generalization in the real world. Furthermore, the training method of this invention automatically filters out noisy images when generating approximate images through an adaptive mechanism, reducing invalid samples in the training data, improving the quality of the training dataset, making the constructed training dataset more representative and effective, reducing noise interference in model learning, and allowing it to focus more on learning more meaningful samples, thus further improving the efficiency of model training. Attached Figure Description

[0053] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0054] In the attached diagram:

[0055] Figure 1 This is a flowchart illustrating step S210, depth encoding, of a low-quality image representation model training method according to an embodiment of the present invention. Detailed Implementation

[0056] The technical solution of the present invention will be clearly and completely described below. 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.

[0057] Example 1

[0058] The training method for a low-quality image representation model according to the present invention includes steps (1) to (7), wherein step (1) is to construct a dataset, step (2) is to construct an initial model, steps (3), (4), (5) and (6) are to train the formal model, and step (7) is to select the final model:

[0059] (1) An adaptive GAN random generation strategy is used to construct a self-supervised training dataset, and the self-supervised training dataset is divided into a training set and a validation set.

[0060] (1.1) Given an original image, generate an approximate low-quality image similar to the original image by using a pre-trained GAN-based image generator;

[0061] (1.1.1) Given the original dataset MS COCO, which contains images represented as X = {x1, x2, ..., x...} N}, where N represents the length of the dataset;

[0062] (1.1.2) Given a pre-trained VGG-16-based semantic feature extractor, then without re-selecting the original image x... i In this case, the feature extractor described above is used to extract the original image x. i semantic vectors s i ;

[0063] (1.1.3) Randomly construct the noise vector r i The specific steps are as follows:

[0064] ①Given the mean u = 0 and variance σ = 1 for the sample;

[0065] ② Given a normally distributed random number generator GEN(u, σ), use this random number generator to generate random numbers that follow a given mean and variance;

[0066] ③ Repeat steps ① and ②, sampling len = 64 random numbers to form a random vector r. i .

[0067] (1.1.4) Given a pre-trained GAN-based image generator, input the original image x from step (1.1.2). i The corresponding semantic vector s i The random vector r constructed in step (1.1.3) i To the image generator, generate the original image x i Approximate low-quality image x′ i Its formal representation is: x′ i =GAN(s) i r i );

[0068] (1.1.5) Calculate the original image x i With approximate image x′ i Cosine similarity between them = cos(x) i , x′ i );

[0069] (1.1.6) Determine if similarity satisfies the preset similarity threshold interval: δ < similarity < δ + 0.1, where δ is the similarity threshold, with a value of 0.7. When the above triangle inequality holds, the approximate image x′ i This is the low-quality image required by this method; if the condition is not met, repeat steps (1.1.3), (1.1.4), (1.1.5), and (1.1.6).

[0070] (1.1.7) Select another original image x from the original dataset. j (j≠i), and generate the corresponding low-quality image x′. j This process continues until all images in the original dataset have been selected.

[0071] (1.2) Divide the original image and the near low-quality image into samples, construct self-supervised training sample units, and make up a complete self-supervised training dataset from all the self-supervised training sample units;

[0072] (1.2.1) Take the original image x selected in step (1.1) i A low-quality image x′ generated from the original image. iAnd other images in the original dataset besides the selected original image {x1, x2, ..., x...} i-1 x i+1 , ..., x N The properties of the samples are defined separately. Low-quality images x′ are defined. i As anchor samples, define the original image x i As positive samples, define the other images {x1, x2, ..., x} besides the selected original image. i-1 x i+1 , ..., x N All samples are negative samples, and all negative samples form a negative sample set. Finally, the positive sample, anchor sample, and negative sample sets are combined into a self-supervised sample unit λ. i ={x i , x′ i x1, x2, ..., x i-1 x i+1 , ..., x N Here, the subscripts distinguish which samples are positive pairs and which are negative pairs. For example, when i = 5, x5 is a positive sample, x′5 is an anchor sample, and x1, x2, x3, x4, x6, ..., x N All are negative samples; x′5 and x5 are positive sample pairs; x′5 and x1, x′5 and x2, x′5 and x3, x′5 and x4, x′5 and x6, ..., x′5 and x N Both are negative sample pairs;

[0073] (1.2.2) Select another original image x without repetition. j Images (j≠i) are designated as positive samples, and their corresponding low-quality images are also designated as positive samples. All other images in the original dataset except for the positive samples are designated as negative samples to construct the second supervised training sample unit. This process continues until all images in the original dataset have been selected.

[0074] (1.2.3) Multiple self-supervised training sample units λ i A self-supervised training dataset λ of length N is formed. i ={λ1, λ2, ..., λ N}

[0075] (1.3) Divide the self-supervised training dataset into two parts: training set and validation set.

[0076] λ i ={λ1, λ2, ..., λ N The first P self-supervised training sample units are divided into the training set, and the remaining NP self-supervised training sample units are divided into the validation set.

[0077] (2) Construct a low-quality image representation model consisting of a deep encoder, a hash layer network, and a binary network, where:

[0078] The deep encoder uses a feature pyramid network to encode deep features of the image, and the bottom feature extractor uses ResNet-50 as the backbone network.

[0079] The hash layer network is implemented using fully connected layers and is designed to transform deep features into compact and efficient hash codes;

[0080] Binary networks employ deterministic nonlinear binary functions;

[0081] Before the model training officially begins, the training epochs need to be set to 300, and the learning step size to l. r The size is 10e-4, and Adam is chosen as the optimizer.

[0082] (3) Input the dataset constructed in step (1) into the low-quality image representation model, and output the feature representation of the image. See [link to relevant documentation]. Figure 1 The specific steps are as follows:

[0083] (3.1) Deep encoding: The i-th self-supervised training sample unit λ i The image x in (1≤i≤P) i 、x′ i and the negative sample set {x1, x2, ..., x} i-1 x i+1 , ..., x N A subset of images {x} with a batch_size of n in} k x k+1 , ..., x k+n-1 The images (k≥1 and k+n-1≤N) are sequentially input into the preprocessor for preprocessing. Then, the preprocessed images are input into the feature pyramid network to learn image depth features. The specific steps are as follows:

[0084] (3.1.1) Perform image reading operations on all images, i.e., open the image handle and generate a PILImage object {y i y′ i , ..., y k y k+1 , ..., y k+n-1};

[0085] (3.1.2) Perform image transformation operations on the PILImage object. The transformation operations, in sequence, include: changing the image channel specifications, normalization, reconstructing the data distribution, and adjusting the size of the PILImage object, wherein:

[0086] ① Convert channel specifications: Convert a NumPy data type with specifications of (height, width, channel) to a Tensor data type with specifications of (channel, height, width);

[0087] ② Normalization: Divide the values ​​of each dimension, such as height, width, and channel, by 255 to normalize the values ​​to [0, 1].

[0088] ③ Reconstruct the data distribution: Given an input mean of [0.485, 0.456, 0.406] and a standard deviation of [0.229, 0.224, 0.225], reconstruct the numerical distribution to the interval (-1, 1);

[0089] ④ Adjust image size: Adjust the PILImage object to the standard 224×224 size;

[0090] (3.1.3) After the above preprocessing operations, high-dimensional feature data {f} of the images in the supervised training sample units can be abstracted. i f′ i f k f k+1 , ..., f k+n-1}

[0091] (3.1.4) Transfer the high-dimensional feature data {f i f′ i f k f k+1 , ..., f k+n-1 The inputs are sequentially fed into a pre-trained ResNet-50-based feature extraction network to extract features. Specifically, the input {f} i f′ i f k f k+1 , ..., f k+n-1 Convolution calculations are performed with convolution kernels of different sizes, namely 3×3, 5×5, and 7×7 kernels. The output of the last residual layer in the convolutional blocks conv3, conv4, and conv5 is then:

[0092]

[0093] (3.1.5) Feature Map After 2x upsampling calculation, the result was obtained Then pass it down.

[0094] (3.1.6) Lateral connectivity feature fusion, the specific steps are as follows:

[0095] ① The feature map C output in step (3.1.4) 3 C4 and C 5 Perform a 1×1 convolution computation on each to reduce dimensionality, and output C. 3′ C 4′ and C 5′ ;

[0096] ②C 5′ The feature map P output by step (3.1.5) 5 P obtained after 2x upsampling 5′ To merge, that is, to directly add them together. Next, C 4′ The feature map P obtained from the previous layer 6 P obtained after 2x upsampling 6′ To merge, that is, to directly add them together. Then C 3′ and the feature map P obtained from the previous layer 7 To merge, that is, to directly add them together.

[0097] ③P 8 Perform a 3×3 convolution to obtain the final feature {z}. i , z′ i , z k , z k+1 , ..., z k+n-1}

[0098] (3.2) Hash Calculation

[0099] Depth features {z i , z′ i , z k , z k+1 , ..., z k+n-1 The input is fed into a hash layer network constructed from fully connected layers, and the output is a 64-bit real-valued hash code {h}. i , h′ i h k h k+1 , ..., h k+n-1};

[0100] (3.3) Binarization

[0101] The real-valued hash code {h} encoded by the depth encoder i , h′ i h k h k+1 , ..., h k+n-1 The input is fed into a nonlinear binary network, and the output is a binary vector depth representation {b}. i , b′ i b k bk+1 , ..., b k+n-1}, where the nonlinear binary function is expressed as:

[0102]

[0103] Here, sign(·) represents the sign function, which can convert real-valued features... The mapping is -1 or 1. Represents the eigenvector h i The j-th real digit in the middle, b represents a binary vector consisting of 0s and 1s i The j-th binary bit.

[0104] (4) Based on the feature representation of the obtained image, calculate the training loss of the initial low-quality image representation model, optimize the model parameters, and obtain the optimized low-quality image representation model. The specific steps are as follows:

[0105] (4.1) Calculate anchor sample b′ i Positive sample b i and the negative sample set {b k b k+1 , ..., b k+n-1 The contrast loss of} is formalized as follows:

[0106]

[0107] Where τ is the temperature coefficient, and its value is 95.

[0108] (4.2) Calculate the real values ​​of the negative sample set before quantization: h{ k h k+1 , ..., h k+n-1} Hash code and quantized binary hash code {b k b k+1 , ..., b k+n-1 The mean squared error of} is the quantization loss, which is formally represented as follows:

[0109]

[0110] (4.3) Calculate the distribution loss of the quantized negative sample set:

[0111]

[0112] (4.4) The contrast loss calculated in step (4.1), the quantization loss calculated in step (4.2), and the distribution loss calculated in step (4.3) are weighted and averaged, and the formal representation is as follows:

[0113] L=αL1+βL2+γL3

[0114] Where α+β+γ=1.

[0115] (4.5) Calculate the loss gradient and backpropagate it in the anchor sample representation model to update the network parameters, thus obtaining the optimized low-quality image representation model, which is formally expressed as follows:

[0116]

[0117] Among them, l r The learning step size is 10e-4; θ q This represents the parameters of the image representation model.

[0118] (4.6) Select the negative sample set {x1, x2, ..., x} i-1 x i+1 , ..., x P For another batch of images with a batch size of n, repeat steps (3.1) to (3.3) and (4.1) to (4.5). After traversing the current self-supervised training sample unit, select the next self-supervised training sample unit λ. i+1 This process continues until all self-supervised training sample units λ in the training set are selected, resulting in an iteratively optimized low-quality image representation model.

[0119] (5) Input the validation set constructed in step (1) to validate the performance of the low-quality image representation model obtained in step (4) after iterative optimization, and save the model. The specific steps are as follows:

[0120] (5.1) Select the positive samples {x} from all self-supervised training sample units in the validation set. N-P x N-P+1 , ..., x N The binary hash representation {b} obtained after deep encoding and hash code quantization calculation N-P b N-P+1 , ..., b N}, and write them into the database as search terms in index order;

[0121] (5.2) Select an anchor sample x′ from the self-supervised training sample units in the validation set. i After feature representation, the binary hash code b′ of the anchor sample is obtained. i and b′ i Use it as a query term to retrieve the nearest neighbor sample from the database constructed in step (5.1) above;

[0122] (5.3) b′ iThe cosine similarity is calculated uniformly with the binary hash codes in the database constructed in step (5.1), resulting in a cosine similarity array arr[similarity]. N-P similarity N-P+1 , ..., similarity N Sort the array according to its similarity from highest to lowest. The sorted array may be arr[similarity]. N-P+7 similarity N , ..., similarity N-P ];

[0123] (5.4) Find query item b′ i The corresponding positive sample b i The image index idx in the sorted similarity array is taken as the reciprocal of the index, which is 1 / idx, and is the precision of the nearest neighbor search task.

[0124] (5.5) Select another anchor sample from the self-supervised training sample unit in the validation set as the query term, and repeat steps (5.2), (5.3), and (5.4) above to calculate the accuracy of the next nearest neighbor retrieval task. This process continues until NP nearest neighbor retrievals are completed, and the representation model is saved. The average accuracy of the representation model in the nearest neighbor retrieval task is the performance of the model, which can be formalized as:

[0125] precision=(1 / idx1+1 / idx2+…+1 / idx N-P ) / NP;

[0126] (6) Repeat steps (3), (4) and (5) to iteratively optimize the low-quality image representation model until 300 rounds of formal training are completed;

[0127] (7) Select the best-performing representation model from all the saved representation models, that is, the representation model with the highest average accuracy in the nearest neighbor retrieval task, as the final low-quality image representation model.

[0128] At this point, the training of the low-quality image representation model is complete.

[0129] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A training method for a low-quality image representation model, characterized in that, Includes the following steps: S100, Adaptive GAN A self-supervised training dataset is constructed using a random generation strategy, and the self-supervised training dataset is divided into a training set and a validation set. The specific steps for constructing the self-supervised training dataset include: S111. Given an original dataset consisting of original images, a pre-trained image semantic feature extractor, and a pre-trained GAN-based image generator; S112. Select an original image from the original dataset and use the image semantic feature extractor to extract the semantic feature vector of the image; S113. Set the noise vector of the image generator and combine it with the semantic feature vector obtained in step S112 to control the generation of a low-quality image that is similar to the original image. S114. Using a similarity measurement method, calculate the similarity between the generated low-quality image and the original image, and compare it with a preset similarity threshold: if the similarity meets the requirements, the generated approximate low-quality image is retained for subsequent steps; otherwise, it is dynamically adjusted. GAN The input noise vector is used to generate a low-quality image that is similar to the original image. This image is then compared with a similarity threshold, and the process is repeated until the similarity meets the requirements. S115. For each original image in the original dataset, repeat steps S112, S113, and S114 to generate a corresponding approximate low-quality image. S121. Select the approximately low-quality images generated in step S115 without repeating them, and designate them as anchor samples; S122. From the original dataset, find the original image corresponding to the anchor sample selected in step S121 and define it as a positive sample; S123. Find other images besides the positive sample from the original dataset and designate them as negative samples; S124. A self-supervised training sample unit is constructed from the above set of anchor samples, positive samples, and negative samples. S125. Repeat steps S121, S122, S123 and S124 until all the approximate low-quality images generated in step S115 have been selected. Generate a self-supervised training sample unit through each approximate low-quality image. All these self-supervised training sample units constitute a complete self-supervised training dataset. S200. Construct an initial low-quality image representation model consisting of a deep encoder, a hash layer network, and a binary network. S300: Input the training set constructed in step S100 into the low-quality image representation model, and output the feature representation of the image; S400. Based on the feature representation of the obtained image, calculate the training loss of the low-quality image representation model and optimize the model parameters to obtain the optimized low-quality image representation model. The validation set constructed from S500 and input S100 validates the performance of the low-quality image representation model optimized by S400, and the model is saved. S600, repeat steps S300, S400 and S500 to iteratively optimize the low-quality image representation model until the conditions for termination of optimization are met; S700 selects the best-performing model from the saved models as the final low-quality image representation model.

2. The training method for the low-quality image representation model according to claim 1, characterized in that, The initial low-quality image representation model consists of a deep encoder, a hash layer network, and a binary network, wherein, The depth encoder uses a feature pyramid network to encode deep features in the image, wherein the bottom-level feature extractor employs... ResNet-50 As a backbone network; The hash layer network is implemented by a fully connected layer; The binary network employs a deterministic nonlinear binary function.

3. The training method for the low-quality image representation model according to claim 1, characterized in that, Step S300 specifically includes: S310. Input the images in the training set one by one into the depth encoder for depth encoding to obtain the image depth feature representation; S320. Input the image depth feature representation into a hash layer network to obtain a real-valued hash code; S330. Given a nonlinear binary function, construct a binary network, input the obtained real-valued hash code into the binary network, and output the quantized binary hash code from the binary network.

4. The training method for the low-quality image representation model according to claim 3, characterized in that, Step S310 specifically includes: S311. After inputting the image, open its handle and generate... PILImage object, then to PILImage The object performs image transformation operations and abstracts high-dimensional feature data of the images in the self-supervised training sample units; S312. Input the high-dimensional feature data into the feature pyramid network's bottom-level feature extractor to extract image features, and then output the feature map after convolution calculation. S313. The feature map is subjected to nearest neighbor upsampling calculation to obtain a larger feature map, and the upsampled feature map is passed down. S314. Perform a convolution calculation on the feature map output in step S312 to reduce the dimensionality and output a low-dimensional feature map. Add the low-dimensional feature map and the feature map obtained in step S313 to obtain the fused feature map. Finally, perform convolution calculation and flattening on the fused feature map to obtain the image depth feature representation.

5. The training method for the low-quality image representation model according to claim 1, characterized in that, The specific steps in step S500 to verify the performance of the optimized low-quality image representation model include: S510. Input the positive samples from all self-supervised training sample units in the validation set into the binary hash representation of the low-quality image representation model, and write it into the database as a retrieval item in index order. S520. Select an anchor sample from the self-supervised training sample unit in the validation set, and obtain the binary hash code of the anchor sample after learning it through the low-quality image representation model. S530. Calculate the cosine similarity between the binary hash code of the anchor sample and the binary hash code in the database constructed in step S510. At this time, a cosine similarity array is obtained. Sort the array from high to low similarity. S540. Find the image index of the positive sample corresponding to the anchor sample in the sorted similarity array, and take the reciprocal of the index as the accuracy of this nearest neighbor search task. S550. Select another anchor sample from the self-supervised training sample unit in the validation set as the query term, and repeat steps S520, S530 and S540 to calculate the accuracy of the next nearest neighbor retrieval task. Continue in this manner until all anchor samples in the self-supervised training sample unit in the validation set have been calculated. Finally, take the average of the retrieval accuracies of all anchor samples as the performance index of the image representation model.

Citation Information

Patent Citations

  • Large-scale data retrieval method based on Hash algorithm combined with generative adversarial network

    CN113204522A

  • Image segmentation method combined with superpixel and multi-scale hierarchical feature recognition

    US11847811B1