National costume identification method and system

By training the FCN model based on the human analytical data set annotated with ethnic clothing features and combining with the DenseNet convolutional neural network, the problem of low accuracy caused by the influence of wearable features in ethnic clothing recognition is solved, and a higher accuracy of ethnic clothing recognition is achieved.

CN119600654APending Publication Date: 2025-03-11GUANGXI LVFA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411732806.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the prior art, the problem of low accuracy is caused by the influence of wearable characteristics during the identification of ethnic clothing.

Method used

By obtaining portrait image data of ethnic clothing in various regions, and processing it, it is performed to use the trained FCN model based on the human analytical data set annotated by ethnic clothing features for segmentation processing. The portrait area feature map containing feature labels for different body parts is obtained, and input it into the DenseNet convolutional neural network for learning and training, and a clothing recognition model with output regional ethnic clothing categories was obtained.

Benefits of technology

It improves the accuracy of ethnic clothing recognition and solves the problem of low accuracy caused by wearing characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600654A_ABST
    Figure CN119600654A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of costume identification, and discloses a national costume identification method and system, and the method comprises the steps: obtaining portrait image data of national costumes worn in all regions; processing the portrait picture data to obtain portrait picture data with the same format, size and resolution; carrying out segmentation processing on the processed portrait image data through an FCN model trained by a human body analysis data set based on national costume feature labeling to obtain a portrait region feature map containing feature labels labeled on different body parts; inputting the portrait region feature map into a DenseNet convolutional neural network for training to obtain a trained clothing identification model; and inputting the ethnic costume picture into the trained costume identification model, and outputting an ethnic costume identification result. According to the invention, the feature attributes of the portrait region feature map sample are enhanced, the learning and training effect of the DenseNet convolutional neural network is improved, and higher ethnic costume identification accuracy is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of clothing recognition, and in particular to a method and system for recognizing ethnic clothing. Background Art

[0002] As people's awareness of protecting ethnic culture continues to increase, ethnic costumes, as an important carrier of ethnic culture, carry the rich connotations of the history, traditions, beliefs and aesthetics of various ethnic groups. In the cultural tourism industry, ethnic costume recognition technology can be applied to intelligent guided tours in scenic spots, cultural experience activities and other scenarios. After tourists take photos of people wearing ethnic costumes, the system can automatically identify the ethnic group to which the costumes belong, enhance tourists' cultural experience, and promote the integrated development of cultural tourism.

[0003] In recent years, deep learning and computer vision technologies have made significant progress, providing powerful technical means for the identification of ethnic costumes. Deep learning architectures such as convolutional neural networks (CNNs), recurrent neural networks (RNNs) and their variants have performed well in tasks such as image feature extraction, classification and target detection, making it possible to automatically identify ethnic costumes through computers. However, due to the differences in the wearing of different parts of ethnic costumes, some differences are not obvious. Due to the influence of detailed wearing features, although the recognition effect can be achieved by using only convolutional neural networks for ethnic costume recognition, its recognition accuracy is not high. Summary of the invention

[0004] In view of the problem that the accuracy rate is low due to the influence of wearing characteristics in the process of identifying ethnic costumes in the prior art, the present invention provides a method and system for identifying ethnic costumes, which can obtain samples based on human body analysis data marked with ethnic costume characteristics, improve the characteristic attributes of samples, and solve the problem that the accuracy rate is low due to the influence of wearing characteristics in the prior art. The specific technical solution is as follows:

[0005] A method for identifying ethnic costumes, comprising:

[0006] Obtain image data of people wearing ethnic costumes in various regions;

[0007] Processing the portrait image data to obtain portrait image data of the same format, size and resolution;

[0008] The processed portrait image data is segmented by the FCN model trained based on the human body analysis dataset with feature labels of ethnic costumes, and a portrait region feature map containing feature labels for different body parts is obtained;

[0009] Inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training, thereby obtaining a trained clothing recognition model capable of outputting regional ethnic clothing categories;

[0010] Input the ethnic costume pictures into the trained costume recognition model and output the regional ethnic costume recognition results.

[0011] Preferably, the acquiring of the portrait image data of people wearing ethnic costumes in various regions specifically refers to:

[0012] Obtain portrait image data of individuals wearing ethnic costumes in various regions.

[0013] Preferably, after the processed portrait image data is segmented by the FCN model trained based on the human body analysis data set labeled with ethnic costume features to obtain the portrait region feature map containing feature labels for different body parts, the method further includes:

