Method and system for automatically matching scenes according to product information
By combining deep convolutional neural networks and the CycleGAN model, the universality and scalability issues of product image scene matching are solved, and efficient automatic scene matching and natural image fusion are achieved for all product images.
Patent Information
- Application Number
- CN202510807810.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-17
AI Technical Summary
Existing technologies have poor universality in product image matching scenarios and are unable to identify non-home products. In addition, the matching model has weak scalability and cannot adapt to new products.
A deep convolutional neural network model is used to extract product image features, and the scene generation model and CycleGAN model are combined to perform image style conversion and synthesis. A classifier is used to predict scene categories and the CycleGAN model is used to achieve product image style transfer. Finally, the scene synthesis model is used to perform image fusion.
It achieves efficient recognition and automatic scene matching of all product images, has high universality and scalability, and the generated display images are harmonious and natural.
Smart Images

Figure CN120707701A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer data processing, and more particularly to a method and system for automatically matching scenes based on product information. Background Art
[0002] Product images are images used to display, promote, and sell specific goods. They are core visual elements used in e-commerce, retail, advertising, and other fields to convey product information, attract consumers, and facilitate transactions. After uploading products to online sales platforms, merchants need to configure a background image that is appropriate for the product's attributes to enhance the product's promotional effectiveness. This configuration process typically requires manual effort, which is inefficient.
[0003] To overcome the above problems, a Chinese patent application with publication number CN114418665A discloses a method, device, equipment, and medium for the virtual display of shopping mall products in home scenes. This technology can automatically configure application scene images for home products uploaded by merchants, realizing the real-life display of shopping mall products in actual home environments, reducing the poor shopping experience caused by the mismatch between products and home environments. This method can improve the efficiency of scene image configuration for home products, but it has the following drawbacks:
[0004] (1) It is unable to identify product image information other than home products and is only applicable to scene adaptation of home products. In a multi-type product sales platform, its scope of application is too small and its universality is poor.
[0005] (2) The matching model used is a black box model, which is not conducive to expanding the scene image matching function of new products. Summary of the Invention
[0006] In order to solve the above-mentioned technical problems of poor universality and weak scalability, the present invention provides a method and system for automatically matching scenarios according to product information.
[0007] In a first aspect, the present invention discloses a method for automatically matching scenarios based on product information, comprising:
[0008] In response to the user inputting a product image into a preset deep convolutional neural network model, image features of the product image are extracted;
[0009] Input the image features into the preset scene generation model for scene matching, obtain a scene graph that matches the product image, and convert the image style of the product image according to the image style of the scene graph;
[0010] The product image and scene image after image style conversion are input into the preset scene synthesis model for image synthesis to obtain the display image.
[0011] Beneficial effect: After the user inputs the product image, a deep convolutional neural network model is used to extract the key image features in the product image that are conducive to category distinction. The image features are then input into the scene generation model for scene matching to obtain the corresponding scene graph, and the image style of the product is converted. Then, relying on the scene synthesis model, the style-converted product image and scene graph are fused to achieve the effect of quickly and efficiently obtaining the display image. Compared with the existing technology, the method of the present invention, which relies on deep convolutional neural network models and scene generation models, can identify the types of almost all product images (including new products), and automatically adapt the corresponding scene graph for fusion according to the type of product image, with high universality and scalability.
[0012] Preferably, the scene generation model includes a classifier and a CycleGAN model; the image features are input into the preset scene generation model for scene matching to obtain a scene graph that matches the product image, and the image style of the product image is converted according to the image style of the scene graph, specifically:
[0013] Input the image features into the classifier to predict the scene category of the product image and generate a scene image library of the corresponding category based on the scene category;
[0014] Extracting scene graphs from a scene image library;
[0015] The CycleGAN model is used to perform adversarial loss operations on the scene graph and the product graph until the image style of the product graph is converted to the same as the scene graph. Figure 1 To.
[0016] Beneficial effect: The classifier is used to output the category of the predicted scene based on the image features. The CycleGAN model is an unsupervised learning model used to perform style transfer between two image domains for product images. Compared with the existing technology, the method of the present invention uses a classifier to predict the scene graph corresponding to the product image to adapt to the scene matching of different types of product images, and then uses the CycleGAN model to transfer the image style of the product image to the scene of the same category. Figure 1 Make the combination of scene pictures and product pictures harmonious and natural.
[0017] Preferably, the expression of the classifier is:
[0018] scene_class=argmax(W·feature_vector+b)
[0019] Where scene_class represents the scene category, W represents the weight matrix of the classifier, feature_vector represents the feature vector of the image feature, b represents the bias term, and arg max represents the maximum index function.
[0020] Preferably, the adversarial loss expression of the CycleGAN model is:
[0021]
[0022] Where, L GAN represents the loss function of GAN, which is used to calculate the adversarial effect between the generator and the discriminator; G represents the generator, which is used to convert the source domain image into the target domain image; D Y represents the discriminator, which is used to determine whether the target domain image is real or generated; X represents the image feature, Y represents the scene graph, Represents the expected value calculation function, y~p data (y) represents the image y sampled from the target domain real data distribution, x~p data (x) represents the image x sampled from the source domain real data distribution, log represents the logarithmic function, D Y (y) represents the output of the discriminator for image y, D Y (G(x)) represents the output image G(x) of the discriminator to the generator.
[0023] Beneficial effects: The method of the present invention designs a CycleGAN model with two generators and two discriminators. The model can realize the image style conversion of product images and the generation of product images after the image style conversion through adversarial training and cycle consistency constraints.
[0024] Preferably, the output image expression of the generator is:
[0025] G(x)=Decoder(Encoder(x))
[0026] Where G(x) represents the output image obtained by the generator after transforming the image x, Encoder represents the encoder, and Decoder represents the decoder.
[0027] Preferably, the scene synthesis model includes a foreground segmentation unit, an image fusion unit, a light and shadow adjustment unit, and a post-processing unit; the product image and the scene image after image style conversion are input into a preset scene synthesis model for image synthesis to obtain a display image, specifically:
[0028] The product image after image style conversion is input into the foreground segmentation unit for image segmentation, and the foreground mask of the product image is extracted;
[0029] The foreground mask and the product image after image style conversion are input into the image fusion unit for image superposition to obtain a fused image;
[0030] The fused image is input into the light and shadow adjustment unit to adjust the foreground brightness to obtain an adjusted image;
[0031] The adjusted image is input into the post-processing unit for smooth adjustment to obtain a display image.
[0032] Beneficial effect: The above method can realize the fusion of foreground image and background image, realize the coordination and unification of the light and shadow relationship between foreground and background, and thus improve the authenticity of the display image of the present invention.
[0033] Preferably, the product image after image style conversion is input into the foreground segmentation unit for image segmentation, and the calculation expression for extracting the foreground mask of the product image is:
[0034] M(i,j)=σ(Decoder(Encoder(I)))
[0035] Where M(i, j) represents the foreground mask with coordinates (i, j) in product image I, Encoder represents the encoder of U-Net, Decoder represents the decoder of U-Net, and σ represents the Sigmoid activation function.
[0036] Preferably, the calculation expression for inputting the foreground mask and the product image after image style conversion into the image fusion unit for image superposition is:
[0037] I blend (i, j) = α(i, j)·I fg (i,j)+(1-α(i,j))·I bg (i,j)
[0038] Where, I blend (i, j) represents the pixel value of the fused image at coordinate (i, j), I fg represents the foreground image, I bg represents the background image, and α represents the transparency.
[0039] Preferably, the calculation expression for inputting the fused image into the light and shadow adjustment unit to adjust the foreground brightness is:
[0040]
[0041] Where I′ fg (i, j) represents the pixel value of the foreground image at coordinate (i, j) after brightness adjustment, I fg (i, j) represents the pixel value of the original foreground image at coordinate (i, j), L bg (i, j) represents the illumination intensity of the background image at coordinate (i, j), L avg Indicates the average light intensity of the background image.
[0042] In a second aspect, the present invention also provides a system for automatically matching scenes based on product information, comprising a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, the method for automatically matching scenes based on product information recorded in the first aspect is implemented.
[0043] The beneficial effects of the present invention are:
[0044] (1) Compared with the existing technology, the method of the present invention can identify the types of almost all product images (including new products) and automatically adapt the corresponding scene images according to the types of product images for fusion, which has high universality and scalability.
[0045] (2) Compared with the existing technology, the method of the present invention uses a classifier to predict the scene graph corresponding to the product image to adapt to the scene matching of different types of product images, and then uses the CycleGAN model to transfer the image style of the product image to the scene of the same category. Figure 1 Make the combination of scene pictures and product pictures harmonious and natural.
[0046] (3) Compared with the existing technology, the method of the present invention designs a CycleGAN model, which can realize the image style conversion of product images and the generation of product images after the converted image style through adversarial training and cycle consistency constraints. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flowchart of a method for automatically matching scenarios based on product information in Embodiment 1 of the present invention;
[0048] Figure 2 It is a structural diagram of a system for automatically matching scenarios based on product information in the second embodiment of the present invention. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0050] This embodiment discloses a method and system for automatically matching scenarios based on product information, which is used to solve the technical problems of poor universality and weak scalability. Specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0051] Example 1
[0052] like Figure 1 As shown, this embodiment discloses a method for automatically matching scenarios based on product information, including:
[0053] S10: In response to the user inputting the product image into the preset deep convolutional neural network model, image features of the product image are extracted.
[0054] In this embodiment, when a user (merchant) uploads a product image via a computer system or API, step S10 is triggered, automatically extracting the product image's image features using a deep convolutional neural network model. The input product image can be in JPEG or PNG format, and the computer system automatically resizes the image to a uniform resolution (e.g., 224x224 pixels) to accommodate subsequent model input. The product image can be of any type, including clothing, furniture, electronics, cosmetics, and food.
[0055] S20: Input the image features into a preset scene generation model to perform scene matching, obtain a scene graph that matches the product image, and convert the image style of the product image according to the image style of the scene graph.
[0056] In this embodiment, the above-mentioned scene generation model is an AI model that can select and optimize the matching background scene from the preset scene image library, and realize the style conversion of the image style of the product image (such as lighting, tone or filter, etc.), so that the product image and the scene image are style-aligned.
[0057] S30: Inputting the product image and the scene image after image style conversion into a preset scene synthesis model for image synthesis to obtain a display image.
[0058] Through the above steps S10 to S30, the method of the present invention relies on a deep convolutional neural network model and a scene generation model, and can identify the types of all product images. After obtaining a scene image that matches the product image, the image style of the product will be converted to align the image styles of the product image and the scene image, and then the product image after style conversion and the corresponding scene image are fused, which has higher universality and scalability, and the output display image is more coordinated and natural.
[0059] Furthermore, the deep convolutional neural network model in step S10 above uses the ResNet-50 model. ResNet-50 is a deep convolutional neural network consisting of 50 layers (convolutional layers, pooling layers, and fully connected layers). It introduces residual connections to address the vanishing gradient and degradation issues in deep network training. It can extract multi-level features from images, such as edges, textures, and shapes, and is suitable for identifying information such as product type, color, and style.
[0060] Specifically, the above step S10 includes:
[0061] S11: Scale the product image to a uniform resolution (224×2244) and normalize the pixels of the scaled product image;
[0062] S12: Use 7×7 convolution kernel to extract low-level features of the normalized product image;
[0063] S13: Extract high-level features of the normalized product image through multiple residual blocks;
[0064] S14: Perform global average pooling operation on low-level features and high-level features to compress and obtain a fixed-length feature vector;
[0065] S15: Use the fully connected layer to realize the mapping between feature vectors and classification labels to obtain image features.
[0066] Furthermore, the expression of the convolutional layer of the deep convolutional neural network model is:
[0067]
[0068] Where I represents the input image (product image), whose size is H×W×C, where H is the height, W is the width, and C is the number of channels (for example, C=3 for RGB images); K represents the convolution kernel, whose size is M×N, used to extract image features; (i, j) represents the pixel position of the output feature map; m represents the row index of the convolution kernel, n represents the column index of the convolution kernel; M represents the height of the convolution kernel; and N represents the width of the convolution kernel.
[0069] Furthermore, the activation function of the above deep convolutional neural network model is expressed as:
[0070] f(x)=max(0,x)
[0071] Where f(x) represents the output of the ReLU activation function, which is x (if x>0) or 0 (if x≤0), x represents the input value, and max represents the maximum value function, which is used to introduce nonlinear calculations.
[0072] Furthermore, the residual block of the above deep convolutional neural network model is expressed as:
[0073]
[0074] Where, represents the residual function, which consists of multiple convolutional layers; represents the input feature; θ represents the output feature, W i represents the weight parameter matrix.
[0075] If the input and output dimensions are different, adjust them through 1×1 convolution The dimension of , the above algorithm can be converted to:
[0076]
[0077] Where W s Represents the dimension adjustment matrix, which is changed by 1×1 convolution The number of channels is adjusted to match the output dimension of the transformation function F.
[0078] Furthermore, the pooling layer expression of the above deep convolutional neural network model is:
[0079]
[0080] Where P(i, j) represents the value of the feature map at position (i, j) after pooling; I represents the input feature map; R represents the pooling window area, which is used to define the local range of the pooling operation; m represents the horizontal coordinate of the relative position in the window, and n represents the vertical coordinate of the relative position in the window.
[0081] More specifically, the features extracted in the above steps S11 to S15 include type, color, size and style. Assuming that the product image is a "shirt", the product category is identified as "shirt" through the classification layer of ResNet-50; the main color tone of the image (such as "white") is extracted using color histogram analysis; if the product image contains a reference object, the size is estimated by U-Net segmentation and calculation of the proportion; if there is no reference object, the metadata provided by the user is relied upon. For the classification of style, the VGG-19 model can be used for classification such as "formal" or "casual". The image features finally output by the above step S15 are structured feature data, which are output in JSON format. The exemplary code is:
[0082] {
[0083] "type":"shirt",
[0084] "color":"white",
[0085] "size":"shoulder width 40cm",
[0086] "style":"Formal"
[0087] }
[0088] Furthermore, the scene generation model in the above step S20 includes a classifier and a CycleGAN model.
[0089] Among them, the classifier is used to predict the scene category based on the image feature output. More specifically, the expression of the classifier is:
[0090] scene_class=argmax(W·feature_vector+b)
[0091] Where scene_class represents the scene category (such as "office"); W represents the weight matrix of the classifier, which is used to map feature vectors to category scores; feature_vector represents the feature vector of image features, such as the 2048-dimensional vector extracted by ResNet-50; b represents the bias term, which is the offset for adjusting the classification score; arg max represents the maximum index function, which is used to return the category with the highest score.
[0092] Furthermore, the above step S20 is specifically as follows:
[0093] S21: Input the image features into the classifier to predict the scene category of the product image, and generate a scene image library of the corresponding category based on the scene category.
[0094] S22: Extract scene graph from scene image library.
[0095] S23: Use the CycleGAN model to perform adversarial loss operations on the scene graph and the product graph until the image style of the product graph is converted to the same style as the scene graph. Figure 1 To.
[0096] Through the above technical solution, the method of the present invention uses a classifier to predict the scene graph corresponding to the product image to adapt to the scene matching of different types of product images, and then uses the CycleGAN model to transfer the image style of the product image to the scene of the same category. Figure 1 Make the combination of scene pictures and product pictures harmonious and natural.
[0097] More specifically, the adversarial loss expression of the above CycleGAN model is:
[0098]
[0099] Where, L GAN represents the loss function of GAN, which is used to calculate the adversarial effect between the generator and the discriminator; G represents the generator, which is used to convert the source domain image into the target domain image; D Y represents the discriminator, which is used to determine whether the target domain image is real or generated; X represents the image feature, Y represents the scene graph, Represents the expected value calculation function, y~p data (y) represents the image y sampled from the target domain real data distribution, x~p data (x) represents the image x sampled from the source domain real data distribution, log represents the logarithmic function, D Y (y) represents the output of the discriminator for image y, D Y (G(x)) represents the output image G(x) of the discriminator to the generator. Y (y) is close to 1, the judgment is true.Y If (G(x)) is close to 0, it is judged to be false.
[0100] It should be explained that the adversarial loss operation is the process by which the generator G attempts to deceive the discriminator. It is used to encourage the two to continuously optimize and compete with each other during the training process, ultimately enabling the generator to generate high-quality data that is difficult to distinguish from real data.
[0101] Furthermore, the present invention designs a cycle consistency loss function based on the above-mentioned generator G, which is a key component in models such as the Cycle Generative Adversarial Network (CycleGAN). It is mainly used for unsupervised or weakly supervised cross-domain image / data conversion tasks. Its core role is to constrain the conversion process and ensure that the conversion results remain consistent in semantics and structure.
[0102] Among them, the generator G and the generator F are inverse mappings to each other, and the expression of the cycle consistency loss function is:
[0103]
[0104] Where, represents the cycle consistency loss function, which is used to ensure that the generator G and the generator F are inverse mappings to each other; G represents the generator from the source domain to the target domain, and F represents the generator from the target domain to the source domain; x represents the input image of the source domain; y represents the input image of the real domain; F(G(x)) represents the result of converting x to y and then converting it back to x; G(F(y)) represents the result of converting Y to x and then converting it back to y; ||·||1 represents the L1 norm, which is used to calculate the sum of the absolute values between two images; Represents the expected value operation function.
[0105] In order to balance the generation ability of the generator and the discrimination ability of the discriminator, while constraining the authenticity, semantic consistency and diversity of the generated results, the total loss function of the above CycleGAN model is defined as:
[0106]
[0107] Where, L(G, F, D X , D Y ) represents the total loss function, Represents the generator G and the discriminator D Y The adversarial loss function, Represents the generator F and the source domain discriminator D X (used to judge the authenticity of the source domain image) adversarial loss function, λ represents the weight hyperparameter (used to balance the adversarial loss and the cycle loss), Denotes the cycle consistency loss function of generator G and generator F.
[0108] Furthermore, the output image expression of the above generator G is:
[0109] G(x)=Decoder(Encoder(x))
[0110] Where G(x) represents the output image obtained by the generator after converting the source domain input image X, Encoder represents the encoder, and Decoder represents the decoder.
[0111] Through the design of the above-mentioned CycleGAN model, the present invention can realize the image style conversion of product images and the generation of product images after the image style conversion through adversarial training and cycle consistency constraints.
[0112] Furthermore, the scene synthesis model in the above step S30 includes a foreground segmentation unit, an image fusion unit, a light and shadow adjustment unit, and a post-processing unit. The above step S30 is specifically as follows:
[0113] S31: Input the product image after image style conversion into the foreground segmentation unit for image segmentation, and extract the foreground mask of the product image.
[0114] S32: Input the foreground mask and the product image after image style conversion into the image fusion unit for image superposition to obtain a fused image.
[0115] S33: Input the fused image into the light and shadow adjustment unit to adjust the foreground brightness to obtain an adjusted image.
[0116] S34: Input the adjusted image into the post-processing unit for smoothing adjustment to obtain a display image.
[0117] Specifically, the calculation expression of the above step S31 is:
[0118] M(i,j)=o(Decoder(Encoder(I)))
[0119] Where M(i, j) represents the foreground mask with coordinates (i, j) in product image I, Encoder represents the encoder of U-Net, Decoder represents the decoder of U-Net, and σ represents the Sigmoid activation function.
[0120] Specifically, the calculation expression of the above step S32 is:
[0121] I blend (i, j) = α(i, j)·I fg (i,j)+(1-α(i,j))·I bg (i,j)
[0122] Where, I blend(i, j) represents the pixel value of the fused image at coordinate (i, j), I fg represents the foreground image, I bg represents the background image, and α represents the transparency.
[0123] It should be explained that the transparency α is usually determined by the foreground mask mentioned above, and can also be preset according to actual conditions.
[0124] Specifically, the calculation expression of the above step S33 is:
[0125]
[0126] Where I′ fg (i, j) represents the pixel value of the foreground image at coordinate (i, j) after brightness adjustment, I fg (i, j) represents the pixel value of the original foreground image at coordinate (i, j), L bg (i, j) represents the illumination intensity of the background image at coordinate (i, j), L avg Indicates the average light intensity of the background image.
[0127] Through the above steps S31 to S34, the method of the present invention optimizes and adjusts the light and shadow relationship of the foreground and background before generating the display image, so that the overall light and shadow and perspective relationship of the display image are more realistic, overcoming the unnatural and uncoordinated problems of traditional AI-generated images.
[0128] For example, the following is a data conversion table for different types of product images according to the method of the present invention:
[0129]
[0130]
[0131] Compared with the existing technology, the method of the present invention can identify the types of almost all product images (including new products), and automatically adapt the corresponding scene images for fusion according to the types of product images. It has higher universality and scalability and can be applied to major online sales platforms.
[0132] Example 2
[0133] like Figure 2 As shown, based on Example 1, this embodiment discloses a system for automatically matching scenarios based on product information. The system serves as a computer system of the method recorded in Example 1, including a processor and a memory. The memory stores computer program instructions. When the computer program instructions are executed by the processor, the method for automatically matching scenarios based on product information recorded in Example 1 is implemented.
[0134] Although this specification has shown and described several embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and substitutions without departing from the idea and spirit of the present invention.
Claims
1. A method for automatically matching scenes based on product information, characterized in that: include: In response to a user inputting a product image into a preset deep convolutional neural network model, extracting image features of the product image; Inputting the image features into a preset scene generation model for scene matching to obtain a scene graph that matches the product image, and converting the image style of the product image according to the image style of the scene graph; The product image after image style conversion and the scene image are input into a preset scene synthesis model for image synthesis to obtain a display image.
2. The method for automatically matching scenes according to product information according to claim 1, characterized in that: The scene generation model includes a classifier and a CycleGAN model; the image features are input into a preset scene generation model for scene matching to obtain a scene graph that matches the product image, and the image style of the product image is converted according to the image style of the scene graph, specifically: Inputting the image features into the classifier, predicting the scene category of the product image, and generating a scene image library of the corresponding category based on the scene category; extracting a scene graph from the scene image library; The CycleGAN model is used to perform adversarial loss operations on the scene graph and the product image until the image style of the product image is converted to be consistent with that of the scene graph.
3. The method for automatically matching scenes according to product information according to claim 2, characterized in that: The expression of the classifier is: scene_class=arg max(W·feature_vector+b) Wherein, scene_class represents the scene category, W represents the weight matrix of the classifier, feature_vector represents the feature vector of the image feature, b represents the bias term, and arg max represents the maximum value index function.
4. The method for automatically matching scenes according to product information according to claim 2, characterized in that: The adversarial loss expression of the CycleGAN model is: Where, L GAN represents the loss function of GAN, which is used to calculate the adversarial effect between the generator and the discriminator; G represents the generator, which is used to convert the source domain image into the target domain image; D Y represents a discriminator, which is used to determine whether the target domain image is real or generated; X represents the image features, Y represents the scene graph, Represents the expected value calculation function, y~p data (y) represents the image y sampled from the target domain real data distribution, x~p data (x) represents the image x sampled from the source domain real data distribution, log represents the logarithmic function, D Y (y) represents the output of the discriminator for image y, D Y (G(x)) represents the output image G(x) of the discriminator to the generator.
5. The method for automatically matching scenes according to product information according to claim 3, characterized in that: The output image expression of the generator is: G(x)=Decoder(Encoder(x)) Where G(x) represents the output image obtained by the generator after transforming the image x, Encoder represents the encoder, and Decoder represents the decoder.
6. The method for automatically matching scenes according to product information according to claim 1, characterized in that: The scene synthesis model includes a foreground segmentation unit, an image fusion unit, a light and shadow adjustment unit, and a post-processing unit. The product image after image style conversion and the scene image are input into the preset scene synthesis model for image synthesis to obtain a display image, specifically: The product image after image style conversion is input into the foreground segmentation unit for image segmentation, and the foreground mask of the product image is extracted; the foreground mask and the product image after image style conversion are input into the image fusion unit for image superposition to obtain a fused image; the fused image is input into the light and shadow adjustment unit for foreground brightness adjustment to obtain an adjusted image; the adjusted image is input into the post-processing unit for smoothing adjustment to obtain a display image.
7. The method for automatically matching scenes according to product information according to claim 6, characterized in that: The product image after image style conversion is input into the foreground segmentation unit for image segmentation. The calculation expression for extracting the foreground mask of the product image is: M(i,j)=σ(Decoder(Encoder(I))) Where M(i, j) represents the foreground mask with coordinates (i, j) in product image I, Encoder represents the encoder of U-Net, Decoder represents the decoder of U-Net, and σ represents the Sigmoid activation function.
8. The method for automatically matching scenes according to product information according to claim 6, characterized in that: The calculation expression for inputting the foreground mask and the product image after image style conversion into the image fusion unit for image superposition is: I blend (i,j)=α(i,j)·I fg (i,j)+(1-α(i,j))·I bg (i,j) Where, I blend (i, j) represents the pixel value of the fused image at coordinate (i, j), I fg represents the foreground image, I bg represents the background image, and α represents the transparency.
9. The method for automatically matching scenes according to product information according to claim 6, characterized in that: The calculation expression for inputting the fused image into the light and shadow adjustment unit to adjust the foreground brightness is: Where I′ fg (i, j) represents the pixel value of the foreground image at coordinate (i, j) after brightness adjustment, L fg (i, j) represents the pixel value of the original foreground image at coordinate (i, j), L bg (i, j) represents the illumination intensity of the background image at coordinate (i, j), L avg Indicates the average light intensity of the background image.
10. A system for automatically matching scenes based on product information, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for automatically matching scenarios according to product information according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Education field image scene graph generation method based on multi-view information fusion
CN115761036A
Method and device for automatically replacing background of commodity photo
CN116862943A
Image generation method and device
CN118365408A
Image processing method and device, electronic equipment, readable storage medium and program product
CN119399299A
E-commerce model optimization method based on industry experience data training
CN119782829A