Clothing color identification method based on multispectral features and boundary verification
By constructing an adaptive method and a closed-loop technical process involving adaptive color correction matrix, multispectral feature separation, and boundary verification, the problem of unstable color reproduction under different ambient color temperatures in existing technologies has been solved, thereby improving the accuracy and robustness of clothing color recognition.
Patent Information
- Application Number
- CN202511518201.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-12-30
AI Technical Summary
Existing image recognition methods struggle to accurately reproduce the true color of target objects under different ambient color temperatures, suffer from high computational complexity, and are prone to losing spatial information during feature fusion, leading to deviations in recognition results.
By constructing a closed-loop technical process of adaptive color correction matrix, multispectral feature enhancement and boundary verification, including adaptive color correction, multispectral feature separation and clustering, and boundary structure verification, pixel-level verification is performed using an improved U-Net neural network.
It improves the accuracy and robustness of clothing color recognition, outputs recognition results containing accurate color category labels and precise contour mask images, effectively suppresses noise interference, and enhances the effectiveness of feature representation.
Smart Images

Figure CN121236418A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method for clothing color recognition based on multispectral features and boundary verification. Background Technology
[0002] With the rapid development of artificial intelligence technology, image recognition technology has been widely applied in fields such as smart wardrobes and smart clothing management. Within image recognition, color information processing has become a key technical challenge. Color, as an important component of visual information, directly affects the system's ability to perceive target objects.
[0003] Currently, although existing image recognition methods can achieve color reproduction to some extent, most of these methods rely on fixed parameters, making it difficult to accurately reproduce the true color of the target object under different ambient color temperatures. For example, images taken at dusk or under fluorescent lights may appear reddish or bluish, leading to inaccurate identification of the object's color category. The extraction and analysis of color features highly depend on the integrity of spectral information; however, existing image recognition methods have high computational complexity when processing multispectral data and are prone to losing spatial information during feature fusion, resulting in lost details and amplified noise. Furthermore, most existing image recognition methods focus on color classification itself, neglecting the integrity of the object's outline. When there is occlusion or multi-color interference in the image, the background is easily misidentified as the main object, leading to spatial deviations in the recognition results. Summary of the Invention
[0004] To address the problems of unstable color reproduction, poor robustness of feature representation, and lack of spatial verification in existing technologies, this invention proposes a clothing color recognition method based on multispectral features and boundary verification. This method improves the accuracy and robustness of clothing color recognition in complex environments by constructing a closed-loop technical process that coordinates adaptive color correction, multispectral feature enhancement, and boundary structure verification.
[0005] The present invention achieves the above objectives through the following technical solutions: A method for clothing color recognition based on multispectral features and boundary verification includes: Acquire input image data and extract initial color distribution information from the input image data; the initial color distribution information includes at least the original color data. Obtain the current ambient color temperature. If the current ambient color temperature exceeds the preset color temperature threshold, use an adaptive color correction matrix to correct the initial color distribution information and obtain a set of corrected color data. Independent component analysis was performed on the calibrated color dataset to separate the multispectral image channel data; The K-means clustering algorithm is used to group the multispectral image channel data to generate a set of spectral feature clusters. Similarity analysis is performed on the set of spectral feature clusters, and the feature vectors of adjacent spectral feature clusters are fused to obtain an enhanced feature representation; Based on enhanced feature representation and a pre-defined feature database, the cosine similarity algorithm is used to determine the color category of the target clothing. The target clothing region is determined based on the spatial distribution information of the target clothing color category and spectral feature cluster set; Extract the boundary contour from the target clothing area and perform edge enhancement filtering to obtain a clear boundary structure; The system integrates clear boundary structures with enhanced feature representations, inputs them into a convolutional neural network for verification, and outputs the final recognition result.
[0006] As a preferred embodiment of the present invention, the step of correcting the initial color distribution information using an adaptive color correction matrix includes: An adaptive color correction matrix is constructed based on a multinomial regression model; The adaptive color correction matrix is multiplied with the original color data in the initial color distribution information to adjust the color space mapping relationship of the initial color distribution information.
[0007] As a preferred embodiment of the present invention, the construction of the adaptive color correction matrix based on the multinomial regression model includes: Collect a dataset of standard color chart images under different ambient color temperatures; the dataset includes color patch measurement values and corresponding standard reference values. Using ambient color temperature and color patch measurements as inputs, and standard reference values as targets, a multinomial regression model is trained. Based on the current ambient color temperature, color correction parameters are predicted using a trained multinomial regression model, and an adaptive color correction matrix is constructed.
[0008] As a preferred embodiment of the present invention, the step of performing similarity analysis on the set of spectral feature clusters and fusing the feature vectors of adjacent spectral feature clusters to obtain the enhanced feature representation includes: Calculate the Euclidean distance between every two spectral feature clusters in the set of spectral feature clusters; If the Euclidean distance is less than a preset similarity threshold, the two corresponding spectral feature clusters are determined to be adjacent spectral feature clusters; The feature vectors of adjacent spectral feature clusters are concatenated, and the concatenated feature vectors are then subjected to feature dimensionality reduction and fusion through a fully connected layer to generate an enhanced feature representation.
[0009] As a preferred embodiment of the present invention, the step of determining the target clothing color category using a cosine similarity algorithm based on enhanced feature representation and a preset feature database includes: The cosine similarity algorithm is used to calculate the similarity between the enhanced feature representation and the feature entries in the preset feature database; Select the color category corresponding to the feature entry with the highest similarity as the target clothing color category.
[0010] As a preferred embodiment of the present invention, determining the target clothing region based on the spatial distribution information of the target clothing color category and the spectral feature cluster set includes: From the set of spectral feature clusters, select at least one spectral feature cluster that has the highest matching degree with the color category of the target clothing; Based on the spatial distribution information of the selected spectral feature clusters, connected regions are determined through morphological operations. The connected region is defined as the target clothing area.
[0011] As a preferred embodiment of the present invention, the step of extracting the boundary contour from the target clothing area and performing edge enhancement filtering to obtain a clear boundary structure includes: Based on the target clothing area, the Sobel edge detection algorithm is used to extract the initial boundary contour; Anisotropic diffusion filtering is used to smooth and enhance the initial boundary contour, resulting in a clear boundary structure.
[0012] As a preferred embodiment of the present invention, the fusion of clear boundary structures and enhanced feature representations, and the input to a convolutional neural network for verification, outputting the final recognition result includes: The clear boundary structure and the enhanced feature representation are concatenated through channels to generate a multi-channel input tensor. The multi-channel input tensor is fed into a convolutional neural network for boundary integrity verification, and the final recognition result is output.
[0013] As a preferred embodiment of the present invention, the convolutional neural network is an improved U-Net neural network, which integrates a Transformer module in the encoder and employs deformable convolution in the decoder.
[0014] As a preferred embodiment of the present invention, the final recognition result includes a binary mask image of the target clothing outline and a corresponding color category label.
[0015] The beneficial effects of this invention are as follows: By dynamically generating an adaptive color correction matrix based on a standard color chart image dataset, it can effectively compensate for color shifts caused by changes in ambient color temperature, providing a true and reliable data foundation for subsequent recognition tasks. By separating multispectral channels and combining clustering fusion, the generated spectral feature cluster set not only better matches the true color attributes of clothing but also effectively suppresses noise interference, reducing feature redundancy while improving feature discrimination ability and subsequent matching efficiency. By introducing boundary contour extraction and boundary contour enhancement, and using an improved neural network for pixel-level verification, the boundary contour of clothing is accurately delineated, effectively eliminating interference from the background and adjacent objects. The final output is a recognition result with both accurate color category labels and accurate contour mask images, improving the overall recognition accuracy. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 A flowchart of a clothing color recognition method based on multispectral features and boundary verification provided in an embodiment of the present invention; Figure 2 This is a flowchart of a method for correcting initial color distribution information based on an adaptive color correction matrix, according to an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention are within the scope of protection of the present invention.
[0018] While existing image recognition methods can achieve color reproduction to some extent, most rely on fixed parameters, making it difficult to accurately reproduce the true color of the target object under different ambient color temperatures. When processing multispectral data, the computational complexity is high, and spatial information is easily lost during feature fusion, leading to missing details and amplified noise. Furthermore, these methods mostly focus on color classification itself, neglecting the integrity of the object's outline. When there is occlusion or multi-color interference in the image, the background is easily misidentified as the main object, resulting in spatial deviations in the recognition results. To address the above problems of existing image recognition methods, this invention proposes a clothing color recognition method based on multispectral features and boundary verification. This method effectively compensates for color shifts caused by changes in ambient color temperature by dynamically generating an adaptive color correction matrix, providing a reliable and accurate data foundation for subsequent recognition tasks. By separating multispectral channels and combining clustering fusion, the generated spectral features not only more closely approximate the true color attributes of clothing but also effectively suppress noise interference. In addition, boundary contour extraction and enhancement techniques are introduced, and pixel-level verification is performed using an improved neural network, ultimately outputting a recognition result containing accurate color category labels and a precise contour mask image, thereby improving the overall recognition accuracy.
[0019] like Figure 1 As shown, this is an embodiment of the present invention, which provides a method for clothing color recognition based on multispectral features and boundary verification. The method includes: S1, acquire input image data, and extract initial color distribution information from the input image data. The initial color distribution information includes at least the original color data.
[0020] Furthermore, the input image data can be acquired from various acquisition devices. These acquisition devices include, but are not limited to, cameras, industrial cameras, or storage devices. In this invention, the input image data is a standard RGB three-channel digital image, stored in JPEG or PNG format.
[0021] To improve the accuracy and consistency of subsequent processing, the acquired input image data undergoes preprocessing, mainly including: Size standardization involves using image interpolation algorithms to adjust images to a uniform, predetermined size. The specific size needs to be set according to the specific application scenario and subsequent processing requirements. In a preferred embodiment, a bilinear interpolation algorithm is used for adjustment, which not only reduces the amount of subsequent computation but also preserves the color details of the clothing.
[0022] Noise filtering is performed by smoothing the image using a spatial domain filtering algorithm. In a preferred embodiment, Gaussian filtering is used, with the filter kernel set to 5×5 and the standard deviation set to 1.5.
[0023] After preprocessing, initial color distribution information is extracted from the preprocessed image data. Specifically, the preprocessed input image is decoded to obtain a pixel matrix in the RGB color space. The original color data is the set of (R, G, B) three-channel intensity values for each pixel in this pixel matrix. For example, for an input image with a resolution of M×N, the original color data is a three-dimensional tensor of M×N×3. This tensor is the direct object of subsequent matrix multiplication color correction operations.
[0024] To further characterize the color attributes of an image at a global level, the initial color distribution information may also include a color histogram, average color value, and / or, the dominant color.
[0025] S2, obtain the current ambient color temperature. If the current ambient color temperature exceeds the preset color temperature threshold, use an adaptive color correction matrix to correct the initial color distribution information and obtain a corrected color data set.
[0026] like Figure 2 As shown, another embodiment of the present invention provides a method for correcting initial color distribution information based on an adaptive color correction matrix. The specific implementation steps include: S21, obtain the current ambient color temperature.
[0027] Furthermore, the current ambient color temperature can be obtained through a hardware sensor or a software estimation algorithm. In a preferred embodiment, a hardware sensor is used to directly measure the ambient color temperature. In another preferred embodiment, when a hardware sensor is unavailable, an image statistics-based color temperature estimation algorithm can be used to indirectly estimate the current ambient color temperature by analyzing the statistical characteristics of the input image data in the RGB channels.
[0028] S22 compares the current ambient color temperature with the preset color temperature threshold.
[0029] Furthermore, the preset color temperature threshold can be set as a fixed threshold or an adaptive threshold that is dynamically adjusted based on scene characteristics.
[0030] S23. If the current ambient color temperature exceeds the preset color temperature threshold, construct an adaptive color correction matrix based on a multinomial regression model.
[0031] The adaptive color correction matrix is constructed based on a multinomial regression model. The specific implementation steps include: A dataset of standard color chart images under different ambient color temperatures was collected. The dataset includes color patch measurements and corresponding standard reference values.
[0032] Furthermore, each sample in the dataset includes color patch measurements taken from the image and their known standard reference values under standard lighting.
[0033] In a preferred embodiment, a color chart containing 24 standard colors is used to ensure coverage of a wide range of colors, from dark to light and from saturated to neutral.
[0034] Using ambient color temperature and color patch measurements as inputs, and a standard reference value as the target, a multinomial regression model is trained.
[0035] Furthermore, the model training process optimizes the regression coefficients using the least squares method to minimize the difference between the model's predicted values and the true standard reference values.
[0036] In a preferred embodiment, the polynomial regression model uses a second- or third-order polynomial because: second- or third-order polynomials include interaction terms between ambient color temperature and color patch measurements, which can effectively simulate the nonlinear effect of ambient color temperature on color perception.
[0037] Based on the current ambient color temperature, color correction parameters are predicted using a trained multinomial regression model, and an adaptive color correction matrix is constructed.
[0038] Furthermore, the adaptive color correction matrix is typically a 3×3 or 3×4 transformation matrix.
[0039] S24, perform matrix multiplication between the adaptive color correction matrix and the original color data in the initial color distribution information to adjust the color space mapping relationship of the initial color distribution information.
[0040] Furthermore, the color value of each pixel in the original color data is converted into a column vector form and multiplied with the adaptive color correction matrix to map the color from the distorted ambient color temperature condition to the color space under the standard ambient color temperature condition, thus obtaining the corrected color data set.
[0041] S3 involves performing independent component analysis on the calibrated color data set to separate the multispectral image channel data. Specific implementation steps include: Preprocess the calibration color data set.
[0042] Furthermore, preprocessing includes data dimensionality reorganization and data standardization. Specifically, the calibrated color dataset is reorganized into a format suitable for independent component analysis, and the reorganized data is standardized. In a preferred embodiment, data dimensionality reorganization employs dimensionality flattening; data standardization employs zero-mean subtraction, i.e., subtracting the mean of each channel from the data for that channel to eliminate the influence of the DC component.
[0043] Independent spectral components are separated from the calibration color dataset using an independent component analysis algorithm.
[0044] Furthermore, independent component analysis (ICA) is based on the principle of maximizing non-Gaussianity to find statistically independent spectral components. In a preferred embodiment, the FastICA algorithm is used to separate the independent components. This algorithm converges quickly to the independent component solution through fixed-point iteration. The number of independent components needs to be set according to specific application requirements. In a preferred embodiment, for RGB three-channel input data, the number of independent components is set to 3.
[0045] Statistical independence tests were performed on the separated independent spectral components to ensure that each component met the independence requirements.
[0046] In a preferred embodiment, mutual information is used to assess the statistical dependence between components. A mutual information value closer to zero indicates stronger independence.
[0047] The independent spectral components, after statistical independence testing, are reconstructed into an image format to visually present the multispectral channel characteristics.
[0048] The reconstructed independent spectral components are mapped to multispectral image channel data. Each independent component represents an independent spectral feature in the image.
[0049] S4 uses the K-means clustering algorithm to group the multispectral image channel data and generate a set of spectral feature clusters.
[0050] Furthermore, based on multispectral image channel data, a comprehensive feature vector that simultaneously incorporates color similarity and spatial proximity is constructed and used as input for cluster analysis. To balance the dimensional differences among different feature components, the feature vector undergoes normalization preprocessing. In a preferred embodiment, the Z-score normalization method is used to normalize the feature vector, ensuring that the mean of each feature component is 0 and the standard deviation is 1.
[0051] K-means clustering algorithm is used to group the comprehensive feature vectors, and parameter optimization improves the clustering effect in clothing color recognition scenarios. The number of clusters needs to be adaptively set according to the complexity of image colors. In a preferred embodiment, the number of clusters is adaptively set according to the elbow rule or contour coefficient, typically ranging from 3 to 10, to accommodate clothing color patterns of varying complexity. The initial centroids are set using the K-means++ strategy to improve clustering effect and convergence speed. The distance metric in the clustering process needs to comprehensively consider color similarity and spatial proximity. In a preferred embodiment, weighted distance is used to implement the distance metric in the clustering process; by adjusting the weight coefficients, the relative importance of color features and spatial features in the clustering decision is balanced.
[0052] The K-means clustering algorithm is executed, and pixels with similar spectral characteristics and spatial proximity are grouped through iterative assignment and center updates. The iterative process continues until the change in cluster centers is less than a predetermined threshold or the maximum number of iterations is reached.
[0053] The initial clustering results are optimized by: merging feature clusters with fewer than a preset threshold pixels into larger neighboring clusters; or smoothing the boundaries of feature clusters based on spatial continuity; or identifying and removing isolated noise points to improve the purity of feature clusters.
[0054] The generated set of spectral feature clusters includes cluster center features, cluster membership relationships, cluster attribute statistics, and cluster adjacency relationships. Among them, cluster center features include the central spectral features and spatial location of each feature cluster; cluster membership relationships include the mapping of pixel affiliation to feature clusters; cluster attribute statistics include statistical information such as the size, density, and color distribution of each feature cluster; and cluster adjacency relationships include a spatial adjacency graph between feature clusters.
[0055] S5 involves performing similarity analysis on the set of spectral feature clusters, fusing the feature vectors of adjacent spectral feature clusters to obtain an enhanced feature representation. Specific implementation steps include: Calculate the Euclidean distance between any two spectral feature clusters in the set of spectral feature clusters; if the Euclidean distance is less than a preset similarity threshold, determine that the two corresponding spectral feature clusters are adjacent spectral feature clusters.
[0056] Furthermore, the preset similarity threshold needs to be adaptively set according to the overall distribution of spectral feature clusters. In a preferred embodiment, by analyzing the statistical distribution of Euclidean distances among all spectral feature clusters, the preset similarity threshold is set to N times the average distance, where N is recommended to be between 0.6 and 0.8.
[0057] The feature vectors of adjacent spectral feature clusters are concatenated, and the concatenated feature vectors are then subjected to feature dimensionality reduction and fusion through a fully connected layer to generate an enhanced feature representation.
[0058] Furthermore, the feature vectors of adjacent spectral feature clusters are concatenated to form a composite feature vector before fusion. In a preferred embodiment, if the feature vector dimensions of two adjacent feature clusters are m and n respectively, then the dimension of the concatenated composite feature vector is m+n. In a preferred embodiment, when multiple feature clusters are adjacent to each other, a multi-path concatenation strategy can be adopted to concatenate the feature vectors of multiple adjacent feature clusters into a higher-dimensional composite feature vector in a predetermined order.
[0059] The concatenated composite feature vector is subjected to feature dimensionality reduction and fusion through a fully connected layer. Specifically, the fully connected layer uses a nonlinear transformation to map the high-dimensional composite features into a low-dimensional enhanced feature representation. The degree of dimensionality reduction is controlled by adjusting the output dimension of the fully connected layer, achieving a balance between maintaining information integrity and computational efficiency. In a preferred embodiment, the ReLU activation function is employed to introduce nonlinear transformation capabilities.
[0060] In this way, the enhanced feature representation generated by similarity analysis and feature fusion can effectively integrate the spectral context information of local regions. Compared with the spectral feature clusters before fusion, it retains the main spectral features while improving the ability to represent color transitions, complex textures and shadow changes, laying a more solid foundation for subsequent accurate recognition.
[0061] S6, based on enhanced feature representation and a pre-defined feature database, uses a cosine similarity algorithm to determine the color category of the target clothing. Specific implementation steps include: The cosine similarity algorithm is used to calculate the similarity between the enhanced feature representation and the feature entries in the preset feature database.
[0062] Furthermore, a large amount of standard clothing sample image data is collected, and enhanced feature representations are extracted through steps S1-S5 to establish a preset feature database. In a preferred embodiment, the preset feature database includes a feature vector set, color category labels, and metadata information; wherein, the feature vector set includes enhanced feature representations of various standard colors under different environmental color temperatures and material conditions, the color category labels include standardized color categories corresponding to each feature vector, and the metadata information includes auxiliary information such as acquisition conditions, clothing material, and lighting environment.
[0063] Select the color category corresponding to the feature entry with the highest similarity as the target clothing color category.
[0064] S7, Based on the spatial distribution information of the target clothing color category and spectral feature cluster set, determine the target clothing region. Specific implementation steps include: From the set of spectral feature clusters, select at least one spectral feature cluster that has the highest matching degree with the color category of the target clothing.
[0065] Furthermore, for each spectral feature cluster, the feature vector of that spectral feature cluster is compared with the standard feature vector corresponding to the target clothing color category in a preset feature database. In a preferred embodiment, cosine similarity is used as the quantitative index of matching degree.
[0066] All spectral feature clusters are sorted in descending order of their calculated cosine similarity, and the spectral feature cluster with the highest matching degree is selected as the main candidate cluster. In a preferred embodiment, if there are multiple garments of the same color or garments with a wide color distribution, the Top-K spectral feature clusters with matching degrees exceeding a preset matching degree threshold are selected as the candidate set, where the recommended preset matching degree threshold is 0.8.
[0067] Based on the spatial distribution information of the selected spectral feature clusters, connected regions are determined through morphological operations.
[0068] Furthermore, based on the pixel coordinates contained in the selected spectral feature clusters, a binary mask image of the same size as the original image is generated. In this mask image, all pixels belonging to these candidate clusters are marked as foreground, and the remaining pixels are marked as background. Morphological image processing techniques are used to process the generated binary mask image to remove noise, fill holes, and smooth boundaries, resulting in an optimized binary mask with smooth boundaries and coherent content. The optimized binary mask contains one or more independent connected regions.
[0069] The connected region is defined as the target clothing area.
[0070] Furthermore, the pixel area of all connected regions is calculated, and the connected region with the largest area is determined as the target clothing region. In scenarios where multiple pieces of clothing of the same color need to be identified, all connected regions, or the set of all connected regions with an area greater than a preset area threshold, are collectively determined as the target clothing region.
[0071] In this way, the abstract target clothing color category is associated with the spatial distribution information of the spectral feature cluster set, and the pixel area where the target clothing is located is accurately defined.
[0072] S8 extracts the boundary contour from the target clothing area and performs edge enhancement filtering to obtain a clear boundary structure. Specific implementation steps include: Based on the target clothing area, the Sobel edge detection algorithm is used to extract the initial boundary contour.
[0073] Anisotropic diffusion filtering is used to smooth and enhance the initial boundary contour, resulting in a clear boundary structure.
[0074] Furthermore, the resulting clear boundary structure is presented in the form of a binary boundary map and stored in matrix format. In the binary boundary map, the boundary pixel value is set to 1, while the non-boundary pixel value is set to 0.
[0075] In this way, clear and coherent boundary structures can be extracted from complex clothing images, providing reliable spatial structure information for subsequent verification.
[0076] S9 integrates clear boundary structures and enhanced feature representations, and inputs them into a convolutional neural network for verification, outputting the final recognition result. Specific implementation steps include: The clear boundary structure and the enhanced feature representation are concatenated through channels to generate a multi-channel input tensor.
[0077] Furthermore, bilinear interpolation is used to extend the enhanced feature representation in the spatial dimension, aligning it spatially with the sharp boundary structure to ensure spatial consistency in subsequent fusion. The spatially extended enhanced feature representation is then used as an additional channel and concatenated with the sharp boundary structure along the channel dimension to generate a multi-channel input tensor.
[0078] To eliminate the dimensional differences in multi-channel data, the generated multi-channel input tensor is uniformly normalized. In a preferred embodiment, the Min-Max normalization method is used to linearly map the values of each channel to the interval between 0 and 1.
[0079] The preprocessed multi-channel input tensor is fed into a convolutional neural network for verification, outputting the final recognition result, which includes a binary mask image of the target clothing outline and the corresponding color category label. The convolutional neural network is an improved U-Net neural network, which integrates a Transformer encoder to capture long-range dependencies and introduces a deformable convolutional module in the decoder to enhance the ability to model irregular boundaries.
[0080] Furthermore, the improved U-Net neural network achieves both boundary integrity verification and color category confirmation by fusing multi-scale, multi-modal features in the output layer. Specifically, boundary integrity verification outputs a binary mask image with the same resolution as the input image. Boundary integrity is verified by analyzing whether the boundary pixels in this mask form a continuous and closed contour. Color category confirmation outputs the color category label of the target clothing. This result is used to further refine the preliminary classification result of step S5 based on the fused multi-modal features, ultimately outputting the verified color category label.
[0081] The boundary integrity verification results and color category confirmation results are integrated to form the final recognition result.
[0082] In this way, by fusing the spatial structure information and spectral color information of clothing, and using advanced deep learning models for joint decision-making, a validated and highly reliable recognition result is output.
[0083] In summary, this invention proposes a clothing color recognition method based on multispectral features and boundary verification. This method improves the accuracy and robustness of clothing color recognition in complex environments by constructing a closed-loop process that coordinates adaptive color correction, multispectral feature enhancement, and boundary structure verification. Specifically, firstly, this method trains a multinomial regression model by collecting standard color card image datasets under different environmental color temperatures, dynamically generating an adaptive color correction matrix to accurately restore the color of the input image data, providing a reliable data foundation for subsequent processing. Subsequently, independent component analysis is performed on the corrected color data set to separate multispectral image channel data containing rich spectral information. A K-means clustering algorithm that integrates color similarity and spatial proximity is used to generate a set of spectral feature clusters, improving the discriminative power of feature representation while suppressing noise interference. Furthermore, by calculating the similarity between feature clusters and fusing adjacent feature clusters, an enhanced feature representation with both core color information and strong discriminative power is generated. In the recognition verification stage, a boundary structure-guided verification mechanism is innovatively introduced. The boundary contours are extracted from the clothing regions corresponding to the target clothing color category and enhanced by edge enhancement filtering to obtain a clear boundary structure. The clear boundary structure is fused with the enhanced feature representation and input into the improved U-Net neural network for pixel-level verification. The final recognition result is output as a binary mask image containing the accurate contour and the corresponding color category label, ensuring the dual accuracy of the final recognition result in both semantic category and spatial contour.
[0084] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A clothes color recognition method based on multi-spectral features and boundary verification, characterized in that, The method comprises the following steps: acquiring input image data and extracting initial color distribution information from the input image data; the initial color distribution information at least includes original color data; acquiring a current ambient color temperature, and if the current ambient color temperature exceeds a preset color temperature threshold, correcting the initial color distribution information by using an adaptive color correction matrix to obtain a corrected color data set; performing independent component analysis on the corrected color data set to separate multispectral image channel data; grouping the multispectral image channel data by using a K-means clustering algorithm to generate a spectral feature cluster set; performing similarity analysis on the spectral feature cluster set, fusing feature vectors of adjacent spectral feature clusters, and obtaining an enhanced feature representation; based on the enhanced feature representation and a preset feature database, determining a target clothing color category by using a cosine similarity algorithm; based on the target clothing color category and spatial distribution information of the spectral feature cluster set, determining a target clothing region; extracting a boundary contour from the target clothing region and performing edge enhancement filtering processing to obtain a clear boundary structure; fusing the clear boundary structure and the enhanced feature representation, and inputting them into a convolutional neural network for verification to output a final recognition result. 2.The clothes color recognition method based on multi-spectral feature and boundary verification according to claim 1, characterized in that, The method of correcting the initial color distribution information by using the adaptive color correction matrix comprises: constructing the adaptive color correction matrix based on a polynomial regression model; performing matrix multiplication operation between the adaptive color correction matrix and the original color data in the initial color distribution information to adjust the color space mapping relationship of the initial color distribution information. 3.The clothes color recognition method based on multi-spectral feature and boundary verification according to claim 2, characterized in that, The method of constructing the adaptive color correction matrix based on the polynomial regression model comprises: collecting standard color chart image data sets under different ambient color temperatures; the data set includes color block measurement values and corresponding standard reference values; training the polynomial regression model by taking the ambient color temperature and the color block measurement value as input and the standard reference value as target; based on the current ambient color temperature, predicting the color correction parameter by using the trained polynomial regression model to construct the adaptive color correction matrix. 4.The clothes color recognition method based on multi-spectral feature and boundary verification of claim 1, wherein, The method of performing similarity analysis on the spectral feature cluster set, fusing the feature vectors of adjacent spectral feature clusters, and obtaining the enhanced feature representation comprises: calculating the Euclidean distance between each two spectral feature clusters in the spectral feature cluster set; if the Euclidean distance is less than a preset similarity threshold, determining that the corresponding two spectral feature clusters are adjacent spectral feature clusters; splicing the feature vectors of the adjacent spectral feature clusters, and performing feature dimension reduction and fusion on the spliced feature vectors through a fully connected layer to generate the enhanced feature representation. 5.The clothes color recognition method based on multi-spectral feature and boundary verification of claim 1, wherein, The method of determining the target clothing color category based on the enhanced feature representation and the preset feature database by using the cosine similarity algorithm comprises: calculating the similarity between the enhanced feature representation and a feature item in the preset feature database by using the cosine similarity algorithm; selecting the color category corresponding to the feature item with the highest similarity as the target clothing color category. 6.The clothes color recognition method based on multi-spectral feature and boundary verification according to claim 1, characterized in that, The method of determining the target clothing region based on the target clothing color category and the spatial distribution information of the spectral feature cluster set comprises: selecting at least one spectral feature cluster with the highest matching degree to the target clothing color category from the spectral feature cluster set; determining a connected region through morphological operation based on the spatial distribution information of the selected spectral feature cluster; The connected region is determined as a target clothing region. 7.The clothes color recognition method based on multi-spectrum feature and boundary verification according to claim 1, characterized in that, The clear boundary structure is obtained by extracting a boundary contour from the target clothing region and performing edge enhancement filtering processing, and the clear boundary structure includes: Based on the target clothing region, a Sobel edge detection algorithm is used to extract an initial boundary contour. The initial boundary contour is smoothed and enhanced by anisotropic diffusion filtering to obtain a clear boundary structure. 8.The clothes color recognition method based on multi-spectrum feature and boundary verification of claim 1, wherein, The clear boundary structure and the enhanced feature representation are fused and input into a convolutional neural network for verification, and a final recognition result is output, and the final recognition result includes: The clear boundary structure and the enhanced feature representation are spliced in a channel to generate a multi-channel input tensor. The multi-channel input tensor is input into the convolutional neural network for boundary integrity verification, and a final recognition result is output. 9.The clothes color recognition method based on multi-spectral feature and boundary verification of claim 8, wherein, The convolutional neural network is an improved U-Net neural network, which integrates a Transformer module in an encoder and uses deformable convolution in a decoder. 10.The clothes color recognition method based on multi-spectral feature and boundary verification according to claim 9, characterized in that, The final recognition result includes a binary mask graph of the target clothing contour and a corresponding color category label.