[0014] Obtaining key feature points of the outer contour of the portrait region feature map by using a contour key point extraction method, and retaining valid points representing the contour shape;

[0015] The retained valid points are fitted using a curve fitting algorithm, and a fitting curve is drawn to replace the original contour of the portrait region feature map.

[0016] Preferably, a method for identifying ethnic costumes further comprises:

[0017] The image synthesis method is used to synthesize the portrait area feature map after contour fitting and the preset background image to generate multiple different background images corresponding to each portrait area image.

[0018] Preferably, the step of inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training to obtain a trained clothing recognition model capable of outputting regional ethnic clothing categories comprises:

[0019] Multiple different background images corresponding to each portrait area image are input into the DenseNet convolutional neural network for learning and training, and a clothing recognition model trained to output regional ethnic clothing categories is obtained.

[0020] Preferably, the FCN model trained based on the human body analysis data set labeled with ethnic costume features is used to segment the processed portrait image data to obtain a portrait region feature map containing feature labels for different body parts, including:

[0021] Based on the processed portrait image data, a human body analysis dataset is constructed, which contains portraits of people wearing ethnic costumes and annotated the wearing features of different parts.

[0022] The human body analysis data set is input into the FCN model for learning and training, and a segmentation and annotation model with segmentation and annotation features for different parts is obtained;

[0023] The portrait image data is input into a trained segmentation and annotation model, and a portrait region feature map containing feature labels for different body parts is output.

[0024] Preferably, constructing a human body analysis data set containing portraits of people wearing ethnic costumes and annotating wearing features of different parts according to the processed portrait image data comprises:

[0025] According to the processed portrait image data, the wearing features of different parts of the portrait's ethnic costumes are extracted, wherein the wearing features of different parts include hats, headscarves and hair accessories for head wearing features, robes, short coats and double-breasted coats for upper clothes wearing features, belts for waist wearing features, skirts and trousers for lower clothes wearing features, and boots and shoes for feet wearing features;

[0026] According to the extracted wearing features of different parts of ethnic costumes, a human body parsing dataset is constructed, which contains portraits of people wearing ethnic costumes and annotated wearing features of different parts.

[0027] Preferably, the processing of the portrait picture data in sequence to obtain portrait picture data of the same format, size and resolution comprises:

[0028] The portrait image data is cleaned, formatted, linearly scaled, and resolution-set to obtain portrait image data of the same format, size, and resolution, including:

[0029] The portrait image data is evaluated for quality using a preset image quality evaluation algorithm to obtain a quality score for each portrait image, and qualified portrait images are screened out based on a preset quality threshold;

[0030] The filtered portrait images are linearly scaled by a preset image size to obtain portrait images of uniform size;

[0031] The portrait pictures of uniform size are exported using a preset resolution and a preset export format to obtain portrait picture data of the same format, size and resolution.

[0032] A national costume recognition system, applied to the aforementioned national costume recognition method, comprises:

[0033] A data acquisition unit, used to acquire image data of people wearing ethnic costumes in various regions;

[0034] A picture processing unit, used to process the portrait picture data to obtain portrait picture data of the same format, size and resolution;

[0035] A segmentation feature labeling unit is used to segment the processed portrait image data through the FCN model trained based on the human body analysis data set labeled with ethnic costume features, and obtain a portrait region feature map containing feature labels for different body parts;

[0036] A model training unit, used for inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training, to obtain a trained clothing recognition model capable of outputting regional ethnic clothing categories;

[0037] The clothing recognition unit is used to input ethnic clothing pictures into the trained clothing recognition model and output regional ethnic clothing recognition results.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] The method for identifying ethnic costumes of the present invention obtains portrait image data of people wearing ethnic costumes in various regions; processes the portrait image data to obtain portrait image data of the same format, size and resolution; performs segmentation processing on the processed portrait image data by an FCN model trained based on a human body analysis data set labeled with ethnic costume features to obtain a portrait region feature map containing feature labels for different body parts; inputs the portrait region feature map into a DenseNet convolutional neural network for learning and training to obtain a clothing recognition model trained to output regional ethnic costume categories; inputs ethnic costume images into the trained clothing recognition model to output regional ethnic costume recognition results. The present invention trains an FCN model using human body analysis data labeled based on ethnic costume features to obtain a portrait region feature map containing feature labels for different body parts, strengthens the characteristic attributes of portrait region feature map samples, improves the effect of DenseNet convolutional neural network learning and training, achieves higher accuracy in identifying ethnic costumes, and solves the problem of low accuracy caused by the influence of wearing features on the learning method in the prior art in the process of identifying ethnic costumes. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0041] Figure 1 The present invention is a flow chart of a method for identifying ethnic costumes.

