Garment pattern part identification method and device based on deep learning
Through deep learning methods, the clothing layout part recognition model is constructed, and transfer learning and data enhancement technology is used to solve the problem of insufficient recognition accuracy and robustness in clothing layout part recognition, and efficient and accurate clothing layout parts are achieved. Identify.
Patent Information
- Application Number
- CN202411408238.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art has insufficient identification accuracy in the recognition of clothing layout parts, especially when deformation or similar layout parts, it is difficult to maintain efficient and accurate identification, and the recognition robustness is insufficient due to the diversification of layouts.
Using deep learning-based methods, we build a clothing layout part recognition model, through transfer learning and custom full connection layer, combined with data enhancement technology, we establish a diverse clothing layout data set, train a deep convolutional neural network model, and achieve high efficiency. Accurate identification of clothing layout parts.
It improves the accuracy and robustness of clothing layout parts recognition, can effectively identify multiple types of clothing layout parts, reduces the recognition error rate, and improves the generalization ability and practicality of the model.
Smart Images

Figure CN119313961A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method and device for identifying clothing pattern parts based on deep learning. Background Art
[0002] With the development of digitalization and artificial intelligence technology, intelligent technology has been widely used in all links of the clothing industry chain. Clothing pattern is the structural expression of the design, which directly determines the category and style of clothing. Each pattern is composed of one or more patterns, and specific parts correspond to different patterns. The classification of clothing pattern parts is closely related to the nesting, cutting method and sewing process in production.
[0003] Rapid classification and accurate identification of clothing pattern parts can significantly improve R&D and production efficiency, reduce costs, shorten cycles, and promote product iteration. However, related technologies mainly identify clothing pattern parts through image shape comparison. Once the image of the clothing pattern part to be identified is deformed, or a clothing pattern part with high similarity appears, the accuracy of identification will be reduced. Summary of the invention
[0004] The present invention provides a method and device for clothing pattern part recognition based on deep learning.
[0005] According to a first aspect of the present disclosure, a method for identifying parts of a clothing pattern based on deep learning is provided, the method comprising:
[0006] Obtain the clothing pattern part to be identified;
[0007] The clothing pattern part to be identified is input into a clothing pattern part recognition model to obtain a recognition result of the clothing pattern part to be identified; wherein, a preset deep learning model is trained through training samples to obtain the clothing pattern part recognition model, and the training samples include different clothing pattern parts respectively contained in different types of clothing.
[0008] According to a second aspect of the present disclosure, a clothing pattern part recognition device based on deep learning is provided, the device comprising:
[0009] A pattern part acquisition module is used to acquire the pattern parts of the garment to be identified;
[0010] The recognition result acquisition module is used to input the clothing pattern part to be identified into the clothing pattern part recognition model to obtain the recognition result of the clothing pattern part to be identified; wherein, the preset deep learning model is trained through training samples to obtain the clothing pattern part recognition model, and the training samples include different clothing pattern parts respectively contained in different types of clothing.
[0011] According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0012] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented.
[0013] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method of the present disclosure when executed by a processor.
[0014] The method and device for identifying clothing pattern parts based on deep learning provided by the embodiments of the present disclosure obtain the clothing pattern parts to be identified and input the clothing pattern parts to be identified into the clothing pattern part identification model to obtain the identification result of the clothing pattern parts to be identified. Since the clothing pattern part identification model is obtained by training a preset deep learning model through training samples, and the training samples include different clothing pattern parts respectively included in different types of clothing, the clothing pattern part identification model obtained after training can accurately identify the clothing pattern parts of different types of clothing, thereby improving the accuracy and robustness of model identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0016] Figure 1 A flowchart of a method for identifying parts of a clothing pattern based on deep learning provided by an exemplary embodiment of the present disclosure;
[0017] Figure 2 A schematic diagram of the names of the panels of various parts in a T-shirt pattern provided by an exemplary embodiment of the present disclosure;
[0018] Figure 3 A schematic block diagram of functional modules of a clothing pattern part recognition device based on deep learning provided by an exemplary embodiment of the present disclosure;
[0019] Figure 4 A structural block diagram of an electronic device provided for an exemplary embodiment of the present disclosure;
[0020] Figure 5 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0022] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0023] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0024] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0027] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0028] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0029] With the development of digitalization and artificial intelligence technology, intelligent technology has been widely used in all links of the clothing industry chain, including raw material procurement, production and manufacturing, sales and distribution, and after-sales service. These technologies not only improve the R&D and production efficiency of clothing products, but also reduce labor costs and realize large-scale customized production.
[0030] The clothing pattern is the structural expression of the design, which directly determines the category and style of the clothing. Each pattern is composed of one or more patterns, and different patterns correspond to specific parts. Taking the basic tops as an example, the pattern parts of T-shirts include the front piece, back piece, collar and sleeves. The classification of clothing pattern parts is closely related to the nesting, cutting method and sewing process in production.
[0031] Rapid classification and accurate identification of clothing pattern parts can significantly improve R&D and production efficiency, reduce costs, shorten cycles, and promote product iteration. However, the diversity of pattern parts makes it challenging for non-professionals to classify and identify them, raising the technical threshold for pattern making. Therefore, developing efficient and accurate classification and identification methods is of great significance for lowering the technical threshold of the industry and promoting the digital transformation of enterprises.
[0032] Related technologies for the study of clothing pattern parts include traditional shape feature matching, fuzzy theory and computer vision. Traditional shape feature matching methods use invariant moments and alluvial map features to compare shapes. Although they have a high speed, they are not accurate enough when dealing with small deformations. Fuzzy theory constructs a fuzzy matrix by extracting contour point features, which is suitable for dealing with shape uncertainty, but it is prone to classification errors between similar pattern parts. Computer vision methods, such as SVM (Support Vector Machine) classifiers, can achieve effective classification through feature extraction, but they are less robust to noise and small shape changes.
[0033] In view of the above technical problems, the embodiments of the present disclosure construct an intelligent model through deep learning technology, and establish a data set of various clothing pattern parts. After systematic model training, efficient and accurate clothing pattern part recognition can be achieved. This can effectively solve the difficulties in similarity recognition in clothing pattern recognition, as well as the problem of insufficient recognition robustness due to the diversity of clothing patterns, and can greatly improve the accuracy of clothing pattern part recognition.
[0034] In a scenario embodiment provided by the present disclosure, the method for identifying parts of a clothing pattern based on deep learning provided by the embodiment of the present disclosure may specifically include the following steps S1 to S6:
[0035] Step S1, constructing a clothing pattern part recognition model.
[0036] Specifically, step S1 may further include the following steps:
[0037] Step S1.1, select a deep learning model.
[0038] When selecting a deep learning model, a variety of architectures can be used, such as Convolutional Neural Networks (CNN) or Deep Residual Networks (ResNet), etc., but the embodiment is not limited thereto. In the embodiment, a VGG16 model can be selected for experimentation. VGG16 is a deep convolutional neural network model that is applicable to clothing pattern part classification tasks.
[0039] Step S1.2, through transfer learning, obtain pre-trained weights to quickly improve model performance.
[0040] In an embodiment, a model that has been trained on a large-scale dataset (such as Open Images, COCO, or ImageNet, etc.) can be used for transfer learning to obtain pre-trained weights. In an embodiment, a large dataset ImageNet can be selected and fine-tuned based on a pre-trained model of VGG16 to make it better suited to a specific clothing pattern part recognition task.
[0041] Step S1.3, add custom fully connected layers to the last few layers of the deep learning model.
[0042] In an embodiment, one or two fully connected layers may be added at the end of the model, and the number of neurons is generally set to 256, which may be adjusted according to the complexity of a specific task. In addition, a dropout layer may be added to the model, and a random dropout probability, for example, set to 0.5, may be used to prevent the model from overfitting.
[0043] Step S1.4, design the output layer to adapt to the multi-classification task.
[0044] For the task of clothing pattern part classification, the output layer can use the Softmax activation function and set the corresponding number of neurons to output the probability distribution of each category. Specifically, if a clothing pattern containing n parts is trained, the number of neuron nodes in the output layer should be set to n to ensure that the model can accurately predict the category probability of each part.
[0045] Step S2, establishing a clothing pattern part data set.
[0046] The embodiment collects different types of clothing patterns, annotates and labels the clothing pattern parts, establishes a clothing pattern part data set, and re-divides the data set into a training set, a validation set, and a test set to adapt to model training.
[0047] Specifically, step S2 may include the following steps:
[0048] Step S2.1, collect various clothing pattern data, covering common types. Finely annotate the data, and clarify the characteristics and classification of clothing pattern parts.
[0049] The basic data in the embodiment, for example, can be 2000 sets of clothing patterns obtained from a certain brand company, including tops, pants, jumpsuits, etc., and 50 T-shirt patterns and 50 pants patterns are selected for experiments. The pattern parts of T-shirts and pants are classified. Among them, each T-shirt pattern includes 5 parts: front piece (Front), back piece (Back), left sleeve (Lsleeve), right sleeve (Rsleeve) and collar (Collar). Each pants pattern also includes 5 parts: left front pants piece (FL_P), right front pants piece (FR_P), left back pants piece (BL_P), right back pants piece (BR_P) and waistband (W_P). In order to facilitate subsequent model training and analysis, each pattern part is set with a corresponding part name label.
[0050] Step S2.2, divide the data set into training set, validation set and test set.
[0051] In order to ensure effective training and performance evaluation of the model, the collected data set was reasonably divided into 70% as a training set, 15% as a validation set, and 15% as a test set. The training set data is used for model learning, and the ability to recognize the characteristics of clothing pattern parts is improved by adjusting parameters. The validation set monitors the model performance during the training process, helps to timely discover and adjust overfitting problems, and performs hyperparameter tuning. Finally, the test set is used for the final evaluation after the model training is completed, ensuring the generalization ability of the model on unseen data.
[0052] Step S3, preprocessing of clothing pattern part data.
[0053] In an embodiment, the size unification, color standardization and contour enhancement technology can be performed on the clothing pattern part images so that they can meet the model training requirements.
[0054] Specifically, in step S3.1, the size and color of the garment pattern part images are unified and the contour enhancement technology is performed.
[0055] In the embodiment, all images can be resized to meet the requirements of the VGG16 model and uniformly adjusted to 224x224 pixels. First, the original width (W) and height (H) are calculated, and a smaller scaling ratio is selected to maintain the aspect ratio. Then the image is scaled using an interpolation method and adjusted to 224x224 pixels by padding or cropping to ensure that the processed image can be correctly input into the VGG16 model.
[0056] Color standardization technology is applied to eliminate the impact of different lighting conditions on image quality. The Z-score normalization (mean and standard deviation normalization) algorithm is used to process the images so that the color distribution of all images is consistent, improving the robustness of the model to color changes.
[0057] The embodiment can use the Canny edge detection algorithm to enhance the clarity of the clothing pattern. First, the color image is converted into a grayscale image and Gaussian blur is performed, then the gradient is calculated and non-maximum suppression and double threshold processing are performed, and finally the strong and weak edges are connected to form a complete edge image. To further highlight the features, the edges are expanded to make them thicker, thereby improving the recognizability and helping the VGG16 model to more accurately identify the details of the clothing pattern.
[0058] In step S3.2, data augmentation techniques are applied to increase the diversity of samples.
[0059] In the embodiment, the diversity of samples can be increased by data enhancement methods such as image rotation and scaling. For each pattern part, 12 random rotation angles can be set, and a reasonable horizontal scaling ratio range (0.8-1.2), vertical scaling ratio range (0.8-1.2) and overall scaling ratio range (0.8-1.2) can be set to avoid excessive deformation. After these data enhancement processing, the total number of samples in the original T-shirt dataset and pants dataset can be increased to 10,000 respectively, which can greatly improve the diversity of samples and thus improve the robustness of the model.
[0060] Step S4: clothing pattern part recognition model training.
[0061] In the embodiment, model training parameters can be set, and appropriate activation functions can be selected. A suitable loss function can be selected to optimize model performance, and the training process can be supervised and parameters can be adjusted in time to ensure effective learning and convergence of the model.
[0062] Specifically, in step S4.1, the initial learning rate and optimizer are configured, the activation function is selected, and the loss function is used to optimize the model.
[0063] In the embodiment, the basic parameters of the model training are set, including selecting an initial learning rate (such as 0.001), an optimizer (such as Adam or SGD), an activation function (such as ReLU) and a loss function (cross entropy loss). In addition, a suitable batch size (such as 32 or 64) is determined to balance memory usage and training speed.
[0064] In step S4.2, the model is trained for multiple rounds, the performance of the validation set is monitored using an early stopping strategy, and the best model is saved.
[0065] In an embodiment, a learning rate scheduling strategy (such as cosine annealing or learning rate decline) can be used to dynamically adjust the learning rate during the training process, thereby improving the training effect of the model.
[0066] During the training process, in order to prevent overfitting and improve the generalization ability of the model, a variety of early stopping strategies can be used. First, monitor the loss and accuracy of the validation set. When there is no improvement within the set rounds, automatically stop training and record the best model version. You can set a patience value to allow a certain number of rounds of fluctuations before deciding whether to stop training, and use visualization tools (such as TensorBoard) to track performance changes in real time. These methods help ensure that the model performs best on the validation set, thereby improving the overall effect.
[0067] After training, the best model needs to be saved for subsequent evaluation and application. You can choose common model saving formats, such as HDF5 (.h5) or TensorFlow's SavedModel format.
[0068] Step S5: model performance evaluation and optimization.
[0069] In the embodiment, after the model training is completed, a comprehensive evaluation is performed using indicators such as accuracy, recall, and F1 value. Based on the evaluation results, optimization is performed by adjusting hyperparameters, optimizing feature engineering, and trying different models.
[0070] The specific steps of step S5 are as follows:
[0071] S5.1: After the model is trained, the saved model is tested using the T-shirt test set and the pants test set. The recognition accuracy of the T-shirt pattern parts reaches 95%, the recall rate is 90%, and the F1 value is 92%. The recognition accuracy of the pants pattern parts reaches 97.5%, the recall rate is 93%, and the F1 value is 95%. The model shows good recognition performance.
[0072] S5.2: Based on the evaluation results, the recall rate of T-shirts is optimized. By adjusting the initial learning rate to 0.005, the recall rate of T-shirts is further improved to 92%, and the F1 value is increased to 94%.
[0073] Step S6: Real-time recognition and application of the model.
[0074] Integrate the trained clothing pattern part recognition model into the actual application system, and accept user feedback to adjust and optimize the model in a timely manner.
[0075] The specific steps of step S6 are as follows:
[0076] Step S6.1: Deploy the trained recognition model into the clothing design software to support the rapid recognition and classification of user input images. The embodiment integrates the clothing pattern part recognition model into the clothing 3D virtual design software to achieve real-time recognition of user uploaded images. The model can automatically analyze the clothing pattern parts in the image and display the classification labels on the software interface to provide users with accurate pattern part recognition information;
[0077] Step S6.2: Collect information about recognition results in real time through user feedback, establish a feedback mechanism, and allow users to comment and make suggestions. According to the feedback, identify the deficiencies of the model, such as recognition errors, and regularly adjust and optimize, including retraining the model, adjusting hyperparameters, and improving data processing procedures. Ensure that the model continues to adapt to user needs and improve recognition accuracy and user satisfaction. At the same time, establish a monitoring system to track model performance indicators in real time and promptly identify and resolve potential problems. Users can also submit new clothing pattern data to facilitate iterative training.
[0078] The method for identifying clothing pattern parts based on deep learning provided by the embodiment of the present disclosure can realize intelligent and automated model training by adopting deep learning technology and combining transfer learning, without the need to manually design feature attributes. It can identify multiple types of clothing pattern parts with high recognition efficiency and strong robustness. Through data enhancement technology, the generalization ability of the model can be improved and the risk of overfitting can be reduced. The model can be integrated into clothing design software and continuously optimized through a user feedback mechanism, which can show strong practicality and market promotion potential.
[0079] Based on the above embodiments, the present disclosure also provides a method for identifying clothing pattern parts based on deep learning. Figure 1 As shown, the method may include the following steps:
[0080] In step S110, the clothing pattern part to be identified is obtained.
[0081] In an embodiment, a clothing image to be identified input by a user may be received, and the clothing image to be identified may be a complete clothing image. The clothing image to be identified may include at least one clothing pattern part, and the clothing pattern part included in the clothing image to be identified may be used as the clothing pattern part to be identified.
[0082] Specifically, in the embodiment, an object to be identified can be obtained, and it can be detected whether the object to be identified is clothing. When the object to be identified is clothing, the object to be identified is divided into at least one clothing pattern part, and the at least one clothing pattern part is used as the clothing pattern part to be identified.
[0083] In the embodiment, the object to be identified can be preprocessed, such as grayscale conversion, histogram equalization, noise removal, cropping and scaling, etc., to enhance the image quality and facilitate subsequent feature extraction. Object detection algorithms (such as YOLO, Mask R-CNN, etc.) can be used to locate clothing items in the image of the object to be identified, accurately frame the location of the clothing, and separate it from the background. Different types of clothing, such as tops, pants, skirts, etc., can be identified and distinguished.
[0084] The embodiment can extract visual features such as color, texture, and pattern from the segmented clothing images through deep learning models such as convolutional neural networks. Convolutional neural networks can automatically learn these features and perform refined analysis of clothing. Through training, the model can learn to recognize features such as stripes, floral patterns, or solid colors. After extracting the features, the clothing is classified using a pre-trained classifier. The classifier can classify clothing into specific categories based on the features, such as jeans, T-shirts, or windbreakers. The training of the classifier requires a large amount of labeled data sets to ensure the accuracy of recognition.
[0085] After identifying that the object to be identified is clothing, the image of the object to be identified can be segmented according to the type of the object to be identified, such as jeans, T-shirts or windbreakers, to obtain various clothing pattern parts.
[0086] In step S120, the clothing pattern part to be identified is input into the clothing pattern part identification model to obtain the identification result of the clothing pattern part to be identified.
[0087] Among them, the preset deep learning model is trained through training samples to obtain a clothing pattern part recognition model, and the training samples include different clothing pattern parts contained in different types of clothing.
[0088] In the embodiment, an image of a clothing pattern part can be obtained to identify the target clothing category corresponding to the image, such as a T-shirt or pants. By dividing each part of the wearing image of the target clothing category, each clothing pattern part to be identified is obtained, and the clothing pattern parts to be identified on the clothing are automatically identified, and the identification results corresponding to each clothing pattern part to be identified are displayed. For example, Figure 2 As shown, when the target clothing category is a T-shirt, the recognition results that can be obtained include five parts: the front piece, the back piece, the left sleeve, the right sleeve and the collar.
[0089] In an embodiment, a clothing pattern part recognition model can be obtained by means of transfer learning. For example, a target pre-trained deep learning model can be first obtained, and the target pre-trained deep learning model can be preliminarily trained based on a preset data set. For example, the target pre-trained deep learning model can be obtained by training a deep convolutional neural network model with a large-scale data set. The target pre-trained deep learning model after the preliminary training is adjusted or trained for a specific task. A fully connected layer, a discard layer, and an output layer are added during the adjustment of the target pre-trained deep learning model after the preliminary training or the specific task training process to obtain a clothing pattern part recognition model. Among them, the fully connected layer is used to classify the clothing pattern parts, the discard layer is used to randomly set the neurons in the target pre-trained deep learning model to zero according to a preset probability, and the output layer is used for the probability distribution of each clothing pattern part category, so as to prevent overfitting of the model.
[0090] The method for identifying clothing pattern parts based on deep learning provided by the embodiment of the present disclosure obtains the clothing pattern parts to be identified and inputs the clothing pattern parts to be identified into the clothing pattern part identification model to obtain the identification result of the clothing pattern parts to be identified. Since the clothing pattern part identification model is obtained by training a preset deep learning model through training samples, and the training samples include different clothing pattern parts respectively included in different types of clothing, the clothing pattern part identification model obtained after training can accurately identify the clothing pattern parts of different types of clothing, thereby improving the accuracy and robustness of model identification.
[0091] Based on the above embodiment, in another embodiment provided by the present disclosure, in order to obtain a training sample, the method may further include the following steps:
[0092] In step S130, multiple types of clothing pattern images are acquired.
[0093] In an embodiment, multiple sets of clothing images of one or several brands may be obtained, and the multiple sets of clothing images may be segmented into different clothing pattern parts.
[0094] In step S140, the clothing pattern parts in the plurality of types of clothing pattern images are classified respectively, and a corresponding part name label is set for each clothing pattern part to obtain a clothing pattern part data set.
[0095] For example, 2,000 clothing patterns of a certain brand are available, including tops, pants, jumpsuits, etc., and 50 T-shirt patterns and 50 pants patterns are selected for experiments. The pattern parts of T-shirts and pants are classified. Among them, each T-shirt pattern contains 5 parts: front piece (Front), back piece (Back), left sleeve (Lsleeve), right sleeve (Rsleeve) and collar (Collar). Each pants pattern also contains 5 parts: left front pants piece (FL_P), right front pants piece (FR_P), left back pants piece (BL_P), right back pants piece (BR_P) and waistband (W_P). In order to facilitate subsequent model training and analysis, each pattern part is set with a corresponding part name label.
[0096] In step S150, each clothing pattern part image in the clothing pattern part data set is preprocessed to obtain a training sample.
[0097] In an embodiment, when preprocessing each clothing pattern part image in the clothing pattern part data set, the clothing pattern part image may be subjected to size unification, color standardization, and contour enhancement technology so that it meets the model training requirements.
[0098] In an embodiment, each clothing pattern part image in the clothing pattern part data set may be converted into a grayscale image, Gaussian blur processing may be performed on the grayscale image, and gradient calculation, non-maximum suppression and double threshold processing may be performed on the processed image.
[0099] In the preprocessing process, in order to more effectively identify the features in the clothing pattern part image, the image edge obtained through the above processing can be used to expand the edge features in the feature image to make it thicker, making the features more prominent and allowing for more accurate identification.
[0100] In the embodiment, the edge of the feature in the garment pattern part image can be refined by non-maximum suppression. By performing non-maximum suppression on the gradient amplitude, that is, only retaining the local maximum and suppressing the non-maximum, the edge can be made more refined and accurate. This can ensure that the edge detection result is more accurate and avoid detecting pseudo edges or unnecessary edge points.
[0101] Through double threshold processing, two thresholds (high threshold and low threshold) are used to process the edge detection results in the clothing pattern part image. The high threshold can be used to retain stronger edges, while the low threshold can be used to retain weaker edges. By comparing the gradient value of the pixel point with the two thresholds, the edge connection and refinement can be achieved. If the gradient value of a pixel point is greater than the high threshold, it is regarded as a strong edge point; if its gradient value is between the two thresholds, it is checked whether there are possible edge points around it, and if so, they are connected; if its gradient value is less than the low threshold, the point is ignored. In this way, through double threshold processing, a more complete and accurate clothing pattern part image edge detection result can be obtained. In this way, through non-maximum suppression and double threshold processing, the accuracy and efficiency of edge detection can be jointly improved, so that the model can better learn the edge features in the clothing pattern part image.
[0102] In the embodiments provided by the present disclosure, in order to improve the diversity of samples and enhance the robustness of the trained model, the embodiments can also rotate the above-mentioned preprocessed clothing pattern part images according to multiple preset rotation angles, and perform horizontal or vertical scaling processing on the rotated images according to multiple preset scaling ratios to obtain training samples.
[0103] For example, data enhancement methods such as image rotation and scaling can be used to increase sample diversity. For each pattern part, multiple random rotation angles can be set, for example, 12 random rotation angles can be set, and a reasonable horizontal scaling ratio range (such as 0.8-1.2), vertical scaling ratio range (0.8-1.2) and overall scaling ratio range (0.8-1.2) can be set to avoid excessive deformation, which can increase the total number of training samples.
[0104] In the case of dividing each functional module according to each function, an embodiment of the present disclosure provides a clothing pattern part recognition device based on deep learning, and the clothing pattern part recognition device based on deep learning can be a server, a terminal or a chip applied to a server. Figure 3 This is a schematic block diagram of the functional modules of a clothing pattern part recognition device based on deep learning provided by an exemplary embodiment of the present disclosure. Figure 3 As shown, the clothing pattern part recognition device based on deep learning includes:
[0105] The pattern part acquisition module 10 is used to acquire the pattern part of the garment to be identified;
[0106] The recognition result acquisition module 20 is used to input the clothing pattern part to be identified into the clothing pattern part recognition model to obtain the recognition result of the clothing pattern part to be identified; wherein, the preset deep learning model is trained through training samples to obtain the clothing pattern part recognition model, and the training samples include different clothing pattern parts respectively contained in different types of clothing.
[0107] In another embodiment provided by the present disclosure, the device further includes a training module, specifically configured to:
[0108] Get the target pre-trained deep learning model;
[0109] The target pre-trained deep learning model is preliminarily trained based on a preset data set, and a fully connected layer, a discard layer and an output layer are added to the target pre-trained deep learning model after the preliminary training to obtain the clothing pattern part recognition model; wherein the fully connected layer is used to classify the clothing pattern parts, the discard layer is used to randomly set the neurons in the target pre-trained deep learning model to zero according to a preset probability, and the output layer is used for the probability distribution of each clothing pattern part category.
[0110] In another embodiment provided by the present disclosure, the device further includes a preprocessing module, specifically configured to:
[0111] Obtain multiple types of clothing pattern images;
[0112] Classifying the clothing pattern parts in the plurality of types of clothing pattern images respectively, and setting corresponding part name labels for the clothing pattern parts, to obtain a clothing pattern part data set;
[0113] Preprocessing is performed on each clothing pattern part image in the clothing pattern part data set to obtain the training sample.
[0114] In another embodiment provided by the present disclosure, the device further includes a preprocessing module, which is specifically further used to:
[0115] Convert each clothing pattern part image in the clothing pattern part data set into a grayscale image;
[0116] Gaussian blur processing is performed on the grayscale image, and gradient calculation, non-maximum suppression and double threshold processing are performed on the processed image.
[0117] In another embodiment provided by the present disclosure, the device further includes a preprocessing module, which is specifically further used to:
[0118] Rotating the preprocessed garment pattern part image according to a plurality of preset rotation angles;
[0119] The rotated image is scaled horizontally or vertically according to a plurality of preset scaling ratios to obtain the training sample.
[0120] In another embodiment provided by the present disclosure, the pattern part acquisition module is specifically used to:
[0121] Acquire an object to be identified, and detect whether the object to be identified is clothing;
[0122] When the object to be identified is clothing, the object to be identified is segmented into at least one clothing pattern part, and the at least one clothing pattern part is used as the clothing pattern part to be identified.
[0123] The clothing pattern part recognition device based on deep learning provided by the embodiment of the present disclosure obtains the clothing pattern part to be recognized and inputs the clothing pattern part to be recognized into the clothing pattern part recognition model to obtain the recognition result of the clothing pattern part to be recognized. Since the clothing pattern part recognition model is obtained by training a preset deep learning model through training samples, and the training samples include different clothing pattern parts respectively included in different types of clothing, the clothing pattern part recognition model obtained after training can accurately recognize the clothing pattern parts of different types of clothing, thereby improving the accuracy and robustness of model recognition.
[0124] An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the above method disclosed in the embodiment of the present disclosure.
[0125] Figure 4 The structure diagram of an electronic device provided by an exemplary embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801 , and the processor 1801 can execute corresponding steps in the above method disclosed in the embodiment of the present disclosure.
[0126] The processor 1801 may also be referred to as a central processing unit (CPU), which may be an integrated circuit chip having signal processing capabilities. Each step in the method disclosed in the embodiment of the present disclosure may be completed by an integrated logic circuit of hardware in the processor 1801 or by instructions in the form of software. The processor 1801 may be a general-purpose processor, a digital signal processor (DSP), an ASIC (Application Specific Integrated Circuit), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a memory 1802, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or other mature storage media in the art. The processor 1801 reads the information in the memory 1802 and completes the steps of the method in combination with its hardware.
[0127] In addition, when various operations / processes according to the present disclosure are implemented by software and / or firmware, they can be transmitted from a storage medium or a network to a computer system having a dedicated hardware structure, such as Figure 5 The computer system 1900 shown is installed with the programs constituting the software. When the various programs are installed, the computer system can perform various functions, including the functions described above. Figure 5 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure.
[0128] Computer system 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0129] like Figure 5As shown, the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 to a random access memory (RAM) 1903. In the RAM 1903, various programs and data required for the operation of the computer system 1900 can also be stored. The computing unit 1901, the ROM 1902, and the RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.
[0130] A plurality of components in the computer system 1900 are connected to the I / O interface 1905, including: an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. The input unit 1906 may be any type of device capable of inputting information to the computer system 1900, and the input unit 1906 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 1907 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1908 may include, but is not limited to, a disk, an optical disk. The communication unit 1909 allows the computer system 1900 to exchange information / data with other devices over a network such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0131] The computing unit 1901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the above methods disclosed in the embodiments of the present disclosure may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1908. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 1902 and / or communication unit 1909. In some embodiments, the computing unit 1901 may be configured to perform the above methods disclosed in the embodiments of the present disclosure in any other appropriate manner (e.g., by means of firmware).
[0132] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the embodiment of the present disclosure.
[0133] The computer-readable storage medium in the disclosed embodiments may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specifically, the computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0135] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the above method disclosed in the embodiments of the present disclosure is implemented.
[0136] In embodiments of the present disclosure, computer program codes for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0138] The modules, components or units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the modules, components or units do not, in some cases, limit the modules, components or units themselves.
[0139] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0140] The above descriptions are only some embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, a technical solution formed by replacing the above features with the technical features with similar functions disclosed in the present disclosure (but not limited to).
[0141] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A clothing pattern part recognition method based on deep learning, characterized in that: The method comprises: Obtain the clothing pattern part to be identified; The clothing pattern part to be identified is input into a clothing pattern part recognition model to obtain a recognition result of the clothing pattern part to be identified; wherein, a preset deep learning model is trained through training samples to obtain the clothing pattern part recognition model, and the training samples include different clothing pattern parts respectively contained in different types of clothing.
2. The method according to claim 1, characterized in that The method further comprises: Get the target pre-trained deep learning model; The target pre-trained deep learning model is preliminarily trained based on a preset data set, and a fully connected layer, a discard layer and an output layer are added to the target pre-trained deep learning model after the preliminary training to obtain the clothing pattern part recognition model; the fully connected layer is used to classify the clothing pattern parts, the discard layer is used to randomly set the neurons in the target pre-trained deep learning model to zero according to a preset probability, and the output layer is used for the probability distribution of each clothing pattern part category.
3. The method according to claim 1, characterized in that: The method further comprises: Obtain multiple types of clothing pattern images; Classifying the clothing pattern parts in the plurality of types of clothing pattern images respectively, and setting corresponding part name labels for the clothing pattern parts, to obtain a clothing pattern part data set; Preprocessing is performed on each clothing pattern part image in the clothing pattern part data set to obtain the training sample.
4. The method according to claim 3, characterized in that The preprocessing of each clothing pattern part image in the clothing pattern part data set comprises: Convert each clothing pattern part image in the clothing pattern part data set into a grayscale image; Gaussian blur processing is performed on the grayscale image, and gradient calculation, non-maximum suppression and double threshold processing are performed on the processed image.
5. The method according to claim 3, characterized in that: The method further comprises: Rotating the preprocessed garment pattern part image according to a plurality of preset rotation angles; The rotated image is horizontally or vertically scaled according to a plurality of preset scaling ratios to obtain the training sample.
6. The method according to claim 1, characterized in that The step of obtaining the garment pattern part to be identified includes: Acquire an object to be identified, and detect whether the object to be identified is clothing; When the object to be identified is clothing, the object to be identified is segmented into at least one clothing pattern part, and the at least one clothing pattern part is used as the clothing pattern part to be identified.
7. A clothing pattern part recognition device based on deep learning, characterized in that: The device comprises: A pattern part acquisition module is used to acquire the pattern parts of the garment to be identified; The recognition result acquisition module is used to input the clothing pattern part to be identified into the clothing pattern part recognition model to obtain the recognition result of the clothing pattern part to be identified; wherein, the preset deep learning model is trained through training samples to obtain the clothing pattern part recognition model, and the training samples include different clothing pattern parts respectively contained in different types of clothing.
8. An electronic device, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.
