Fabric management methods, fabric retrieval methods, equipment and media based on self-collection

By automating fabric color data acquisition and neural network calibration, combined with a texture-preserving color transformation algorithm, the problems of low efficiency and low recognition accuracy in fabric color management are solved, achieving efficient and accurate fabric management and retrieval.

CN122309796APending Publication Date: 2026-06-30GUANGZHOU ZHANLAN ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU ZHANLAN ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
Filing Date
2026-04-18
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing technologies for fabric color management are inefficient, manual information collection is time-consuming and labor-intensive, human error is large, color data calibration is insufficient, and the accuracy of identifying complex textured fabrics is low, making it difficult to achieve efficient and accurate color simulation and retrieval.

Method used

The system automatically locates and measures the color data of fabric areas using image acquisition equipment, performs color calibration using a neural network model, generates simulated images using a texture-preserving color transformation algorithm, and extracts depth feature vectors to store in a database, supporting content-based image retrieval.

Benefits of technology

It has achieved fully automated management of fabric color data, improved collection efficiency and accuracy, ensured color consistency and preserved texture details, improved retrieval accuracy, and met the precise needs of "image search".

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309796A_ABST
    Figure CN122309796A_ABST
Patent Text Reader

Abstract

This application relates to the technical field of fabric data processing and retrieval, and in particular to a fabric management method, fabric retrieval method, device, and medium based on self-acquisition. The method includes: acquiring a digital image of a fabric sample using an image acquisition device, and controlling a color sampling device to automatically locate and measure the original color data of multiple regions on the fabric sample; inputting the original color data into a pre-trained color calibration model, wherein the color calibration model is a neural network model, and outputting standard color space values ​​independent of standard devices; receiving a target color value, and synthesizing a simulated image of the fabric under the target color based on the standard color space value and texture information extracted from the digital image using a color transformation algorithm; extracting the depth feature vector of the simulated image, and associating it with fabric identification information and storing it in a feature database. This application improves the accuracy of fabric recognition and recommendations to users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of fabric data processing and retrieval, and in particular to a fabric management method, fabric retrieval method, equipment and medium based on self-collection. Background Technology

[0002] In the fabric design and management industry, with the continuous development of the textile fabric industry and its widespread application in dyeing, apparel design, e-commerce, and other fields, fabric color management has become increasingly important. Accurate and efficient fabric color management helps improve production efficiency, reduce costs, and meet the diverse needs for fabric colors in different scenarios. In apparel design, precise color management enables designers to better present their design concepts; in e-commerce scenarios, it provides consumers with a more realistic display of product colors.

[0003] Currently, to address issues such as color evaluation, record management, and sample retrieval, physical sample preparation and manual operation are commonly employed. In terms of information collection, color and texture sampling from color charts requires manual location and photographing of each color patch. Color simulation often involves simple color replacement. For color management, effective calibration methods are lacking for color data collected from different devices. Sample retrieval relies heavily on text keywords or traditional image features.

[0004] The existing technical solutions described above have the following drawbacks: Manual information collection is inefficient, time-consuming, costly, and prone to human error. Simple color replacement simulations ignore the complex influence of fabric texture on color representation, leading to distorted simulation results and making them unsuitable for physical samples. Color data collected from different devices lacks calibration, resulting in discrepancies between digital and real colors. Retrieval methods based on text keywords or traditional image features have low accuracy in identifying fabrics with complex textures and similar colors, failing to meet the precise requirements of "image-to-image search." Summary of the Invention

[0005] To improve the accuracy of fabric identification and recommendations to users, this application provides a self-collection-based fabric management method, fabric retrieval method, device, and medium.

[0006] The above-mentioned objective of this application is achieved through the following technical solution: A fabric management method based on self-collection, the fabric management method based on self-collection includes: Digital images of fabric samples are acquired using an image acquisition device, and a color sampling device is controlled to automatically locate and measure the original color data of multiple areas on the fabric sample. The raw color data is input into a pre-trained color calibration model, which is a neural network model, and outputs standard color space values ​​that are independent of standard devices. Receive the target color value, and based on the standard color space value and the texture information extracted from the digital image, synthesize a simulated image of the fabric under the target color using a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing; The depth feature vector of the simulated image is extracted and associated with the fabric identification information and stored in the feature database to support content-based image retrieval.

[0007] By adopting the above technical solution, digital images of fabric samples are acquired using image acquisition equipment, and color sampling equipment is controlled to automatically locate and measure the original color data of multiple areas. This avoids the tedious process of manually locating and photographing each color block, improving information acquisition efficiency and reducing labor costs and human error. The original color data is input into a pre-trained neural network color calibration model, which outputs standard color space values ​​independent of standard equipment. This solves the problem of differences in color data acquired by different devices, calibrating color data acquired by ordinary cameras to professional-grade accuracy. The average color difference (CIEDE2000) can be reduced to below 1.32, providing a reliable data foundation for subsequent color simulation. Based on the calibrated standard color space values ​​and the texture information extracted from the digital images, a color transformation algorithm including texture preservation processing is used to synthesize a simulated image of the fabric under the target color. This can simulate and generate realistic effect images of the fabric under different target colors, preventing texture blurring caused by color transformation, ensuring that texture details are preserved after transformation, and generating high-quality color code graphics of the fabric under the target color. This method extracts depth feature vectors from simulated images and associates them with fabric identification information, storing them in a feature database to support content-based image retrieval. It can understand complex texture semantics and achieves a retrieval accuracy far exceeding traditional methods. It is particularly adept at distinguishing fabrics with similar colors and textures, enabling efficient "image-to-image" retrieval. Overall, this method achieves end-to-end digital and intelligent management of fabric color data from input to application, significantly improving design efficiency, reducing costs, and ensuring color consistency.