[0042] Figure 2 The figure is a flow chart of another embodiment of a method for identifying ethnic costumes of the present invention.

[0043] Figure 3 The figure is a schematic diagram of a system for identifying ethnic costumes according to the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0046] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0047] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0048] See the following examples Figure 1 , Figure 2 and Figure 3 .

[0049] The present application embodiment provides a method for identifying ethnic clothing, including:

[0050] Step S1, obtaining image data of people wearing ethnic costumes in various regions;

[0051] The portrait image data specifically refers to the portrait image data of individuals wearing national costumes in various regions, which can prevent interference in subsequent model training.

[0052] Through web crawlers and other means, we obtain image resource websites that can be used for academic or research purposes, official websites of folk culture institutions, and social media with clear ethnic costume labels and authorized content, and filter out portrait images that meet the requirements. At the same time, the photos include traditional villages of ethnic minorities, venues for folk activities, and other scenes, including personal photos of different ages and genders wearing ethnic costumes. In addition, the personal photos include multiple angles (front, side, back, etc.) and multiple postures (standing, sitting, walking, dancing, etc.) to ensure that a rich and diverse collection of portrait images is collected.

[0053] The collected portrait image data are preliminarily classified and sorted according to the source regions of the images and the general characteristics of ethnic costumes. For example, they are divided according to dimensions such as "administrative division area + ethnicity" to construct an original portrait image dataset.

[0054] By constructing a portrait image dataset covering multiple nationalities, different regions, and diverse clothing scenarios, we can provide a rich data foundation for subsequent ethnic costume recognition methods, making the trained model more generalizable and able to cope with complex ethnic costume situations.

[0055] Step S2, processing the portrait picture data to obtain portrait picture data of the same format, size and resolution;

[0056] Specifically, the portrait picture data are processed in sequence to obtain portrait picture data of the same format, size and resolution, including:

[0057] The portrait image data is cleaned, formatted, linearly scaled, and resolution-set to obtain portrait image data of the same format, size, and resolution, including:

[0058] The portrait image data is evaluated for quality using a preset image quality evaluation algorithm to obtain a quality score for each portrait image, and qualified portrait images are screened out based on a preset quality threshold;

[0059] The preset image quality assessment algorithm is set up by integrating the assessment function constructed by considering multiple dimensional indicators such as image clarity, contrast, color accuracy, etc. For example, inputting portrait image data into the assessment algorithm module containing the assessment function will output a value between 0 and 10 to represent its quality, and the higher the value, the better the quality.

[0060] The preset quality threshold is used to accurately distinguish qualified and unqualified images, filter out images with quality scores below the threshold (such as blurred, severely distorted portraits, etc.), and mark these images as data to be removed. For example, if the preset quality threshold is 8, images with quality scores below 8 will be included in the list to be removed, and portrait images with quality scores not less than 8 will be filtered out.

[0061] The filtered portrait images are linearly scaled by a preset image size to obtain portrait images of uniform size;

[0062] According to the preset standard size specifications, determine the unified target size for linear scaling of portrait images (including specific pixel values ​​of width and height). For example, after comprehensive consideration, the target size is determined to be 900 pixels in width and 1600 pixels in height as the reference standard for all image scaling.

[0063] For each portrait image's current size (width and height in pixels), based on the target size, the scaling ratio of each image is accurately calculated using a proportional calculation method (taking into account proportional scaling, the proportional calculation strategy that ensures the integrity of key areas must be prioritized). For example, if the original width of a picture is 1800 pixels, and based on the target width of 900 pixels, the scaling ratio in the width direction is 0.5, and then the scaling ratio in the height direction is calculated based on the principle of keeping the aspect ratio consistent.

[0064] A linear scaling algorithm is used to perform linear scaling on each portrait image according to the calculated scaling ratio, so that all images reach a uniform target size after scaling.

[0065] The portrait pictures of uniform size are exported using a preset resolution and a preset export format to obtain portrait picture data of the same format, size and resolution.

