Clothing style retrieval method and system, model training method, terminal and medium
By introducing clothing style search methods and systems in the clothing production process, using pre-trained models and historical style databases to quickly and accurately find similar styles, the problem of difficulty and low efficiency of designing new styles in the clothing factory is solved, and a more efficient design process is achieved.
Patent Information
- Application Number
- CN202311855345.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
The fact that the existing clothing production process is not able to quickly and accurately find historical similar styles that meet the conditions, making it difficult and inefficient for the design of new models by the clothing factory.
A clothing style search method and system is provided. By entering the style information of the clothing to be retrieved, a candidate style set is filtered from the historical style database, and a pre-trained clothing style search model is used to combine style image and size information to perform matching comparisons to determine the style similar to the clothing to be retrieved.
It realizes rapid and accurate search of historical similar styles, reduces the difficulty and time of clothing design, improves design efficiency, and makes full use of historical data.
Smart Images

Figure CN120234437A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of clothing design, and particularly relates to a clothing style retrieval method and system, a model training method, a terminal, and a medium. Background Art
[0002] ODM clothing factories are a type of clothing factory characterized by original design and high-quality production. These clothing factories focus on the creativity of designers and the characteristics of brands, and also pay attention to the quality and craftsmanship of products, and are committed to creating unique fashion brands. For such clothing factories, not only do they need to carry out the sewing production of clothing, but also need to design the production process of clothing, including the layout design and processing technology of clothing. With the increase in the number of order styles, clothing factories need to invest a large amount of manpower and material resources in the design of the clothing production process before mass production.
[0003] Traditional clothing production is usually mass production, which takes a long time to complete the entire production cycle. It takes several months or even longer from design to production and then to market sales. At the same time, the types and quantities of styles produced are relatively small. "Small order, quick response" is a more flexible and fast production model, which emphasizes quickly responding to market demands and can complete design, production, and market sales in a short time. In this model, the production cycle is greatly shortened, products can be launched into the market faster, inventory pressure is reduced, and market risks are lowered. At the same time, the types and quantities of products can also be adjusted more flexibly to adapt to market changes. However, this requires clothing factories to shorten the clothing development cycle and improve development efficiency.
[0004] There is a certain similarity and reference significance between different styles. Therefore, how to quickly and accurately find historical similar styles that meet the conditions and use historical information to guide the design process of the production process to reduce the difficulty of clothing factories in designing new styles and improve the overall design efficiency has actually become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a clothing style retrieval method and system, a model training method, a terminal, and a medium, which are used to solve the technical problems that in the existing clothing production process, it is impossible to quickly and accurately find historical similar styles that meet the conditions, resulting in high difficulty and low design efficiency for clothing factories to design new styles.
[0006] In a first aspect, the present application provides a clothing style retrieval method, comprising: inputting style information of clothing to be retrieved; screening out a candidate style set from a historical style database based on the style information; determining whether the style information includes a style image and size information; if the style information includes the style image, preprocessing the style image, and inputting the preprocessed style image into a pre-trained clothing style retrieval model to extract a first image feature; comparing the first image feature with the image feature corresponding to each style in the candidate style set to obtain a first matching degree; if the style information includes the size information, standardizing the size information, and comparing the standardized size information with the size information of each style in the candidate style set to obtain a second matching degree; based on the first matching degree and / or the second matching degree, determining a clothing style similar to the clothing to be retrieved.
[0007] In an implementation of the first aspect, screening out a candidate style set from a historical style database according to the style information includes:
[0008] Determine whether the style information includes any one of the reference fields or any combination of the reference fields: clothing brand, clothing category, gender of the people for whom the clothing is applicable, fabric characteristics, clothing version, and year; each of the reference fields corresponds to at least one attribute feature;
[0009] If yes, then comparing the attribute characteristics of the reference field included in the style information with the attribute characteristics of the reference field of each style in the historical style database to obtain a third matching degree;
[0010] Based on the third matching degree, style data satisfying each reference field is screened out from the historical style database to form the candidate style set.
[0011] In a second aspect, the present application provides a clothing style retrieval model training method, comprising: obtaining sample clothing data drawn by a clothing brand using a professional graphic design tool to obtain a plurality of clothing sample pictures of different categories;
[0012] According to the design features of clothing samples, the clothing sample images of similar styles within all categories are labeled to obtain data set C;
[0013] Based on the data set C, construct a multi-group candidate style set S;
[0014] Preprocessing the data set C, and inputting the preprocessed data set C into a first neural network model to train the first neural network model;
[0015] When the loss value or accuracy of the first neural network model reaches the preset requirements, the training is completed, and the classification layer of the first neural network model is removed to obtain a second neural network model;
[0016] Preprocess the multi - tuple candidate style set S, adjust the parameters of the second neural network model based on the preprocessed multi - tuple candidate style set S, and use the adjusted second neural network model as a clothing style retrieval model.
[0017] In one implementation manner of the second aspect, the preprocessing of the style image includes: padding the style images in the multi - tuple candidate style set S to obtain padded style images; scaling the padded style images proportionally.
[0018] In one implementation manner of the second aspect, the multi - tuple candidate style set S is represented as (I, P, N, β), where I represents any style image in the data set C, P represents another style image of the same category as I and similar to I, N represents a style image of the same category as I but not similar to I, or a style image of a different category from I, and β represents whether I and N belong to the same category; when β = 0, it means I and N belong to the same category, and when β = 1, it means I and N do not belong to the same category.
[0019] In one implementation manner of the second aspect, the multi - tuple candidate style set S is represented as (I, P, N, α), where I represents any style image in the data set C, P represents another style image of the same category as I, N represents another style image of the same category as I, or a style image of a different category from I, and different α values have different meanings. Among them, when α = 0, it means I and P are the same style, and I and N are completely dissimilar; when α = 1, it means I and P are not the same style but are style - similar, and I and N are completely dissimilar; when α = 2, it means I and P are similar styles but cannot be fully reused, and I and N are completely dissimilar; when α = 3, it means I and P are the same style, and I and N are similar styles but cannot be fully reused; when α = 4, it means I and P are not the same style but are style - similar, and I and N are similar styles but cannot be fully reused.
[0020] In one implementation manner of the second aspect, adjusting the parameters of the second neural network model based on the preprocessed multi - tuple candidate style set S and using the adjusted second neural network model as a clothing style retrieval model includes:
[0021] Input the preprocessed multi - tuple candidate style set S into the second neural network model to extract the image feature f of the style image I ji 、the image feature f of the style image P jp and the image feature f of the style image Njn ;
[0022] For each sample data, calculate the image feature f of the style image I ji and the image feature f of the style image P jp The Euclidean distance s between them jp , and the image feature f of the style image I ji and the image feature f of the style image N jn The Euclidean distance s between them jn ;
[0023] Based on the Euclidean distance s jp and the Euclidean distance s jn , calculate the single-sample loss loss j ;
[0024] Sum all the single-sample losses to obtain the total loss, and according to the total loss loss, use the backpropagation algorithm to adjust the parameters of the second neural network model, and train the second neural network model for multiple epochs until the model converges.
[0025] In an implementation of the second aspect, when the multi-tuple candidate style set S is represented as (I, P, N, β), the following formula is used to calculate the total loss loss:
[0026]
[0027] where s jp represents the Euclidean distance between the image feature f of the style image I and the image feature f of the style image P in the j-th sample data ji and s jp represents the Euclidean distance between the image feature f of the style image I and the image feature f of the style image N in the j-th sample data, beta jn is an adjustable hyperparameter and is related to the value of β. ji and s jn between the image feature f of the style image N j ;
[0028] In an implementation of the second aspect, when the multi-tuple candidate style set S is represented as (I, P, N, α), the following formula is used to calculate the total loss loss:
[0029]
[0030] where s jp represents the Euclidean distance between the image feature f of the style image I and the image feature f of the style image P in the j-th sample data ji and s jp between the image feature f of the style image Ijn Denote the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image N jn The Euclidean distance between them, where k, dp, and dn are adjustable hyperparameters. For different α values, the value of k is the same, while dp and dn are different.
[0031] Thirdly, the present application provides a clothing style retrieval system, including:
[0032] A to-be-retrieved style information input module for inputting the style information of the to-be-retrieved clothing;
[0033] A preliminary screening module for screening out a candidate style set from the historical style database according to the style information;
[0034] A content judgment module for judging whether the style information includes a style image and size information;
[0035] An image feature extraction module for preprocessing the style image when the style information includes the style image, and inputting the preprocessed style image into a pre-trained clothing retrieval model to extract the first image feature;
[0036] A first matching degree determination module for comparing the first image feature with the image features corresponding to each style in the candidate style set to obtain a first matching degree;
[0037] A second matching degree determination module for standardizing the size information when the style information includes the size information, and comparing the standardized size information with the size information of each style in the candidate style set to obtain a second matching degree;
[0038] A similar clothing style determination module for determining the clothing styles similar to the to-be-retrieved clothing based on the first matching degree and / or the second matching degree.
[0039] Fourthly, the present application provides a terminal, including: a processor and a memory;
[0040] The memory is used for storing a computer program;
[0041] The processor is used for executing the computer program stored in the memory, so that the terminal executes the clothing style retrieval method and / or the clothing style retrieval model training method described in any one of the above.
[0042] Fifthly, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the clothing style retrieval method and / or the clothing style retrieval model training method described in any one of the above.
[0043] As described above, the clothing style retrieval method and system, model training method, terminal and medium described in the present application have the following beneficial effects:
[0044] (1) It takes into account the style pictures and the size information of different parts, and auxiliary considerations such as clothing brand, clothing category, gender of the people suitable for clothing, fabric characteristics, clothing version and year, which can help clothing factory designers quickly and accurately retrieve historical styles, reduce the difficulty of clothing factories designing new styles, and improve the accuracy and efficiency of clothing design; it can make full use of historical data and give play to the role of data assets. At the same time, it can also help designers discover the size characteristics and proportional relationships of different parts more quickly, so as to better realize the design intention.
[0045] (2) A lightweight neural network model is used as the clothing style retrieval model, which has low configuration requirements for computers and other devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 Shown is a flow chart of an embodiment of the clothing style retrieval method described in this application.
[0047] Figure 2 Shown is a schematic diagram of a search interaction interface in an embodiment of the clothing style search method described in this application.
[0048] Figure 3 Shown is a flow chart of another embodiment of the clothing style retrieval method described in the present application.
[0049] Figure 4 Shown is a training flowchart of the clothing retrieval model described in this application in one embodiment.
[0050] Figure 5 Shown is a schematic structural diagram of a clothing style retrieval system described in the present application in one embodiment.
[0051] Figure 6 Shown is a schematic structural diagram of an electronic device described in this application in an embodiment.
[0052] Component number description
[0053] 100 Input module for style information to be retrieved
[0054] 200 Preliminary screening module
[0055] 300 Content judgment module
[0056] 400 Image feature extraction module
[0057] 500 First matching degree determination module
[0058] 600 Second matching degree determination module
[0059] 700 Similar clothing style determination module
[0060] 61 Processor
[0061] 62 Memory Specific implementation manner
[0062] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0063] It should be noted that the drawings provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. Therefore, only the components related to the present application are shown in the drawings, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0064] In addition, in the present application, descriptions such as "first" and "second" are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the fact that those skilled in the art can implement them. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present application.
[0065] The following embodiments of the present application provide a clothing style retrieval method and system, a model training method, a terminal, and a medium. Designers of clothing manufacturers can use the method of the present application to quickly and accurately find historical similar styles that meet the conditions to guide the design of the production process, reduce the difficulty of designing new styles, and improve the overall design efficiency. The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application.
[0066] Please refer to Figure 1 , which shows the flowchart of the clothing style retrieval method described in the present application in an embodiment.
[0067] As Figure 1As shown, the clothing style retrieval method provided in this embodiment includes steps S100 to S700.
[0068] Step S100: input the style information of the clothing to be retrieved.
[0069] In this embodiment, the user can provide the style information of the clothing to be retrieved in a variety of ways. One of the ways is text input. For example, the user can enter relevant style descriptions or keywords on the search interaction interface, and the system will match and retrieve based on this information; another way is image upload. For example, the user can upload line drawings of the front and back containing clothing style details, and the system will automatically identify and extract relevant information.
[0070] For ease of understanding, this application provides a schematic diagram of a search interaction interface to illustrate the specific implementation process of the clothing style search method. Figure 2 As shown, the style information of the clothing to be retrieved may be any one or any combination of style image, size information and reference field.
[0071] Specifically, the style image is a vector image drawn by a designer using a professional graphic design tool, with small pixels, high definition, and no background such as a portrait, and is generally a line drawing of the front and back of the clothing. In this embodiment, the professional graphic design tool can be Adobe Illustrator (AI) commonly used in the field of clothing design. Other drawing tools that can achieve the same function are also applicable to this application, and will not be described one by one here.
[0072] The size information includes parameters such as chest circumference, waist circumference, leg circumference, seat circumference and shirt hem width.
[0073] The reference fields include clothing brand, clothing category, gender of the people the clothing is suitable for, fabric properties, fabric structure, clothing style and year, etc.
[0074] In this implementation, multiple filtering conditions such as style images, size information, and reference fields are added to narrow the filtering range, thereby helping users to quickly and accurately filter out clothing styles that meet specific needs such as expected size and design requirements.
[0075] Step S200: Filter out a candidate style set from a historical style database according to the style information.
[0076] In the embodiment of the present application, the user can create a historical style database M0 by himself, M0 includes all style information of clothing produced or designed by the garment factory in history. According to the style information of the clothing to be retrieved input by the user, a candidate style set M1 that meets the conditions can be preliminarily screened from the historical style database M0.
[0077] See alsoFigure 3 , which is a flow chart of another embodiment of the clothing style retrieval method described in the present application.
[0078] like Figure 3 As shown, according to the style information, the candidate style set is screened out from the historical style database, including:
[0079] Step S210, determining whether the style information includes any one of the reference fields or any combination of the reference fields: clothing brand, clothing category, gender of the people for whom the clothing is applicable, fabric characteristics, clothing version and year.
[0080] Each of the reference fields corresponds to at least one attribute feature. For example, the attribute features of clothing categories include but are not limited to "Polo", "Legging" and "Dress"; the attribute features of the gender of the people for whom the clothing is applicable include but are not limited to "neutral", "children's girls", "children's boys", "adult men" and "adult women"; the attribute features of fabric properties include but are not limited to "high elasticity", "slightly elasticity" and "non-elasticity"; the attribute features of clothing styles include but are not limited to "LOOSE" and "Regular"; the attribute features of fabric structure include but are not limited to "knitted", "woven" and "needle and weaving"; the attribute features of the year include but are not limited to "2022 Spring and Summer" and "2023 Autumn and Winter".
[0081] In the actual search process, the style information entered by the user can include any one of the above reference fields or any combination of multiple reference fields in addition to the style picture and size information. For example, the user can enter "brand, Polo, children's boy, slightly elastic, LOOSE, 2022 autumn and winter style" as the filtering conditions at the same time.
[0082] Step S220: If the style information includes any one of the above reference fields or any combination of reference fields, compare the attribute characteristics of the reference field with the attribute characteristics of the same reference field of each style in the candidate style set to obtain a third matching degree.
[0083] It should be noted that, unlike the conventional distance measurement method for calculating similarity, the calculation of the third matching degree is a hard rule matching.
[0084] Step S230: Based on the third matching degree, filter out style data satisfying each reference field from the historical style database to form the candidate style set.
[0085] For example, when a user enters reference fields such as "Polo shirt" and "Women's style", the system will extract style information of all clothing associated with reference fields such as "Polo shirt" and "Women's style" from the historical style database M0 to form a candidate style set M1.
[0086] In this implementation manner, information such as clothing brand, clothing category, gender of the applicable population of the clothing, fabric characteristics, clothing pattern, and year is considered as an aid, which can help designers of clothing factories quickly and accurately retrieve historical styles, narrow the retrieval scope, and improve the retrieval efficiency; it can make full use of historical data and play the role of data assets.
[0087] Step S300: Determine whether the style information includes a style image and size information.
[0088] Step S400: If the style information includes the style image, preprocess the style image, and input the preprocessed style image into a pre-trained clothing style retrieval model to extract first image features.
[0089] Specifically, the preprocessing of the style image includes Step S401 and Step S402.
[0090] Step S401: Fill the style image to obtain a filled style image.
[0091] Step S402: Scale the filled style image proportionally.
[0092] The original style image may be a screenshot of any size, which is inconsistent with the pixel size of the image to be compared. In order to facilitate subsequent image comparison on the same scale, it is necessary to fill the original style image. At the same time, considering the proportional nature of the clothing, it is necessary to ensure that the shape of the image and the shape of the clothes in the image do not distort. Therefore, after obtaining the filled style image, scale the filled style image proportionally to keep the proportion and shape of the image unchanged.
[0093] For example, if the size of the image to be compared is 200×200, and the size of the original style picture is 600×800, if the style picture is directly scaled to 200×200, distortion will occur. At this time, the original style picture with a size of 600×800 can be randomly filled to 800×800 first, and then scaled proportionally to 200×200.
[0094] It should be noted that the size of the scaled style image can be adaptively adjusted according to actual situations such as the retrieval speed requirement and computer configuration. Generally, the larger the style image, the greater the computing power required for the clothing style retrieval model.
[0095] In this implementation manner, through preprocessing operations such as filling and proportional scaling of the style image, it can ensure that the image quality meets the requirements, while keeping the proportion and shape of the image unchanged, and improving the accuracy and reliability of subsequent image comparison.
[0096] In a garment factory, due to the need for frequent garment retrieval and classification, an efficient and resource - less - consuming garment style retrieval model is required.
[0097] The embodiment of this application adopts a lightweight convolutional neural network model. The model includes structures such as convolutional layers, fully - connected layers, activation layers, and normalization. The convolution kernels are 3×3 or 5×5. By choosing smaller convolution kernels, the number of parameters of the model can be reduced, thereby reducing the complexity of the model and enabling it to run quickly on low - configuration computers.
[0098] Step S500: Compare the first image feature with the image features corresponding to each style in the candidate style set to obtain the first matching degree.
[0099] Specifically, the following formula is used to calculate the first matching degree:
[0100] s1=||f i1 -f j1 ||
[0101] Where f i1 represents the first image feature, f j1 represents the image features corresponding to each style in the candidate style set, and s1 represents the first matching degree.
[0102] Step S600: If the style information includes the size information, standardize the size information, and compare the standardized size information with the size information of each style in the candidate style set to obtain the second matching degree.
[0103] Different from conventional image search methods, the size of clothing design is also very important because it involves the shape and size of the cut pieces. Therefore, this application not only needs to compare the style images but also needs to compare the size of different parts of the style.
[0104] Specifically, the following formula is used to calculate the second matching degree:
[0105] s2=||f i2 -f j2 ||
[0106] Where f i2 represents the standardized size information, f j2 represents the size information of each style in the candidate style set, and s2 represents the second matching degree.
[0107] Furthermore, the standardized size information can be saved in the historical style database for future projects, thereby improving work efficiency.
[0108] Step S700: Determine the clothing styles similar to the clothing to be retrieved based on the first matching degree and / or the second matching degree.
[0109] Specifically, when the style image simultaneously includes the style image and size information, the first matching degree and the second matching degree are weighted and summed to obtain a similarity score; the similarity scores are sorted, and the clothing styles similar to the clothing to be retrieved are determined based on the sorting result.
[0110] In an embodiment of the present application, the following formula is used to calculate the similarity score:
[0111] S = a * s1 + b * s2
[0112] Where s1 represents the first matching degree, a represents the weight of the first matching degree, s2 represents the second matching degree, b represents the weight of the second matching degree, and S represents the similarity score.
[0113] It should be noted that the values of a and b in this embodiment represent their influence on the similarity score. In practical applications, the values of a and b can be adjusted according to requirements.
[0114] When sorting the similarity scores, they can be sorted in ascending or descending order according to the magnitude of the similarity scores. According to the sorting result, the clothing styles similar to the clothing to be retrieved can be determined. For example, the clothing styles with higher similarity scores can be selected as the styles similar to the clothing to be retrieved.
[0115] Furthermore, the styles similar to the clothing to be retrieved can be displayed in a list form in the software. By clicking on the viewing function option, the detailed information of this style can be obtained.
[0116] In this implementation, the style pictures and size information of different parts are considered, which can help the designers of clothing factories quickly and accurately retrieve historical styles, reduce the difficulty of designing new styles in clothing factories, improve the accuracy and efficiency of clothing design; can make full use of historical data and give play to the role of data assets; at the same time, it can also help designers discover the size characteristics and proportional relationships of different parts faster, so as to better achieve the design intention.
[0117] As an alternative embodiment, the user can manually compare relevant style pictures and size information to find the styles similar to the clothing to be retrieved.
[0118] Please refer to Figure 4 , which shows the flowchart of the clothing style retrieval model training method described in this application in an embodiment.
[0119] As Figure 4As shown in the figure, the method for training the clothing style retrieval model provided by the embodiments of the present application includes:
[0120] S1. Obtain the sample clothing materials drawn by clothing brands using professional graphic design tools to obtain multiple clothing sample pictures of different categories.
[0121] Specifically, the professional graphic design tool can be Adobe Illustrator (AI) commonly used in the field of clothing design. Different from the pictures collected on the Internet platform, the style pictures drawn using professional graphic design tools can be infinitely scaled without losing clarity and quality, and elements such as color, size, shape, and layout can also be easily changed to meet the needs of customers.
[0122] Furthermore, after the clothing samples are drawn, designers can save the clothing sample pictures as historical data for use in future projects, thereby improving work efficiency.
[0123] It should be noted that other drawing tools that can achieve the same function are also applicable to the present application, and will not be elaborated here one by one.
[0124] The sample clothing materials (or TP materials) refer to technical materials containing detailed information such as the style, fabric, accessories, technology, and size of the clothing, and also include the requirements and specifications of various links such as clothing designers, fabric suppliers, factories, and quality inspections. Complete and accurate TP materials can ensure the quality and production efficiency of clothing.
[0125] In the clothing industry, clothing categories usually refer to the overall classification of clothing, which is usually divided according to characteristics such as the use, style, and material of the clothing. Common clothing categories include T-shirts, shirts, skirts, pants, jackets, sweatshirts, Polo shirts, and dresses, etc. And clothing styles are different design styles or models for further subdividing clothing within a category. For example, in the T-shirt category, there are different styles such as round-neck T-shirts, V-neck T-shirts, stand-up collar T-shirts, raglan sleeve T-shirts, and tight-fitting T-shirts; in the skirt category, there are different styles such as mini-skirts, mid-length skirts, and long skirts; in the jacket category, there are different styles such as loose styles, tight-fitting styles, hooded styles, stand-up collar styles, and zipper styles.
[0126] In this embodiment, as many single-piece clothing samples of different categories as possible will be collected, for example, the number of each category >= 100.
[0127] S2. According to the design characteristics of the clothing samples, label the clothing sample pictures of similar styles within all categories to obtain the dataset C.
[0128] Specifically, the design characteristics of the clothing samples include features such as hats, pockets, shoulder types, looseness, necklines, and waistlines.
[0129] According to the design features of the clothing samples in this application, first, the clothing sample pictures of similar styles within each category are labeled. For example, for the feature of a hat, it can be labeled which clothing sample pictures have a hat and which do not; for features such as pockets, shoulder shapes, looseness, necklines, and waistlines, similar labeling can also be performed, which will not be elaborated here. Then, after the labeling is completed, sub-datasets C1 to C M , C1 to C M together constitute dataset C, and M is the total number of categories. Each row of data in dataset C represents a set of clothing sample pictures that belong to the same category and have similar styles.
[0130] It should be noted that when the number of clothing sample pictures of similar styles within the same category is small, data augmentation can be performed on the existing clothing sample pictures to construct sufficient data.
[0131] In an embodiment of this application, the operations of deforming the clothing sample pictures include vertical flipping, color transformation, scaling in proportion, and padding, etc. For example, by performing color transformation on the clothing sample pictures, adjusting parameters such as brightness, contrast, hue, and saturation, and random padding, picture samples of the same style that conform to the brand style image features but are different can be generated.
[0132] S3. Based on the dataset C, construct a multi-tuple candidate style set S.
[0133] In an embodiment of this application, the multi-tuple candidate style set S is represented as (I, P, N, β), where I represents any style image in the dataset C, P represents another style image that belongs to the same category as I and is similar to I, N represents a style image that belongs to the same category as I but is not similar to I, or a style image that belongs to a different category from I, and β represents whether I and N belong to the same category; when β = 0, it means that I and N belong to the same category, and when β = 1, it means that I and N do not belong to the same category.
[0134] It should be noted that if I has no similar styles or has few similar styles, P can appropriately deform I through the operation methods such as vertical flipping, color transformation, scaling, and padding mentioned in S2 above to generate similar styles of I and increase the amount of data.
[0135] In another embodiment of the present application, the multi - tuple candidate style set S is represented as (I, P, N, α), where I represents any style image in the data set C, P represents another style image of the same category as I, N represents yet another style image of the same category as I, or a style image of a different category from I. Different values of α have different meanings. When α = 0, it means that I and P are the same style, and I and N are completely dissimilar; when α = 1, it means that I and P are not the same style but are style - similar, and I and N are completely dissimilar; when α = 2, it means that I and P are similar styles but cannot be fully reused, and I and N are completely dissimilar; when α = 3, it means that I and P are the same style, and I and N are similar styles but cannot be fully reused; when α = 4, it means that I and P are not the same style but are style - similar, and I and N are similar styles but cannot be fully reused.
[0136] In this embodiment, N represents a style that is more dissimilar to I than P. For example, when α = 4, P represents a similar style, and N represents a style that, although having a certain degree of similarity to I, has weak reference value; when α = 2, P represents a style that has a certain degree of similarity to I but has weak reference value, and N represents a style that has no reference value for the design of I. For example, a jacket - style for a T - shirt - style, I and N are completely dissimilar.
[0137] S4. Pre - process the data set C, and input the pre - processed data set C into the first neural network model to train the first neural network model.
[0138] Specifically, the pre - processing of the data set C includes performing random transformations on the clothing sample pictures in the data set C, such as vertical flipping and color transformation operations.
[0139] S5. When the loss value or accuracy of the first neural network model reaches the preset requirements, the training is completed. Remove the classification layer of the first neural network model to obtain the second neural network model.
[0140] In this embodiment, removing the classification layer of the first neural network model is to transform the first neural network model into a feature extractor for use in practical applications. Once the classification layer is removed, the model can be used to extract the feature vectors of the input style images instead of directly performing classification. These feature vectors can be used to complete the similarity matching task.
[0141] S6. Pre - process the multi - tuple candidate style set S, adjust the parameters of the second neural network model based on the pre - processed multi - tuple candidate style set S, and use the adjusted second neural network model as the clothing style retrieval model.
[0142] In an embodiment of the present application, preprocessing the multi - tuple candidate style set S includes step S601 and step S602.
[0143] Step S601: Fill the style images in the multi - tuple candidate style set S to obtain the filled style images.
[0144] Step S602: Scale the filled style images proportionally.
[0145] Specifically, the style images in the multi - tuple candidate style set S may be screenshots of any size, which are inconsistent with the pixel size of the image to be compared. To facilitate subsequent image comparison on the same scale, it is necessary to fill the style images in the multi - tuple candidate style set S. At the same time, considering the proportional nature of clothing, it is necessary to ensure that the shape of the image and the shape of the clothes in the image do not distort. Therefore, after obtaining the filled style images, scale the filled style images proportionally to keep the proportion and shape of the image unchanged.
[0146] For example, if the size of the image to be compared is 200×200, and the size of the style image in the multi - tuple candidate style set S is 600×800, if the style picture is directly scaled to 200×200, distortion will occur. At this time, the original style picture with a size of 600×800 can be randomly filled to 800×800 first, and then scaled proportionally to 200×200.
[0147] It should be noted that the size of the scaled style image can be adaptively adjusted according to actual situations such as the retrieval speed requirement and computer configuration. Generally, the larger the style image, the greater the computing power required for the clothing style retrieval model.
[0148] In this implementation, through preprocessing operations such as filling and proportional scaling of the style images in the multi - tuple candidate style set S, it can ensure that the image quality meets the requirements, while keeping the proportion and shape of the image unchanged, improving the accuracy and reliability of image comparison.
[0149] In an embodiment of the present application, adjusting the parameters of the second neural network model based on the preprocessed multi - tuple candidate style set S and using the adjusted second neural network model as the clothing style retrieval model includes:
[0150] S61: Input the preprocessed multi - tuple candidate style set S into the second neural network model to extract the image feature f of the style image I ji the image feature f of the style image P jp and the image feature f of the style image N jn .
[0151] As an alternative embodiment, the multi - tuple candidate style set input to the second neural network model may be (I, P, N, 0), where I represents any style image in the dataset C, P represents another style image of the same category as I and similar to I, and N represents another style image of a different category from I.
[0152] S62. For each sample data, calculate the image feature f of the style image I ji and the image feature f of the style image P jp The Euclidean distance s between them jp , and the image feature f of the style image I ji and the image feature f of the style image N jn The Euclidean distance s between them jn .
[0153] In an embodiment of the present application, the following formula is used to calculate the Euclidean distance s jp and s jn :
[0154] s jp = ||f ji - f jp ||
[0155] s jn = ||f ji - f jn ||
[0156] where f ji represents the image feature of the style image I, f jp represents the image feature of the style image P, f jp , s jp represents the Euclidean distance between the image feature f of the style image I and the image feature f of the style image P; f ji represents the image feature of the style image N, s jp represents the Euclidean distance between the image feature f of the style image I and the image feature f of the style image N. jn represents the image feature of the style image N, s jn represents the Euclidean distance between the image feature f of the style image I and the image feature f of the style image N. ji and the image feature f of the style image N jn between.
[0157] S63. Based on the Euclidean distance s jp and the Euclidean distance s jn , calculate the single - sample loss loss j .
[0158] In an embodiment of the present application, when the multi - tuple candidate style set S is expressed as (I, P, N, β), the following formula is used to calculate the total loss loss:
[0159]
[0160] where s jp represents the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image P jp The Euclidean distance between them, s jn represents the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image N jn The Euclidean distance between them, beta j is an adjustable hyperparameter and is related to the value of β.
[0161] In another embodiment of the present application, when the multi-tuple candidate style set S is represented as (I, P, N, α), the following formula is used to calculate the total loss loss:
[0162]
[0163] where s jp represents the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image P jp The Euclidean distance between them, s jn represents the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image N jn The Euclidean distance between them, k, dp, and dn are adjustable hyperparameters. For different values of α, the value of k is the same (for example, 0.02), and the values of dp and dn are different. For example, during the actual training process of the second neural network model, the values of α, dp, and dn are (which can be adjusted according to the actual situation):
[0164] α = 0, dp = 5e-4, dn = 0.8;
[0165] α = 1, dp = 0.1, dn = 0.8;
[0166] α = 2, dp = 0.3, dn = 0.8;
[0167] α = 3, dp = 5e-4, dn = 0.3;
[0168] α = 4, dp = 0.1, dn = 0.3.
[0169] In this implementation, the different similarity degrees between styles can be distinguished, and the robustness of the model can be improved.
[0170] S64. For all single-sample losses loss jSum to obtain the total loss, and based on the total loss, use the backpropagation algorithm to adjust the parameters of the second neural network model and train the second neural network model for multiple epochs until the model converges.
[0171] It should be noted that the protection scope of the clothing style retrieval method described in the embodiments of the present application is not limited to the execution order of the steps listed in this embodiment. Any solution achieved by adding or reducing steps of the prior art and replacing steps according to the principles of the present application is included in the protection scope of the present application.
[0172] As Figure 5 shown, this embodiment provides a clothing style retrieval system, including a to-be-retrieved style information input module 100, a preliminary screening module 200, a content judgment module 300, an image feature extraction module 400, a first matching degree determination module 500, a second matching degree determination module 600, and a similar clothing style determination module 700.
[0173] The to-be-retrieved style information input module 100 is used to input the style information of the to-be-retrieved clothing.
[0174] The preliminary screening module 200 is used to screen out a candidate style set from the historical style database according to the style information.
[0175] The content judgment module 300 is used to judge whether the style information includes a style image and size information.
[0176] The image feature extraction module 400 is used to preprocess the style image when the style information includes the style image, and input the preprocessed style image into a pre-trained clothing style retrieval model to extract the first image feature.
[0177] The first matching degree determination module 500 is used to compare the first image feature with the image features corresponding to each style in the candidate style set to obtain the first matching degree.
[0178] The second matching degree determination module 600 is used to standardize the size information when the style information includes the size information, and compare the standardized size information with the size information of each style in the candidate style set to obtain the second matching degree.
[0179] The similar clothing style determination module 700 is used to determine the clothing styles similar to the to-be-retrieved clothing based on the first matching degree and / or the second matching degree.
[0180] It should be noted that the structures and principles of the to-be-retrieved style information input module 100, the preliminary screening module 200, the content judgment module 300, the image feature extraction module 400, the first matching degree determination module 500, the second matching degree determination module 600, and the similar clothing style determination module 700 correspond one by one to the steps in the above clothing style retrieval method, so they will not be elaborated here.
[0181] The clothing style retrieval system provided by the embodiments of the present application can implement the clothing style retrieval method described in the present application. However, the implementation devices of the clothing style retrieval method described in the present application include, but are not limited to, the structures of the clothing style retrieval system listed in this embodiment. Any structural deformation and replacement of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0182] As Figure 6 shown, this embodiment provides a terminal, including: a processor 61 and a memory 62.
[0183] The memory 62 is used to store a computer program.
[0184] The processor 61 is used to execute the computer program stored in the memory 62, so that the terminal executes the method described in any one of the above.
[0185] In several embodiments provided by the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules / units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or modules or units can be in electrical, mechanical or other forms.
[0186] The modules / units described as separate components may or may not be physically separated. The components shown as modules / units may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, in each embodiment of the present application, the various functional modules / units can be integrated in a processing module, or each module / unit can exist physically alone, or two or more modules / units can be integrated in one module / unit.
[0187] Those of ordinary skill in the art should also be further aware that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0188] The embodiments of this application also provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the clothing style retrieval method described in any one of the above. Those of ordinary skill in the art can understand that all or part of the steps in the method of implementing the above embodiments can be completed by instructing a processor through a program. The described program can be stored in a computer-readable storage medium. The storage medium is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof. The above storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid state disk (SSD)), etc.
[0189] The embodiments of this application can also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, they wholly or partly generate the processes or functions described in the embodiments of this application. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, or data center to another website, computer, or data center in a wired manner (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (e.g., infrared, wireless, microwave, etc.).
[0190] When the computer program product is executed by a computer, the computer executes the method described in the foregoing method embodiments. The computer program product can be a software installation package. In the case where the foregoing method needs to be used, the computer program product can be downloaded and executed on the computer.
[0191] The descriptions of the processes or structures corresponding to the foregoing respective drawings each have their own focuses. For parts not detailed in a certain process or structure, reference can be made to the relevant descriptions of other processes or structures.
[0192] The foregoing embodiments merely illustrate the principles and effects of the present application, rather than limiting the present application. Any person familiar with this technology can modify or change the foregoing embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present application should still be covered by the claims of the present application.
Claims
1. A method for retrieving clothing styles, characterized in that, include: Enter the style information of the clothing to be retrieved; According to the style information, a candidate style set is selected from a historical style database; Determining whether the style information includes a style image and size information; If the style information includes the style image, preprocessing the style image, and inputting the preprocessed style image into a pre-trained clothing style retrieval model to extract a first image feature; Comparing the first image feature with image features corresponding to each style in the candidate style set to obtain a first matching degree; If the style information includes the size information, standardize the size information, and compare the standardized size information with the size information of each style in the candidate style set to obtain a second matching degree; Based on the first matching degree and / or the second matching degree, a clothing style similar to the clothing to be retrieved is determined.
2. The method according to claim 1, wherein According to the style information, a candidate style set is screened out from the historical style database, including: Determine whether the style information includes any one of the reference fields or any combination of the reference fields: clothing brand, clothing category, gender of the people for whom the clothing is applicable, fabric characteristics, clothing version, and year; each of the reference fields corresponds to at least one attribute feature; If yes, then comparing the attribute characteristics of the reference field included in the style information with the attribute characteristics of the reference field of each style in the historical style database to obtain a third matching degree; Based on the third matching degree, style data satisfying each reference field is screened out from the historical style database to form the candidate style set.
3. A method for training a clothing style retrieval model, characterized in that, include: Obtain clothing sample data drawn by clothing brands using professional graphic design tools, and obtain clothing sample pictures of multiple different categories; According to the design features of clothing samples, the clothing sample images of similar styles within all categories are labeled to obtain data set C; Based on the data set C, construct a multi-group candidate style set S; Preprocessing the data set C, and inputting the preprocessed data set C into a first neural network model to train the first neural network model; When the loss value or accuracy of the first neural network model reaches a preset requirement, the training is completed, and the classification layer of the first neural network model is removed to obtain a second neural network model; Preprocess the multi-group candidate style set S, adjust the parameters of the second neural network model based on the preprocessed multi-group candidate style set S, and use the adjusted second neural network model as a clothing style retrieval model.
4. The method according to claim 3, characterized in that, Preprocessing the multi-group candidate style set S includes: Filling the style images in the multi-group candidate style set S to obtain a filled style image; The filled style image is scaled proportionally.
5. The method according to claim 3, characterized in that, The multi-group candidate style set is represented as S(I, P, N, β), where I represents any style image in the data set C, P represents another style image of the same category as I and similar to I, N represents a style image of the same category as I but not similar to I, or a style image of a different category from I, and β represents whether I and N belong to the same category; β When β = 0, it means that I and N belong to the same category. When β = 1, it means that I and N do not belong to the same category.
6. The method according to claim 3, characterized in that, The multi - tuple candidate style set is denoted as S(I, P, N, α), where I represents any style image in the data set C, P represents another style image of the same category as I, N represents another style image of the same category as I, or a style image of a different category from I. Different α values have different meanings. When α = 0, it means that I and P are the same style, and I and N are completely dissimilar; when α = 1, it means that I and P are not the same style but are style - similar, and I and N are completely dissimilar; when α = 2, it means that I and P are similar styles but cannot be fully reused, and I and N are completely dissimilar; when α = 3, it means that I and P are the same style, and I and N are similar styles but cannot be fully reused; when α = 4, it means that I and P are not the same style but are style - similar, and I and N are similar styles but cannot be fully reused.
7. The method according to claim 5 or 6, characterized in that, Adjusting the parameters of the second neural network model based on the pre - processed multi - tuple candidate style set S, and using the adjusted second neural network model as a clothing style retrieval model includes: Input the pre - processed multi - tuple candidate style set S into the second neural network model to extract the image feature f of the style image I ji , the image feature f of the style image P jp and the image feature f of the style image N jn ; For each sample data, calculate the image feature f of the style image I ji and the image feature f of the style image P jp The Euclidean distance s between them jp , and the image feature f of the style image I ji and the image feature f of the style image N jn The Euclidean distance s between them jn ; Based on the Euclidean distance s jp and the Euclidean distance s jn , calculate the single-sample loss loss j ; Sum all single-sample losses j to obtain the total loss, and adjust the parameters of the second neural network model according to the total loss using the backpropagation algorithm, and train the second neural network model for multiple epochs until the model converges.
8. The method according to claim 7, characterized in that, When the multi - tuple candidate style set S is expressed as (I, P, N, β), the total loss loss is calculated using the following formula: where s jp represents the Euclidean distance between the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image P jp , s jn represents the Euclidean distance between the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image N jn , beta j is an adjustable hyperparameter and is related to the value of β 9. The method according to claim 7, characterized in that, When the multi - tuple candidate style set S is expressed as (I, P, N, α), the total loss loss is calculated using the following formula: where s jp represents the Euclidean distance between the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image P jp , and s jn represents the Euclidean distance between the image feature f of the style image I in the j-th sample data ji and the image feature f of the style image N jn . k, dp, and dn are adjustable hyperparameters. For different α values, the k value is the same, while the dp and dn values are different.
10. A clothing style retrieval system, characterized in that, Including: A module for inputting information of the style to be retrieved, which is used to input the style information of the clothing to be retrieved; A preliminary screening module, which is used to screen out a candidate style set from the historical style database according to the style information; A content judgment module, which is used to judge whether the style information includes a style image and size information; An image feature extraction module, which is used to pre - process the style image when the style information includes the style image, and input the pre - processed style image into a pre - trained clothing retrieval model to extract the first image feature; A first matching degree determination module, which is used to compare the first image feature with the image features corresponding to each style in the candidate style set to obtain the first matching degree; A size feature extraction module, which is used to standardize the size information when the style information includes the size information, and input the standardized size information into a pre - trained clothing retrieval model to extract the first size feature; A second matching degree determination module, which is used to standardize the size information when the style information includes the size information, and compare the standardized size information with the size information of each style in the candidate style set to obtain the second matching degree; A module for determining similar clothing styles, which is used to determine the clothing styles similar to the clothing to be retrieved based on the first matching degree and / or the second matching degree.
11. A terminal, characterized in that, Including: A processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer programs stored in the memory, so that the terminal executes the clothing style retrieval method according to any one of claims 1 to 3 and / or the clothing style retrieval model training method according to any one of claims 4 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the clothing style retrieval method described in any one of claims 1 to 3 and / or the clothing style retrieval model training method described in any one of claims 4 to 9.