[0008] In a preferred embodiment, this application can be further configured as follows: acquiring digital images of the fabric sample via an image acquisition device, and controlling the color sampling device to automatically locate and measure the original color data of multiple regions on the fabric sample, specifically includes: The overall image of the color chart acquired by the image acquisition device is preprocessed and segmented to identify all color block regions and calculate the center point coordinates of each color block region; Based on the center point coordinates of all the color block regions, a path planning algorithm is used to calculate the movement sequence of the color picking device; According to the optimal movement sequence, the color sampling device is controlled to move sequentially to the coordinates of each center point and trigger color measurement to obtain the original color data.

[0009] By employing the above technical solution, preprocessing and image segmentation are performed on the overall image of the color chart acquired by the image acquisition device. This removes image noise, enhances image features, and makes color block areas clearer and more distinguishable, thereby accurately identifying all color block areas. Calculating the center point coordinates of each color block area provides a basis for the precise positioning of the color picking device. Based on the center point coordinates of all color block areas, a path planning algorithm is used to calculate the movement sequence of the color picking device. This optimizes the device's movement path, avoids unnecessary movements and repetitive operations, and reduces color picking time and energy consumption. Controlling the color picking device to move sequentially to each center point coordinate and trigger color measurement according to the optimal movement sequence automates and improves the efficiency of the color picking process. This allows for the rapid and accurate acquisition of raw color data from multiple areas on the fabric sample, improving the efficiency and accuracy of fabric color data acquisition and providing a reliable data foundation for subsequent color calibration, simulation, and retrieval operations.

[0010] In a preferred embodiment, this application can be further configured such that: the input of the original color data to a pre-trained color calibration model, wherein the color calibration model is a neural network model, and the output is a standard color space value independent of standard devices, specifically includes: The original color data is standardized and preprocessed to conform to the numerical distribution requirements of the color calibration model input. The preprocessed color data is input into the color calibration model, which is a deep neural network containing an input layer, multiple hidden layers and an output layer. The color calibration model performs nonlinear transformation and feature extraction on the input data through its hidden layer, and generates predicted standard color space values ​​in the output layer.

[0011] By adopting the above technical solution, the original color data is first standardized and preprocessed to ensure that the data conforms to the numerical distribution requirements of the color calibration model input, laying the foundation for accurate data processing in subsequent models. Then, the preprocessed color data is input into a deep neural network color calibration model containing an input layer, multiple hidden layers, and an output layer. In the model, the hidden layers can perform nonlinear transformations and feature extraction on the input data, utilizing the powerful learning ability of neural networks to uncover latent features in the data. Through this nonlinear transformation, the complex relationships in the color data can be captured more accurately. Finally, the output layer generates predicted standard color space values, calibrating the original color data to a standard color space independent of standard devices. This solves the problem of differences in color data collected by different devices, calibrating color data collected by ordinary devices to professional-grade accuracy. The average color difference (CIEDE2000) can be reduced to below 1.32, providing a reliable data foundation for subsequent color simulations.

[0012] In a preferred embodiment, this application can be further configured as follows: upon receiving the target color value, based on the standard color space value and the texture information extracted from the digital image, a simulated image of the fabric under the target color is synthesized using a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing, specifically including: The digital image and the reference color generated according to the standard color space values ​​are converted from the RGB color space to the HSV color space; Calculate the hue difference ΔH, saturation difference ΔS, and lightness difference ΔV between the target color and the reference color in the HSV space; The HSV components of each pixel in the digital image are adjusted using the formula: H' = H + ΔH, S' = S + ΔS, V' = V + ΔV. The adjusted image is then converted back to the RGB color space to generate an initial analog image. The initial simulated image is fused with the texture edge information extracted from the original digital image to obtain the final simulated image that retains clear texture.

[0013] By employing the above technical solution, the digital image and the reference color generated based on standard color space values ​​are first converted from the RGB color space to the HSV color space. This is because the HSV color space better matches human color perception, allowing for more intuitive adjustments to hue, saturation, and brightness during color transformation. Next, the hue difference ΔH, saturation difference ΔS, and brightness difference ΔV between the target color and the reference color in the HSV space are calculated. Based on these differences, the HSV components of each pixel in the digital image are adjusted, enabling precise color replacement. The adjusted image is then converted back to the RGB color space to generate an initial simulated image. Finally, the initial simulated image is fused with texture edge information extracted from the original digital image. Since texture edge information represents the fabric's texture characteristics, this effectively prevents texture blurring caused by color transformation, ensuring that the final simulated image retains clear texture. This allows for the generation of realistic simulations of the fabric under different target colors.

[0014] In a preferred embodiment, this application can be further configured as follows: extracting the depth feature vector of the simulated image and associating it with fabric identification information and storing it in a feature database to support content-based image retrieval, specifically including: The simulated image is input into a pre-trained convolutional neural network model; Obtain the feature map of at least one intermediate convolutional layer in the convolutional neural network; A global average pooling operation is performed on the feature map, and the pooled feature tensor is flattened to form the depth feature vector.

