Image data enhancement method and system, electronic equipment and storage medium

By preprocessing, feature extraction, clustering and denoising the image data, new images are generated, and the problem of sample imbalance in the image data is solved, and the automatic expansion of image data and the improvement of model performance is achieved.

CN119863369APending Publication Date: 2025-04-22QINGMUTEC
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411760751.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art faces the problem of sample imbalance when processing image data, especially the uneven number of samples in fine-grained classification within the same category, resulting in poor model training results and it is difficult to quickly identify and solve problems when the data volume is large.

Method used

By preprocessing, feature extraction, clustering and denoising the image data, new images are generated, target feature data is selected from each cluster using the cluster algorithm, and new images are generated based on hidden space vectors, positive and negative prompt words.

Benefits of technology

Effective expansion of images with inconspicuous features is achieved, the attention of the model during training is improved, the image data expansion task is automated, the efficiency is significantly improved, and the generated samples are diverse, which improves the generalization ability and classification accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863369A_ABST
    Figure CN119863369A_ABST
Patent Text Reader

Abstract

The invention discloses an image data enhancement method and system, electronic equipment and a storage medium, and relates to the technical field of image data enhancement, and the method comprises the steps: carrying out the feature extraction of each preprocessed preset image, carrying out the clustering of all extracted feature data, and selecting a plurality of pieces of target feature data from each cluster; performing denoising processing on the hidden space vector corresponding to each target image to obtain a denoised hidden space vector corresponding to each target image, and describing content in each target image to obtain a forward cue word corresponding to each target image; determining a negative prompt word corresponding to each target image; and generating a new image corresponding to each target image according to the denoised hidden space vector, the positive cue word and the negative cue word corresponding to each target image. According to the method, the image with unobvious features can be expanded in a more targeted manner, the expansion task of the image data can be automatically executed, and the efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the field of e-commerce, the surge in image data has brought new challenges to enterprises. Before the product images are updated, enterprises need to effectively classify a large amount of image data. To improve efficiency, enterprises usually use artificial intelligence algorithms to classify images. However, in the process of implementing artificial intelligence algorithms for image classification, some common problems are often encountered, such as: the overall classification effect of the model is not good or the partial classification effect is not ideal. In order to solve these problems, the image data must be processed in a targeted manner to ensure that the model training effect reaches the expected goal.

[0003] When the model performance does not meet expectations, manual data review is usually required to identify the root cause of the unsatisfactory model effect. Under the premise of ensuring that the training data is accurate, this performance degradation is usually caused by sample imbalance in the data. Sample imbalance can be further divided into two types: the imbalance of sample numbers between different categories, and the imbalance of sample numbers of subcategories within the same category. Then:

[0004] 1) The problem of sample number imbalance between different categories can be solved by implementing a sample number alignment strategy, for example, by increasing the amount of data for categories with fewer samples or reducing the amount of data for categories with more samples. However, for the problem of sample imbalance in fine-grained classification within the same category, it is usually necessary to separate and analyze the data in detail to observe the true distribution of the data, which usually requires in-depth manual inspection and analysis to identify and solve potential problems. When the amount of data is small, problems in the data can be located and solved relatively quickly. However, when the data is diverse and large in number, identifying and solving the specific reasons that lead to the decline in model performance requires a lot of time and effort. In this case, it may be necessary to use automated tools or algorithms to assist in analysis to improve efficiency and accuracy.

[0005] 2) Methods for dealing with the problem of imbalanced sample numbers in subcategories within the same category usually include two strategies:

[0006] ① Expand a small number of samples, specifically:

[0007] Increase the data of categories with smaller sample sizes, and balance the data set by generating or collecting more data belonging to categories with smaller sample sizes. The advantages and disadvantages are as follows:

[0008] a. By balancing the data set, the generalization ability can be improved, so that the model can better capture the characteristics of each category during the learning process, and thus perform well in real-world applications. However, if the method of expanding the sample is too simple, or the generated sample is very different from the original data, it may cause the model to learn unrealistic features, increase the risk of overfitting, and perform poorly on the test set.