[0066] Perform resolution setting operations on each portrait image that has been processed previously to ensure that all images have the same resolution. For example, pass each portrait image into the resolution setting module, and accurately write the set resolution value into the corresponding data structure of the image according to its specific setting process and encoding method. At the same time, determine the unified target image format to be converted according to the format compatibility requirements of the target application scenario and subsequent processing system (such as specific image analysis software, model training platform, etc.). For example, after analysis, all operations are most compatible with the jpg format, so the target format is determined to be the jpg format.

[0067] Step S3, segmenting the processed portrait image data using the FCN model trained based on the human body analysis data set labeled with ethnic costume features, and obtaining a portrait region feature map containing feature labels for different body parts;

[0068] We collected image data containing rich ethnic costumes and detailed annotations of human body parts and ethnic costume features to build a human body analysis dataset. The annotation content includes the combination of ethnic costume parts such as headwear, tops, bottoms, accessories, and human body parts such as hair, face, and limbs.

[0069] The portrait image data processed in the previous steps are input into the trained FCN model one by one. The model extracts and fuses features of the input image according to its internal structures such as convolutional layer, pooling layer, upsampling layer and skip connection.

[0070] Through segmentation processing based on the FCN model trained on a special human body analysis dataset, the complex human body and ethnic costume information in the portrait image can be accurately analyzed at the pixel level, and accurate feature labels can be given to the portrait area feature map. This helps to further analyze the specific presentation details of ethnic costumes on the human body, and provides detailed and structured image feature information for subsequent input into the DenseNet neural network for more in-depth clothing category recognition, improving the accuracy of the entire recognition process.

[0071] Step S4, inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training, to obtain a trained clothing recognition model capable of outputting regional ethnic clothing categories;

[0072] Multiple different background images corresponding to each portrait area image are input into the DenseNet convolutional neural network for learning and training, and a clothing recognition model trained to output regional ethnic clothing categories is obtained.

[0073] By taking multiple different background images corresponding to each portrait area image as samples, the rich sample image data can make the trained model more generalizable.

[0074] According to factors such as the complexity of the task, computing resources, and expectations for model accuracy, select an appropriate DenseNet version, such as DenseNet-169, and select an appropriate optimization algorithm to update the model parameters based on the scale and characteristics of the DenseNet-169 model.

[0075] Training process: Determine the number of training times, for example, set it to 50 times, and then adjust it according to the convergence of the model on the validation set. In each training, the portrait area feature map and the corresponding regional ethnic clothing category labels are sent to the model in batches according to the batch size for forward propagation and loss calculation, and then the optimizer is used for back propagation to update the model parameters. After each round of training, the portrait area feature map of the validation set is input into the model to obtain the model's predicted output, and then the performance of the model on the validation set is evaluated by calculating indicators such as accuracy, recall rate, and F1 value to determine whether the model is overfitting or underfitting. According to the verification results, continuous training and verification are carried out to continuously optimize the model performance.

[0076] After training on the DenseNet convolutional neural network, the model can learn the deep-level feature representation related to the regional ethnic costume categories in the portrait area feature map, and finally obtain a clothing recognition model that can output regional ethnic costume categories. When faced with new ethnic costume pictures, it can accurately determine the regional ethnic costume category to which it belongs, improving recognition efficiency and accuracy.

[0077] Step S5: input the ethnic costume picture into the trained costume recognition model, and output the regional ethnic costume recognition result.

[0078] By inputting the pictures of ethnic costumes to be identified into the trained model, the regional ethnic costume category to which they belong can be output quickly and accurately, thus realizing the automation and intelligence of ethnic costume recognition.

[0079] In the specific implementation, due to the popularity of mobile devices such as mobile phones, the trained ethnic costume recognition model can be used on mobile devices such as mobile phones, which can improve the tourists' experience. The specific principles are as follows:

[0080] The trained clothing recognition model is generally saved in a format based on a specific deep learning framework (such as PyTorch's .pth format, etc.). These formats cannot be run directly on mobile phones, so the format needs to be converted.

[0081] Use tools suitable for mobile phones to convert to .tflite format. For PyTorch models, they may be converted to ONNX format first, and then further converted to .tflite format or other formats suitable for mobile phones as needed.

[0082] Next, we need to develop a mobile client application to build an "environment" for the model to run and implement related functions. There are two ways to develop: native development or cross-platform development. For example, the Android system can use Java or Kotlin, and the iOS system uses Objective-C or Swift to build applications; cross-platform development uses frameworks such as Flutter and ReactNative, so that you can write code once and run the application on mobile phones with multiple different operating systems.

[0083] Finally, the prepared model is integrated into the application. For example, if native Android development is adopted, the corresponding class should be created in the Android project to load the model file. Generally, the converted model file (such as the model in .tflite format) is placed in a specific directory of the Android project, and then the model file is read and loaded through the code so that it can be called after the application is started. In this process, it is also necessary to initialize some buffers for inputting image data and receiving model output results, so that the image can be smoothly passed to the model for processing and the corresponding recognition results can be obtained.

[0084] In mobile client applications, the most common way to obtain pictures is to allow users to select pictures from the mobile phone album, or tourists and others to directly use the mobile phone camera to take pictures. For example, in Android applications, the corresponding functions can be implemented with the help of the Android system's MediaStore or CameraAPI; in Flutter applications, plug-ins such as image_picker can be used to achieve the purpose of obtaining pictures. The obtained image data needs to be sorted and preprocessed in the format required by the model to ensure that it can be accurately used as the input data of the model.

[0085] The present invention trains an FCN model using human body analysis data annotated based on the characteristics of ethnic costumes, obtains a portrait region feature map containing feature labels annotated for different body parts, strengthens the characteristic attributes of the portrait region feature map samples, improves the effect of DenseNet convolutional neural network learning and training, achieves higher accuracy in ethnic costume recognition, and solves the problem in the prior art that the learning method has a low accuracy rate due to the influence of wearing characteristics in the process of ethnic costume recognition.

[0086] Specifically, in a preferred embodiment of the present application, after the processed portrait image data is segmented by the FCN model trained based on the human body analysis data set labeled with ethnic costume features to obtain the portrait region feature map containing feature labels for different body parts, it also includes:

[0087] Obtaining key feature points of the outer contour of the portrait region feature map by using a contour key point extraction method, and retaining valid points representing the contour shape;

[0088] For example, a corner detection method (such as Harris corner detection, etc.) or a contour key point extraction method (such as contour-based curvature calculation, etc.) is used to obtain key feature points on the outer contour of the portrait region feature map. For example, the Harris corner detection function in the OpenCV library is used, and appropriate parameters (such as response threshold, etc.) are set to ensure that a sufficient number of feature points that accurately reflect the changes in contour shape can be extracted.

[0089] The extracted feature points are screened and the retained feature points can better represent the shape characteristics of the outer contour, which is convenient for subsequent curve fitting operations.

[0090] Since the outer contour of the portrait area feature map often contains other pixel information, screening out key feature points through the contour key point extraction method can simplify the data representation, focus on the key position information that best reflects the contour shape characteristics, and convert the complex contour description into a small set of feature points.

[0091] The retained valid points are fitted using a curve fitting algorithm, and a fitting curve is drawn to replace the original contour of the portrait region feature map.

[0092] Common curve fitting algorithms that can be used include polynomial fitting, spline curve fitting (such as B-spline curve fitting, etc.), etc., which can be selected according to the shape characteristics of the portrait's outer contour. If the contour shape is relatively smooth and the curvature is relatively regular, a low-order polynomial fitting can be used; if the contour shape is complex and has many curvature changes, spline curve fitting may be more suitable to better approximate the true contour shape.

[0093] According to the fitted curve function, a fitted curve is drawn on the image to cover the original inaccurate outer contour part, thereby realizing the refinement of the outer contour. Drawing functions in libraries such as OpenCV can be used to draw smoother and more accurate outer contour lines on the portrait area feature map according to the coordinate information of the fitted curve.

[0094] In this embodiment, the processed portrait area feature map is used as training data for the subsequent clothing recognition model, and a smooth and precise fitting curve is used as the outer contour feature input. Compared with the rough and irregular original contour, the model can learn the typical features of the ethnic clothing contour more easily, which helps to improve the training effect and generalization ability of the model.

[0095] It should also be noted that the portrait region feature map after contour fitting may also need to be manually refined to ensure the best portrait region feature map.

[0096] Specifically, in a preferred implementation of the present application, a method for identifying ethnic costumes further includes:

[0097] The image synthesis method is used to synthesize the portrait area feature map after contour fitting and the preset background image to generate multiple different background images corresponding to each portrait area image.

[0098] In practical applications, ethnic costumes may appear in a variety of background environments. It is difficult for the model to learn the common characteristics and adaptive performance of ethnic costumes in different scenes by only relying on the limited background images at the time of original collection for model training. By synthesizing the portrait region feature map with multiple different preset background images, the situation of ethnic costumes appearing in a variety of actual scenes (such as indoors, outdoors, in front of buildings of different styles, different natural landscapes, etc.) is simulated, which greatly enriches the diversity of data samples. At the same time, different backgrounds may have different degrees of interference factors, such as complex textures and similar colors in ethnic costumes, which may affect the accurate recognition of the characteristics of ethnic costumes themselves. The background of the original portrait region feature map is relatively fixed. If the model relies too much on these specific backgrounds to identify ethnic costumes, it is easy to make recognition errors when encountering similar clothing images with other backgrounds. By synthesizing multiple background images for training, the model can be prompted to make judgments based on the characteristics of ethnic costumes themselves (such as style, color, pattern, etc.), rather than being affected by background factors. Therefore, by synthesizing the portrait region feature map with multiple different preset background images, the learning samples of the model can be enriched, background interference can be eliminated, and the generalization ability of the model and the accuracy in complex real-life scenes can be improved.

[0099] Specifically, in a preferred embodiment of the present application, the FCN model trained based on the human body analysis data set labeled with ethnic costume features is used to segment the processed portrait image data to obtain a portrait region feature map containing feature labels for different body parts, including:

[0100] Step S31, constructing a human body analysis data set containing portraits of people wearing ethnic costumes and annotating wearing features of different parts according to the processed portrait image data;

[0101] According to the processed portrait image data, the wearing features of different parts of the portrait's ethnic costumes are extracted, wherein the wearing features of different parts include hats, headscarves and hair accessories for head wearing features, robes, short coats and double-breasted coats for upper clothes wearing features, belts for waist wearing features, skirts and trousers for lower clothes wearing features, and boots and shoes for feet wearing features;

[0102] According to the extracted wearing features of different parts of ethnic costumes, a human body parsing dataset is constructed, which contains portraits of people wearing ethnic costumes and annotated wearing features of different parts.

[0103] In implementation, a set of detailed and clear annotation rules need to be formulated to standardize the annotation of the wearing features of different parts of ethnic costumes. For example, professional image annotation tools such as LabelMe or VGGImageAnnotator (VIA) are used to define a unique digital code or character label for each wearing feature category. The following is an example of head wearing features: "01" represents a hat, "02" represents a headscarf, "03" represents hair accessories, etc., the letter "r" represents red, the letter "o" represents orange, the letter "y" represents yellow, the letter "g" represents green, the letter "b" represents blue, the letter "b" represents black, and the letter "w" represents white.

[0104] The detailed records of the wearing characteristics of each part and the constructed data set help to deeply analyze the differences and commonalities between different ethnic costumes, whether in terms of style, color or decoration. It provides key data support for subsequent tasks such as accurately identifying ethnic costumes and distinguishing the categories of ethnic costumes in different regions, thereby enhancing the accuracy of the entire ethnic costume recognition method.

[0105] Common human body parsing data sets include the LIP (Look into Person) data set, the PASCAL-Person-Part data set, and the CIHP (Clothed Human Parsing in the Wild) data set. In this embodiment, the LIP (Look into Person) data set is selected for implementation. The LIP human body parsing data set includes human images in different scenes, including portraits of people in various postures (standing, sitting, walking, running, etc.), wearing different clothes, and in different background environments. Its annotation information is very rich, and various parts of the human body (such as the head, upper limbs, lower limbs, torso, etc.) and clothing (tops, pants, skirts, shoes, hats and other wearable items) are finely annotated at the pixel level, which can be used to train and evaluate models related to human body parsing, and help the model learn the characteristic performance and distribution rules of different parts of the human body and clothing in the image. It is suitable for clothing recognition of the portrait area feature map of the present application scheme.

[0106] At the same time, combined with the ethnic costume recognition of this application, the annotation categories in the human body analysis data set can be customized. In the human body analysis related to ethnic costumes, in addition to the conventional human body part annotation, detailed annotation categories can be defined specifically for the unique parts of ethnic costumes (such as the four-cornered hat in Mongolian costumes, the bangdian and other headdresses and accessories in Tibetan costumes), and these elements with ethnic characteristics can be separated as annotation objects, so that the data set is more in line with the needs of ethnic costume analysis, and it is convenient for subsequent models to learn the unique characteristics of ethnic costumes.

[0107] Step S32, inputting the human body analysis data set into the FCN model for learning and training, and obtaining a trained segmentation and annotation model with segmentation and annotation features for different parts;

[0108] Determine the specific network structure parameters of the FCN model, such as selecting the appropriate number of convolutional layers, convolution kernel size and step size, type and location of pooling layers, upsampling layer method, etc. For example, set the convolution kernel size to 3×3, step size to 1, and set the maximum pooling layer at a specific location for downsampling.

[0109] Random initialization can be used to assign initial values ​​to the parameters of each layer of the model. Alternatively, if there is a pre-trained FCN-related model structure on a large-scale general image dataset, the weights can be loaded by customizing them and making appropriate adjustments according to the characteristics of the current ethnic costume human body parsing task (such as adjusting the weight initialization method of the last few layers, etc.), providing a relatively reasonable starting state for model training, which helps to speed up the convergence of the model and improve the training effect.

[0110] For the segmentation and labeling task, the cross-entropy loss function (Cross-EntropyLoss) is selected in this embodiment to measure the difference between the segmentation result predicted by the model and the actual labeling.

[0111] Set the training parameters and training iteration operations, determine the number of training epochs, and in each round of training, send the images in the human body parsing dataset and the corresponding annotation labels into the FCN model in batches according to the batch size for forward propagation to obtain the segmentation prediction result of each pixel by the model. Then, calculate the loss value between the prediction result and the true label through the loss function, and then use the optimizer for back propagation to update the model parameters.

[0112] Step S33: input the portrait image data into a trained segmentation and annotation model, and output a portrait region feature map containing feature labels for different body parts.

[0113] The preprocessed portrait image data is input into the trained segmentation and annotation model. The model will perform forward propagation calculations according to the feature extraction and segmentation logic learned during the training process, and output a segmentation prediction map with the same size as the input image. Each pixel position in the prediction map corresponds to the predicted probability value of the wearing features of different body parts, and the one with the highest prediction probability is selected as the final result.

[0114] In this embodiment, by inputting the portrait image into the trained segmentation and annotation model, a portrait region feature map with accurate annotations of the wearing feature labels of different body parts can be obtained. The feature map clearly presents the distribution of various parts of ethnic costumes on the portrait, and extracts the feature information that is very critical for the subsequent identification of ethnic costume categories. It provides a structured image feature basis for further input into the DenseNet convolutional neural network for learning and training, thereby improving the accuracy of ethnic costume recognition.

[0115] The embodiment of the present application further provides a system for identifying ethnic costumes, which is applied to the aforementioned method for identifying ethnic costumes, and includes:

[0116] A data acquisition unit, used to acquire image data of people wearing ethnic costumes in various regions;

[0117] A picture processing unit, used to process the portrait picture data to obtain portrait picture data of the same format, size and resolution;

[0118] A segmentation feature labeling unit is used to segment the processed portrait image data through the FCN model trained based on the human body analysis data set labeled with ethnic costume features, and obtain a portrait region feature map containing feature labels for different body parts;

[0119] A model training unit, used for inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training, to obtain a trained clothing recognition model capable of outputting regional ethnic clothing categories;

[0120] The clothing recognition unit is used to input ethnic clothing pictures into the trained clothing recognition model and output regional ethnic clothing recognition results.

[0121] The beneficial effects of the ethnic costume identification system of the present invention are the same as those of the embodiment of the ethnic costume identification method, and the functional explanation of each unit in the system corresponds to that of the aforementioned method, which will not be repeated here.

[0122] Those of ordinary skill in the art will appreciate that the units of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition of each example has been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0123] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored, etc.