[0015] By adopting the above technical solution, the simulated image is first input into a pre-trained convolutional neural network model, which can leverage the model's powerful feature extraction capabilities to process the simulated image. Then, the feature map of at least one intermediate convolutional layer in the network is obtained, which can extract feature information at different levels, providing richer materials for subsequent operations. Next, global average pooling is performed on the feature map and it is flattened to form a depth feature vector. This facilitates the integration of the feature map into a vector form that is easy to process and compare. It is also convenient to associate the depth feature vector with fabric identification information and store it in the feature database, thereby supporting content-based image retrieval, improving the accuracy and efficiency of retrieval, and realizing effective management and rapid query of fabric data.

[0016] In a preferred embodiment, this application can be further configured such that: obtaining the feature map of at least one intermediate convolutional layer in the convolutional neural network specifically includes: The simulated image is input into a pre-trained convolutional neural network for forward propagation, activating and extracting the feature map output of a specified intermediate convolutional layer; Based on the texture characteristics of the fabric sample, an adaptive combination of intermediate convolutional layers for feature fusion is selected, wherein samples with complex textures are assigned higher weights to lower-level feature maps, and samples with uniform color are assigned higher weights to higher-level feature maps.

[0017] By adopting the above technical solution, forward propagation of simulated images can activate and extract feature maps output by specified intermediate convolutional layers. Based on the texture characteristics of the fabric sample, the combination of intermediate convolutional layers used for feature fusion is adaptively selected. Samples with complex textures are assigned higher weights to feature maps at lower levels, while samples with uniform color are assigned higher weights to feature maps at higher levels. This can form feature vectors with strong expressive power, enabling deep learning-based feature extraction to understand complex texture semantics, improve image retrieval accuracy, and is particularly good at distinguishing fabrics with similar colors and textures.

[0018] The second objective of this invention is achieved through the following technical solution: A fabric retrieval method, the fabric retrieval method comprising: Receive the query image; Obtain the query feature vector of the query image, wherein the query feature vector is obtained using the feature extraction method of the above-mentioned fabric management method based on self-collection; Calculate the similarity between the query feature vector and all stored feature vectors in the feature database; Sort by similarity and return at least one fabric identification information and its corresponding simulated image that is most similar.

[0019] By adopting the above technical solution, a query image can be received, and a query feature vector of the query image can be obtained using a feature extraction method based on self-collection fabric management. The similarity between this vector and the vector stored in the feature database can be calculated, and the most similar fabric identification information and corresponding simulated image can be returned according to the similarity ranking. This achieves efficient and accurate fabric image retrieval, improves the efficiency and accuracy of fabric retrieval, and meets the precise needs of "image search".

[0020] In a preferred embodiment, this application can be further configured such that: calculating the similarity between the query feature vector and all stored feature vectors in the feature database specifically includes: The initial similarity between the query feature vector and a feature vector in the database is calculated using the cosine similarity algorithm. Based on the color histograms of the query image and the original images in the database, the Bach coefficient of the color histograms is calculated as the color distribution similarity. The initial similarity and color distribution similarity are weighted and fused to obtain the final comprehensive similarity.

[0021] By adopting the above technical solution, the initial similarity is calculated using the cosine similarity algorithm, which can initially measure the similarity between the query feature vector and the feature vector in the database; the Bach coefficient is calculated based on the color histogram as the color distribution similarity, which can take into account the similarity of the color distribution of the image; the initial similarity and the color distribution similarity are weighted and fused to obtain the final comprehensive similarity, which can comprehensively consider the similarity of both feature vector and color distribution, thereby improving the accuracy of fabric retrieval.

[0022] The above-mentioned objective three of this application is achieved through the following technical solution: A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described self-collection-based fabric management method or fabric retrieval method.

[0023] The fourth objective of this application is achieved through the following technical solution: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described self-collection-based fabric management method or fabric retrieval method.

[0024] In summary, this application includes at least one of the following beneficial technical effects: 1. Achieve full-process automation, reducing fabric management work from the traditional days to hours or even minutes, increasing efficiency by dozens of times and solving the problem of low efficiency in traditional manual information collection; 2. By using texture preservation processing in the color calibration model and color transformation algorithm, we ensure that the digital colors are consistent with the real objects, the color simulation effect is realistic, the average color difference is reduced, and the problems of unrealistic color simulation and inconsistent color management in traditional color management are solved. 3. Image retrieval using deep feature vectors achieves a much higher accuracy rate than traditional methods, meeting the precise requirement of "image-to-image search" and solving the problem of difficult traditional sample retrieval. Attached Figure Description

[0025] Figure 1 These are sample images acquired in this embodiment.

[0026] Figure 2 This is a schematic diagram of the sample color obtained by the colorimeter in this embodiment.

[0027] Figure 3 These are the sample cover and macro texture map obtained by color sampling fitting in this embodiment.

[0028] Figure 4This is a schematic diagram of the original photograph of the first sample in this embodiment.

[0029] Figure 5 This is a schematic diagram showing the center point of the first sample in this embodiment.

[0030] Figure 6 This is a schematic diagram of the original photograph of the second sample in this embodiment.

[0031] Figure 7 This is a schematic diagram showing the center point of the second sample in this embodiment. Detailed Implementation

[0032] The present application will be further described in detail below with reference to the accompanying drawings.

[0033] In one embodiment, this application discloses a fabric management method based on self-collection, which specifically includes the following steps: S10: Acquire digital images of the fabric sample through an image acquisition device, and control the color sampling device to automatically locate and measure the original color data of multiple areas on the fabric sample.