[0009] b. A balanced data set helps improve the classification accuracy after model training, but the authenticity of the data is difficult to guarantee. Simply copying or slightly distorting the original samples may introduce redundant information, while complex generative models may produce samples that are inconsistent with the original data distribution.

[0010] c. By expanding the samples, especially the important minority class samples, ensuring that the model does not ignore these categories, all available data can be fully utilized. However, obtaining data for a small number of samples is challenging, especially when searching for suitable images through manual means, which takes a lot of time.

[0011] d. In an unbalanced dataset, the model may be biased towards the majority class, resulting in poor prediction performance for the minority class. By expanding the minority class samples, this method makes the model pay more attention to these categories, thereby reducing the bias. However, it is difficult to choose a suitable sample expansion method. Different methods are suitable for different scenarios. Multiple experiments and adjustments may be required to determine the method that best suits the current dataset and task.

[0012] ② Most samples were reduced, specifically:

[0013] Reduce the data of the categories with a large sample size by randomly downsampling or selectively deleting some redundant samples to achieve balance. The advantages and disadvantages are as follows:

[0014] a. When dealing with a dataset with imbalanced categories, the model may often over-focus on the majority class samples, resulting in poor performance on the minority class. By appropriately reducing the number of majority class samples, the model can be effectively forced to pay more attention to minority class samples, thereby reducing the risk of overfitting on the majority class. However, this strategy may lead to information loss because some patterns or features that are of great value to model prediction may be ignored in the process of reducing samples.

[0015] b. A balanced data set can help the model better learn and identify the features of minority classes, thereby improving the recognition rate of these classes. However, when implementing sample reduction, special attention should be paid to the problem of sample selection bias. The selection of majority class samples for reduction requires careful consideration. Random reduction may introduce bias, while reduction based on specific rules may lead to human bias.

[0016] c. This strategy is not applicable to all scenarios. In some tasks, majority class samples may contain rich information, and reducing these samples may have an adverse effect on the overall performance of the model.

[0017] In summary, if the problems of image acquisition and expansion difficulties can be overcome, this is an effective strategy to enhance the classification effect of the model. By expanding the minority class samples, the generalization ability and classification accuracy of the model can be improved, the data can be fully utilized and the bias can be reduced. However, the selection of the expansion method needs to be cautious to avoid overfitting and data authenticity problems. On the other hand, the majority sample reduction method reduces the risk of overfitting and improves the recognition rate of the minority class by reducing the majority class samples, but special attention should be paid to the sample selection bias to avoid information loss and human bias. Although the reduction strategy may not be applicable in some scenarios, it can effectively help the model pay more attention to the minority class features under appropriate circumstances. Summary of the invention

[0018] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and specifically provide an image data enhancement method, system, electronic device and storage medium, as follows:

[0019] 1) In the first aspect, the present invention provides an image data enhancement method, and the specific technical solution is as follows:

[0020] Preprocess each preset image;

[0021] Performing feature extraction on each preprocessed preset image to obtain feature data of each preprocessed preset image;

[0022] Cluster all the extracted feature data and select multiple target feature data from each cluster;

[0023] De-noising the latent space vector corresponding to each target image to obtain the denoised latent space vector corresponding to each target image, wherein the target image is: a pre-processed preset image corresponding to the target feature data;

[0024] Describe the content of each target image and obtain the positive prompt words corresponding to each target image;

[0025] Determine the negative cue word corresponding to each target image;

[0026] According to the denoised latent space vector, positive prompt words and negative prompt words corresponding to each target image, a new image corresponding to each target image is generated.

[0027] The beneficial effects of an image data enhancement method provided by the present invention are as follows:

[0028] On the one hand, by clustering all the extracted feature data, images with unclear features can be expanded more specifically, so that these key information can be more effectively focused on during the model training process. On the other hand, the image data expansion task can be performed automatically, which has significant efficiency advantages compared to the speed of manual sample expansion.

[0029] Based on the above solution, an image data enhancement method of the present invention can also be improved as follows.

[0030] Further, multiple target feature data are selected from each cluster, including:

