Image quality identification method and device, electronic equipment and storage medium
By constructing image-text pairs and fine-tuning the visual language model, the target training model is generated, which solves the problem of rapid recognition and high cost of image quality recognition in the field of autonomous driving, realizes image quality diagnosis and recognition in the field of autonomous driving, reduces costs and improves efficiency. .
Patent Information
- Application Number
- CN202410858686.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-11
AI Technical Summary
In the field of autonomous driving technology, existing technologies are difficult to quickly and accurately screen and identify images with poor image quality, resulting in long model training iteration cycles and high manual screening costs. The construction of high-quality annotated data sets requires a large amount of manual annotation costs.
By obtaining image quality description information of unlabeled images based on the first visual language model, constructing image-text pairs, fine-tuning the second visual language model, and generating target training models for feature extraction and tag library construction, and then feature matching of the images to be recognized and recognition to achieve automatic recognition of image quality.
Image quality can be quickly identified without manual annotation of data, which reduces costs, improves image recognition efficiency, and enables image quality diagnosis and recognition in the field of autonomous driving.
Smart Images

Figure CN118762224A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving technology, and specifically to an image quality recognition method, device, electronic device, and storage medium. Background Art
[0002] In the field of autonomous driving, deep learning models are often used to perceive images and identify dynamic and static objects, enabling autonomous driving. Training better perception models requires a large amount of high-quality annotated data. Images are typically extracted from video files captured by a vehicle, which can suffer from quality issues such as blur, occlusion, and lens dirt. Filtering these poor-quality images often requires the training of a targeted image quality model. Image quality models require the accumulation of a large number of annotated samples. Collecting these samples from various scenarios takes a long time, resulting in lengthy model iteration cycles. This makes it difficult to quickly and accurately filter out images of poor quality, leading to high costs for subsequent manual screening. Once poor-quality images are added to the training set, they can lead to problems such as inaccurate model recognition.
[0003] Related technologies are all based on supervised learning, relying heavily on pre-constructing a high-quality dataset to train a dedicated model for quality diagnosis. However, constructing a high-quality dataset requires significant manual labeling costs and the accumulation of samples; otherwise, the model cannot be trained. This often results in various fields being unable to quickly perform image quality diagnosis and identification. Often, only after arriving at the labeling platform do labelers report that an image cannot be labeled and needs to be discarded. Constructing a dataset often requires algorithm personnel to perform extensive data mining and screening before it can be obtained, resulting in high costs. Therefore, how to complete image quality diagnosis and identification in the field of autonomous driving without manual labeling and quickly achieve screening results has become a pressing issue for those skilled in the art. Summary of the Invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides an image quality identification method, device, electronic device and storage medium.
[0005] In a first aspect, the present application provides an image quality identification method, the method comprising:
[0006] Obtaining N image quality description information corresponding to the N unlabeled images based on a first visual language model; wherein the first visual language model is used to extract text from the unlabeled images;
[0007] constructing image-text pairs based on the unlabeled images and the image quality description information, and using N of the image-text pairs as a domain dataset;
[0008] Fine-tune and retrain the second visual language model based on the domain dataset to obtain a target training model; wherein the second visual language model is used to extract features from the input data;
[0009] Building a label library based on the N unlabeled images based on the target training model;
[0010] Extracting features of the image to be identified based on the target training model to obtain target features corresponding to the image to be identified;
[0011] Performing a search and match in the tag library according to the target feature to obtain a target similarity between the target feature and the tag library;
[0012] The image quality of the image to be identified is identified according to the target similarity and a preset threshold.
[0013] Optionally, constructing a label library according to the N unlabeled images based on the target training model includes:
[0014] Performing feature extraction on the unlabeled image based on the target training model to obtain a first image feature;
[0015] Entering the first image feature into a vector database to obtain a retrieval database;
[0016] Acquire target text data; wherein the target text data is text used to indicate that image quality is abnormal;
[0017] Searching the target text data in the search database to determine a target sample set corresponding to the target text data;
[0018] The label library is constructed based on the target sample set.
[0019] Optionally, searching the retrieval database based on the target text data to determine a target sample set corresponding to the target text data includes:
[0020] Searching the search database based on the target text data to obtain a first result set;
[0021] sorting the first result set according to relevance to the target text data to obtain a second result set;
[0022] The top K results in the second result set are taken as the target sample set corresponding to the target text data; wherein K is less than N.
[0023] Optionally, constructing the label library based on the target sample set includes:
[0024] Performing clustering processing on the target sample set to obtain cluster center features;
[0025] Using the cluster center feature as the target label corresponding to the target sample set;
[0026] The tag library is constructed based on all the target tags.
[0027] Optionally, after sorting the first result set according to relevance to the target text data to obtain a second result set, and before taking the top K results in the second result set as the target sample set corresponding to the target text data, the method further includes:
[0028] Obtain target screening information;
[0029] Filter the results in the second result set based on the target filtering information to obtain a third result set;
[0030] Accordingly, taking the top K results in the second result set as the target sample set corresponding to the target text data includes:
[0031] The top K results in the third result set are taken as the target sample set corresponding to the target text data.
[0032] Optionally, constructing an image-text pair based on the unlabeled image and the image quality description information includes:
[0033] Determining whether the image quality description information includes a negative word;
[0034] If the image quality description information includes a negative word, negating the negative word to obtain positive expression description information corresponding to the image quality description information;
[0035] The image-text pair is constructed based on the unlabeled image and the positive expression description information.
[0036] Optionally, fine-tuning and retraining the second visual language model based on the domain dataset to obtain a target training model includes:
[0037] Obtaining the number of layers of the second visual language model;
[0038] Set the target learning rate for each target layer based on the layer-by-layer learning rate decay strategy;
[0039] The second visual language model is fine-tuned and retrained based on the domain dataset and different target learning rates.
[0040] Optionally, identifying the image quality of the image to be identified according to the target similarity and a preset threshold includes:
[0041] Obtaining the preset threshold;
[0042] If the target similarity is less than or equal to the preset threshold, identifying the image to be identified as a normal image;
[0043] If the target similarity is greater than the preset threshold, the image to be identified is identified as an abnormal image.
[0044] Optionally, after identifying the image to be identified as an abnormal image, the method further includes:
[0045] Obtaining a target label corresponding to the target similarity;
[0046] The category of the image to be identified is marked as the target label.
[0047] Optionally, after marking the category of the image to be identified as the target label, the method further includes:
[0048] The image to be identified is added to the label library as an abnormal image sample.
[0049] Optionally, obtaining the preset threshold includes:
[0050] Taking the first central features of the top K results in the second result set;
[0051] Calculating a first similarity between each image feature in the second result set and the first central feature respectively;
[0052] Taking the second central features of the bottom K results in the second result set;
[0053] Calculating a second similarity between each image feature in the second result set and the second central feature respectively;
[0054] The preset threshold is determined according to the first similarity and the second similarity.
[0055] Optionally, after obtaining the second central features of the bottom K results in the second result set, the method further includes:
[0056] Pair the top K results with the bottom K results in the second result set one by one to obtain K positive and negative sample pairs;
[0057] Training an initial contrastive learning model based on the positive and negative sample pairs to obtain a trained target contrastive learning model;
[0058] The image quality of the image to be identified is identified according to the target contrast learning model.
[0059] In a second aspect, the present application provides an image quality identification device, the device comprising:
[0060] an acquisition module, configured to acquire N image quality description information corresponding to N unlabeled images based on a first visual language model; wherein the first visual language model is used to perform text extraction on the unlabeled images;
[0061] An image-text pair construction module is configured to construct an image-text pair based on the unlabeled image and the image quality description information, and use N of the image-text pairs as a domain dataset;
[0062] A training module, configured to fine-tune and retrain the second visual language model based on the domain dataset to obtain a target training model; wherein the second visual language model is configured to extract features from input data;
[0063] A label library construction module, configured to construct a label library based on the target training model and the N unlabeled images;
[0064] A feature extraction module is used to extract features of the image to be identified based on the target training model to obtain target features corresponding to the image to be identified;
[0065] A retrieval module is used to perform a search and match in the tag library according to the target feature, and obtain a target similarity between the target feature and the tag library;
[0066] The recognition module is used to recognize the image quality of the image to be recognized based on the target similarity and a preset threshold.
[0067] In a third aspect, the present application provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0068] Memory for storing computer programs;
[0069] The processor is used to implement the steps of the image quality identification method described in any one of the embodiments of the first aspect when executing the program stored in the memory.
[0070] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the image quality identification method as described in any one of the embodiments of the first aspect.
[0071] Beneficial effects of this application:
[0072] The method provided in an embodiment of the present application obtains N image quality description information corresponding to N unlabeled images based on a first visual language model; wherein the first visual language model is used to perform text extraction on the unlabeled images; constructs image-text pairs based on the unlabeled images and the image quality description information, and uses the N image-text pairs as a domain data set; fine-tunes and retrains the second visual language model based on the domain data set to obtain a target training model; wherein the second visual language model is used to extract features from input data; constructs a label library based on the N unlabeled images based on the target training model; performs feature extraction on the image to be identified based on the target training model to obtain target features corresponding to the image to be identified; performs search and matching in the label library based on the target features to obtain the target similarity between the target features and the label library; and identifies the image quality of the image to be identified based on the target similarity and a preset threshold. The method can obtain image quality description information of the unlabeled image based on the first visual language model, and construct a picture-text pair, and train a target training model based on the picture-text pair. The target training model can construct a label library based on the unlabeled image, so that feature extraction can be performed on the unlabeled image to be identified, and the target feature of the image to be identified is obtained. The target similarity is obtained based on the target feature and the label library, and then the image quality of the image to be identified is identified according to the target similarity and a preset threshold. The method does not need to use manually annotated image data as training data, and can quickly identify the collected image, thereby improving the image recognition efficiency while reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0074] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0075] Figure 1 A system architecture diagram of an image quality identification method provided in one embodiment of the present application;
[0076] Figure 2 A flowchart of an image quality identification method provided in one embodiment of the present application;
[0077] Figure 3 A flowchart of an image quality identification method based on a multimodal large model provided in one embodiment of the present application;
[0078] Figure 4 A schematic diagram of data-driven automatic iteration provided in one embodiment of the present application;
[0079] Figure 5 A schematic structural diagram of an image quality identification device provided in one embodiment of the present application;
[0080] Figure 6 A schematic structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0081] The following will describe the embodiments of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand the other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for the purpose of illustrating the present application and are not intended to limit the scope of protection of the present application.
[0082] The first embodiment of the present application provides an image quality recognition method, which can be applied to Figure 1 The system architecture shown includes at least an image acquisition module 101 and an image quality identification module 102, which establish a communication connection. Specifically, the system architecture can be a vehicle with an autonomous driving function, wherein the type of vehicle is not limited, and can be, for example, a pure electric vehicle, a hybrid vehicle, or a fuel cell vehicle.
[0083] Next, based on the system architecture, the image quality recognition method is described in detail. Figure 2 , the image quality identification method includes:
[0084] Step 201 : Obtain N pieces of image quality description information corresponding to N unlabeled images based on a first visual language model; wherein the first visual language model is used to extract text from the unlabeled images.
[0085] The visual language model can obtain key information of unlabeled images and generate image quality description information that is highly consistent with the image content, i.e., a text description. In this embodiment, the first visual language model is illustrated by the DeepSeek-VL model. Of course, the first visual language model can also be other multimodal large models without limitation. The unlabeled images can be images collected by the visual sensors of the autonomous vehicle (such as monocular sensors, binocular sensors, front-view cameras, surround-view cameras, etc.). Based on the first visual language model, the image quality description information corresponding to each unlabeled image can be obtained. The image quality description information can be text information used to characterize the image quality, such as blur, occlusion, glare, etc. Specifically, the first visual language model's understanding of the unlabeled image can be obtained through a specific prompt word Prompt. Prompt can be, for example, "Is the image blurry?", "Is the image lens dirty or occluded?", etc. Wherein, N is a positive integer representing the number of unlabeled images collected from the autonomous vehicle's visual sensor. For example, it can be any number such as 100, 1000, or 10,000, without limitation.
[0086] Step 202: construct image-text pairs based on the unlabeled images and image quality description information, and use N image-text pairs as a domain dataset.
[0087] In one embodiment, a picture-text pair is constructed based on an unlabeled image and image quality description information, including: determining whether the image quality description information includes a negative word; if the image quality description information includes a negative word, negating the negative word to obtain positive expression description information corresponding to the image quality description information; and constructing a picture-text pair based on the unlabeled image and the positive expression description information.
[0088] In this embodiment, the image quality description information obtained through the prompt words may include negative words. To facilitate the understanding of the visual language model, it is possible to first determine whether the image quality description information includes negative words. If it includes negative words, the negative words are negated to obtain the positive expression description information corresponding to the image quality description information. For example, if the image quality description information is "no image blur is found", it is negated to become "the image is clear", thereby facilitating the semantic understanding of the visual language model.
[0089] Step 203 : fine-tune and retrain the second visual language model based on the domain dataset to obtain a target training model; wherein the second visual language model is used to extract features from the input data.
[0090] The second visual language model can be a large multimodal model, such as the Chinese CLIP model, which supports Chinese and English text-to-image retrieval and feature extraction. The Chinese CLIP model is trained by adding 200 million Chinese image-text pairs to the original CLIP (400 million image-text pairs), and is highly effective in understanding the content of the image itself. The Chinese CLIP model can be fine-tuned and retrained based on domain datasets to obtain the target training model. In other words, the target training model can be the fine-tuned Chinese CLIP model.
[0091] In one embodiment, the second visual language model is fine-tuned and retrained based on the domain dataset to obtain a target training model, including: obtaining the number of layers of the second visual language model; setting a target learning rate for each target layer based on a layered learning rate decay strategy; and fine-tuning and retraining the second visual language model based on the domain dataset and different target learning rates.
[0092] In this embodiment, the training learning rate can be reduced to 3e-5, and a layer-wise learning rate decay strategy is used, with different learning rates for different layers. The top layer learning rate is the largest, and then decreases layer by layer. The second visual language model is fine-tuned and retrained based on the domain dataset and different target learning rates. Of course, training can be further performed using data enhancement strategies such as random erase, rotation, shear, and brightness. This can retain general feature capabilities while better adapting to domain data.
[0093] Step 204: construct a label library based on the target training model and the N unlabeled images.
[0094] In one embodiment, a label library is constructed based on N unlabeled images based on a target training model, including: extracting features of the unlabeled images based on the target training model to obtain a first image feature; entering the first image feature into a vector database to obtain a retrieval database; obtaining target text data; wherein the target text data is text used to characterize abnormalities in image quality; searching in the retrieval database based on the target text data to determine a target sample set corresponding to the target text data; and constructing a label library based on the target sample set.
[0095] In this embodiment, feature extraction is performed on a large number of unlabeled images based on a fine-tuned Chinese CLIP model to obtain the first image features corresponding to each unlabeled image. The backbone structure of the fine-tuned Chinese CLIP model can be ViT-L-14-336, that is, its network structure adopts ViT-L and the input resolution is 336. 336 is chosen here because its high resolution allows for the acquisition of more image information. The first image features are entered into a vector database, such as the Milvus vector database (Milvus vector database is an open source database that supports vector storage and retrieval), and the vector database with the entered data is used as a retrieval database. The target text data can be the Chinese and English names of image quality in the field of autonomous driving, such as blur, occlusion, and glare, which characterize image quality. Blur includes raindrops, lens fogging, and lens dirt. Occlusion includes raindrop occlusion, dirt occlusion, and object occlusion. Glare includes ground reflection and direct light. The target text data is searched in the retrieval database to determine the target sample set corresponding to the target text data, and the label library is constructed based on the target sample set.
[0096] In one embodiment, a target sample set corresponding to the target text data is determined based on a search in a retrieval database, including: searching in a retrieval database based on the target text data to obtain a first result set; sorting the first result set according to its relevance to the target text data to obtain a second result set; taking the top K results in the second result set as the target sample set corresponding to the target text data; wherein K is less than N.
[0097] In this embodiment, the first result set obtained by searching the retrieval database based on the target text data can be sorted according to its relevance to the target text data to obtain a second result set. The top K results in the second result set are taken as the target sample set corresponding to the target text data. K can be 100 without limitation. The obtained target sample set can be regarded as a positive example.
[0098] In one embodiment, building a label library based on a target sample set includes: clustering the target sample set to obtain cluster center features; using the cluster center features as target labels corresponding to the target sample set; and building a label library based on all target labels.
[0099] In this embodiment, DBScan clustering can be performed on each target sample set to obtain the cluster center feature corresponding to the target sample set. The purpose of clustering here is to obtain the central feature of K samples and reduce the impact of individual sample features that deviate from the center on the results. The central feature obtained after clustering is the feature representation of the target sample set. This central feature can be used as the target label for the target sample set and stored in the Milvus vector database. A label library is constructed based on all target labels.
[0100] In one embodiment, after sorting the first result set according to its relevance to the target text data to obtain the second result set, and before taking the top K results in the second result set as the target sample set corresponding to the target text data, the method also includes: obtaining target screening information; and screening the results in the second result set based on the target screening information to obtain a third result set.
[0101] Correspondingly, taking the top K results in the second result set as the target sample set corresponding to the target text data includes: taking the top K results in the third result set as the target sample set corresponding to the target text data.
[0102] In this embodiment, in order to ensure that all target sample sets meet the search label, manual screening can be performed after obtaining the second result set. For example, target screening information is obtained. The target screening information can be manual screening information. The second result set is screened based on the manual screening information to obtain a third result set. Accordingly, when taking the top K results, the top K results in the third result set can be taken as the target sample set corresponding to the target text data.
[0103] Step 205 : extracting features of the image to be identified based on the target training model to obtain target features corresponding to the image to be identified.
[0104] By performing feature extraction on the image to be identified based on the Chinese CLIP model, the target features corresponding to the image to be identified can be obtained.
[0105] Step 206: perform a search and match in the tag library according to the target feature to obtain the target similarity between the target feature and the tag library.
[0106] By retrieving the constructed tag library based on the target feature, the target similarity between the target feature and the tag library can be obtained. The target similarity can include multiple, for example, it can include all similarities between the target feature and all tags in the tag library, for example, including the first similarity between the first tag, the second similarity between the target feature and the second tag in the tag library, the third similarity between the target feature and the third tag in the tag library, and so on, without limitation.
[0107] Step 207 : Identify the image quality of the image to be identified based on the target similarity and a preset threshold.
[0108] The method can obtain image quality description information of the unlabeled image based on the first visual language model, and construct a picture-text pair, and train a target training model based on the picture-text pair. The target training model can construct a label library based on the unlabeled image, so that feature extraction can be performed on the unlabeled image to be identified, and the target feature of the image to be identified is obtained. The target similarity is obtained based on the target feature and the label library, and then the image quality of the image to be identified is identified according to the target similarity and a preset threshold. The method does not need to use manually annotated image data as training data, and can quickly identify the collected image, thereby improving the image recognition efficiency while reducing costs.
[0109] In one embodiment, the image quality of the image to be identified is identified based on the target similarity and a preset threshold, including: obtaining the preset threshold; if the target similarity is less than or equal to the preset threshold, identifying the image to be identified as a normal image; if the target similarity is greater than the preset threshold, identifying the image to be identified as an abnormal image.
[0110] In this embodiment, if the target similarity is less than or equal to the preset threshold, that is, no similarity exceeds the preset threshold, the image to be identified is regarded as a normal image. If the target similarity is greater than the preset threshold, that is, the similarity with the image with image quality problems is high, the image to be identified is regarded as an abnormal image.
[0111] In one embodiment, after identifying the image to be identified as an abnormal image, the method further includes: obtaining a target label corresponding to the target similarity; and marking the category of the image to be identified as the target label.
[0112] In this embodiment, after identifying the image to be identified as an abnormal image, the target label corresponding to the target similarity greater than the preset threshold can also be obtained, and the abnormal category of the image to be identified can be marked as the target label. For example, if the similarity corresponding to the image occlusion is greater than the preset threshold, the image to be identified is determined to be an abnormal image, and the category of the image to be identified is marked as occlusion.
[0113] In one embodiment, after marking the category of the image to be identified as a target label, the method further includes: adding the image to be identified as an abnormal image sample to a label library.
[0114] In this embodiment, after marking the category of the image to be identified as the target label, the image to be identified can also be added to the label library as an abnormal image sample, thereby realizing online learning of the model and continuously updating the model with newly added data to achieve the effect of automatic iteration.
[0115] In one embodiment, obtaining a preset threshold includes: taking the first central features of the top K results in the second result set; calculating the first similarity between each image feature in the second result set and the first central feature; taking the second central features of the bottom K results in the second result set; calculating the second similarity between each image feature in the second result set and the second central feature; and determining the preset threshold based on the first similarity and the second similarity.
[0116] In this embodiment, the threshold can be selected in an automated manner. Specifically, the first central features of the top K results in the second result set are taken, the second central features of the bottom K results in the second result set are taken, a counterexample set is established, and DBScan clustering is performed. In this way, two types of cluster central features, positive and negative, are obtained. The first similarity between each image feature in the second result set and the first central feature is calculated, the first similarities are averaged, the second similarities between each image feature in the second result set and the second central feature are calculated, the second similarities are averaged, and finally the average of the two averages is taken as the preset initialization threshold.
[0117] In one embodiment, after taking the second central features of the K results ranked at the bottom in the second result set, the method also includes: pairing the K results ranked at the top with the K results ranked at the bottom in the second result set one by one to obtain K positive and negative sample pairs; training an initial contrast learning model based on the positive and negative sample pairs to obtain a trained target contrast learning model; and identifying the image quality of the image to be identified based on the target contrast learning model.
[0118] In this embodiment, since the selection of a threshold can easily lead to poor results, in practical applications, a contrastive learning network (such as the SimCLR contrastive learning network) can be selected for self-supervision instead of the threshold-based method. Similarly, model training can be performed without manual labeling. Specifically, the top K results in the second result set can be paired with the bottom K results one by one to obtain K positive and negative sample pairs; an initial contrastive learning model is trained based on the positive and negative sample pairs to obtain a trained target contrastive learning model; and the image quality of the image to be identified is identified based on the target contrastive learning model. That is, using the contrastive learning model approach, there is no need to calculate a preset threshold. Instead, after the contrastive learning model is trained based on the positive and negative sample pairs, the image quality of the image to be identified can be directly identified based on the contrastive learning model. The contrastive learning model trained by this method can make the features of the positive example close to the positive example and the features of the negative example close to the negative example. That is, after obtaining the target contrastive learning model, it can be used to determine whether the image to be identified is similar to the feature library. If the model output is similar, it is an abnormal image; if it is not similar, it is a normal image.
[0119] In a specific embodiment, the flowchart of the image quality identification method based on the multimodal large model is as follows: Figure 3 ,include:
[0120] S1. Use the DeepSeek-VL model to extract descriptive sentences from a large number of images and construct a domain dataset through text analysis. Use the DeepSeek-VL model to obtain descriptions related to image quality using specific prompts for the collected unlabeled images. The specific prompt is to ask the large model whether there are any quality-related problems with the image. For example, "Is the image blurry?", "Is the lens dirty or blocked?", etc. The description obtained usually includes negative words, such as "No image blur was found." Next, the negative words are negated to obtain positive expressions. For example, "No image blur was found" becomes "The image is clear." This is because the CLIP multimodal large model used does not have the ability to understand the semantics of negative words.
[0121] S2: Fine-tune the domain dataset based on the Chinese CLIP model. The autonomous driving image quality domain dataset, newly added in S1, is added to the Chinese CLIP model for fine-tuning and retraining. The training learning rate is reduced to 3e-5, and a layer-wise learning rate decay strategy is used, with different learning rates for different layers. The top layer has the highest learning rate, and then decreases layer by layer. Data augmentation strategies such as random erase, rate, shear, and brightness are then used. This approach preserves general feature capabilities while better adapting to the domain data.
[0122] S3: Use the Chinese CLIP model to extract features from a large number of images. The fine-tuned Chinese CLIP model from S2 is used to extract features from the large number of unlabeled images collected. The fine-tuned Chinese CLIP model uses the ViT-L-14-336 backbone, adopts the ViT-L network architecture, and uses an input resolution of 336. 336 was chosen here because of its high resolution, which allows it to capture more image information.
[0123] S4. Enter the features into the Milvus vector database. All image features are entered into the Milvus vector database, which is an open source database that supports vector storage and retrieval.
[0124] S5. Search for autonomous driving image quality in both Chinese and English to obtain a result set. Search for image quality in the autonomous driving field in both Chinese and English. Common image quality categories in this field include blur, occlusion, and glare. Blur includes lens raindrops, lens fogging, and lens dirt. Occlusion includes raindrop occlusion, dirt occlusion, and object occlusion. Glare includes ground reflections and direct light. Perform a text search on the feature map using these Chinese and English equivalents to obtain the corresponding result set.
[0125] S6. Take the top K of the result set and perform DBScan clustering to obtain cluster center features. From the obtained result set, select the top K, where K is usually 100. The obtained result set is considered a positive example. Furthermore, to ensure that all the result sets meet the search label, manual screening can be performed.
[0126] S7. Store the features and build a tag library. For each tag result set, perform DBScan clustering to obtain the cluster center feature corresponding to that tag. The purpose of clustering is to obtain the center feature of K samples, reducing the impact of individual samples' features that deviate from the center. The center feature obtained through clustering becomes the feature representation of the tag and is stored in the Milvus vector database to build the tag library.
[0127] S8. Extract features from the image to be classified and search the tag library one by one to obtain similarity. For the image to be classified (i.e., the image to be identified), use the Chinese CLIP model to extract image features. Search the established tag library one by one through the image features and obtain the similarity between the tag cluster center vector and the tag cluster center vector.
[0128] S9. Diagnose the image through the SimCLR discriminant model. Compare the vector similarities through the pre-set threshold. If no similarity exceeds the threshold, it is considered normal. Otherwise, it is considered abnormal and needs to be filtered. The selection of the threshold here can be automated. Specifically, in step S4, select the result image of the top K, establish a negative example set, and perform DBScan clustering. In this way, two types of cluster center features, positive and negative, are obtained. Then calculate the similarity between the image features in the positive example and the cluster center features of the positive and negative examples one by one, and then take the average of the similarities. In this way, two thresholds that are absolutely positive and negative examples are obtained, and finally the average value is taken as the initialization threshold.
[0129] The solution of the embodiment of the present application has at least the following advantages:
[0130] 1. Image quality diagnosis and identification can be performed without labeled data. The overall process is based on a large multimodal model. Quality diagnosis can be performed without the need for training dedicated models or large amounts of training data, saving significant manual labeling costs, shortening R&D cycles, and saving manpower.
[0131] 2. Wide applicability. The embodiments of the present application can be extended to various scene data mining. By establishing the correspondence between images and texts through a multimodal large model, various scene libraries can be established through vector search to accumulate scene data.
[0132] 3. Data-driven, automatic iteration. Traditional models rely on continuous data annotation and retraining to improve recognition capabilities. This application, however, uses an unsupervised approach, allowing for continuous fine-tuning of the CLIP model with new samples, re-clustering to obtain better cluster center features, and thus continuously improving performance. It also provides a discriminant method based on contrastive learning, allowing the final discriminant model to be continuously improved with new samples.
[0133] In this embodiment, the selection of the threshold is very critical, and the effect is often poor due to the selection of the threshold. Therefore, in practical applications, the SimCLR contrast learning network can be selected for self-supervision instead of the threshold-based method. This method still does not require manual display and annotation to perform model training. The specific method is: pair the positive and negative example feature libraries obtained above one by one, and the pairing method is one positive example and one negative example. Thus, positive and negative sample pairs are automatically obtained. The positive and negative sample pairs are trained using the SimCLR contrast learning model to train the model so that the features of the positive example are close to the positive example, and the features of the negative example are close to the negative example, thereby obtaining the discrimination function. After obtaining the model, it can be used to determine whether the image to be classified is similar to the feature library. If the model output is similar, it is an abnormal image and needs to be filtered. Otherwise, it is a normal image.
[0134] Furthermore, the schematic diagram of data-driven automatic iteration is as follows Figure 4 As shown, by continuously adding samples and conducting online learning, the performance can be automatically improved in a data-driven manner. Specifically, samples identified as positive examples are added to the label library built in S5 and re-clustered using DBScan to obtain updated distance center features. Simultaneously, new positive and negative sample pairs are generated, allowing SimCLR comparative learning to update the discriminant model. This allows the continuous addition of new data to continuously refine the model.
[0135] In an embodiment of the present application, it is possible to perform quality diagnosis on images collected by autonomous driving, thereby filtering out images of poor quality. First, a large number of unlabeled images collected are used to obtain descriptions related to image quality using DeepSeek-VL and specific Prompt and processed into a domain data set. Then, the Chinese CLIP model is fine-tuned to become a large domain model. The image features are extracted through the model and entered into the Milvus vector database. Furthermore, Chinese and English vocabulary for autonomous driving image quality are used for retrieval, and the TOP K of the obtained data are selected for DBScan clustering, and then a label index library is constructed. Then, for the images to be classified, features are extracted and the label index library is searched one by one. Finally, SimCLR is used to determine whether the image belongs to a label with known poor quality.
[0136] This application proposes a method for quickly diagnosing and identifying collected images in the field of autonomous driving without the need for training data, which can save a lot of manual labeling costs and shorten the R&D cycle. This application proposes a method for building unsupervised image recognition based on a large multimodal model, and provides a discriminant model based on contrastive learning, which is highly applicable and also applicable to common image classification tasks. This application proposes a data-driven online learning method that can continuously use new data to update the model to achieve the effect of automatic iteration.
[0137] Based on the same technical concept, the second embodiment of the present application provides an image quality recognition device, such as Figure 5 , the device comprises:
[0138] An acquisition module 501 is configured to acquire N image quality description information corresponding to N unlabeled images based on a first visual language model; wherein the first visual language model is configured to perform text extraction on the unlabeled images;
[0139] An image-text pair construction module 502 is configured to construct an image-text pair based on the unlabeled image and the image quality description information, and use N of the image-text pairs as a domain dataset;
[0140] A training module 503 is configured to fine-tune and retrain the second visual language model based on the domain dataset to obtain a target training model; wherein the second visual language model is configured to extract features from the input data;
[0141] A label library construction module 504 is configured to construct a label library based on the target training model and the N unlabeled images;
[0142] A feature extraction module 505 is used to extract features of the image to be identified based on the target training model to obtain target features corresponding to the image to be identified;
[0143] A retrieval module 506 is configured to perform a search and match in the tag library according to the target feature, and obtain a target similarity between the target feature and the tag library;
[0144] The recognition module 507 is configured to recognize the image quality of the image to be recognized based on the target similarity and a preset threshold.
[0145] The device can obtain image quality description information of an unlabeled image based on a first visual language model, and construct an image-text pair. A target training model can be trained based on the image-text pair. The target training model can construct a label library based on the unlabeled image, so that feature extraction can be performed on the unlabeled image to be identified, and target features of the image to be identified can be obtained. Matching is performed based on the target features and the label library to obtain target similarity, and then the image quality of the image to be identified can be recognized based on the target similarity and a preset threshold. The device does not need to use manually labeled image data as training data, and can quickly recognize the collected image, thereby improving image recognition efficiency while reducing costs.
[0146] like Figure 6 As shown, the third embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0147] Memory 113, for storing computer programs;
[0148] In one embodiment, the processor 111 is configured to implement the image quality identification method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113 .
[0149] The memory and processor in the electronic device communicate via a communication bus and a communication interface. The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, and the like.
[0150] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0151] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0152] A fourth embodiment of the present application provides a computer-readable medium having non-volatile program code executable by a processor.
[0153] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store program code for a processor to execute the above method.
[0154] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0155] When implementing the embodiments of the present application, reference may be made to the above embodiments, which have corresponding technical effects.
[0156] It is understood that the embodiments described herein may be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of the present application, or a combination thereof.
[0157] For software implementation, the technology herein can be implemented by a unit that performs the functions herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0158] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0159] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0160] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0161] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0162] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0163] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0164] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0165] The above embodiments are only preferred embodiments for fully illustrating the present application, and the protection scope of the present application is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art based on the present application are within the protection scope of the present application.
Claims
1. A method for identifying image quality, It is characterized in that The method comprises: Acquire N image quality description information corresponding to the N unlabeled images based on a first visual language model; wherein the first visual language model is used to extract text from the unlabeled images; Constructing image-text pairs based on the unlabeled images and the image quality description information, and using N image-text pairs as domain data sets; Fine-tune and retrain the second visual language model based on the domain data set to obtain a target training model; wherein the second visual language model is used to extract features from input data; Building a label library based on the target training model and the N unlabeled images; Extracting features of the image to be identified based on the target training model to obtain target features corresponding to the image to be identified; Search and match the target feature in the tag library to obtain the target similarity between the target feature and the tag library; The image quality of the image to be identified is identified according to the target similarity and a preset threshold.
2. The method according to claim 1, It is characterized in that Building a label library based on the target training model and the N unlabeled images includes: Extracting features from the unlabeled image based on the target training model to obtain a first image feature; Entering the first image feature into a vector database to obtain a retrieval database; Acquire target text data; wherein the target text data is text used to characterize that image quality is abnormal; Searching the target text data in the search database to determine a target sample set corresponding to the target text data; The label library is constructed based on the target sample set.
3. The method according to claim 2, It is characterized in that Searching the target text data in the search database to determine a target sample set corresponding to the target text data includes: Searching the search database based on the target text data to obtain a first result set; sorting the first result set according to the relevance to the target text data to obtain a second result set; The top K results in the second result set are taken as the target sample set corresponding to the target text data; wherein K is less than N.
4. The method according to claim 3, It is characterized in that Constructing the label library based on the target sample set includes: Performing clustering processing on the target sample set to obtain cluster center features; Using the cluster center feature as the target label corresponding to the target sample set; The tag library is constructed based on all the target tags.
5. The method according to claim 3, It is characterized in that After sorting the first result set according to the relevance to the target text data to obtain a second result set, and before taking the top K results in the second result set as the target sample set corresponding to the target text data, the method further includes: Obtain target screening information; Filter the results in the second result set based on the target screening information to obtain a third result set; Accordingly, taking the top K results in the second result set as the target sample set corresponding to the target text data includes: The top K results in the third result set are taken as the target sample set corresponding to the target text data.
6. The method according to claim 1, It is characterized in that Constructing an image-text pair based on the unlabeled image and the image quality description information, including: Determining whether the image quality description information includes negative words; If the image quality description information includes a negative word, negate the negative word to obtain positive expression description information corresponding to the image quality description information; The image-text pair is constructed based on the unlabeled image and the positive expression description information.
7. The method according to claim 1, It is characterized in that Fine-tuning and retraining the second visual language model based on the domain dataset to obtain a target training model includes: Obtaining the number of layers of the second visual language model; Set the target learning rate for each target layer based on the layered learning rate decay strategy; The second visual language model is fine-tuned and retrained based on the domain dataset and different target learning rates.
8. The method according to claim 3, It is characterized in that Identifying the image quality of the image to be identified according to the target similarity and a preset threshold, including: Obtaining the preset threshold; If the target similarity is less than or equal to the preset threshold, identifying the image to be identified as a normal image; If the target similarity is greater than the preset threshold, the image to be identified is identified as an abnormal image.
9. The method according to claim 8, It is characterized in that After identifying that the image to be identified is an abnormal image, the method further includes: Obtaining a target label corresponding to the target similarity; The category of the image to be identified is marked as the target label.
10. The method according to claim 9, It is characterized in that After marking the category of the image to be identified as the target label, the method further includes: The image to be identified is added to the label library as an abnormal image sample.
11. The method according to claim 8, It is characterized in that Obtaining the preset threshold includes: Taking the first central features of the top K results in the second result set; Calculating respectively a first similarity between each image feature in the second result set and the first central feature; Taking the second central features of the bottom K results in the second result set; Calculate the second similarity between each image feature in the second result set and the second central feature respectively; The preset threshold is determined according to the first similarity and the second similarity.
12. The method according to claim 11, It is characterized in that After obtaining the second central features of the bottom K results in the second result set, the method further includes: Pairing the top K results with the bottom K results in the second result set one by one to obtain K positive and negative sample pairs; Training an initial contrastive learning model based on the positive and negative sample pairs to obtain a trained target contrastive learning model; The image quality of the image to be identified is identified according to the target contrast learning model.
13. An image quality recognition device, It is characterized in that The device comprises: An acquisition module, configured to acquire N image quality description information corresponding to the N unlabeled images based on a first visual language model; wherein the first visual language model is used to perform text extraction on the unlabeled images; An image-text pair construction module, used to construct an image-text pair based on the unlabeled image and the image quality description information, and use N of the image-text pairs as a domain data set; A training module, used for fine-tuning and retraining the second visual language model based on the domain data set to obtain a target training model; wherein the second visual language model is used for feature extraction of input data; A label library construction module, used to construct a label library according to the N unlabeled images based on the target training model; A feature extraction module is used to extract features of the image to be identified based on the target training model to obtain target features corresponding to the image to be identified; A retrieval module, used to perform retrieval and matching in the tag library according to the target feature, and obtain the target similarity between the target feature and the tag library; The recognition module is used to recognize the image quality of the image to be recognized according to the target similarity and a preset threshold.
14. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 12 when executing a program stored in a memory.
15. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Image exposure quantification method and electronic equipment
CN119559453A
Cross-granularity target detection method and device and electronic equipment
CN120411465A