[0034] In this embodiment, to acquire high-quality fabric images and accurate color data, the image acquisition device (such as a high-resolution digital camera or scanner) is first initialized. This device must operate under standard lighting conditions (e.g., using a D65 standard light source, color temperature 6500K, and illuminance of at least 1000 lux) to eliminate the influence of ambient light on color. The fabric sample is placed flat on the acquisition platform, and the image acquisition device captures digital images at a resolution of at least 300 DPI, ensuring the images are clear and contain complete fabric texture details. The acquired images are as follows: Figure 1 As shown. Simultaneously, the system controls the color sampling device (such as a spectrophotometer or colorimeter) for automatic positioning. The color sampling device achieves precise positioning via a robotic arm or mobile platform, with a positioning accuracy of ±0.1 mm. The system first identifies the effective area of ​​the fabric sample based on the digital image, and then selects multiple representative areas (usually 5-10 areas) for color measurement through grid division or random sampling strategies. The measurement point diameter of each area is approximately 2 mm. The color sampling device measures the raw color data of each area using contact or non-contact methods, outputting the device-related RGB values ​​or spectral data. The entire acquisition process must be completed within 10 seconds to improve efficiency. The raw color data and digital image are associated and stored, providing input for subsequent processing.

[0035] S20: Input the raw color data into a pre-trained color calibration model. The color calibration model is a neural network model that outputs standard color space values ​​that are independent of standard devices.

[0036] Specifically, to address color deviations caused by device differences, a color calibration model converts the raw data into a standard color space (such as CIELAB or sRGB). The color calibration model is a pre-trained deep neural network, trained on measurements from a large number of standard color charts (such as ColorChecker) covering different devices and lighting conditions. The model input is the raw color data (such as RGB values), and the output is the standard CIELAB value. The neural network structure includes an input layer (3 nodes corresponding to RGB), 3 hidden layers (128 nodes per layer, using the ReLU activation function), and an output layer (3 nodes corresponding to L, a, and b values). During training, a mean squared error loss function and the Adam optimizer are used, with a learning rate of 0.001 and over 10,000 iterations. In the inference phase, the system first performs standardization preprocessing on the raw color data, scaling it to the [0,1] range. This is then input into the model, where the hidden layers learn the mapping from device-dependent values ​​to device-independent values ​​through non-linear transformations. The output layer generates predicted standard color space values ​​with an average color difference ΔEab of less than 1.5, ensuring color accuracy. The calibrated data is used for subsequent color transformations to eliminate the influence of the acquisition equipment.

[0037] S30: Receive the target color value, and synthesize a simulated image of the fabric under the target color based on the standard color space value and the texture information extracted from the digital image through a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing.

[0038] To achieve virtual color replacement of fabric while maintaining the realism of the texture, the algorithm receives the target color value (such as CIELAB value or Pantone code) input by the user and calculates the color difference based on the standard color space values ​​from step 1.2. The color transformation algorithm first converts the digital image from the RGB color space to the HSV color space.

[0039] Furthermore, the differences (ΔH, ΔS, ΔV) between the target color and the average color of the fabric are calculated, and the HSV components of each pixel are adjusted: H' = H + ΔH, S' = S + ΔS, V' = V + ΔV. The adjusted image is then converted back to RGB space to generate the initial simulated image. To preserve texture, texture information is extracted from the original image (using Canny edge detection or Gabor filters), and then the texture details are superimposed onto the initial simulated image through image fusion (such as Laplacian pyramid fusion) to ensure texture clarity.

[0040] refer to Figures 2-3 By inputting the target color, sample images of different colors in the texture can be simulated.

[0041] S40: Extract the depth feature vector of the simulated image and associate it with the fabric identification information to store it in the feature database to support content-based image retrieval.

[0042] To provide a feature index for fabric retrieval, deep features of simulated images are extracted using a pre-trained convolutional neural network (such as ResNet-50). Images are first scaled to 224x224 pixels and then fed into the CNN model. Features are extracted from the feature map of the last convolutional layer, compressed into a 1x1xC tensor (where C is the number of channels, e.g., 2048) using global average pooling, and then flattened into a feature vector. This vector captures high-level features of the image's texture, color, and shape. The feature vector is then associated with fabric identification information (such as material and supplier number) and stored in a feature database (such as using MySQL or Elasticsearch). The database index uses vector similarity search techniques (such as FAISS) to support fast retrieval. The feature dimension can be reduced to 512 dimensions to improve efficiency.

[0043] In one embodiment, step S10, namely acquiring a digital image of the fabric sample through an image acquisition device and controlling a color sampling device to automatically locate and measure the original color data of multiple areas on the fabric sample, specifically includes: S11: Preprocess and segment the overall image of the color chart acquired by the image acquisition device, identify all color block regions, and calculate the center point coordinates of each color block region.

[0044] In this embodiment, to accurately locate the color blocks on the color chart and provide a coordinate basis for color measurement, the overall image of the color chart (such as the 24-color chart image of X-Rite ColorChecker) is first acquired, with an image resolution of at least 600 DPI to ensure clear details. Preprocessing includes Gaussian filtering for noise reduction (kernel size 5x5, σ=1.5) and histogram equalization to enhance contrast. Then, an image segmentation algorithm is used to identify the color block regions: first, the image is binarized using the Otsu thresholding method to separate the foreground (color blocks) and background; then, morphological operations (such as closing operation, kernel size 3x3) are applied to fill holes and smooth edges; finally, a contour detection algorithm (such as the Suzuki85 algorithm) is used to extract the boundary contour of each color block. For each contour, the system calculates its minimum bounding rectangle and takes the center point of the rectangle as the center coordinate of the color block. The coordinate calculation is based on the image pixel coordinate system, with the origin at the top left corner of the image. To improve accuracy, the system verifies the number of color blocks (e.g., ensuring that all 24 color blocks are detected) and excludes non-rectangular contours. The center point coordinates are stored in floating-point form with an accuracy of 0.01 pixels, which is used to guide the positioning of the color picking device.