[0031] Calculate and determine the feature data greater than a preset distance threshold as the target feature data selected from the cluster based on the distance between each feature data in any cluster and the cluster center of the cluster, or sort all the feature data in descending order of distance, and select a preset proportion of feature data as the target feature data selected from the cluster in a forward-to-back order of the sorted sequence, until the target feature data in each cluster is obtained.

[0032] Further, each preset image is preprocessed, including:

[0033] Perform image grayscale processing and Canny edge extraction processing on each preset image.

[0034] Furthermore, all the extracted feature data are clustered, including:

[0035] The BIRCH clustering algorithm is used to cluster all the extracted feature data.

[0036] 2) In a second aspect, the present invention further provides an image data enhancement system, and the specific technical solution is as follows:

[0037] It includes a preprocessing module, a feature extraction module, a clustering module, a selection module, a denoising processing module, a prompt word acquisition module and an image generation module;

[0038] The preprocessing module is used to: preprocess each preset image;

[0039] The feature extraction module is used to: extract features from each preprocessed preset image to obtain feature data of each preprocessed preset image;

[0040] The clustering module is used to: cluster all extracted feature data;

[0041] The selection module is used to: select multiple target feature data from each cluster;

[0042] The denoising processing module is used to: perform denoising processing on the latent space vector corresponding to each target image to obtain the denoised latent space vector corresponding to each target image, wherein the target image is: a pre-processed preset image corresponding to the target feature data;

[0043] The prompt word acquisition module is used to: describe the content in each target image to obtain the positive prompt word corresponding to each target image;

[0044] The prompt word acquisition module is also used to: determine the negative prompt word corresponding to each target image;

[0045] The image generation module is used to generate a new image corresponding to each target image according to the denoised latent space vector, positive prompt words and negative prompt words corresponding to each target image.

[0046] Based on the above solution, the image data enhancement system of the present invention can also be improved as follows.

[0047] Furthermore, the selection module is specifically used to: calculate and, based on the distance between each feature data in any cluster and the cluster center of the cluster, determine the feature data greater than a preset distance threshold as the target feature data selected from the cluster, or sort all the feature data in order of distance from large to small, and select a preset proportion of feature data as the target feature data selected from the cluster in order from front to back of the sorting sequence, until the target feature data in each cluster is obtained.

[0048] Furthermore, the preprocessing module is specifically used to perform image grayscale processing and Canny edge extraction processing on each preset image.

[0049] Furthermore, the clustering module is specifically used to cluster all the extracted feature data using the BIRCH clustering algorithm.

[0050] 3) In a third aspect, the present invention further provides an electronic device, comprising a processor, the processor being coupled to a memory, the memory storing at least one computer program, and the at least one computer program being loaded and executed by the processor so that the electronic device implements any one of the above-mentioned image data enhancement methods.

[0051] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any of the above-mentioned image data enhancement methods is implemented.

[0052] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments of the present invention:

[0054] Figure 1 A schematic diagram of a flow chart of an image data enhancement method according to an embodiment of the present invention;

[0055] Figure 2 A schematic diagram of the structure of an image data enhancement system according to an embodiment of the present invention;

[0056] Figure 3 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0057] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0058] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0059] like Figure 1 As shown, an image data enhancement method according to an embodiment of the present invention comprises the following steps:

[0060] S1. Preprocess each preset image. Specifically, perform image grayscale processing and Canny edge extraction processing on each preset image.

[0061] Among them, the preset image can be a product picture in the field of e-commerce, or it can be other images, such as monitoring images and face images in the field of security monitoring, and can be set according to actual conditions.

[0062] S2, extracting features from each preprocessed preset image to obtain feature data of each preprocessed preset image;

[0063] Among them, the ResNet50 network is used to extract features of each preprocessed preset image.

[0064] S3. Cluster all the extracted feature data and select multiple target feature data from each cluster.

[0065] Among them, the BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clustering algorithm is used to cluster all the extracted feature data. After clustering all the extracted feature data, all the feature data will be divided into multiple clusters.

[0066] Among them, selecting multiple target feature data from each cluster can be achieved in the following way:

