Image generation method and device, computer equipment and storage medium
By acquiring users' EEG signals and using detection models to determine desired information, an improvement plan that meets users' needs is generated. This solves the problems of insufficient humanization and adaptability in existing generative design technologies, and realizes a design plan that is more in line with users' needs.
Patent Information
- Application Number
- CN202510907540.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-11-07
AI Technical Summary
Existing generative artificial intelligence has failed to effectively incorporate users' subjective feelings, behavioral characteristics, and psychological preferences in landscape design and urban planning, resulting in shortcomings in the humanization and adaptability of the generated solutions.
By acquiring the EEG signals of target users when viewing images of the area to be improved, a pre-trained detection model is used to determine the user's expected information, and a target improvement image is generated based on this information. Combined with an image generation model, an improvement plan that meets the user's improvement needs is generated.
The generated improvement solutions are better suited to the improvement needs of the target users, improving humanization and adaptability, and quickly generating design solutions that fit user needs.
Smart Images

Figure CN120912698A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to an image generation method and device, a computer device and a storage medium. BACKGROUND
[0002] In recent years, with the improvement of people's aesthetic level, the requirements for landscape design, architectural creativity and urban planning fields are becoming higher and higher. With the development of generative artificial intelligence, generative design is gradually becoming an important direction in the field of urban space planning and design. However, the design scheme generated based on generative design often has deficiencies in humanization and adaptability, so how to use artificial intelligence for generative design is an important basis for generating good design schemes. SUMMARY
[0003] Therefore, the present application provides an image generation method and device, a computer device and a storage medium.
[0004] In a first aspect, the present application provides an image generation method, comprising:
[0005] obtaining an image of a region to be improved, and an electroencephalogram of a target user imagining an improvement result of the region to be improved during viewing of the image to be improved;
[0006] inputting the electroencephalogram into a pre-trained detection model to determine expected information of the target user on the region to be improved; wherein the expected information includes intensity level information of the target user on improvement of the region to be improved in each spatial feature dimension;
[0007] generating prompt information based on the expected information, and generating a target improved image corresponding to the image of the region to be improved based on the prompt information, the image of the region to be improved and a first image generation model.
[0008] Optionally, the inputting of the electroencephalogram into the pre-trained detection model comprises:
[0009] determining a spatial element type corresponding to the image of the region to be improved;
[0010] inputting the electroencephalogram into a detection model corresponding to the spatial element type, wherein different spatial element types correspond to different detection models.
[0011] Optionally, the inputting of the electroencephalogram into the pre-trained detection model comprises:
[0012] determining a spatial element type corresponding to the image of the region to be improved;
[0013] inputting the spatial element type and the electroencephalogram signal into the pre-trained detection model, wherein different spatial element types correspond to the same detection model.
[0014] Optionally, the method further comprises obtaining sample data for training the detection model according to the following method:
[0015] obtaining sample images under multiple spatial element types;
[0016] for any sample image under any spatial element type, generating multiple updated images of the sample image under multiple preset intensity levels of each spatial feature dimension of the spatial element type based on a second image generation model;
[0017] taking the sample image, the updated image, and the intensity level of the spatial feature dimension when the updated image is generated as the sample data.
[0018] Optionally, the method further comprises training the detection model according to the following method:
[0019] generating a sample video based on a sample image in the sample data and an updated image corresponding to the sample image;
[0020] obtaining a sample electroencephalogram signal of a test user when the test user watches the sample video;
[0021] inputting the sample electroencephalogram signal into the detection model to be trained to determine a prediction result of the detection model, wherein the prediction result is intensity level information of the updated image predicted by the detection model to be improved under each spatial feature dimension;
[0022] training the detection model to be trained based on the prediction result and the intensity level of the spatial feature dimension when the updated image is generated.
[0023] Optionally, the method further comprises:
[0024] for any sample video, obtaining multiple initial electroencephalogram signals of multiple test users when the test users watch the sample video;
[0025] determining a perception intensity score corresponding to the multiple initial electroencephalogram signals;
[0026] taking a sample video with a perception intensity score greater than a preset value as a target sample video, and taking an electroencephalogram signal of the test user when the test user watches the target sample video as the sample electroencephalogram signal.
[0027] Optionally, the method further comprises:
[0028] extracting time domain features and frequency domain features of the sample electroencephalogram signal;
[0029] inputting the time domain features and the frequency domain features into the detection model to be trained.
[0030] In a second aspect, the present application further provides an image generation device, which comprises:
[0031] an acquisition module, configured to acquire an image of a region to be improved, and an electroencephalogram signal of a target user imagining an improvement result of the region to be improved during viewing of the image to be improved;
[0032] a determination module, configured to input the electroencephalogram signal into a pre-trained detection model, and determine expected information of the target user on the region to be improved; wherein the expected information comprises intensity level information of the target user on improvement of the region to be improved in each spatial feature dimension;
[0033] a generation module, configured to generate prompt information based on the expected information, and generate a target improved image corresponding to the image of the region to be improved based on the prompt information, the image of the region to be improved, and a first image generation model.
[0034] In a third aspect, the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the image generation method.
[0035] In a fourth aspect, the present application further provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the image generation method when executing the program.
[0036] The image generation method, device, computer device and storage medium provided by the present application can acquire the electroencephalogram signal of the target user imagining the improvement result of the region to be improved during viewing of the image to be improved, process the electroencephalogram signal through the pre-trained detection model, determine the expected information of the target user on the region to be improved, reflect the intensity of the target user on improvement of the region to be improved in various spatial feature dimensions through the expected information, generate the prompt information based on the expected information, and generate the target improved image corresponding to the region to be improved based on the prompt information, the image of the region to be improved, and the first image generation model. In this way, the target improved image can be understood as being generated based on the electroencephalogram signal when the target user imagines the improvement result, and the improvement scheme provided by the target improved image can better meet the improvement needs of the target user, so that the improvement scheme meeting the user's improvement needs can be quickly generated through this way. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 is a flow chart of an image generation method according to an example embodiment of the present application;
[0038] Figure 2 is a flow chart of a sample data construction method according to an example embodiment of the present application;
[0039] Figure 3 is a flow chart of a detection model training method according to an example embodiment of the present application;
[0040] Figure 4 is a general flow framework diagram of an image generation method according to an example embodiment of the present application;
[0041] Figure 5 is an architecture schematic diagram of an image generation apparatus according to an example embodiment of the present application;
[0042] Figure 6 is a structure schematic diagram of a computer device according to an example embodiment of the present application. DETAILED DESCRIPTION
[0043] The example embodiments will now be described in detail with reference to the accompanying drawings. If the description of the example embodiments refers to accompanying drawings, then the description is illustrative of the example embodiments and does not limit the present application. Although specific implementations have been shown and described herein, it is understood that the application is not limited to the implementations shown, but is to be accorded the full scope as claimed.
[0044] The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the description of the application and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It also will be understood that the term “and / or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0045] It is to be understood that the singular forms “a,” “an,” and “the” include plural referents unless the context clearly dictates otherwise. It is to be understood that the term “and / or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It is to be understood that although the terms first, second, third, etc. can be used herein to describe various information, the information is not to be limited by these terms. These terms are only used to distinguish one piece of information from another. For example, a first information can be termed a second information, and, similarly, a second information can be termed a first information without departing from the scope of the present application. As used herein, the term “if’ can be construed to mean “when” or “upon” or “in response to determining” depending on the context.
[0046] In recent years, with the improvement of people's aesthetic level, the requirements for landscape design, architectural creativity and urban planning are becoming higher and higher. With the development of generative artificial intelligence, generative design is gradually becoming an important direction in the field of urban space planning and design.
[0047] However, general artificial intelligence generally takes planning constraints, experience constraints or optimization functions as the core of the generation logic. Although it can achieve rapid scheme output, it fails to incorporate user's subjective feelings, behavioral characteristics and psychological preferences into the generation process, resulting in deficiencies in humanization and adaptability of the generated scheme.
[0048] Therefore, the present application provides an image generation method, device, computer equipment and storage medium. After obtaining the electroencephalogram signal of the target user imagining the improvement result of the to-be-improved area during watching the to-be-improved image, the electroencephalogram signal is processed by the pre-trained detection model, the expected information of the target user for the to-be-improved area can be determined, the expected information can reflect the intensity of the target user's improvement of the to-be-improved area in various spatial characteristic dimensions, then the prompt information is generated based on the expected information, and the target improvement image corresponding to the to-be-improved area is generated based on the prompt information, the to-be-improved area image and the first image generation model. In this way, the target improvement image can be understood as being generated based on the electroencephalogram signal when the target user imagines the improvement result, and the improvement scheme provided by the target improvement image can better meet the improvement needs of the target user. Therefore, by this way, the improvement scheme meeting the user's improvement needs can be quickly generated.
[0049] Referring to Figure 1 The flowchart of the image generation method provided by the present application is shown, which includes the following steps:
[0050] S101, obtaining a to-be-improved area image and an electroencephalogram signal of a target user imagining an improvement result of a to-be-improved area during watching the to-be-improved image.
[0051] S102, inputting the electroencephalogram signal into a pre-trained detection model to determine expected information of the target user for the to-be-improved area; wherein the expected information includes intensity level information of the target user for improvement of the to-be-improved area in each spatial characteristic dimension.
[0052] S103, generating prompt information based on the expected information, and generating a target improvement image corresponding to the to-be-improved area image based on the prompt information, the to-be-improved area image and a first image generation model.
[0053] The following is a detailed description of the above steps.
[0054] For S101,
[0055] The to-be-improved region image can be a panoramic image, and the to-be-improved region can be, for example, a to-be-improved block or a to-be-improved house.
[0056] Optionally, the target user can play prompt information matched with the to-be-improved image during watching the to-be-improved image, to guide the target user to imagine the improvement result. For example, the prompt information can be "Can you imagine that green plants need to be added on both sides of the street, and what decorative objects need to be placed beside the street…".
[0057] For S102,
[0058] Here, the detection model can be, for example, a random forest (Random Forest) or an XGBoost model.
[0059] The spatial feature dimension of the to-be-improved region is related to the spatial element type to which the to-be-improved region belongs, and the spatial feature dimensions of different spatial element types are different.
[0060] For example, the spatial element type can include a wall-type interface (such as a wall), a commercial-type interface (such as a shop), and an outdoor landscape element (such as a decorative sign or a commercial outdoor display).
[0061] The spatial feature dimension of the wall-type interface can include openness, decoration, and interactivity. The openness of the wall-type interface refers to the degree of permeability of the wall, that is, whether there are window holes, hollow designs, or vegetation coverage to affect the visual experience of pedestrians and the openness of the street space; the decoration refers to the color, texture, and additional elements of the wall, which determine the coordination with the surrounding architectural style and affect the cultural expression of the block; the interactivity refers to whether the wall has interactive functions, such as whether it contains seats, display columns, semi-open windows, or other facilities that can be used by pedestrians to enhance the social attributes and spatial vitality of the wall.
[0062] The spatial feature dimension of the commercial-type interface can include hierarchy, visual accessibility, and aesthetics. The hierarchy of the commercial-type interface refers to the vertical relationship between the commercial interface and the street, such as the steps, platforms, or height difference treatment in front of the shop, which affects the accessibility of pedestrians, the rhythm of the space, and the accessibility of the shop; the visual accessibility refers to the visibility of elements such as storefronts and billboards, which affects the attractiveness of the commercial space and the efficiency of information transmission; and the aesthetics refers to the collocation of different signs and decorations, which plays an important role in the overall visual experience of the street and the environmental quality.
[0063] The spatial feature dimensions of the outdoor landscape elements can include enclosure, permeability, and shielding. The enclosure of the outdoor landscape elements refers to the enclosure and continuity of the street side green land to the street, which affects the walking comfort and the activity safety on the ground. The permeability measures the penetration of the outdoor landscape in the street, including the opening degree of the public space affected by the form and quantity of the street furniture. The shielding refers to the shielding effect of the building sunshades, canopies, and the like on the street, which affects the microclimate environment, the pedestrian comfort, and the visual focus guidance.
[0064] Optionally, the spatial element type can further include one or more of a traffic node, a street corner, street furniture, lighting facilities, a building facade component, a public art device, an identification system, and a greening system.
[0065] In a possible implementation, the inputting of the electroencephalogram signal into the pre-trained detection model can refer to determining a spatial element type corresponding to the image of the region to be improved, and then inputting the electroencephalogram signal into a detection model corresponding to the spatial element type, wherein different spatial element types correspond to different detection models.
[0066] Taking the spatial element type including the above-mentioned wall-type interface, commercial-type interface, and outdoor landscape element as an example, the wall-type interface corresponds to one detection model, the commercial-type interface corresponds to one detection model, and the outdoor landscape element corresponds to one detection model. The actual detection process can be detected through the three detection models.
[0067] In another possible implementation, different spatial element types can correspond to the same detection model. When the electroencephalogram signal is input into the pre-trained detection model, the spatial element type corresponding to the image of the region to be improved can be determined first; and then the spatial element type and the electroencephalogram signal are input into the pre-trained detection model synchronously.
[0068] Since the spatial feature dimensions of different spatial element types are different, after the spatial element type corresponding to the image of the region to be improved is input into the detection model, the detection model can determine the corresponding spatial feature dimension according to the spatial element type corresponding to the image of the region to be improved, and determine the intensity level information under the corresponding spatial feature dimension.
[0069] Optionally, the spatial element type corresponding to the image of the region to be improved can be pre-marked or detected through a semantic detection model. For example, the semantic elements in the image of the region to be improved can be detected through a semantic detection model, and then the spatial element type is determined according to the category of the semantic elements.
[0070] Optionally, the spatial element type corresponding to the image of the region to be improved can be a certain type, and the expected information is the level information of each spatial feature dimension of the spatial element type. For example, if the spatial element type corresponding to the image of the region to be improved is a fence interface, the determined expected information can be high openness + medium decoration + low interaction.
[0071] Optionally, the spatial element type corresponding to the image of the region to be improved can be multiple types, and the expected information includes the level information of each spatial feature dimension of each spatial element type. For example, if the spatial element type corresponding to the image of the region to be improved is a fence interface + a commercial interface, the determined expected information can be high openness + medium decoration + low interaction + high hierarchy + low visual accessibility + medium aesthetics.
[0072] In actual application, before the electroencephalogram signal is input into the detection model, the time domain feature and the frequency domain feature of the electroencephalogram signal can be extracted, and then the extracted time domain feature and the frequency domain feature are input into the detection model.
[0073] Here, the time domain feature of the electroencephalogram signal can be represented by a late positive potential (LPP), and the frequency domain feature can be represented by a Gamma wave. Optionally, the time domain feature can also be represented by P300, N200, N170, etc., and the frequency domain feature can also be represented by waves of different frequency bands such as Theta, Alpha, Beta, etc.
[0074] For example, when extracting the time domain feature, a preset time window (such as 0.3s-1.0s) can be selected as the time window for LPP calculation, the electroencephalogram signal data in the time period is extracted, and the mean value of the time dimension is calculated to obtain the average amplitude feature of LPP.
[0075] When extracting the frequency domain feature, the Gamma wave in the preset frequency range can be selected, and a frequency sequence is constructed according to a fixed frequency length (such as 2 Hz) incremental step, and a wavelet transform is used to calculate the time-frequency power.
[0076] After the calculation is completed, in order to integrate the LPP and the Gamma frequency band feature, the two features can be spliced in the feature dimension (channel) to form a final electroencephalogram signal feature matrix, each channel of the electroencephalogram signal feature matrix includes two features: LPP amplitude and Gamma power. Then the electroencephalogram signal feature matrix can be input into the detection model.
[0077] For S103,
[0078] In a possible implementation, when the prompt information is generated based on the expected information, the intensity level information included in the expected information can be added to the corresponding position of the prompt template to generate the corresponding prompt information.
[0079] Alternatively, the label information can be converted into a multi-dimensional text label combination (such as openness high + decoration medium + interaction low), and then detailed prompt information is generated based on a generative model (such as a generative pre-trained transformer (GPT)).
[0080] In the generating of the target improvement image corresponding to the region-to-be-improved image based on the prompt information, the region-to-be-improved image, and the first image generation model, the prompt information and the region-to-be-improved image can be input into the first image generation model, and the first image generation model can output the target improvement image.
[0081] Optionally, the prompt information can further include style information, which is used to describe the architectural style to which the target improvement image belongs. For example, the style information can be determined by the target user.
[0082] The target improvement image generated in this way can be understood as being generated based on the brain electrical signals when the target user imagines the improvement result, and the improvement scheme provided by the target improvement image can better meet the improvement needs of the target user. Therefore, this way can quickly generate an improvement scheme that meets the user's improvement needs.
[0083] The training process of the detection model will be described below in conjunction with the specific embodiments.
[0084] Referring to Figure 2 As shown in the figure, a flowchart of a sample data construction method provided for the application describes the construction of sample data for training the detection model, and includes the following steps:
[0085] S201, acquire sample images under multiple spatial element types.
[0086] S202, for any sample image under any spatial element type, generate multiple updated images of the sample image under multiple preset intensity levels of each spatial feature dimension of the spatial element type based on a second image generation model.
[0087] Optionally, the second image generation model can be the same model as the first image generation model, or can be a different model.
[0088] Here, when generating the updated image, each intensity level can be traversed to generate different updated images.
[0089] For example, for sample image 1, if the spatial feature type corresponding to sample image 1 is a fence interface, 27 updated images with different intensity levels can be generated respectively, with the spatial feature dimensions being (openness high / medium / low)*(decorativeness high / medium / low)*(interactivity high / medium / low).
[0090] S203, the sample image, the updated image, and the intensity level of the spatial feature dimension when generating the updated image are taken as the sample data.
[0091] Here, the intensity level of the spatial feature dimension when generating the updated image can be taken as label data or supervised data, and the specific training process is described below.
[0092] Referring to Figure 3 The training method of the detection model provided by the present application comprises the following steps:
[0093] S301, generating a sample video based on a sample image in the sample data and an updated image corresponding to the sample image.
[0094] Here, when generating a sample video, a corresponding sample video can be generated for each sample image. Different sample images correspond to different sample videos.
[0095] For example, when generating a sample video, in order to improve the stability of the data and reduce the influence of individual differences, each picture can be presented 20 times in the video to enhance the reliability of the data and ensure the stability of the electroencephalogram signal in multiple tests. In order to prevent the electroencephalogram signal from overlapping due to continuous stimulation, and to reduce the electroencephalogram artifacts caused by excessive visual stimulation, a 1000 millisecond (1 second) inter-stimulus interval (ISI) can be inserted between the presentation of the pictures. This setting not only helps the subsequent test users to properly recover their cognition between different stimuli, but also reduces the deviation caused by visual adaptation or attention decline, improving the accuracy and interpretability of the data.
[0096] S302, obtaining a sample electroencephalogram signal of a test user when watching the sample video.
[0097] Optionally, after obtaining the sample electroencephalogram signal, a series of standardization preprocessing can be performed on the sample electroencephalogram signal to improve the signal quality and ensure the accuracy of subsequent analysis. For example, the sample electroencephalogram signal can be preprocessed by downsampling, identifying and proposing damaged channels, filtering, cropping time, processing artifacts, etc.
[0098] In addition, in order to make the LPP data comparable between different individuals and different spatial element update schemes (different update images generated above include different spatial element update schemes), the electroencephalogram can be screened through the perceived intensity score.
[0099] Specifically, when obtaining the sample electroencephalogram of the test user watching the sample video, for any sample video, a plurality of initial electroencephalograms of the test user watching the sample video can be obtained, and then the perceived intensity scores corresponding to the plurality of initial electroencephalograms are determined, and then the sample video with a perceived intensity score greater than a preset value is taken as a target sample video, and the electroencephalogram of the test user watching the target video is taken as the sample electroencephalogram.
[0100] Here, the perceived intensity score can be determined according to the maximum LPP value and the minimum LPP value in the electroencephalogram of all test users. For example, the perceived intensity score (PIS) can be calculated by the following formula:
[0101]
[0102] Wherein, LPP represents the late positive potential under the current experimental condition, LPP max represents the maximum LPP value in the plurality of initial electroencephalograms, LPP min represents the minimum LPP value in the plurality of initial electroencephalograms.
[0103] The PIS score takes the maximum Max-min minimum normalization method as the core method, so that the LPP data is comparable between different individuals and different spatial element update schemes.
[0104] If the LPP response is high (i.e., the PIS score is high, such as greater than 0.6), it means that the update scheme of the spatial element is more likely to cause a positive perception response, such as enhancing the pleasant feeling, attracting attention or improving the environmental experience. This indicates that the update strategy is more effective in improving the spatial perception effect. If the LPP response is low, it means that the update scheme of the spatial element has a weak effect on the perception of the subject, or the subject cannot perceive the changes brought by the update. This may mean that the update amplitude is insufficient, or the spatial feature itself has a small effect on the perception. Therefore, through the PIS, sample data with high quality can be screened out.
[0105] Optionally, when screening the sample data, gaze duration, aesthetic score, electroencephalogram response intensity, expert artificial evaluation, questionnaire feedback, etc. can also be combined to screen out sample data with higher quality, thereby enhancing the reliability and adaptability of the data.
[0106] In a possible implementation, if the number of sample images of a certain spatial element type is small (for example, less than a preset proportion or less than a preset number) after the sample data is screened based on the method, in order to improve the richness of the sample, the sample data of the spatial element type can be reconstructed based on the method shown in Figure 2 to avoid affecting the recognition accuracy of the detection model for the spatial element type.
[0107] S303, input the sample electroencephalogram signal into the detection model to be trained, and determine a prediction result of the detection model, wherein the prediction result is intensity level information of the updated image predicted by the detection model in each spatial feature dimension.
[0108] Here, when the sample electroencephalogram signal is input into the detection model to be trained, time domain feature extraction and frequency domain feature extraction can be performed on the sample electroencephalogram signal, and then the extracted time domain features and frequency domain features are input into the detection model to be trained.
[0109] In order to train an efficient detection model, the sample electroencephalogram data of all test users can be merged first, and the training set and the test set are divided according to a preset proportion (for example, 80% as the training set and 20% as the test set), and each sample contains LPP waveform features and Gamma band power features. Among them, the independent variable is the electroencephalogram feature matrix, and the target variable is the intensity level of each spatial element in each spatial feature dimension.
[0110] S304, training the detection model to be trained based on the prediction result and the intensity level of the spatial feature dimension when the updated image is generated.
[0111] Optionally, when the detection model to be trained is trained based on the prediction result and the intensity level of the spatial feature dimension when the updated image is generated, loss value calculation can be performed based on the prediction result and the intensity level of the spatial feature dimension when the updated image is generated, and then the model parameters of the detection model to be trained are adjusted based on the calculated loss value until the detection model converges or reaches a preset training number.
[0112] Here, it should be noted that if different spatial element types correspond to different detection models, the training processes of different detection models are separate, that is, the training can be parallel or sequential. The sample data for training a certain detection model includes sample images of the spatial element type detected by the detection model, updated images corresponding to the sample images, and intensity levels of spatial feature dimensions when the updated images are generated. The specific training process is the same as the steps shown in Figure 3 .
[0113] If different spatial elements correspond to the same detection model, the sample data set for training the detection model includes sample images of multiple spatial element types, update images corresponding to each sample image, and the intensity level of the spatial feature dimension when generating each update image.
[0114] Next, the above image generation method will be introduced in combination with the overall flowchart. Referring to Figure 4 , it is an overall flowchart of an image generation method provided by the present application, which includes the following steps:
[0115] First, generate samples based on AI. The samples generated based on AI are sample images in the method shown in Figure 2 , and then collect electroencephalogram signals. Here, the collected sample electroencephalogram signals are those of the test user when watching the sample video in step S302 described above. Then, the perception system is used to score, i.e. filter pictures with PIS greater than a preset value (such as 0.6), to form a spatial element feature database. Then, based on the sample data in the spatial element feature database, the detection model is trained to obtain a trained detection model. Then, based on the above step S101, the electroencephalogram signals of the user are collected, and the electroencephalogram features are extracted. The extracted features are input into the detection model, and then the GPT description and AI picture generation are performed to generate the target improvement image.
[0116] For detailed description of the above steps, refer to the above embodiment, which will not be described here.
[0117] Corresponding to the above embodiment of the image generation method, the present application also provides an embodiment of an image generation device.
[0118] Referring to Figure 5 , it is an architecture schematic diagram of an image generation device provided by the present application, which includes:
[0119] The acquisition module 501 is configured to acquire a to-be-improved region image and electroencephalogram signals of a target user imagining an improvement result of the to-be-improved region during watching the to-be-improved image;
[0120] The determination module 502 is configured to input the electroencephalogram signals into a pre-trained detection model to determine expected information of the target user on the to-be-improved region; wherein the expected information includes intensity level information of the target user on the improvement of the to-be-improved region in each spatial feature dimension;
[0121] The generation module 503 is configured to generate prompt information based on the expected information, and generate a target improvement image corresponding to the to-be-improved region image based on the prompt information, the to-be-improved region image, and a first image generation model.
[0122] Optionally, the determining module 502, when inputting the EEG signal into the pre-trained detection model, is used to:
[0123] Determine the spatial feature type corresponding to the image of the region to be improved;
[0124] The EEG signal is input into the detection model corresponding to the spatial element type, wherein different spatial element types correspond to different detection models.
[0125] Optionally, the determining module 502, when inputting the EEG signal into the pre-trained detection model, is used to:
[0126] Determine the spatial feature type corresponding to the image of the region to be improved;
[0127] The spatial element types and the EEG signals are input into the pre-trained detection model, wherein different spatial element types correspond to the same detection model.
[0128] Optionally, the device further includes a training module 504, configured to acquire sample data for training the detection model according to the following method:
[0129] Acquire sample images under various spatial feature types;
[0130] For any sample image under any spatial feature type, based on the second image generation model, generate multiple updated images of the sample image under multiple preset intensity levels of each spatial feature dimension of the spatial feature type;
[0131] The sample image, the updated image, and the intensity level of the spatial feature dimension when the updated image was generated are used as the sample data.
[0132] Optionally, the training module 504 is further configured to train the detection model according to the following method:
[0133] A sample video is generated based on the sample images in the sample data and the updated images corresponding to the sample images.
[0134] Obtain sample EEG signals from test users while they watch the sample video;
[0135] The sample EEG signal is input into the detection model to be trained, and the prediction result of the detection model is determined. The prediction result is the intensity level information of the improvement of the updated image in each spatial feature dimension predicted by the detection model.
[0136] The detection model to be trained is trained based on the prediction results and the intensity level of the spatial feature dimension when generating the updated image.
[0137] Optionally, the training module 504, when acquiring the sample electroencephalogram of the test user when watching the sample video, is configured to:
[0138] acquire a plurality of initial electroencephalograms of a plurality of test users when watching a sample video;
[0139] determine the perception intensity scores corresponding to the plurality of initial electroencephalograms;
[0140] determine the perception intensity scores corresponding to the plurality of initial electroencephalograms;
[0141] Optionally, the training module 504, when inputting the sample electroencephalogram into the detection model to be trained, is configured to:
[0142] extract time domain features and frequency domain features of the sample electroencephalogram;
[0143] input the time domain features and the frequency domain features into the detection model to be trained.
[0144] The implementation process of the functions and roles of each unit in the above apparatus is specifically described in the implementation process of the corresponding steps in the above method, which will not be repeated here.
[0145] For the device embodiment, since it basically corresponds to the method embodiment, the relevant part can be referred to the part of the method embodiment. The device embodiments described above are only illustrative, and the units described as separate components can be or can not be physically separated, and the components displayed as units can be or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. According to the actual needs, some or all of the modules can be selected to achieve the purpose of the present application scheme. Those skilled in the art can understand and implement without creative labor.
[0146] The application also provides a computer readable storage medium, which stores a computer program, and the computer program can be used to execute the image generation method described in the above embodiments.
[0147] The application also provides a computer device, which is shown in Figure 6As shown, it is a structural schematic diagram of the computer device provided in the present application. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and of course, other hardware required by the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the bridge construction and discovery method described in the above embodiments. Of course, in addition to the software implementation, the present specification does not exclude other implementation manners, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0148] Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non-transitory program carrier to execute or control the operation of data processing apparatus when executed. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
[0149] The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform actions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit), and the apparatus can be implemented as special purpose logic circuitry.
[0150] Computers suitable for the execution of a computer program include, by way of example, general and / or special purpose microprocessors, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory and / or a random access memory. The essential elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device (e.g., a universal serial bus (USB) flash drive), to name just a few.
[0151] Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
[0152] While the specification contains many specifics, these should not be construed as limiting the scope of any invention or of any claim, but as merely providing illustrations of some of the embodiments of the inventions. Certain features that are, for clarity, described above in the context of separate embodiments, can also be provided in combination in a single embodiment. Conversely, various features that are, for brevity, described above in the context of a single embodiment, can also be provided separately or in any suitable subcombination. In addition, while features can be described above as being implemented in digital electronic circuitry, forms, or combinations of an appropriate device, such features are not limited to hardware implementations, but can also be provided in terms of a computer software product, or a computer hardware product, including a computer program tangibly embodied in a computer readable storage medium for execution by a computer or any suitable apparatus or processing device executing the program. Furthermore, it should be emphasized that a variety of computer-readable storage media is available, such as a semiconductor-based RAM, a ROM, a DVD, a CD, a hard disk, a floppy disk, a cartridge, a tape, and the like, for storing computer program instructions and data structures.
[0153] Similarly, while operations are depicted in the drawings in a particular order, this should not be understood as requiring such order, nor that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing can be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated in a single software product or packaged into multiple software products.
[0154] Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.
[0155] The above-described embodiments are merely possible implementations of the present application, and do not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall fall within the scope of the present application.
Claims
1. An image generation method characterized by, The method comprises: acquiring an image of a region to be improved, and an electroencephalogram of a target user imagining an improvement result of the region to be improved during viewing of the image of the region to be improved; inputting the electroencephalogram into a pre-trained detection model to determine expected information of the target user on the region to be improved, wherein the expected information comprises intensity level information of the target user on improvement of the region to be improved in each spatial feature dimension; generating prompt information based on the expected information, and generating a target improved image corresponding to the image of the region to be improved based on the prompt information, the image of the region to be improved, and a first image generation model.
2. The method of claim 1, wherein, The inputting of the electroencephalogram into the pre-trained detection model comprises: determining a spatial element type corresponding to the image of the region to be improved; inputting the electroencephalogram into a detection model corresponding to the spatial element type, wherein different spatial element types correspond to different detection models.
3. The method of claim 1, wherein, The inputting of the electroencephalogram into the pre-trained detection model comprises: determining a spatial element type corresponding to the image of the region to be improved; inputting the spatial element type and the electroencephalogram into the pre-trained detection model, wherein different spatial element types correspond to the same detection model.
4. The method of claim 1, wherein, The method further comprises acquiring sample data for training the detection model according to the following method: acquiring sample images under multiple spatial element types; for any sample image under any spatial element type, generating multiple updated images of the sample image under multiple preset intensity levels of each spatial feature dimension of the spatial element type based on a second image generation model; taking the sample image, the updated image, and the intensity level of the spatial feature dimension when the updated image is generated as the sample data.
5. The method of claim 4, wherein, The method further comprises training the detection model according to the following method: generating a sample video based on a sample image in the sample data and an updated image corresponding to the sample image; acquiring a sample electroencephalogram of a test user when the test user views the sample video; inputting the sample electroencephalogram into a detection model to be trained to determine a prediction result of the detection model, wherein the prediction result is intensity level information of the updated image predicted by the detection model in each spatial feature dimension; training the detection model to be trained based on the prediction result and the intensity level of the spatial feature dimension when the updated image is generated.
6. The method of claim 5, wherein, The acquiring of the sample electroencephalogram of the test user when the test user views the sample video comprises: for any sample video, acquiring multiple initial electroencephalograms of multiple test users when the test users view the sample video; determining a perception intensity score corresponding to the multiple initial electroencephalograms; taking a sample video with a perception intensity score greater than a preset value as a target sample video, and taking an electroencephalogram of the test user when the test user views the target sample video as the sample electroencephalogram.
7. The method of claim 5, wherein, The inputting of the sample electroencephalogram into the detection model to be trained comprises: extracting time domain features and frequency domain features of the sample electroencephalogram; inputting the time domain features and the frequency domain features into the detection model to be trained.
8. An image generation apparatus characterized by comprising: The device comprises: an acquisition module, configured to acquire an image of a region to be improved, and an electroencephalogram signal of a target user imagining an improvement result of the region to be improved during viewing of the image of the region to be improved; a determination module, configured to input the electroencephalogram signal into a pre-trained detection model, and determine expected information of the target user on the region to be improved, wherein the expected information comprises intensity level information of the target user on improvement of the region to be improved in each spatial feature dimension; a generation module, configured to generate prompt information based on the expected information, and generate a target improved image corresponding to the image of the region to be improved based on the prompt information, the image of the region to be improved, and a first image generation model.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program, when executed by a processor, implements the steps of the image generation method of any one of claims 1-7.
10. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor is configured to execute the steps of the image generation method of any one of claims 1-7.