[0045] refer to Figure 4 and Figure 6 These are real photos of different types of samples, and Figure 5 and Figure 7 To identify all the color regions and mark their corresponding center positions, it is convenient to calculate the coordinates of the center point.

[0046] S12: Based on the center point coordinates of all color block areas, a path planning algorithm is used to calculate the movement sequence of the color picking device.

[0047] In this embodiment, to optimize the movement path of the color picking device and improve measurement efficiency, the path planning algorithm can adopt an approximate solution to the Traveling Salesman Problem (TSP) to minimize the total movement distance. Specifically, the system treats the center point of each color block as a city node and calculates the Euclidean distance matrix. Then, the nearest neighbor algorithm is used to generate the initial path: starting from the first color block, the nearest unvisited color block is selected each time until all color blocks are traversed. For further optimization, the 2-opt algorithm can be used for local search, swapping edges in the path to shorten the total distance. Path planning considers the device's physical constraints, such as acceleration and deceleration, to avoid sudden stops. The movement sequence is stored in list form, containing the coordinates and access order of each color block. The planning time is controlled within 100ms to ensure real-time performance. For a standard 24-color card, the total path distance can be optimized to be reduced by more than 30% compared to a random sequence. S13: Control the color sampling device to move sequentially to the coordinates of each center point according to the optimal movement sequence and trigger color measurement to obtain the original color data.

[0048] Specifically, during automatic measurement, a motion control card (such as an STM32-based controller) drives the stepper motor of the color picking device, achieving a movement accuracy of ±0.05 mm. The device moves sequentially to each center point coordinate, pausing for 100ms upon arrival to stabilize its position before triggering color measurement. Measurements are performed by a spectrophotometer with an integration time of 100ms. Each color patch is measured three times, and the average value is used as the raw data. The raw data includes RGB values ​​or spectral reflectance (wavelength range 380-730nm, 10nm intervals). Data is transmitted to the host computer in real time and labeled with the corresponding color patch number. If the measured value fluctuates beyond a preset value, such as 5% (possibly due to changes in illumination), the system will remeasure. The entire process for a 24-color chart can be completed within 30 seconds, and the raw data is stored in CSV format for subsequent calibration.

[0049] In one embodiment, in step S20, the original color data is input into a pre-trained color calibration model. The color calibration model is a neural network model that outputs standard color space values ​​independent of standard devices. Specifically, this includes: S21: Standardize and preprocess the raw color data to make it conform to the numerical distribution requirements of the color calibration model input.

[0050] Preprocessing ensures data consistency and improves model stability. Raw color data (such as RGB values) may come from different devices and have varying value ranges (e.g., 0-255 or 0-1). The system first scales the data to the [0,1] range using the following formula: ; Where R min and R max Find the minimum and maximum values ​​in the dataset. Then, apply Z-score standardization to make the data mean 0 and the standard deviation 1. ; Here, μ and σ are the pre-computed mean and standard deviation of the training set. Preprocessing also includes outlier detection; if a channel value exceeds ±3σ, it is replaced with the median. The processed data dimension matches the model input layer (e.g., a 3D vector) and is directly input into the model.

[0051] S22: Input the preprocessed color data into the color calibration model, which is a deep neural network containing an input layer, multiple hidden layers, and an output layer.

[0052] The color calibration model is a fully connected neural network with 3 nodes in the input layer (corresponding to RGB) and 3 nodes in the output layer (corresponding to CIELAB). The hidden layers are designed with 3 layers, each with 128, 64, and 32 nodes, using the ReLU activation function to introduce non-linearity. The output layer uses linear activation. The model is implemented in the TensorFlow framework, and L2 regularization (coefficient 0.01) is used during training to prevent overfitting. The forward propagation formula is: h1=ReLU(W 1x +b1), h2=ReLU(W2h1+b2), y=W3h2+b3; Where x is the input and y is the output. The model parameters are learned through backpropagation, and the time taken for a single forward propagation during inference is less than 1ms.

[0053] S23: The color calibration model performs nonlinear transformation and feature extraction on the input data through its hidden layer, and generates predicted standard color space values ​​in the output layer.

[0054] Specifically, the hidden layers are responsible for feature transformation: the first layer learns low-level features (such as color intensity), the second layer fuses context, and the third layer compresses features. The output layer is directly mapped to the CIELAB color space. The model is trained using the ColorChecker dataset, with the loss function being the CIEDE2000 color difference formula, the optimizer being Adam, and the learning rate being 0.001. After training, the model's average color difference ΔE00 on the test set is less than 1.5. During inference, the output values ​​are denormalized to restore them to the actual range, serving as standard color space values.

[0055] In one embodiment, in step S30, the target color value is received, and based on the standard color space value and the texture information extracted from the digital image, a simulated image of the fabric under the target color is synthesized using a color transformation algorithm. The color transformation algorithm includes texture preservation processing, specifically comprising: S31: Convert digital images and reference colors generated based on standard color space values ​​from the RGB color space to the HSV color space.