[0067] 1) The first implementation method: calculate and determine the feature data greater than a preset distance threshold as the target feature data selected from any cluster based on the distance between each feature data in any cluster and the cluster center of the cluster, wherein the preset distance threshold can be set according to actual conditions.

[0068] 2) The second implementation method: sort all feature data in descending order of distance, and select a preset proportion of feature data as the target feature data selected from the cluster in the order of the sorting sequence from front to back, until the target feature data in each cluster is obtained. The preset proportion can be 40%, 50% or 60%, etc., which can be set according to actual conditions.

[0069] S4, performing denoising processing on the latent space vector corresponding to each target image to obtain the denoised latent space vector corresponding to each target image, wherein the target image is: a pre-processed preset image corresponding to the target feature data;

[0070] Among them, the process of obtaining the latent space vector corresponding to each target image is as follows:

[0071] The encoding part of the Variational Autoencoder (VAE) is used to compress the high-dimensional target image into a low-dimensional latent space to obtain the latent space vector corresponding to the target image.

[0072] S5. Describe the content of each target image and obtain the positive prompt words corresponding to each target image. Specifically:

[0073] The content in each target image is described by a large language model. Specifically, the Florence2 basic visual language model can be used to describe the content in each target image to obtain positive prompt words corresponding to each target image. The positive prompt words include vocabulary and / or phrases used to describe the elements, style and effects appearing in the target image.

[0074] Optionally, after using the Florence2 basic visual language model to describe the content in any target image, the target image is segmented according to the words and / or phrases in the positive prompt words to obtain a local image corresponding to each word or phrase, recorded as a first local image, and the positive prompt words are used as input to the image generation algorithm to generate a new image, and the local image corresponding to each word and / or phrase is segmented from the new image, recorded as a second local image, and the similarity between the first local image and the second local image corresponding to the same word or phrase is calculated. Specifically, the features corresponding to the word or phrase (such as color) are extracted from the first local image. , shape, etc.), extract features corresponding to the word or phrase from the second partial image, such as color, shape, etc.), specifically calculate the pixels between the two features as the similarity between the first partial image and the second partial image corresponding to the same word or phrase, until the similarity corresponding to each word and the similarity corresponding to each phrase are calculated, calculate whether the proportion of similarities exceeding a preset similarity threshold exceeds a preset proportion, if so, use the positive prompt word corresponding to the target image to participate in the generation of the new image in S7, if not, replace other large language models to generate positive prompt words, and also retrain the Florence2 basic visual language model.

[0075] S6. Determine the negative prompt word corresponding to each target image. The negative prompt word can make the generated new image have a more realistic effect.

[0076] The specific implementation process of determining the negative prompt word corresponding to each target image is as follows:

[0077] Specifically, the negative prompt word model can be used to generate the negative prompt word corresponding to each target image.

[0078] S7. Generate a new image corresponding to each target image according to the denoised latent space vector, positive prompt word and negative prompt word corresponding to each target image. Specifically:

[0079] The denoised latent space vector, positive cue words and negative cue words corresponding to any target image are input into the AIGC model to draw a new image that is similar to the target image but not exactly the same, that is, the new image corresponding to the target image, until a new image corresponding to each target image is obtained.

[0080] Among them, the ComfyUI workflow corresponding to the technical solution of the present invention can be installed on the computer when image expansion is required. After installation, a data set including multiple preset images is imported, which can automatically realize image expansion with high efficiency.

[0081] At present, in the image classification tasks in the field of artificial intelligence, the key to improving image classification effects mainly focuses on two aspects: data optimization and model improvement. The current model performance has reached a relatively high level, and there is limited room for further improvement. Therefore, in order to improve the classification effect, it is a more effective strategy to give priority to processing at the data level. If the data content is clear and the boundaries are clear, the effect of model training will usually be significantly improved.

