Image generation method and device, electronic equipment and storage medium
By acquiring and analyzing the description data of insurance claims cases, and using the image generation model to generate and enhance the scene images, the problem of insufficient universality of image data sets in the prior art is solved, and the accuracy and visualization of claims cases are improved.
Patent Information
- Application Number
- CN202411338167.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-17
AI Technical Summary
In the prior art, in the insurance claim scenario, the universality of the image data set leads to mismatching the image content with the specific case, reducing the accuracy of the scene image.
By obtaining the description data of the target claim case, extracting key information and performing scene analysis, the pre-trained image generation model is used to generate preliminary scene images, and image enhancement is performed to improve the accuracy and adaptability of the image.
It improves the accuracy and visualization of the scene images of claims case cases, makes the explanation more accurate and flexible, and enhances users' understanding of the case.
Smart Images

Figure CN119323622A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to an image generation method and device, an electronic device and a storage medium. Background Art
[0002] At present, in various business fields, it is often necessary to explain the business to various objects so that the objects can fully understand different businesses. For example, in the insurance field, insurance agents often need to explain claim cases to insured persons, and the insurance agents often rely on oral descriptions and written explanations when explaining. Although this method can convey basic information, it still has certain limitations in showing the specific details of the claim case and the claim scenario, which will result in the insured person not being able to fully understand the claim case.
[0003] Based on this, the related technology considers constructing a general image dataset for insurance claims scenarios, and using the constructed image dataset and text description to explain each claim case. However, in this method, the image dataset corresponding to each claim case is a fixed general image, and there is a problem that the image content is not highly compatible with the specific content of the claim case, resulting in low accuracy of the scene image corresponding to the claim case. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose an image generation method and device, an electronic device and a storage medium, which are intended to generate scene images corresponding to claim cases and improve the accuracy of scene images of each claim case.
[0005] To achieve the above object, a first aspect of an embodiment of the present application provides an image generation method, the method comprising:
[0006] In response to an image generation request for a target claim case, obtaining target case description data of the target claim case;
[0007] Extracting key information from the target case description data to obtain key case information;
[0008] Performing scenario analysis on the target case description data to obtain case scenario description information;
[0009] Generate an image of the case key information and the case scene description information based on a pre-trained image generation model to obtain a preliminary case scene image corresponding to the target claim case;
[0010] The preliminary case scene image is enhanced to obtain a target case scene image, so as to display the target case scene image when a request for explanation of the target claim case is received.
[0011] In some embodiments, extracting key information from the target case description data to obtain case key information includes:
[0012] Sentence processing is performed on the target case description data to obtain a plurality of case description sentences;
[0013] Encoding the case description sentence to obtain a sentence representation vector of the case description sentence;
[0014] Performing topic prediction on the case description sentence based on the sentence representation vector to obtain a case topic corresponding to the case description sentence;
[0015] Clustering the case description sentences according to the case topics of the case description sentences to obtain a case description sentence set;
[0016] For each of the case topics, extract key information from the case description sentence set of the case topic to obtain the topic key information of the case topic;
[0017] Combine multiple subject key information into the case key information.
[0018] In some embodiments, performing scenario analysis on the target case description data to obtain case scenario description information includes:
[0019] Performing word segmentation processing on the target case description data to obtain multiple case description words;
[0020] Performing self-attention calculation on each of the case description words to obtain attention calculation results of each of the case description words;
[0021] Performing feed-forward processing on the attention calculation result to obtain the descriptive latent features of each case description word;
[0022] Perform feature splicing on the descriptive latent features of each case description word to obtain a scene description splicing feature;
[0023] The scene description splicing features are feature decoded based on preset instructions to obtain the case scene description information.
[0024] In some embodiments, the image generation model includes a text encoder, an image generation network, and a decoding network; the image generation model based on the pre-trained image generation performs image generation on the case key information and the case scene description information to obtain a preliminary case scene image corresponding to the target claim case, including:
[0025] Encoding the case key information based on the text encoder to obtain case description encoding features;
[0026] Encoding the case scene description information based on the text encoder to obtain scene description encoding features;
[0027] Performing feature fusion on the case description coding feature and the scene description coding feature to obtain a case fusion feature;
[0028] Based on the case fusion features, the noise latent space features corresponding to the preset noise image are denoised through the image generation network to obtain denoised image features;
[0029] The denoised image features are decoded based on the decoding network to obtain a preliminary case scene image corresponding to the target claim case.
[0030] In some embodiments, based on the case fusion features, denoising the noise latent space features corresponding to the preset noise image through the image generation network to obtain the denoised image features includes:
[0031] Performing linear projection on the noise latent space features through the image generation network to obtain a query feature vector;
[0032] Linearly projecting the case fusion features through the image generation network to obtain a key feature vector and a value feature vector;
[0033] Performing attention calculation on the query feature vector and the key feature vector to obtain an attention weight;
[0034] A weighted operation is performed on the attention weight and the value feature vector to obtain the denoised image feature.
[0035] In some embodiments, the image generation model is trained in the following manner:
[0036] Acquire a plurality of image-text sample pairs of sample claim cases, wherein the image-text sample pairs include a preset noise image, a sample case scene image of the sample claim case, and sample case description information of the sample case scene image;
[0037] Diffusion processing is performed on the preset noise image based on a preset original model to obtain noise latent space features of the preset noise image;
[0038] Performing text encoding on the sample case description information based on the original model to obtain a sample case description fusion feature;
[0039] Based on the sample case description fusion feature, the noise latent space feature is denoised to obtain a predicted case scene image;
[0040] Perform loss calculation based on the predicted case scene image and the sample case scene image to obtain an image loss function;
[0041] Based on the image loss function, the original model is trained to obtain the image generation model.
[0042] In some embodiments, performing image enhancement on the preliminary case scene image to obtain a target case scene image includes:
[0043] Performing pixel normalization processing on the preliminary case scene image to obtain a normalized image;
[0044] Performing feature extraction on the normalized image to obtain image edge features and image texture features of the normalized image;
[0045] Performing feature enhancement on the image edge features and image texture features to obtain enhanced image features;
[0046] Feature mapping is performed on the enhanced image features to obtain the target case scene image.
[0047] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides an image generating device, the device comprising:
[0048] an acquisition unit, configured to acquire target case description data of the target claim case in response to an image generation request for the target claim case;
[0049] An extraction unit, used to extract key information from the target case description data to obtain case key information;
[0050] An analysis unit, used to perform scenario analysis on the target case description data to obtain case scenario description information;
[0051] A generating unit, configured to generate an image of the case key information and the case scene description information based on a pre-trained image generation model, and obtain a preliminary case scene image corresponding to the target claim case;
[0052] The enhancement unit is used to perform image enhancement on the preliminary case scene image to obtain a target case scene image, so as to display the target case scene image when receiving an explanation request for the target claim case.
[0053] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the image generation method described in the first aspect is implemented.
[0054] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image generation method described in the first aspect is implemented.
[0055] The image generation method and device, electronic device and storage medium proposed in the present application can obtain the target case description data of the target claim case by responding to the image generation request for the target claim case, and can promptly respond to the user's demand for the generation of scene images of each claim case, which is conducive to improving the efficiency of response interaction. Furthermore, the key information of the target case description data is extracted to obtain the case key information, and the scene analysis of the target case description data is performed to obtain the case scene description information, which can eliminate the interference of irrelevant description information on image generation, which is conducive to improving the accuracy and comprehensiveness of the extraction of the description information of the target claim case. Furthermore, based on the pre-trained image generation model, the case key information and the case scene description information are image generated to obtain the preliminary case scene image corresponding to the target claim case, and the preliminary case scene image is enhanced to obtain the target case scene image, which can improve the convenience and accuracy of image generation, so that when the explanation request for the target claim case is received, a high-quality target case scene image is displayed. This method enables the target case scene image and target case description data to be combined for explanation when explaining the claims case, which is conducive to improving the accuracy and flexibility of the explanation of the claims case and improving the visualization of the explanation of the claims case. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 is a flow chart of an image generation method provided in an embodiment of the present application;
[0057] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.
[0058] Figure 3 yes Figure 1 Flow chart of step S103 in FIG.
[0059] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.
[0060] Figure 5 yes Figure 4Flow chart of step S404 in FIG.
[0061] Figure 6 yes Figure 1 Flow chart of step S105 in FIG.
[0062] Figure 7 is a flow chart of a training image generation model provided in an embodiment of the present application;
[0063] Figure 8 is a structural schematic diagram of an image generating device provided in an embodiment of the present application;
[0064] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0066] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0067] The image generation method and device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the image generation method in the embodiments of the present application is described.
[0068] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0069] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0070] The image generation method provided in the embodiment of the present application relates to the fields of financial technology and artificial intelligence technology. The image generation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the image generation method, etc., but is not limited to the above forms.
[0071] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0072] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as object information, object behavior data, object historical data, and object location information, the permission or consent of the object will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the personal information of the object, the separate permission or separate consent of the object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the object, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0073] Figure 1 is an optional flowchart of the image generation method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.
[0074] Step S101, in response to an image generation request for a target claim case, obtaining target case description data of the target claim case;
[0075] Step S102, extracting key information from the target case description data to obtain case key information;
[0076] Step S103, performing scenario analysis on the target case description data to obtain case scenario description information;
[0077] Step S104, generating an image of the case key information and the case scene description information based on a pre-trained image generation model to obtain a preliminary case scene image corresponding to the target claim case;
[0078] Step S105, performing image enhancement on the preliminary case scene image to obtain a target case scene image, so as to display the target case scene image when receiving an explanation request for the target claim case.
[0079] Steps S101 to S105 shown in the embodiment of the present application, by responding to the image generation request for the target claim case and obtaining the target case description data of the target claim case, can promptly respond to the user's demand for generating scene images for each claim case, which is beneficial to improving the efficiency of response interaction. Further, key information is extracted from the target case description data to obtain case key information, and scene analysis is performed on the target case description data to obtain case scene description information, which can eliminate the interference of irrelevant description information on image generation, which is beneficial to improving the accuracy and comprehensiveness of the extraction of description information for the target claim case. Further, based on the pre-trained image generation model, image generation is performed for case key information and case scene description information to obtain a preliminary case scene image corresponding to the target claim case, and image enhancement is performed on the preliminary case scene image to obtain a target case scene image, which can improve the convenience and accuracy of image generation, so that when a request for explanation of the target claim case is received, a high-quality target case scene image is displayed. This method enables the target case scene image and target case description data to be combined for explanation when explaining the claims case, which is conducive to improving the accuracy and flexibility of the explanation of the claims case and improving the visualization of the explanation of the claims case.
[0080] In step S101 of some embodiments, in response to an image generation request for a target claim case, target case description data of the target claim case is acquired.
[0081] The target claim case is used to indicate an insurance claim example that has occurred. For example, the target claim case can be a car insurance claim case, a medical insurance claim case, and so on.
[0082] An image generation request refers to a request initiated when an insurance agent wants to explain a specific claim case in a graphic and text format, but lacks scene images related to the specific claim case.
[0083] The target case description data is used to describe the case type, specific details, etc. of the target claim case.
[0084] For example, when the target claim case is a car insurance claim case, the target case description data will include the specific process of the vehicle collision accident, the damage to the vehicle, and various objects related to the claim.
[0085] In the specific implementation of this embodiment, when the object wants to generate a scene image corresponding to a target claim case, the object will perform interactive operations on the interactive interface of the object terminal to send an image generation request for the target claim case to the server, and when sending the image generation request, the object will submit the relevant information describing the target claim case to the server in the form of text or voice, etc. Based on this, the server will respond to the image generation request for the target claim case, parse the received image generation request, and obtain the target case description data of the target claim case.
[0086] Specifically, when text data is parsed from the image generation request, the text data is directly used as the target case description data of the target claim case. When voice data is parsed from the image generation request, the voice data is subjected to noise reduction and frame processing to obtain voice frame data to improve voice quality. Next, key feature information is extracted from the voice frame data to obtain the Mel frequency cepstral coefficients corresponding to the voice data, and the Mel frequency cepstral coefficients are input into the acoustic model for phoneme feature extraction to obtain the phoneme features corresponding to the voice data, and the phoneme features are decoded into a word sequence, and each word in the word sequence is combined into the target case description data of the target claim case.
[0087] In step S102 of some embodiments, key information is extracted from the target case description data to obtain case key information.
[0088] The case key information is used to indicate the main description content in the target case description data.
[0089] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S206:
[0090] Step S201, performing sentence processing on the target case description data to obtain a plurality of case description sentences;
[0091] Step S202, encoding the case description sentence to obtain a sentence representation vector of the case description sentence;
[0092] Step S203, performing topic prediction on the case description sentence based on the sentence representation vector to obtain the case topic corresponding to the case description sentence;
[0093] Step S204, clustering the case description sentences according to the case topics of the case description sentences to obtain a set of case description sentences;
[0094] Step S205, for each case theme, extract key information from the case description sentence set of the case theme to obtain the theme key information of the case theme;
[0095] Step S206, combining multiple subject key information into case key information.
[0096] Steps S201 to S206 are described in detail below.
[0097] In step S201 of some embodiments, first, a preset regular expression is obtained, wherein the regular expression is used to indicate a specific mode for segmenting the target case description data. Then, the target case description data is segmented using the preset regular expression, and the sentence boundaries are identified according to the punctuation marks (such as a period, a question mark, an exclamation mark, etc.) at the end of each sentence in the target case description data and the subsequent spaces or paragraph marks, thereby segmenting the target case description data into multiple case description sentences.
[0098] In step S202 of some embodiments, for each case description sentence, the case description sentence is input into a preset text encoding model, the case description sentence is encoded by the text encoding model, and the case description sentence is converted from the data space to the latent vector space to obtain the sentence encoding features of the case description sentence, wherein the sentence encoding features are used to indicate the semantic content representation of the case description sentence in the latent vector space. Furthermore, based on the text encoding model, the sentence encoding features of each case description sentence are pooled, and the key semantic content information in the sentence encoding features is extracted to obtain the sentence representation vector of the case description sentence. Among them, the text encoding model is a neural network model constructed based on the BERT encoder. The sentence representation vector is a feature vector of a fixed length that can represent the key information of the case description sentence.
[0099] In step S203 of some embodiments, for each case description sentence, the sentence representation vector of the case description sentence is first input into a preset prediction function, and the preset prediction function creates a probability distribution of the case description sentence on each candidate topic, wherein the candidate topic refers to the name of each link that a claim case usually has. Then, the predicted probability of the case description sentence on each candidate topic is determined according to the probability distribution, and the candidate topic with the largest predicted probability is used as the case topic to which the case description sentence belongs.
[0100] In step S204 of some embodiments, when clustering the case description sentences, the case description sentences with the same case subject are clustered into one large category, and the case description sentences with different case subjects are clustered into different large categories, and each large category is used as a case description sentence set, so that each case subject has a corresponding case description sentence set.
[0101] In step S205 of some embodiments, for each case topic, a named entity recognition algorithm is used to extract entity features from the case description sentence set of the case topic, and multiple case entity features corresponding to the case topic are obtained. Then, the importance of each case entity feature is scored based on the random forest algorithm, and the importance score of the case entity feature to the case topic is calculated. According to the importance score, a predetermined number of case entities with larger importance scores are selected from multiple case entities as target entity features, and the target entity features are spliced into the key information of the case topic.
[0102] In step S206 of some embodiments, multiple subject key information are integrated into a whole to achieve the combination of subject key information of each case subject, thereby obtaining case key information of the target claim case.
[0103] The benefit of this embodiment is that the key information extraction of the target claim case is converted from text-level feature extraction to sentence-level feature extraction, the target case description data is split into multiple case description sentences, each case description sentence is encoded and pooled, and the sentence representation of the case description sentence is obtained. Then, in the vector space, according to the case theme pointed to by the sentence representation vector of each case description sentence, the multiple case description sentences are clustered into a case description sentence set according to the case theme, the theme key information is determined in each case description sentence set, and the theme key information of all case themes is integrated into case key information, which can realize the extraction of key information under each case theme and improve the information accuracy and comprehensiveness of the case key information.
[0104] In step S103 of some embodiments, scenario analysis is performed on the target case description data to obtain case scenario description information.
[0105] The case scenario description information is used to indicate the specific content of the claim scenario involved in the target claim case. For example, the case scenario description information may be that the target claim case is a claim event caused by a traffic accident.
[0106] See also Figure 3 In some embodiments, step S103 may include but is not limited to steps S301 to S305:
[0107] Step S301, performing word segmentation processing on the target case description data to obtain multiple case description words;
[0108] Step S302, performing self-attention calculation on each case description word to obtain the attention calculation result of each case description word;
[0109] Step S303, feed-forward processing is performed on the attention calculation results to obtain the description latent features of each case description word;
[0110] Step S304, performing feature splicing on the description latent features of each case description word to obtain a scene description splicing feature;
[0111] Step S305: decoding the scene description splicing features based on the preset instructions to obtain case scene description information.
[0112] Steps S301 to S305 are described in detail below.
[0113] In step S301 of some embodiments, a preset word segmenter is used to segment the target case description data, and the target case description data is divided into multiple description words. The modal particles, stop words and other words without actual meaning in the description words are filtered out, and the retained description words are used as case description words.
[0114] In step S302 of some embodiments, first, each case description word is subjected to word embedding processing, and the case description word is converted from the data space to the latent vector space to obtain the case description embedding features corresponding to each case description word. Then, the case description embedding features corresponding to each case description word are input into the preset description generation model, and the self-attention layer of the description generation model performs self-attention calculation on multiple case description words. Specifically, for each case description word, the self-attention layer first linearly projects the case description word in the query channel, the key channel, and the value channel, respectively, to obtain the first query vector output by the query channel, the first key vector output by the key channel, and the first value vector output by the value channel. Then, a dot product operation is performed on the first key vector and the first query vector to obtain a first attention score, and the square root of the feature dimension of the first key vector is used as the first scaling factor, and the first attention score is divided by the first scaling factor to implement a scaling operation on the first attention score, and obtain the scaled first attention score. Furthermore, the scaled first attention score is normalized using the softmax function to obtain the first attention weight, and the first value vector is weighted using the first attention weight to obtain the attention calculation results of each case description word. The attention calculation results can be used to indicate the degree of attention of other case description words to the current case description word.
[0115] In step S303 of some embodiments, the attention calculation results of each case description word are input into the feedforward neural network of the description generation model, and the first linear layer of the feedforward neural network first performs a first linear transformation on the attention calculation results of each case description word, and maps the attention calculation results from a narrow-dimensional vector space to a wide-dimensional vector space, thereby obtaining the variable-dimensional attention features of each case description word. Next, the activation function of the feedforward neural network performs nonlinear activation on the variable-dimensional attention features of each case description word, thereby obtaining the activated attention features of each case description word. Finally, the second linear layer of the feedforward neural network performs a second linear transformation on the activated attention features, and maps the activated attention features of each case description word from a wide-dimensional vector space to the original narrow-dimensional vector space, thereby obtaining the description latent features of each case description word. Among them, the feature dimensions of the description latent features and the attention calculation results are the same.
[0116] In step S304 of some embodiments, the descriptive latent features of each case description word are spliced according to the order of each case description word in the target case description data, and multiple descriptive latent features are sequentially spliced into a longer feature vector to obtain a scene description splicing feature.
[0117] In step S305 of some embodiments, first, the scene description concatenation feature is input into the linear layer of the description generation model, and the linear layer performs feature mapping on the scene description concatenation feature, and maps the scene description concatenation feature from the high-dimensional space to the low-dimensional space to obtain the scene description mapping feature. Then, the scene description mapping feature is input into the decoding layer of the description generation model, and the decoding layer converts the description features in the scene description mapping feature into a sequence form according to the information format defined by the preset instruction, and obtains the case scene description information.
[0118] The advantage of this embodiment is that the semantic information related to the scene description in the target case description data is captured by using the self-attention layer and feedforward neural network of the preset description generation model, so that the scene description information in the target case description data can be gradually deepened, so that the finally generated case scene description information has relatively complete content information, which is beneficial to improving the accuracy of extracting the scene description information of the target case description data, and is also beneficial to improving the accuracy of analyzing the claims scenarios of the target claims cases.
[0119] In step S104 of some embodiments, image generation is performed on the case key information and the case scene description information based on a pre-trained image generation model to obtain a preliminary case scene image corresponding to the target claim case.
[0120] The image generation model is a neural network model constructed based on the diffusion model (stabled influence, SD). The image generation model of the disclosed embodiment often takes a noise image, a case text description of a target claim case, etc. as input, and outputs a scene image consistent with the case text description of the target claim case. The image generation model can generate corresponding scene images according to the case descriptions of various claim cases, and can meet the image generation requirements in various claim scenarios.
[0121] Among them, the image generation model includes a diffusion network, a text encoder, an image generation network and a decoding network.
[0122] The diffusion network is used to implement the gradual noise addition processing of the image features of the input image in the latent vector space until the image features of the input image approach pure noise.
[0123] The image generation network is essentially a denoising network, which is used to gradually denoise the latent space features output by the diffusion network until the predicted image features are generated.
[0124] The text encoder is used to convert the conditional constraints pre-set in image generation from text form to vector form. The text encoder in the embodiment of the present application is mainly used to process the case description data of the target claim case.
[0125] The decoding network is used to map the image features predicted by the image generation model from the latent vector space to the pixel space to output a predicted image that meets the conditional constraints (case description data of the target claim case).
[0126] The preliminary case scene image refers to a case scene image corresponding to a target claim case that is predicted by an image generation model based on target case description data of the target claim case.
[0127] See also Figure 4 In some embodiments, step S104 may include but is not limited to steps S401 to S405:
[0128] Step S401, encoding the case key information based on the text encoder to obtain the case description encoding features;
[0129] Step S402, encoding the case scene description information based on the text encoder to obtain the scene description encoding features;
[0130] Step S403, performing feature fusion on the case description coding feature and the scene description coding feature to obtain a case fusion feature;
[0131] Step S404, based on the case fusion features, denoising is performed on the noise latent space features corresponding to the preset noise image through the image generation network to obtain denoised image features;
[0132] Step S405: Decoding the denoised image features based on the decoding network to obtain a preliminary case scene image corresponding to the target claim case.
[0133] Steps S401 to S405 are described in detail below.
[0134] In step S401 of some embodiments, first, the case key information is input into a text encoder, and the case key information is segmented using the text encoder to obtain multiple key information words. Next, the key information words are embedded, and each key information word is converted from the data space to the latent vector space to obtain the keyword embedding feature corresponding to each key information word, wherein the keyword embedding feature is used to represent the key information word in the form of a string. Next, a preset word list is obtained, wherein the preset word list is used to indicate the candidate feature vector corresponding to each candidate embedding feature in the latent vector space. Further, for each key information word, a candidate embedding feature consistent with the keyword embedding feature is searched in the preset word list, and the candidate feature corresponding to the candidate embedding feature consistent with the keyword embedding feature is used as the case description coding feature of the key information word.
[0135] In step S402 of some embodiments, the specific process of encoding the case scenario description information based on the text encoder is similar to the above step S401, which will not be described in detail to save space.
[0136] In step S403 of some embodiments, when the case description coding feature and the scene description coding feature are fused, the case description coding feature and the scene description coding feature are concatenated to generate a longer feature vector, and the concatenated feature vector is used as the case fusion feature. The case fusion feature is used to indicate the claim scenario information (the occasion when the claim event occurs) and the key claim information (for example, the claim amount, claim time) of the target claim case.
[0137] In step S404 of some embodiments, the noise latent space features corresponding to the preset noise image are used to indicate the result of adding noise to the encoded image features of the preset noise image at a fixed time step through the diffusion network of the image generation model. The encoded image features of the preset noise image are used to indicate the image features of the preset noise image in the vector space (latent space).
[0138] The denoised image features are used to indicate the image feature information that the image corresponding to the target claim case predicted by the image generation model should have.
[0139] The specific process of generating the noise latent space feature corresponding to the preset noise image includes but is not limited to the following steps:
[0140] Performing encoding processing on a preset noise image to obtain encoded image features;
[0141] Based on the preset time step, the encoded image features are diffused through the diffusion network of the image generation model to obtain the noise latent space features.
[0142] Specifically, first, with authorization, the preset image encoder is called. Then, the preset noise image is input into the image encoder, and the preset noise image is encoded based on the image encoder to realize the mapping of the preset noise image from the pixel space to the vector space (potential latent space), thereby obtaining the encoded image feature. Further, according to the preset time step, noise is added to the encoded image feature one by one through the diffusion network, so that the encoded image feature loses its original features one by one. When the number of noise additions reaches the preset time step, the encoded image feature will become a latent space representation without any features. At this time, the obtained latent space representation is determined as the noise latent space feature. For example, the preset time step is set to T, T is a positive integer, and the encoded image feature is noised T times using the diffusion network, and the result after T times of noise addition is used as the noise latent space feature.
[0143] This method maps the preset noise image from the pixel space to the latent space, so that the preset noise image becomes a coded image feature that meets the input requirements of the image generation model, which can improve the usability of the preset noise image. Furthermore, the diffusion network of the image generation model is used to add noise to the coded image features multiple times, realizing the pure noise processing of the coded image features, which can effectively strip the effective image features from the coded image features, so that the model can restore the image features according to the various description information of various target claims cases in the subsequent denoising process, which is conducive to improving the accuracy of the scene images corresponding to the target claims cases generated by the model.
[0144] To save space, the specific process of denoising the noise latent space features corresponding to the preset noise image through the image generation network in the embodiment of the present application will be described in detail below. No further description will be given here.
[0145] In step S405 of some embodiments, the denoised image features are input into a decoding network, and the image features in the denoised image features are mapped from the latent vector space back to the original pixel space through the decoding network to generate a noise-free preliminary case scene image that is consistent with the target case description data of the target claim case.
[0146] The benefit of this embodiment is that the key information and scene description extracted from the target case description data of the target claim case are first converted into a form that meets the input requirements of the image generation model using a text encoder to obtain case fusion features. Then, the encoded image features of the preset noise image are denoised multiple times using a diffusion network to obtain noise latent space features. Furthermore, the noise latent space features are denoised multiple times using an image generation network to achieve image generation. In this process, the predicted image features are fine-tuned using the case key information and scene description information contained in the case fusion features to achieve feature information adjustment at the image angle and text angle, so that the final predicted denoised image features meet the image generation requirements. Finally, the denoised image features are decoded using a decoding network to obtain a predicted preliminary case scene image, which can improve the generation accuracy of the case scene images of each target claim case.
[0147] See also Figure 5 In some embodiments, step S404 may include but is not limited to steps S501 to S504:
[0148] Step S501, linearly projecting the noise latent space features through an image generation network to obtain a query feature vector;
[0149] Step S502, linearly projecting the case fusion features through an image generation network to obtain a key feature vector and a value feature vector;
[0150] Step S503, performing attention calculation on the query feature vector and the key feature vector to obtain an attention weight;
[0151] Step S504, performing a weighted operation on the attention weight and the value feature vector to obtain a denoised image feature.
[0152] Steps S501 to S504 are described in detail below.
[0153] In step S501 of some embodiments, a linear projection is performed on the noise latent space features through a query channel of the image generation network to obtain a query feature vector, wherein the query feature vector is used to indicate internal feature information of a preset noise image extracted by the image generation model.
[0154] In step S502 of some embodiments, the case fusion features are linearly projected through the key channel of the image generation network to obtain a key feature vector, and the case fusion features are linearly projected through the value channel of the image generation network to obtain a value feature vector, wherein both the key feature vector and the value feature vector are used to indicate specific descriptive information of the target case description data of the target claim case.
[0155] In step S503 of some embodiments, when performing attention calculation on the query feature vector and the key feature vector, a dot product operation is performed on the key feature vector and the query feature vector to obtain a second attention score, and the square root of the feature dimension of the key feature vector is used as a second scaling factor, and the second attention score is divided by the second scaling factor to implement a scaling operation on the second attention score to obtain a scaled second attention score. Further, the scaled second attention score is normalized using a softmax function to obtain an attention weight.
[0156] In step S504 of some embodiments, a weighted operation is performed on the attention weight and the value feature vector to obtain a denoised image feature. The denoised image feature can be used to represent specific feature information contained in the image generated by the image generation model under the constraints of the target case description data.
[0157] The benefit of this embodiment is that when generating denoised image features through the image generation network, a cross-attention calculation method is introduced, and the descriptive information contained in the case fusion features is used as a conditional constraint (key feature vectors and value feature vectors are constructed), so that when the image generation network performs multiple denoising on the noise latent space features, in each denoising process, the noise latent space features (initial features in the first round of denoising) or the denoising results of the previous round (initial features in non-first round of denoising) are fine-tuned according to the descriptive information contained in the case fusion features, so that the feature information of the denoised image features finally generated can be closely related to the descriptive information contained in the case fusion features, which can effectively improve the controllability and accuracy of image generation, and is conducive to making the feature information of the denoised image features finally generated as close to the target claim case as possible.
[0158] In step S105 of some embodiments, the preliminary case scene image is enhanced to obtain a target case scene image, so that the target case scene image can be displayed when a request for explanation of the target claim case is received.
[0159] The target case scene image refers to the scene description image that is finally generated and corresponds to the target claim case. The target case scene image includes scene images of multiple links of the target claim case. The target case scene image may contain multiple elements such as characters, environment, and objects. The target case scene image can be used to more comprehensively reproduce the story context of the target claim case.
[0160] An explanation request refers to a request made by an insurance agent to provide insurance knowledge to the insured or other persons or to conduct a detailed analysis of a specific insurance example.
[0161] See also Figure 6 In some embodiments, step S105 includes but is not limited to steps S601 to S604:
[0162] Step S601, performing pixel normalization processing on the preliminary case scene image to obtain a normalized image;
[0163] Step S602, performing feature extraction on the normalized image to obtain image edge features and image texture features of the normalized image;
[0164] Step S603, performing feature enhancement on the image edge features and the image texture features to obtain enhanced image features;
[0165] Step S604, performing feature mapping on the enhanced image features to obtain a target case scene image.
[0166] Steps S601 to S604 are described in detail below.
[0167] In step S601 of some embodiments, first, the pixel value of each pixel in the initial case scene image is obtained. Then, according to the pixel value of each pixel, the pixel value of the pixel with the largest pixel value is taken as the maximum pixel value, and the pixel value of the pixel with the largest pixel value is taken as the minimum pixel value. Further, for each pixel, the difference between the pixel value of the pixel and the minimum pixel value is divided by the difference between the maximum pixel value and the minimum pixel value to obtain the normalized pixel value of the pixel. Finally, the normalized pixel value of each pixel is used to replace the original pixel value to obtain a normalized image. This method normalizes the pixel values of all pixels to a smaller numerical range, which can effectively avoid the numerical stability problems caused by too large or too small numerical ranges, thereby improving the convenience and accuracy of image processing.
[0168] In step S602 of some embodiments, a convolutional neural network can be used to perform feature extraction on the normalized image to capture texture feature information and edge feature information of the normalized image, thereby obtaining image edge features and image texture features of the normalized image, wherein the image texture features are used to indicate the spatial relationship between pixels of the normalized image, and the image edge features are used to indicate the area range where the brightness changes more dramatically in the normalized image.
[0169] In step S603 of some embodiments, when the image edge features and image texture features are enhanced, first, the image texture features are quantized using the gray level co-occurrence matrix to obtain the texture parameters of each pixel of the normalized image in the latent vector space. Then, the texture parameters of each pixel are adjusted to enhance the local details of the normalized image and make the texture information clearer. At the same time, the edge features of the image are sharpened using an edge detection algorithm (e.g., Canny edge detection algorithm, etc.) to make the edge contour of the normalized image clearer, thereby obtaining the enhanced image features corresponding to the normalized image.
[0170] In step S604 of some embodiments, feature mapping is performed on the enhanced image features, and the enhanced image features are mapped from the latent vector space to the pixel space to generate a target case scene image that matches the target case description data of the target claim case. The target case scene image will have more obvious texture, edge and other detail information than the preliminary case scene image, and the image clarity and resolution of the target case scene image will be greater than the preliminary case scene image.
[0171] In addition, upon receiving an explanation request for a target claims case, the server will display the target case scene image on the front-end interface of the object terminal (user end). The object can zoom in, zoom out, rotate, and perform other operations on the target case scene image on the interface at any time to view different image contents.
[0172] The benefit of this embodiment is that the image edge features and image texture features of the preliminary case scene image are enhanced, which can improve the accuracy and visualization effect of the generated target case scene image. Based on this, when a request for explanation of the target claim case is received, a high-quality target case scene image is displayed through the front-end interface, so that when explaining the claim case, the target case scene image and the target case description data can be combined for explanation, which is conducive to improving the accuracy and flexibility of the explanation of the claim case, and improving the visualization of the explanation of the claim case. In addition, when the target case scene image is displayed in a visual form for explanation, the object can zoom in, zoom out, rotate the target case scene image at any time to view different image contents, which can improve the interactive convenience of the claim case explanation, and is conducive to the object fully understanding the case context and process of the target claim case, thereby improving the intuitiveness and display effect of the case explanation.
[0173] See also Figure 7 In some embodiments, the specific process of training the image generation model may include but is not limited to steps S701 to S706:
[0174] Step S701, obtaining image and text sample pairs of multiple sample claim cases;
[0175] Step S702, performing diffusion processing on a preset noise image based on a preset original model to obtain noise latent space features of the preset noise image;
[0176] Step S703, text encoding the sample case description information based on the original model to obtain the sample case description fusion feature;
[0177] Step S704, denoising the noise latent space features based on the sample case description fusion features to obtain a predicted case scene image;
[0178] Step S705, performing loss calculation based on the predicted case scene image and the sample case scene image to obtain an image loss function;
[0179] Step S706: Based on the image loss function, the original model is trained to obtain an image generation model.
[0180] Steps S701 to S706 are described in detail below.
[0181] In step S701 of some embodiments, the image-text sample pair includes a preset noise image, a sample case scene image of a sample claim case, and sample case description information of the sample case scene image.
[0182] The sample case scene image is used to illustrate the specific links involved in the sample claim case and the specific content of each link from an image perspective.
[0183] The sample case description information is used to describe the specific links involved in the sample claim case and the specific content of each link from a textual perspective.
[0184] The preset noise image is a noise image generated based on random numbers and obeys Gaussian distribution.
[0185] When this embodiment is implemented, with authorization, the claim data of claim events that have been generated in the past and have been processed are extracted from a preset database to obtain the claim data of multiple historical claim events. Then, among the multiple historical claim events, the historical claim events that contain both text descriptions and image descriptions in the claim data are screened out as candidate claim events. Furthermore, for each candidate claim event, the text content in the claim data of the candidate claim event is extracted and spliced into sample case description information, and the image content in the claim data of the candidate claim event is extracted and spliced into sample case scene images. Finally, the candidate claim event is used as a sample claim case, and the sample case description information and the sample case scene image of the candidate claim event are constructed into a text-image sample pair.
[0186] In step S702 of some embodiments, the original model is an untrained neural network model constructed based on the diffusion model. The specific process of obtaining the noise latent space feature of the preset noise image by diffusion processing of the preset noise image based on the preset original model is similar to the specific process of generating the noise latent space feature of the preset noise image before step S404. In order to save space, it will not be repeated.
[0187] In step S703 of some embodiments, the specific process of text encoding the sample case description information based on the original model to obtain the sample case description fusion features is similar to the above steps S401 to S403, which will not be described in detail to save space.
[0188] In step S704 of some embodiments, the specific process of denoising the noise latent space features based on the sample case description fusion features to obtain the predicted case scene image is similar to the above step S405, which will not be described in detail to save space.
[0189] In step S705 of some embodiments, since the sample case scene image and the predicted case scene image are of the same size, and the sample case scene image and the predicted case scene image have an equal number of pixels. Based on this, for a single sample claim case, the first pixel value of the pixel at each position in the sample case scene image is obtained, and the second pixel value of the pixel is obtained at the same position in the predicted case scene image. Then, for each pixel, the difference between the first pixel value and the second pixel value is calculated, and the pixel difference is obtained by subtracting the second pixel value from the first pixel difference. Then, the absolute values of the pixel differences of all pixels are averaged to obtain the sub-loss function of the single sample claim case. Finally, the sub-loss functions of all sample claim cases are averaged to obtain the image loss function. Among them, the sub-loss function is used to indicate the degree of difference between the real case scene image of a single sample claim case and the case scene image predicted by the model. The image loss function is used to indicate the overall degree of difference between the case scene image predicted by the original model and the real case scene image.
[0190] In step S706 of some embodiments, the model parameters of the original model are adjusted with minimizing the image loss function as the training goal, and the above steps S710 to S706 are repeated to implement iterative training of the original model, and the model parameters that minimize the image loss function are used as the final model parameters, and the original model with the final model parameters is used as the trained image generation model.
[0191] The advantage of this embodiment is that, based on a supervised learning approach, the sub-loss function of each image-text sample pair is determined according to the pixel differences between the sample case scene image and the predicted case scene image of each sample claim case, and an image loss function is constructed based on multiple sub-loss functions. This approach can train an image generation model by minimizing the pixel differences between the sample case scene image and the predicted case scene image, which is beneficial to improving the model training effect, and thereby improving the model's prediction accuracy in generating case scene images corresponding to each claim case.
[0192] See also Figure 8 The embodiment of the present application further provides an image generating device, which can implement the above-mentioned image generating method, and the device includes:
[0193] An acquisition unit 801 is used to acquire target case description data of a target claim case in response to an image generation request for a target claim case;
[0194] An extraction unit 802 is used to extract key information from the target case description data to obtain case key information;
[0195] An analysis unit 803 is used to perform scenario analysis on the target case description data to obtain case scenario description information;
[0196] A generating unit 804 is used to generate an image of the case key information and the case scene description information based on a pre-trained image generation model to obtain a preliminary case scene image corresponding to the target claim case;
[0197] The enhancement unit 805 is used to perform image enhancement on the preliminary case scene image to obtain a target case scene image, so as to display the target case scene image when receiving an explanation request for the target claim case.
[0198] In some embodiments, the extraction unit 802 is used to:
[0199] Sentence processing is performed on the target case description data to obtain multiple case description sentences;
[0200] Encode the case description sentence to obtain a sentence representation vector of the case description sentence;
[0201] Based on the sentence representation vector, the topic of the case description sentence is predicted to obtain the case topic corresponding to the case description sentence;
[0202] According to the case topics of each case description sentence, the case description sentences are clustered to obtain a case description sentence set;
[0203] For each case topic, extract key information from the case description sentence set of the case topic to obtain the key information of the case topic;
[0204] Combine multiple topic key information into case key information.
[0205] In some embodiments, the analysis unit 803 is used to:
[0206] Perform word segmentation on the target case description data to obtain multiple case description words;
[0207] Perform self-attention calculation on each case description word to obtain the attention calculation result of each case description word;
[0208] Perform feed-forward processing on the attention calculation results to obtain the latent features of the description words of each case;
[0209] The latent features of the description words of each case are concatenated to obtain the scene description concatenation features;
[0210] Based on the preset instructions, the scene description splicing features are decoded to obtain the case scene description information.
[0211] In some embodiments, the image generation model includes a text encoder, an image generation network, and a decoding network; the generation unit 804 is used to:
[0212] Encode the key information of the case based on the text encoder to obtain the coding features of the case description;
[0213] Encode the case scene description information based on the text encoder to obtain the scene description encoding features;
[0214] Perform feature fusion on the case description coding features and the scene description coding features to obtain case fusion features;
[0215] Based on the case fusion features, the noise latent space features corresponding to the preset noise image are denoised through the image generation network to obtain the denoised image features;
[0216] The denoised image features are decoded based on the decoding network to obtain the preliminary case scene image corresponding to the target claim case.
[0217] In some embodiments, based on the case fusion features, the noise latent space features corresponding to the preset noise image are denoised through the image generation network to obtain denoised image features, including:
[0218] Linearly project the noise latent space features through the image generation network to obtain the query feature vector;
[0219] Linearly project the case fusion features through the image generation network to obtain the key feature vector and value feature vector;
[0220] Perform attention calculation on the query feature vector and the key feature vector to obtain the attention weight;
[0221] The attention weights and value feature vectors are weighted to obtain the denoised image features.
[0222] In some embodiments, the enhancement unit 805 is used to:
[0223] Perform pixel normalization on the preliminary case scene image to obtain a normalized image;
[0224] Perform feature extraction on the normalized image to obtain image edge features and image texture features of the normalized image;
[0225] Perform feature enhancement on image edge features and image texture features to obtain enhanced image features;
[0226] Perform feature mapping on the enhanced image features to obtain the target case scene image.
[0227] In some embodiments, the image generation model is trained in the following manner:
[0228] Acquire a plurality of image-text sample pairs of sample claim cases, wherein the image-text sample pairs include a preset noise image, a sample case scene image of the sample claim case, and sample case description information of the sample case scene image;
[0229] Diffusion processing is performed on a preset noise image based on a preset original model to obtain noise latent space features of the preset noise image;
[0230] Based on the original model, the sample case description information is encoded textually to obtain the sample case description fusion features;
[0231] Based on the sample case description fusion features, the noise latent space features are denoised to obtain the predicted case scene image;
[0232] The loss is calculated based on the predicted case scene image and the sample case scene image to obtain the image loss function;
[0233] Based on the image loss function, the original model is trained to obtain the image generation model.
[0234] The specific implementation of the image generating device is substantially the same as the specific implementation of the above-mentioned image generating method, and will not be described in detail here.
[0235] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned image generation method. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0236] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0237] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0238] The memory 902 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 may store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the image generation method of the embodiment of this application;
[0239] Input / output interface 903, used to implement information input and output;
[0240] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);
[0241] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0242] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0243] An embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the above-mentioned image generation method.
[0244] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0245] The image generation method, image generation device, electronic device and computer-readable storage medium provided in the embodiments of the present application can obtain the target case description data of the target claim case by responding to the image generation request for the target claim case, and can promptly respond to the user's demand for generating scene images of each claim case, which is conducive to improving the efficiency of response interaction. Further, the target case description data is extracted for key information to obtain the case key information, and the target case description data is subjected to scene analysis to obtain the case scene description information, which can eliminate the interference of irrelevant description information on image generation, and is conducive to improving the extraction accuracy and comprehensiveness of the description information of the target claim case. Further, based on the pre-trained image generation model, the case key information and the case scene description information are image generated to obtain the preliminary case scene image corresponding to the target claim case, and the preliminary case scene image is enhanced to obtain the target case scene image, which can improve the convenience and accuracy of image generation, so that when the explanation request for the target claim case is received, a high-quality target case scene image is displayed. This method enables the target case scene image and target case description data to be combined for explanation when explaining the claims case, which is conducive to improving the accuracy and flexibility of the explanation of the claims case and improving the visualization of the explanation of the claims case.
[0246] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0247] It can be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0248] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0249] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0250] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0251] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0252] In the several embodiments provided in the present 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 only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0253] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0254] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0255] If the integrated unit 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 present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0256] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. An image generation method, characterized in that: The image generation method comprises: In response to an image generation request for a target claim case, obtaining target case description data of the target claim case; Extracting key information from the target case description data to obtain key case information; Performing scenario analysis on the target case description data to obtain case scenario description information; Generate an image of the case key information and the case scene description information based on a pre-trained image generation model to obtain a preliminary case scene image corresponding to the target claim case; The preliminary case scene image is enhanced to obtain a target case scene image, so as to display the target case scene image when a request for explanation of the target claim case is received.
2. The method according to claim 1, characterized in that The key information of the target case description data is extracted to obtain the key information of the case, including: Sentence processing is performed on the target case description data to obtain a plurality of case description sentences; Encoding the case description sentence to obtain a sentence representation vector of the case description sentence; Performing topic prediction on the case description sentence based on the sentence representation vector to obtain a case topic corresponding to the case description sentence; Clustering the case description sentences according to the case topics of the case description sentences to obtain a case description sentence set; For each of the case topics, extract key information from the case description sentence set of the case topic to obtain the topic key information of the case topic; Combine multiple subject key information into the case key information.
3. The method according to claim 1, characterized in that The performing scenario analysis on the target case description data to obtain case scenario description information includes: Performing word segmentation processing on the target case description data to obtain multiple case description words; Performing self-attention calculation on each of the case description words to obtain attention calculation results of each of the case description words; Performing feed-forward processing on the attention calculation result to obtain the descriptive latent features of each case description word; Perform feature splicing on the descriptive latent features of each case description word to obtain a scene description splicing feature; The scene description splicing features are feature decoded based on preset instructions to obtain the case scene description information.
4. The method according to claim 1, characterized in that The image generation model includes a text encoder, an image generation network and a decoding network; the image generation model based on the pre-training generates an image of the case key information and the case scene description information to obtain a preliminary case scene image corresponding to the target claim case, including: Encoding the case key information based on the text encoder to obtain case description encoding features; Encoding the case scene description information based on the text encoder to obtain scene description encoding features; Performing feature fusion on the case description coding feature and the scene description coding feature to obtain a case fusion feature; Based on the case fusion features, the noise latent space features corresponding to the preset noise image are denoised through the image generation network to obtain denoised image features; The denoised image features are decoded based on the decoding network to obtain a preliminary case scene image corresponding to the target claim case.
5. The method according to claim 4, characterized in that Based on the case fusion features, the noise latent space features corresponding to the preset noise image are denoised by the image generation network to obtain denoised image features, including: Performing linear projection on the noise latent space features through the image generation network to obtain a query feature vector; Linearly projecting the case fusion features through the image generation network to obtain a key feature vector and a value feature vector; Performing attention calculation on the query feature vector and the key feature vector to obtain an attention weight; A weighted operation is performed on the attention weight and the value feature vector to obtain the denoised image feature.
6. The method according to claim 1, characterized in that The image generation model is trained in the following way: Acquire a plurality of image-text sample pairs of sample claim cases, wherein the image-text sample pairs include a preset noise image, a sample case scene image of the sample claim case, and sample case description information of the sample case scene image; Diffusion processing is performed on the preset noise image based on a preset original model to obtain noise latent space features of the preset noise image; Performing text encoding on the sample case description information based on the original model to obtain a sample case description fusion feature; Based on the sample case description fusion feature, the noise latent space feature is denoised to obtain a predicted case scene image; Perform loss calculation based on the predicted case scene image and the sample case scene image to obtain an image loss function; Based on the image loss function, the original model is trained to obtain the image generation model.
7. The method according to any one of claims 1 to 6, characterized in that: The performing image enhancement on the preliminary case scene image to obtain a target case scene image includes: Performing pixel normalization processing on the preliminary case scene image to obtain a normalized image; Performing feature extraction on the normalized image to obtain image edge features and image texture features of the normalized image; Performing feature enhancement on the image edge features and image texture features to obtain enhanced image features; Feature mapping is performed on the enhanced image features to obtain the target case scene image.
8. An image generating device, characterized in that: The image generating device comprises: an acquisition unit, configured to acquire target case description data of the target claim case in response to an image generation request for the target claim case; An extraction unit, used to extract key information from the target case description data to obtain case key information; An analysis unit, used to perform scenario analysis on the target case description data to obtain case scenario description information; A generating unit, configured to generate an image of the case key information and the case scene description information based on a pre-trained image generation model, and obtain a preliminary case scene image corresponding to the target claim case; The enhancement unit is used to perform image enhancement on the preliminary case scene image to obtain a target case scene image, so as to display the target case scene image when receiving an explanation request for the target claim case.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the image generation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image generating method according to any one of claims 1 to 7 is implemented.