[0056] In this embodiment, color space conversion is fundamental to color transformation. First, each pixel of the digital image is converted from RGB to HSV space using a standard conversion formula. For the reference color (derived from a standard color space value such as CIELAB), CIELAB is first converted to RGB by the color management module, and then similarly converted to HSV. This conversion ensures that all colors are processed in a perceptibly uniform HSV space. In the conversion formula, H (hue) ranges from 0-360°, and S (saturation) and V (lightness) range from 0-1. The conversion process is performed pixel-by-pixel, accelerated in parallel by the GPU, taking less than 50ms for a 1-megapixel image.

[0057] S32: Calculate the hue difference ΔH, saturation difference ΔS, and lightness difference ΔV between the target color and the reference color in the HSV space.

[0058] Specifically, difference calculation is the core of color adjustment. The reference color is taken as the average HSV value of the fabric image (calculated by averaging all pixels). The target color is input by the user. The difference calculation is as follows: ΔH=H target -H ref , ΔS=Starget−Sref, ΔV=Vtarget−Vref; ΔH needs to account for hue cycle characteristics (e.g., the difference from 350° to 10° is 20° instead of -340°). The difference range is limited to a reasonable range (ΔH ∈ [-180, 180], ΔS, ΔV ∈ [-1, 1]) to avoid over-adjustment.

[0059] S33: Adjust the HSV components of each pixel in the digital image using the formula: H' = H + ΔH, S' = S + ΔS, V' = V + ΔV, and convert the adjusted image back to the RGB color space to generate the initial analog image.

[0060] Specifically, to maintain naturalness, ΔH, ΔS, and ΔV can be weighted according to the original pixel values ​​(e.g., reducing the influence of ΔS for low-saturation pixels). After adjustment, H' is processed modulo 360, and S' and V' are cropped to [0,1]. Then the image is converted back to RGB space using the following formula: C = V′ × S′, H′sec =H′ / 60, X=C×(1−∣H′) sec mod2−1∣); Then calculate the RGB values ​​based on the H' interval.

[0061] S34: The initial simulated image is fused with the texture edge information extracted from the original digital image to obtain the final simulated image that retains clear texture.

[0062] Specifically, texture edges are extracted from the original image using a Canny detector (thresholds 50 for low values ​​and 150 for high values). Then, multi-resolution fusion is employed: a Gaussian pyramid (5 layers) is constructed between the initial simulated image and the texture image, Laplacian mixing is performed at each layer, and the image is reconstructed. The fusion weights are based on texture intensity, with higher weights for edge regions. The final image exhibits clear texture and a structural similarity index (SSIM) greater than 0.9.

[0063] In one embodiment, step S40 involves extracting the depth feature vector of the simulated image and associating it with fabric identification information, storing it in a feature database to support content-based image retrieval. Specifically, this includes: S41: Input the simulated image into the pre-trained convolutional neural network model.

[0064] Specifically, the CNN model uses a pre-trained ResNet-50 and is trained on ImageNet. The input image is scaled to 224x224 pixels, and the values ​​are normalized to [0,1]. The model retains the convolutional basis and removes the fully connected layers. Forward propagation is implemented using PyTorch, with a single image processing time of approximately 10ms.

[0065] S42: Obtain the feature map of at least one intermediate convolutional layer in the convolutional neural network.

[0066] Specifically, the feature map is extracted from the last convolutional layer (such as layer 4 of ResNet-50), which outputs a feature map of size 7x7x2048, capturing high-level semantic features. The output of this layer is activated and extracted during forward propagation via a hook mechanism.

[0067] S43: Perform global average pooling on the feature map and flatten the pooled feature tensor to form a depth feature vector.

[0068] Specifically, global average pooling averages the 7x7 feature maps for each channel, outputting a 1x1x2048 tensor. This tensor is then flattened into a 2048-dimensional vector. Pooling reduces parameters while preserving translation invariance. The vector is then subjected to L2 normalization for easier similarity calculation.

[0069] In one embodiment, step S42, namely obtaining the feature map of at least one intermediate convolutional layer in the convolutional neural network, specifically includes: S421: Input the simulated image into the pre-trained convolutional neural network for forward propagation, activate and extract the feature map output of the specified intermediate convolutional layer.

[0070] Specifically, in practical applications, fabric simulation images first need to undergo standardization preprocessing to adapt to the input requirements of convolutional neural networks. Taking textile enterprise fabric library management as an example, the simulation image (resolution 512×512 pixels) generated in steps S31-S34 is obtained, scaled to 224×224 pixels, and then input into the pre-trained ResNet-50 model. During forward propagation, the system activates and extracts feature maps from multiple intermediate layers in real time through a hook mechanism, including the low-level layer 2 (output size 28×28×512) and the high-level layer 4 (output size 7×7×2048). The low-level feature maps contain rich texture details (such as yarn density and weave structure), while the high-level feature maps capture semantic information (such as pattern style and overall style), thus providing a data foundation for subsequent adaptive fusion due to the comprehensiveness of the feature maps.

[0071] S422: Adaptively select the combination of intermediate convolutional layers for feature fusion based on the texture characteristics of the fabric sample, where samples with complex textures are assigned higher weights to lower-level feature maps, and samples with uniform color are assigned higher weights to higher-level feature maps.