[0082] The present invention aims to achieve image data expansion in an automated manner, especially for data sets with small sample sizes and unclear features. This automated expansion can significantly reduce the process of manual participation in data screening and analysis, thereby reducing the cost of manual screening; and by utilizing the capabilities of the AIGC model, the expanded samples can have a certain diversity, which is superior to the traditional upsampling method, thereby significantly improving the training effect of the model (such as a classification model or a monitoring and early warning model, etc.), and there is no need to manually adjust the prompt word (prompt), thereby significantly speeding up the speed of image expansion and improving work efficiency.

[0083] The effectiveness of the present invention has been fully demonstrated by the verification of multiple e-commerce data sets, specifically:

[0084] The e-commerce data set includes: image data of hats of a certain clothing brand at different angles, image data of bags of a certain luggage brand at different angles, image data of tops of a certain clothing brand at different angles, and image data of bottoms of a certain clothing brand at different angles. Compared with the original data without sample expansion, the performance of the present invention on the validation set is significantly improved by 5% to 15%. In addition, the performance on the test set is also improved by about 5%. These results show that the present invention has significant advantages in data set expansion.

[0085] Moreover, when performing image expansion, the processing time for each image is about 1.5 seconds. In the image generation task, this speed has reached an extremely fast level and has a significant efficiency advantage compared to the speed of manual sample expansion.

[0086] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.

[0087] like Figure 2As shown, an image data enhancement system 200 according to an embodiment of the present invention includes a preprocessing module 201, a feature extraction module 202, a clustering module 203, a selection module 204, a denoising processing module 205, a prompt word acquisition module 206 and an image generation module 207;

[0088] The preprocessing module 201 is used to: preprocess each preset image;

[0089] The feature extraction module 202 is used to: extract features from each preprocessed preset image to obtain feature data of each preprocessed preset image;

[0090] The clustering module 203 is used to: cluster all extracted feature data;

[0091] The selection module 204 is used to: select a plurality of target feature data from each cluster;

[0092] The denoising processing module 205 is used to: perform denoising processing on the latent space vector corresponding to each target image to obtain the denoised latent space vector corresponding to each target image, wherein the target image is: a pre-processed preset image corresponding to the target feature data;

[0093] The prompt word acquisition module 206 is used to: describe the content in each target image and obtain the positive prompt word corresponding to each target image;

[0094] The prompt word acquisition module 206 is also used to: determine the negative prompt word corresponding to each target image;

[0095] The image generation module 207 is used to generate a new image corresponding to each target image according to the denoised latent space vector, the positive prompt word and the negative prompt word corresponding to each target image.

[0096] Optionally, in the above technical solution, the selection module 204 is specifically used to: calculate and, based on the distance between each feature data in any cluster and the cluster center of the cluster, determine the feature data greater than a preset distance threshold as the target feature data selected from the cluster, or, sort all feature data in order of distance from large to small, and select a preset proportion of feature data as the target feature data selected from the cluster in order of the sorting sequence from front to back, until the target feature data in each cluster is obtained.

[0097] Optionally, in the above technical solution, the preprocessing module 201 is specifically used to: perform image grayscale processing and Canny edge extraction processing on each preset image.

[0098] Optionally, in the above technical solution, the clustering module 203 is specifically used to cluster all the extracted feature data using a BIRCH clustering algorithm.

[0099] It should be noted that the beneficial effects of the image data enhancement system 200 provided in the above embodiment are the same as the beneficial effects of the above image data enhancement method, which will not be described in detail here. In addition, when the system provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be described in detail here.

[0100] Among them, the image data enhancement system of the present invention can be a computer program (including program code) running in a computer device. For example, the image data enhancement system of the present invention is an application software that can be used to execute the corresponding steps in the image data enhancement method of the present invention.

[0101] In some embodiments, the image data enhancement system of the present invention can be implemented by a combination of software and hardware. As an example, the image data enhancement system of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the image data enhancement method of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0102] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The name of a module does not limit the module itself in some cases.

[0103] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any one of the above-mentioned image data enhancement methods is implemented. That is to say, an electronic device according to an embodiment of the present invention may include but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the image data enhancement method shown in any embodiment of the present invention by calling the computer program.

[0104] In an alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0105] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0106] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3In the figure, only one thick line is used to represent the bus 4002, but this does not mean that there is only one bus or one type of bus.