[0124] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-0nlyMemory), random access memory (RAM, RandomAccessMemory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.

[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

Claims

1. A method for identifying ethnic costumes, characterized in that: include: Obtain image data of people wearing ethnic costumes in various regions; Processing the portrait image data to obtain portrait image data of the same format, size and resolution; The processed portrait image data is segmented by the FCN model trained based on the human body analysis dataset with feature labels of ethnic costumes, and a portrait region feature map containing feature labels for different body parts is obtained; Inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training, thereby obtaining a trained clothing recognition model capable of outputting regional ethnic clothing categories; Input the ethnic costume pictures into the trained costume recognition model and output the regional ethnic costume recognition results.

2. The method for identifying ethnic costumes according to claim 1, characterized in that: The obtaining of the portrait image data of people wearing ethnic costumes in various regions specifically refers to: Obtain portrait image data of individuals wearing ethnic costumes in various regions.

3. The method for identifying ethnic costumes according to claim 2, characterized in that: The FCN model trained based on the human body analysis data set labeled with ethnic costume features is used to segment the processed portrait image data to obtain a portrait region feature map containing feature labels for different body parts, and further includes: Obtaining key feature points of the outer contour of the portrait region feature map by using a contour key point extraction method, and retaining valid points representing the contour shape; The retained valid points are fitted using a curve fitting algorithm, and a fitting curve is drawn to replace the original contour of the portrait region feature map.

4. The method for identifying ethnic costumes according to claim 3, characterized in that: Also includes: The image synthesis method is used to synthesize the portrait area feature map after contour fitting and the preset background image to generate multiple different background images corresponding to each portrait area image.

5. The method for identifying ethnic costumes according to claim 4, characterized in that: The inputting of the portrait region feature map into the DenseNet convolutional neural network for learning and training to obtain a trained clothing recognition model capable of outputting regional ethnic clothing categories comprises: Multiple different background images corresponding to each portrait area image are input into the DenseNet convolutional neural network for learning and training, and a clothing recognition model trained to output regional ethnic clothing categories is obtained.

6. The method for identifying ethnic costumes according to claim 5, characterized in that: The FCN model trained based on the human body analysis data set labeled with ethnic costume features is used to segment the processed portrait image data to obtain a portrait region feature map containing feature labels for different body parts, including: Based on the processed portrait image data, a human body analysis dataset is constructed, which contains portraits of people wearing ethnic costumes and annotated the wearing features of different parts. The human body analysis data set is input into the FCN model for learning and training, and a segmentation and annotation model with segmentation and annotation features for different parts is obtained; The portrait image data is input into a trained segmentation and annotation model, and a portrait region feature map containing feature labels for different body parts is output.

7. A method for identifying ethnic costumes according to claim 6, characterized in that: The process of constructing a human body analysis data set including portraits of people wearing ethnic costumes and annotating the wearing features of different parts according to the processed portrait image data includes: According to the processed portrait image data, the wearing features of different parts of the portrait's ethnic costumes are extracted, wherein the wearing features of different parts include hats, headscarves and hair accessories for head wearing features, robes, short coats and double-breasted coats for upper clothes wearing features, belts for waist wearing features, skirts and trousers for lower clothes wearing features, and boots and shoes for feet wearing features; According to the extracted wearing features of different parts of ethnic costumes, a human body parsing dataset is constructed, which contains portraits of people wearing ethnic costumes and annotated wearing features of different parts.

8. The method for identifying ethnic costumes according to claim 2, characterized in that: The portrait picture data are processed in sequence to obtain portrait picture data of the same format, size and resolution, including: The portrait image data is cleaned, formatted, linearly scaled, and resolution-set to obtain portrait image data of the same format, size, and resolution, including: The portrait image data is evaluated for quality using a preset image quality evaluation algorithm to obtain a quality score for each portrait image, and qualified portrait images are screened out based on a preset quality threshold; The filtered portrait images are linearly scaled by a preset image size to obtain portrait images of uniform size; The portrait pictures of uniform size are exported using a preset resolution and a preset export format to obtain portrait picture data of the same format, size and resolution.

9. A national costume recognition system, characterized in that: A method for identifying ethnic costumes as described in any one of claims 1 to 8, comprising: A data acquisition unit, used to acquire image data of people wearing ethnic costumes in various regions; A picture processing unit, used to process the portrait picture data to obtain portrait picture data of the same format, size and resolution; A segmentation feature labeling unit is used to segment the processed portrait image data through the FCN model trained based on the human body analysis data set labeled with ethnic costume features, and obtain a portrait region feature map containing feature labels for different body parts; A model training unit, used for inputting the portrait region feature map into a DenseNet convolutional neural network for learning and training, to obtain a trained clothing recognition model capable of outputting regional ethnic clothing categories; The clothing recognition unit is used to input ethnic clothing pictures into the trained clothing recognition model and output regional ethnic clothing recognition results.