[0072] Specifically, to address the differentiated feature representation requirements of various fabric characteristics, taking fabric retrieval for apparel manufacturers as an example, the texture complexity indicators of the original image—contrast and entropy—are first calculated using the gray-level co-occurrence matrix. Specifically, after converting the fabric image to grayscale, the gray-level co-occurrence matrices in the 0°, 45°, 90°, and 135° directions are calculated, and the average contrast value is taken. If the contrast is higher than a threshold, such as the empirical value of 50, it is determined to be a fabric with complex textures, such as jacquard or coarse-woven fabrics. In this case, the system assigns a higher weight to the lower-level feature maps, for example, 0.7, to enhance the contribution of texture details. Conversely, if the contrast is lower than the threshold, it is determined to be a fabric with uniform color, such as plain weave fabric, and a higher weight is assigned to the higher-level feature maps, for example, 0.6, focusing on color and global features.

[0073] In fabric recommendation scenarios on e-commerce platforms, the system can automatically identify the texture type of fabric images uploaded by users. For example, when a user searches for "lace fabric," the system prioritizes matching the openwork texture of lace using low-level features; while when searching for "solid color cotton," it relies on comparing color consistency using high-level features. Furthermore, the system dynamically adjusts weights, such as increasing the texture weight to 0.8 for high-value fabrics (e.g., silk) to accurately reproduce their unique luster. By combining this with database indexing technology, feature retrieval speed is improved to millisecond levels, significantly supporting the real-time management needs of large-scale fabric databases.

[0074] In one embodiment, this application discloses a fabric retrieval method, which specifically includes the following steps:

[0075] Specifically, the query image can be obtained by uploading or capturing it in real time. After the query image is obtained, it is preprocessed: scaled to a fixed size (e.g., 500x500 pixels), automatically white balanced, and its fabric image is detected, for example, using a CNN classifier.

[0076] S60: Obtain the query feature vector of the query image, wherein the query feature vector is obtained by the feature extraction method based on the self-collected fabric management method described above.

[0077] Specifically, the query feature vector of the query image is extracted using the above-mentioned self-collection-based fabric management method. The same CNN model and parameters are used to ensure consistency, and the extracted vector dimension is consistent with the feature vector in the database.

[0078] S70: Calculate the similarity between the query feature vector and all stored feature vectors in the feature database.

[0079] Specifically, a cosine similarity algorithm can be used to calculate the similarity between the query feature vector and the feature vector in the feature database.

[0080] S80: Sort by similarity and return at least one fabric identification information and its corresponding simulated image that is most similar.

[0081] Specifically, the similarity is sorted from high to low, and at least one simulated image corresponding to the fabric identification information is output.

[0082] In one embodiment, step S70, which calculates the similarity between the query feature vector and all stored feature vectors in the feature database, specifically includes: S71: The cosine similarity algorithm is used to calculate the initial similarity between the query feature vector and a feature vector in the database.

[0083] Specifically, the cosine similarity is calculated as in step 70, with a value range of [-1, 1]. Since the feature vector has been normalized, the actual value is [0, 1], thus ensuring that the calculated initial similarity reflects the structural similarity.

[0084] S72: Based on the color histograms of the query image and the original image in the database, calculate the Bach coefficient of the color histogram as the color distribution similarity.

[0085] Specifically, the query images and the original fabric simulation images in the database are first converted from the RGB color space to the HSV (Hue, Saturation, Lightness) color space, which is more suitable for color statistics. This conversion separates the lightness information (V) from the color information (H, S), which is more in line with human visual perception. The conversion formula follows a standard calculation model: Hue (H) is obtained by comparing the relative relationships of the RGB channels, Saturation (S) reflects the purity of the color, and Lightness (V) is taken as the maximum value in RGB.

[0086] Furthermore, a three-dimensional color histogram is constructed for each image in the HSV space to accurately depict its color distribution. Specific parameter settings are as follows: the hue (H) component is quantized into 36 intervals (each interval being 10 degrees) to account for the circular nature of hue; the saturation (S) and lightness (V) components are each quantized into 10 equally spaced intervals. Therefore, the total number of intervals in the histogram is 36(H) x 10(S) x 10(V) = 3600 intervals (bins). After counting the frequency of pixels falling into each interval, the system normalizes the histogram by dividing the count value of each interval by the total number of pixels in the image, thus converting the histogram into a function representing the color probability distribution.

[0087] S73: Weighted fusion of the initial similarity and color distribution similarity to obtain the final comprehensive similarity.

[0088] Specifically, based on the calculated initial similarity and color distribution similarity, their weights in the final comprehensive similarity are determined. It should be noted that the weight allocation is not fixed but dynamically adjusted according to the characteristics of the query image itself to achieve optimal retrieval results.

[0089] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0090] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a self-collection-based fabric management method or fabric retrieval method.

[0091] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Digital images of fabric samples are acquired through image acquisition devices, and color sampling devices are controlled to automatically locate and measure the original color data of multiple areas on the fabric sample. The raw color data is input into a pre-trained color calibration model, which is a neural network model and outputs standard color space values ​​that are independent of standard devices. The target color value is received, and based on the standard color space value and the texture information extracted from the digital image, a simulated image of the fabric under the target color is synthesized through a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing. The depth feature vector of the simulated image is extracted and associated with the fabric identification information and stored in the feature database to support content-based image retrieval.

[0092] or, Receive the query image; Obtain the query feature vector of the query image, wherein the query feature vector is obtained by the feature extraction method of the fabric management method based on self-collection described above; Calculate the similarity between the query feature vector and all stored feature vectors in the feature database; Sort by similarity and return at least one fabric identification information and its corresponding simulated image that is most similar.