[0107] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0108] The memory 4003 is used to store the application code (computer program) for executing the solution of the present invention, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.

[0109] Among them, the electronic device can also be a terminal device, and the terminal device can be any device that can install applications, including at least one of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, and a smart car device.

[0110] It should be noted that Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0111] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned image data enhancement methods is implemented.

[0112] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0113] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above-mentioned image data enhancement methods.

[0114] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0115] It should be understood that the flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The computer-readable storage medium provided by the embodiment of the present invention may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or component.

[0117] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0118] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.

[0119] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.

[0120] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.

[0121] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A method for image data enhancement, characterized in that: include: Preprocess each preset image; Performing feature extraction on each preprocessed preset image to obtain feature data of each preprocessed preset image; Cluster all the extracted feature data and select multiple target feature data from each cluster; De-noising the latent space vector corresponding to each target image to obtain the de-noised latent space vector corresponding to each target image, wherein the target image is: a pre-processed preset image corresponding to the target feature data; Describe the content of each target image and obtain the positive prompt words corresponding to each target image; Determine the negative cue word corresponding to each target image; According to the denoised latent space vector, positive prompt words and negative prompt words corresponding to each target image, a new image corresponding to each target image is generated.

2. The image data enhancement method according to claim 1, characterized in that: Select multiple target feature data from each cluster, including: Calculate and determine the feature data greater than a preset distance threshold as the target feature data selected from the cluster based on the distance between each feature data in any cluster and the cluster center of the cluster, or sort all the feature data in descending order of distance, and select a preset proportion of feature data as the target feature data selected from the cluster in a forward-to-back order of the sorted sequence, until the target feature data in each cluster is obtained.

3. The image data enhancement method according to claim 1, characterized in that: Preprocess each preset image, including: Perform image grayscale processing and Canny edge extraction processing on each preset image.

4. The image data enhancement method according to claim 1, characterized in that: Clustering of all extracted feature data, including: The BIRCH clustering algorithm is used to cluster all the extracted feature data.

5. An image data enhancement system, characterized in that: It includes a preprocessing module, a feature extraction module, a clustering module, a selection module, a denoising processing module, a prompt word acquisition module and an image generation module; The preprocessing module is used to: preprocess each preset image; The feature extraction module is used to: extract features from each preprocessed preset image to obtain feature data of each preprocessed preset image; The clustering module is used to: cluster all extracted feature data; The selection module is used to: select multiple target feature data from each cluster; The denoising processing module is used to: perform denoising processing on the latent space vector corresponding to each target image to obtain the denoised latent space vector corresponding to each target image, wherein the target image is: a pre-processed preset image corresponding to the target feature data; The prompt word acquisition module is used to: describe the content in each target image to obtain the positive prompt word corresponding to each target image; The prompt word acquisition module is also used to: determine the negative prompt word corresponding to each target image; The image generation module is used to generate a new image corresponding to each target image according to the denoised latent space vector, positive prompt words and negative prompt words corresponding to each target image.

6. The image data enhancement system according to claim 5, characterized in that: The selection module is specifically used to: calculate and, based on the distance between each feature data in any cluster and the cluster center of the cluster, determine the feature data that is greater than a preset distance threshold as the target feature data selected from the cluster, or sort all the feature data in order of distance from large to small, and select a preset proportion of feature data as the target feature data selected from the cluster in order from front to back of the sorting sequence, until the target feature data in each cluster is obtained.

7. The image data enhancement system according to claim 6, characterized in that: The preprocessing module is specifically used to perform image grayscale processing and Canny edge extraction processing on each preset image.

8. The image data enhancement system according to claim 5, characterized in that: The clustering module is specifically used to cluster all the extracted feature data using the BIRCH clustering algorithm.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, an image data enhancement method according to any one of claims 1 to 4 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, an image data enhancement method according to any one of claims 1 to 4 is implemented.

Citation Information

Cited By

  • Semantic-based AI edited image tampering data generation method and system

    CN120808124A

  • Monitoring video data processing method and system for mine safety operation

    CN120976072A