[0093] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor: Digital images of fabric samples are acquired through image acquisition devices, and color sampling devices are controlled to automatically locate and measure the original color data of multiple areas on the fabric sample. The raw color data is input into a pre-trained color calibration model, which is a neural network model and outputs standard color space values ​​that are independent of standard devices. The target color value is received, and based on the standard color space value and the texture information extracted from the digital image, a simulated image of the fabric under the target color is synthesized through a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing. The depth feature vector of the simulated image is extracted and associated with the fabric identification information and stored in the feature database to support content-based image retrieval.

[0094] or, Receive the query image; Obtain the query feature vector of the query image, wherein the query feature vector is obtained by the feature extraction method of the fabric management method based on self-collection described above; Calculate the similarity between the query feature vector and all stored feature vectors in the feature database; Sort by similarity and return at least one fabric identification information and its corresponding simulated image that is most similar.

[0095] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0096] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0097] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A fabric management method based on self-collection, characterized in that, The self-collection-based fabric management method includes: Digital images of fabric samples are acquired using an image acquisition device, and a color sampling device is controlled to automatically locate and measure the original color data of multiple areas on the fabric sample. The raw color data is input into a pre-trained color calibration model, which is a neural network model, and outputs standard color space values ​​that are independent of standard devices. Receive the target color value, and based on the standard color space value and the texture information extracted from the digital image, synthesize a simulated image of the fabric under the target color using a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing; The depth feature vector of the simulated image is extracted and associated with the fabric identification information and stored in the feature database to support content-based image retrieval.

2. The fabric management method based on self-collection according to claim 1, characterized in that, The process of acquiring digital images of the fabric sample through an image acquisition device and controlling a color sampling device to automatically locate and measure the original color data of multiple areas on the fabric sample specifically includes: The overall image of the color chart acquired by the image acquisition device is preprocessed and segmented to identify all color block regions and calculate the center point coordinates of each color block region; Based on the center point coordinates of all the color block regions, a path planning algorithm is used to calculate the movement sequence of the color picking device; According to the optimal movement sequence, the color sampling device is controlled to move sequentially to the coordinates of each center point and trigger color measurement to obtain the original color data.

3. The fabric management method based on self-collection according to claim 1, characterized in that, The step of inputting the original color data into a pre-trained color calibration model, wherein the color calibration model is a neural network model, and outputs standard color space values ​​independent of standard devices, specifically includes: The original color data is standardized and preprocessed to conform to the numerical distribution requirements of the color calibration model input. The preprocessed color data is input into the color calibration model, which is a deep neural network containing an input layer, multiple hidden layers and an output layer. The color calibration model performs nonlinear transformation and feature extraction on the input data through its hidden layer, and generates predicted standard color space values ​​in the output layer.

4. The fabric management method based on self-collection according to claim 1, characterized in that, The received target color value, based on the standard color space value and the texture information extracted from the digital image, is used to synthesize a simulated image of the fabric under the target color through a color transformation algorithm, wherein the color transformation algorithm includes texture preservation processing, specifically including: The digital image and the reference color generated according to the standard color space values ​​are converted from the RGB color space to the HSV color space; Calculate the hue difference ΔH, saturation difference ΔS, and lightness difference ΔV between the target color and the reference color in the HSV space; The HSV components of each pixel in the digital image are adjusted using the following formulas: H' = H + ΔH, S' = S + ΔS, V' = V + ΔV. The adjusted image is then converted back to the RGB color space to generate an initial analog image. The initial simulated image is fused with the texture edge information extracted from the original digital image to obtain the final simulated image that retains clear texture.

5. The fabric management method based on self-collection according to claim 1, characterized in that, The step of extracting the depth feature vector of the simulated image and associating it with fabric identification information and storing it in the feature database to support content-based image retrieval specifically includes: The simulated image is input into a pre-trained convolutional neural network model; Obtain the feature map of at least one intermediate convolutional layer in the convolutional neural network; A global average pooling operation is performed on the feature map, and the pooled feature tensor is flattened to form the depth feature vector.

6. The fabric management method based on self-collection according to claim 5, characterized in that, The step of obtaining the feature map of at least one intermediate convolutional layer in the convolutional neural network specifically includes: The simulated image is input into a pre-trained convolutional neural network for forward propagation, activating and extracting the feature map output of a specified intermediate convolutional layer; Based on the texture characteristics of the fabric sample, an adaptive combination of intermediate convolutional layers for feature fusion is selected, wherein samples with complex textures are assigned higher weights to lower-level feature maps, and samples with uniform color are assigned higher weights to higher-level feature maps.

7. A fabric retrieval method, characterized in that, The fabric retrieval method includes: Receive the query image; Obtain the query feature vector of the query image, wherein the query feature vector is obtained using the feature extraction method of the fabric management method based on self-collection as described in any one of claims 1 to 6; Calculate the similarity between the query feature vector and all stored feature vectors in the feature database; Sort by similarity and return at least one fabric identification information and its corresponding simulated image that is most similar.

8. The fabric retrieval method according to claim 7, characterized in that, The calculation of the similarity between the query feature vector and all feature vectors stored in the feature database specifically includes: The initial similarity between the query feature vector and a feature vector in the database is calculated using the cosine similarity algorithm. Based on the color histograms of the query image and the original images in the database, the Bach coefficient of the color histograms is calculated as the color distribution similarity. The initial similarity and color distribution similarity are weighted and fused to obtain the final comprehensive similarity.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the self-collection-based fabric management method as described in any one of claims 1 to 6, or implements the steps of the fabric retrieval method as described in any one of claims 7 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the self-collection-based fabric management method as described in any one of claims 1 to 6, or implements the steps of the fabric retrieval method as described in any one of claims 7 to 8.