A color calibration and conversion method and system
By constructing a neural network mapping model for color feature extraction and fusion, and combining confidence level and color difference determination, the problem of low efficiency and poor consistency of traditional color management methods in the textile industry is solved. This achieves high-precision color conversion and robustness, meeting the high-precision requirements of the textile industry.
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-05-29
Smart Images

Figure CN122115593A_ABST
Abstract
Description
Technical Field
[0001] This application relates to technical issues of color management in the textile industry, and in particular to a color calibration and conversion method and system. Background Technology
[0002] With the rapid development of the textile, dyeing, and apparel e-commerce industries, the accurate acquisition and digital presentation of fabric colors has become a core element affecting product quality control, supply chain collaboration, and end-consumer experience. Traditional color management methods mainly rely on professional color sampling equipment such as spectrophotometers to perform contact measurements on a few representative samples, which has inherent limitations such as low process efficiency and difficulty in meeting the needs of large-scale fabric testing.
[0003] Existing color digitization technologies are mainly divided into two categories: contact measurement relying on professional equipment and non-contact conversion based on ordinary cameras. Although the former has higher accuracy, the equipment is expensive and the operation is complex, making it difficult to deploy on a large scale; although the latter has lower cost and is easy to integrate, it often uses fixed color space conversion formulas and does not take into account the combined effects of differences in imaging equipment, changes in lighting conditions, and the characteristics of fabric materials, resulting in serious inaccuracies in color reproduction in practical applications.
[0004] However, simple mathematical conversion models cannot construct a stable mapping relationship from the RGB space of general imaging devices to the standard LAB color space. They are not adaptable to multiple source devices, changing environments and diverse materials. Significant deviations are prone to occur in the color transfer process across platforms and scenarios, making it difficult to meet the textile industry's high-precision color management requirements of ΔE < 2.0. Summary of the Invention
[0005] In view of this, this application provides a color calibration and conversion method and system. By constructing a neural network mapping model based on multi-source sample learning, it achieves high-precision adaptive conversion from general imaging devices to standard color spaces, improves the accuracy and environmental robustness of color digitization, and solves the technical problems of low efficiency, strong device dependence and poor cross-scene consistency of traditional methods.
[0006] This application provides a color calibration and conversion method and system, which adopts the following technical solution: A color calibration and conversion method, comprising: Receive image acquisition data of the target fabric, extract features from the image acquisition data, and obtain RGB color features and fabric type features; Based on RGB color features and fabric type features, a pre-set neural network mapping model is used to identify and obtain the predicted LAB color value and the corresponding prediction confidence level. The predicted color difference value is obtained based on the predicted LAB color value and the standard LAB color value; The predicted confidence level is compared with the preset confidence threshold, and the predicted color difference value is compared with the preset color difference tolerance threshold. If the prediction confidence level is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold, then the predicted LAB color value will be used as the final color output result.
[0007] By employing the above technical solution, feature extraction is performed on image acquisition data to obtain multi-dimensional feature representations containing color information and material properties. Then, a neural network mapping model is used to learn the non-linear mapping relationship from RGB to LAB from the multi-dimensional features, achieving high-precision color space conversion and simultaneously outputting prediction confidence. Furthermore, through color difference calculation and a dual threshold comparison mechanism, the reliability of the prediction results is verified and quality is controlled. The color result is only output when both the confidence and color difference meet the preset standards. This effectively controls the output quality while ensuring the accuracy of color conversion, realizing high-precision adaptive conversion from general imaging equipment to standard color space. This improves the accuracy and environmental robustness of color digitization and solves the technical problems of low efficiency, strong equipment dependence, and poor cross-scene consistency of traditional methods.
[0008] Preferably, feature extraction is performed on the image acquisition data to obtain RGB color features and fabric type features, including: The image acquisition data is preprocessed to obtain the fabric color image; The color image of the fabric is extracted to obtain the color histogram and surface texture information; The RGB color features are obtained by calculation based on the color histogram; Material classification is performed based on surface texture information to obtain fabric type characteristics.
[0009] By adopting the above technical solution, the original image data is systematically preprocessed and feature layered extraction is performed to obtain a pure fabric color image, eliminate background interference, and then the color distribution characteristics are quantified by color histogram analysis to obtain accurate RGB color features. At the same time, the fabric material type is accurately identified by extracting and classifying surface texture information, thereby realizing the separation and representation of color information and material features, and enhancing the adaptability to different fabric materials during the color conversion process.
[0010] Preferably, the image acquisition data is preprocessed to obtain a fabric color image, including: The image acquisition data is converted to a standard RGB color space. The standard RGB color space is normalized to obtain a balanced lighting image. Image segmentation is performed on the image under uniform illumination to extract the effective color region of the target fabric as the fabric color image.
[0011] By adopting the above technical solution, the influence of equipment differences on color representation is eliminated through color space standardization, and the interference of ambient light changes on color acquisition is reduced through illumination normalization. Finally, the effective color area of the fabric is extracted through precise image segmentation to eliminate background noise interference, thereby obtaining a pure and standardized fabric color image, which improves the stability and repeatability of color features.
[0012] Preferably, feature extraction is performed on the image acquisition data to obtain RGB color features and fabric type features, and then the process further includes: An initial neural network model is constructed, and the network weights of the initial neural network model are initialized using the He normal initialization method; Obtain a training dataset containing multiple sets of training samples, and divide the training dataset into a training subset and a validation subset; each set of training samples includes RGB color features, fabric type features, and standard LAB color values; Based on the training subset, the initial neural network model is iteratively trained, and the training LAB color values are obtained through forward propagation. Calculate the loss function value between the training LAB color values and the corresponding standard LAB color values; Based on the loss function value, the network weights of the initial neural network model are updated using the backpropagation algorithm to obtain the intermediate neural network model; Based on the validation subset, the intermediate neural network model is calculated to obtain the validation LAB color value; The verification color difference value is obtained by calculating the verification LAB color value and the corresponding standard LAB color value; The average color difference is obtained by averaging all verified color difference values. If the average color difference is lower than the preset accuracy threshold, training will stop, and the intermediate neural network model will be used as the preset neural network mapping model.
[0013] By adopting the above technical solution, a neural network mapping model for color conversion was constructed. The He initialization method was used to ensure the stability of model training. The reasonable division of the training set and validation set enabled effective monitoring of model performance. The average color difference was used as the key evaluation index and a precision threshold was set to control the training termination condition. In this way, a high-performance model that can accurately complete the mapping from RGB features to LAB color space was trained, which solved the problems of insufficient accuracy and strong equipment dependence of traditional mathematical conversion methods.
[0014] Preferably, the pre-defined neural network mapping model includes an input layer, an embedding layer, a feature fusion layer, multiple hidden layers, and an output layer; Based on RGB color features and fabric type features, a pre-defined neural network mapping model is used for identification to obtain predicted LAB color values and corresponding prediction confidence levels, including: The input layer receives RGB color features and fabric type features to obtain the original input vector; The RGB color features in the original input vector are embedded and mapped in a high-dimensional manner through an embedding layer to generate a color feature vector. The material feature vector is generated by performing category embedding mapping on the fabric type features in the original input vector through the embedding layer. The color feature vector and the material feature vector are weighted and fused through a feature fusion layer to generate a fused feature vector; By performing layer-by-layer nonlinear transformation and feature extraction on the fused feature vector through multiple hidden layers, a joint feature representation is obtained. The predicted LAB color value is obtained by performing linear regression calculation on the joint feature representation through the output layer; The prediction confidence is calculated based on the activation response distribution of at least one of the multi-layer hidden layers.
[0015] By adopting the above technical solution, high-dimensional mapping of color features and material features is performed through the embedding layer to fully explore the deep representation of different features. The feature fusion layer realizes the effective fusion of color and material information. Then, nonlinear transformation is performed through multiple hidden layers to learn complex color space mapping relationships. Finally, the LAB color value is obtained by direct regression through the output layer, and the prediction confidence is calculated by combining the activation distribution of the hidden layer. This achieves interpretable control of the color conversion process, improves the model's adaptability to different fabric materials and textures, and solves the problems of sensitivity to material differences and insufficient conversion accuracy of traditional methods.
[0016] Preferably, the predicted confidence level is compared with a preset confidence threshold, and the predicted color difference value is compared with a preset color difference tolerance threshold. The method further includes: If the prediction confidence level is lower than the preset confidence threshold, or the predicted color difference value is higher than the preset color difference tolerance threshold, the predicted LAB color value will be corrected using the preset color correction rule.
[0017] By adopting the above technical solution and introducing a dual judgment mechanism based on confidence level and color difference, it is possible to identify and screen samples that may have deviations in the prediction results. When the prediction results do not meet the preset quality standards, the color correction process is triggered, and the abnormal prediction values are corrected in a targeted manner using preset rules. This reduces color conversion errors caused by factors such as environmental changes, equipment differences, or material characteristics, improves the stability and reliability of the system output, and ensures that the final color results always meet the requirements of professional-grade color accuracy.
[0018] Preferably, the predicted LAB color value is corrected using a preset color correction rule, including: Extract illumination condition parameters from image acquisition data; Based on the fabric type characteristics and lighting condition parameters, the fabric-lighting compensation rule is obtained by matching it with the preset color correction rule. Numerical compensation is performed on the predicted LAB color value according to the fabric-lighting compensation rule to generate the corrected LAB color value; The second confidence level is obtained by calculating based on the fabric-light compensation rule and light condition parameters. The second confidence level is compared with the preset confidence threshold; If the second confidence level is higher than the preset confidence threshold, the corrected LAB color value will be updated to the final color output result.
[0019] By adopting the above technical solution, the lighting conditions and fabric material characteristics of the actual collection environment are comprehensively analyzed, and targeted color compensation rules are dynamically matched and applied to achieve effective correction of abnormal prediction results. At the same time, a second confidence evaluation mechanism based on rule matching degree is introduced to verify the correction results a second time, ensuring that the corrected color output meets the quality requirements, thereby improving the accuracy and adaptability of color conversion under different lighting conditions and fabric materials.
[0020] A color calibration and conversion system, comprising: The feature extraction module is used to receive image acquisition data of the target fabric, extract features from the image acquisition data, and obtain RGB color features and fabric type features. The color recognition module is used to identify LAB color values and corresponding prediction confidence levels based on RGB color features and fabric type features through a preset neural network mapping model. The color difference calculation module is used to obtain the predicted color difference value based on the predicted LAB color value and the standard LAB color value; The comparison and verification module is used to compare the predicted confidence level with the preset confidence threshold and the predicted color difference value with the preset color difference tolerance threshold. The result decision module is used to take the predicted LAB color value as the final color output result if the prediction confidence is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold.
[0021] By adopting the above technical solution, the feature extraction module focuses on the separation and extraction of color and material features, the color recognition module completes high-precision color space conversion and confidence assessment, the color difference calculation module provides objective quality evaluation indicators, the comparison and verification module establishes a dual quality control mechanism, and the result decision module ensures that the final output meets professional-grade standards. This achieves high-precision adaptive conversion from general imaging equipment to standard color space, improves the accuracy and environmental robustness of color digitization, and solves the technical problems of low efficiency, strong equipment dependence and poor cross-scene consistency of traditional methods.
[0022] An electronic device includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform steps of a color calibration and conversion method.
[0023] A computer-readable storage medium having a computer program stored thereon, which, when executed, implements a color calibration and conversion method.
[0024] In summary, this application includes at least one of the following beneficial technical effects: 1. Receive image acquisition data of the target fabric, extract features from the image acquisition data to obtain RGB color features and fabric type features. Based on the RGB color features and fabric type features, identify the fabric using a preset neural network mapping model to obtain the predicted LAB color value and corresponding prediction confidence. Based on the predicted LAB color value and the standard LAB color value, obtain the predicted color difference value. Compare the prediction confidence with a preset confidence threshold and the predicted color difference value with a preset color difference tolerance threshold. If the prediction confidence is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold, then the predicted LAB color value is used as the final color output result. By constructing an end-to-end color digitization processing flow, fusing color and material features to achieve multi-dimensional representation, utilizing a neural network model to achieve high-precision nonlinear mapping, and introducing a dual verification mechanism based on confidence and color difference to control the quality of prediction results, this method achieves high-precision adaptive conversion from general imaging equipment to standard color space, improves the accuracy and environmental robustness of color digitization, and solves the technical problems of low efficiency, strong equipment dependence, and poor cross-scene consistency of traditional methods. 2. By introducing a dynamic color correction mechanism based on fabric material characteristics and lighting conditions, the corresponding color compensation rules are automatically matched and applied when the prediction results do not meet the quality requirements, so as to achieve targeted correction of abnormal prediction values. The correction results are then verified by combining the second confidence level assessment, which improves the accuracy and stability of color reproduction under different environmental conditions and fabric materials, and reduces color deviation caused by environmental interference and material differences. 3. By designing a dedicated neural network structure that includes an embedding layer, a feature fusion layer, and multiple hidden layers, and by adopting a systematic training process and a precision control strategy based on color difference index, a high-performance mapping model for fabric color conversion is constructed. This model can effectively learn the complex nonlinear relationship from the general camera RGB space to the standard LAB color space, achieving accurate color conversion across devices and scenarios. It reaches the measurement accuracy level of professional color pickers (ΔE < 2.0), significantly reducing the dependence of color digitization on professional hardware equipment. Attached Figure Description
[0025] Figure 1 This is a flowchart of the steps of a color calibration and conversion method provided in an embodiment of this application.
[0026] Figure 2 This is a structural block diagram of a color calibration and conversion system provided in an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. It should be noted that in the optional embodiments of this application, the object information and other related data involved require the permission or consent of the object when the embodiments of this application are applied to specific products or technologies, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. That is to say, if the embodiments of this application involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of relevant departments, and in compliance with relevant laws, regulations, and standards. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject is required, and the embodiments also need to be implemented with the authorization and consent of the object.
[0028] This application discloses a color calibration and conversion method and system. Those skilled in the art will understand that this technical solution possesses high flexibility and scalability, adaptable to various software and hardware platforms and industrial application scenarios, forming a complete digital solution from data acquisition to color management. Specifically, its industrial implementation may cover, but is not limited to, the following models: Cloud service model: The trained neural network mapping model is deployed on a cloud server. Clients upload fabric image data through a browser or application programming interface (API). The cloud service performs high-precision color calculation and calibration, and returns standard LAB color values and related reports. This model facilitates centralized maintenance and updates of the model, as well as color data collaboration among various links in the supply chain.
[0029] Edge and mobile computing modes: By lightweighting the core neural network model (e.g., applying knowledge distillation, weight quantization, or network pruning techniques), lightweight models suitable for smartphones, tablets, or embedded industrial devices can be generated. Users can use mobile device cameras to collect and convert fabric colors in real time in environments without a network connection, meeting the high real-time requirements of scenarios such as rapid on-site quality inspection and outdoor sampling.
[0030] System Integration Mode: This solution can provide standardized application programming interfaces or color data output functions (such as supporting XML, JSON format or ICC configuration files), thereby seamlessly integrating with widely used color management software in the industry (such as Pantone Live, Color iQC), enterprise resource planning systems, product lifecycle management systems and computer-aided design software, etc., to realize the automated flow and consistency management of color data in the entire process of clothing design, fabric production, quality control and e-commerce.
[0031] Cross-platform support: To facilitate global deployment and application, this solution supports major operating system platforms including Windows, Linux, macOS, iOS, and Android, and provides multi-language user interface support. Furthermore, its software development kit supports multiple programming languages such as Python, C++, Java, and C#, allowing developers to easily integrate it into various customized industrial applications or automated production lines.
[0032] The technical solution of this application will be further described in detail below through specific embodiments. It should be understood that the embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Example 1
[0033] Please see Figure 1 This application provides a color calibration and conversion method, comprising: Step 101: Receive image acquisition data of the target fabric, extract features from the image acquisition data, and obtain RGB color features and fabric type features.
[0034] The target fabric refers to a flat or curved sample with certain surface texture and color characteristics, including but not limited to various textile fabrics such as cotton, linen, silk, and chemical fibers.
[0035] Image acquisition data refers to digital images containing the target fabric area acquired by general imaging devices such as industrial cameras, mobile phone cameras, or scanners under natural light or standard light sources. Preferably, the image acquisition data in this application can be in RGB format or a multispectral image.
[0036] RGB color features refer to the quantitative features extracted from fabric color images that characterize the color distribution.
[0037] Fabric type characteristics refer to the features that characterize the material category and surface texture attributes of a fabric, and are used to distinguish the influence of different materials on color presentation.
[0038] Preferably, step 101 includes the following sub-steps: S11. Preprocess the image acquisition data to obtain the fabric color image.
[0039] Preferably, the pretreatment process can be: The image acquisition data is converted to a standard RGB color space. The standard RGB color space is normalized to obtain a balanced lighting image. Image segmentation is performed on the image under uniform illumination to extract the effective color region of the target fabric as the fabric color image.
[0040] In this embodiment, image data from different devices are uniformly converted to the standard RGB color space to eliminate differences in device color response. Then, the grayscale world method illumination normalization algorithm is used to reduce the impact of ambient illumination non-uniformity on color acquisition. Finally, an image segmentation method based on edge detection or semantic segmentation is used to accurately extract the effective area of the fabric, remove background interference, and obtain the fabric color image.
[0041] S12. Extract the fabric color image to obtain the color histogram and surface texture information.
[0042] A color histogram is a multidimensional frequency distribution map obtained by statistically calculating the distribution of RGB three-channel color values in a fabric color image. It reflects the pixel distribution pattern of the fabric in the red, green, and blue color components.
[0043] Surface texture information refers to a set of feature data extracted through image analysis technology that characterizes the microstructure, texture direction, luster properties, and material type of a fabric surface, enabling objective differentiation between different fabric materials such as cotton, linen, silk, and synthetic fibers. Surface texture information includes, but is not limited to, surface structure, luster, and material properties.
[0044] In this embodiment, a color histogram is calculated on the fabric color image, and the distribution statistical features of the RGB three channels are extracted as a color histogram to characterize the color distribution characteristics of the fabric in the three dimensions of red, green and blue. At the same time, a local binary mode is used to encode the local texture structure of the image to obtain a texture feature descriptor that characterizes the microstructure of the fabric surface, thereby obtaining fabric texture information. This achieves an objective and repeatable digital representation of the fabric material properties and effectively supports the adaptive processing of different fabric materials during the color conversion process.
[0045] S13. Calculate the RGB color features based on the color histogram.
[0046] In this embodiment of the application, by calculating the statistical moments of each channel in the color histogram, including the first moment (mean), the second moment (variance) and the third moment (skewness), the color distribution characteristics are transformed into a multi-dimensional numerical feature vector, thereby obtaining RGB color features that can comprehensively characterize the color distribution of the fabric.
[0047] S14. Based on surface texture information, classify materials to obtain fabric type characteristics.
[0048] In this embodiment, surface texture information is input into a pre-trained material classifier for identification. Based on the texture features, it can accurately distinguish common fabric material types such as cotton, linen, silk, and chemical fibers, and output the corresponding fabric type code or probability distribution vector to form structured fabric type features.
[0049] Preferably, the material classifier can be built based on a convolutional neural network or a vector machine; no specific limitation is made here.
[0050] Step 102: Based on RGB color features and fabric type features, the predicted LAB color value and corresponding prediction confidence level are obtained by using a preset neural network mapping model.
[0051] The preset neural network mapping model refers to a machine learning model built on deep neural networks that can learn complex nonlinear mapping relationships from RGB color features and fabric type features to standard LAB color values, and has the ability to convert colors under multiple materials and lighting conditions.
[0052] LAB color values refer to three-dimensional coordinates in a color space defined by the International Commission on Illumination (CIE) based on the characteristics of human visual perception. The L component represents lightness, with a value ranging from 0 (black) to 100 (white); the a component represents red-green hue, with positive values leaning towards red and negative values leaning towards green; and the b component represents yellow-blue hue, with positive values leaning towards yellow and negative values leaning towards blue.
[0053] Confidence level refers to the quantitative index of the certainty of a neural network model regarding the current prediction result. It is calculated by analyzing the activation response distribution of the hidden layers inside the model. The value ranges from 0 to 1. The higher the value, the more confident the model is in the prediction result, and the lower the value, the greater the uncertainty of the prediction result.
[0054] Preferably, the preset neural network mapping model can be obtained by the following steps: An initial neural network model is constructed, and the network weights of the initial neural network model are initialized using the He normal initialization method; Obtain a training dataset containing multiple sets of training samples, and divide the training dataset into a training subset and a validation subset; each set of training samples includes RGB color features, fabric type features, and standard LAB color values; Based on the training subset, the initial neural network model is iteratively trained, and the training LAB color values are obtained through forward propagation. Calculate the loss function value between the training LAB color values and the corresponding standard LAB color values; Based on the loss function value, the network weights of the initial neural network model are updated using the backpropagation algorithm to obtain the intermediate neural network model; Based on the validation subset, the intermediate neural network model is calculated to obtain the validation LAB color value; The verification color difference value is obtained by calculating the verification LAB color value and the corresponding standard LAB color value; The average color difference is obtained by averaging all verified color difference values. If the average color difference is lower than the preset accuracy threshold, training will stop, and the intermediate neural network model will be used as the preset neural network mapping model.
[0055] In this embodiment, a deep neural network architecture comprising an input layer, an embedding layer, a feature fusion layer, multiple hidden layers, and an output layer is constructed. The He normal initialization method is used to assign a reasonable initial distribution to the network weights, ensuring stable convergence during training. During training, predicted values are calculated using forward propagation based on a training subset. Mean squared error is used as the loss function to measure the difference between the predicted and standard values. The network parameters are iteratively optimized using a backpropagation algorithm to obtain an intermediate neural network model. In the validation phase, the average color difference of the model output is calculated using the validation subset as the core evaluation metric. This metric objectively quantifies the color conversion accuracy of the model in practical applications. When the average color difference reaches a preset accuracy threshold (e.g., ΔE < 2.0), the model is deemed to meet professional-grade color management requirements. Training is terminated, and the model parameters are fixed, ultimately obtaining a preset neural network mapping model capable of accurately achieving high-precision conversion from the RGB space of general imaging devices to the standard LAB color space.
[0056] More preferably, in order to improve the generalization ability and robustness of the model, the training dataset is a multi-source heterogeneous image dataset constructed based on multiple standard physical color card sample libraries: Under standard lighting conditions, different models of industrial cameras and smartphone cameras are used to collect images of standard color card samples covering 12 materials in four major categories: cotton, linen, silk and chemical fiber, from multiple angles and distances. Each sample is captured under three different angles (0°, 45°, 90°) and two distances (30cm, 60cm). Simultaneously, the standard LAB value of the corresponding area is measured using an X-Rite i1 Pro professional colorimeter. Finally, a standardized training dataset containing more than 2,000 paired samples and covering a wide range of equipment types and fabric materials is constructed.
[0057] When constructing the training dataset, to ensure the model's universality, the number of samples should be between 200 and 1000 paired samples, preferably more than 500. The acquisition process needs to cover a wide range of imaging devices and acquisition conditions: in addition to industrial cameras and smartphones, it should also include various general imaging devices such as tablet cameras and webcams; in addition to standard light source boxes, lighting conditions should also include common ambient light such as simulated natural light and indoor fluorescent lights; in addition to 0°, 45°, and 90°, a slight tilt angle of ±15° can be added to simulate the slight deviation of handheld shooting; the acquisition distance can be sampled at 10cm intervals within the range of 30cm to 100cm.
[0058] To further enhance data diversity and improve the model's robustness to imaging noise, a systematic data augmentation process is implemented before inputting image data into the training process. This includes: Geometric transformation: Randomly flip the original fabric image horizontally / vertically (probability 0.5), rotate it slightly (within ±5°), and translate it (within ±5% pixels).
[0059] Color perturbation: Within the RGB color space, small random perturbations (within ±10%) are applied to the overall brightness, contrast, and saturation of the image to simulate subtle differences in color response across different devices.
[0060] Noise injection: Add low-level Gaussian noise (standard deviation σ in the range of 0.01 to 0.05) to the image to simulate sensor noise.
[0061] Simulate uneven lighting: Apply a radial gradient filter to simulate a slight light attenuation effect at the edges of the image.
[0062] All augmentation operations are generated online in real time during the preprocessing stage and together with the standard LAB values corresponding to the original samples, they constitute the amplified training samples. This significantly expands the data distribution coverage of the training data without increasing the physical acquisition cost, thereby enhancing the model's adaptability to real-world complex scenarios.
[0063] During training, to improve model training efficiency and ensure performance reliability, the training dataset is divided into a training subset, a validation subset, and a test subset in a 7:1.5:1.5 ratio. The training subset is used for learning and optimizing model parameters; the validation subset is used for hyperparameter tuning and early stopping detection during training; and the test subset serves as an independent benchmark for evaluating the final model performance, avoiding performance misjudgments due to data partitioning bias.
[0064] It should be noted that, in order to more accurately measure color differences and improve the model's ability to distinguish subtle color differences, the loss function uses a weighted combination of mean squared error and CIEDE2000 color difference. In the early stages of training, mean squared error is used primarily to promote rapid convergence; after a certain number of training epochs, the weight of CIEDE2000 color difference is gradually increased to make the model training more consistent with the characteristics of human visual perception, especially focusing on improving the recognition accuracy of subtle color differences with ΔE values below 2.0.
[0065] For example, in a training process with a total of 800 rounds, the first 200 rounds used a pure mean squared error loss function to quickly reduce the overall prediction error. From rounds 201 to 400, a linear transition strategy was adopted, gradually increasing the weight of CIEDE2000 color difference from 0 to 0.5, forming a 1:1 weighted combination with the mean squared error. After round 401, the weight of CIEDE2000 color difference was increased to 0.8, focusing on optimizing the prediction accuracy for color regions sensitive to human vision. Experiments showed that the model using this dynamic weighting strategy reduced the average ΔE value on the test set by 15% compared to the model using only mean squared error, and improved the pass rate by 8 percentage points for ΔE < 2.0.
[0066] Preferably, to prevent the model from overfitting the training data and improve training efficiency, a multi-level early stopping monitoring mechanism is introduced during training. In addition to monitoring whether the validation loss has not decreased for a set number of rounds, the mechanism also monitors multiple indicators such as the average ΔE value of the validation set and the color difference performance of key color regions (such as skin color, common clothing colors, etc.). When any key indicator fails to improve within a set number of rounds, early stopping is triggered to prevent the model from getting stuck in local optima.
[0067] Example: In a multi-level early shutdown monitoring mechanism, the following three parallel monitoring channels are set up: 1) Verification loss monitoring channel: Early stop is triggered when the verification loss fails to decrease for 50 consecutive rounds; 2) Average ΔE monitoring channel: Early stop is triggered when the average ΔE does not decrease for 30 consecutive rounds; 3) Key Color Area Monitoring Channel: For 5 key colors (skin tone, denim blue, classic black, bright red, olive green), early stop is triggered when the ΔE value of any 3 of these colors does not improve for 40 consecutive rounds.
[0068] Training stops immediately when any one of the three channels meets the trigger condition.
[0069] Meanwhile, in order to balance the model's convergence speed and final accuracy, while considering the changing trend of the validation loss, the decay rate is dynamically adjusted in combination with factors such as the current training round and the model's convergence status. An adaptive learning rate adjustment strategy is adopted: a larger decay rate is used in the early stage of training to accelerate the adjustment, while a smaller decay rate is used in the later stage of training for fine-tuning. A minimum learning rate threshold is set when the model is close to convergence to prevent the learning rate from being too small and causing training to stagnate.
[0070] Example: In adaptive learning rate adjustment, a three-stage adjustment strategy can be set: 1) During the first 300 training rounds, if the validation loss does not improve for 15 consecutive rounds, the learning rate decreases by 0.6 times; 2) Train for 301-600 rounds. When the validation loss does not improve for 20 consecutive rounds, the learning rate decreases by 0.5 times. 3) After 600 training rounds, if the validation loss does not improve for 25 consecutive rounds, the learning rate is reduced by 0.3 times. At the same time, the minimum learning rate threshold is set to 0.0001 to prevent insufficient gradient updates due to an excessively small learning rate.
[0071] It is worth mentioning that an intelligent weight management strategy is implemented in the model selection and storage mechanism. In addition to continuously storing the model weights that perform best on the validation set, model weights that have performed well on specific materials (such as silk, high-gloss fabrics, and other difficult-to-process materials) in recent rounds are also stored. When finally deployed, the most suitable model version can be selected according to the specific application scenario requirements to ensure the optimal performance of the model in actual applications.
[0072] Preferably, the preset neural network mapping model includes an input layer, an embedding layer, a feature fusion layer, multiple hidden layers, and an output layer. Step 102 includes the following sub-steps: S21. The input layer receives RGB color features and fabric type features to obtain the original input vector.
[0073] In this embodiment, the input layer adopts a basic structure design with three neurons, which correspond to the R (red), G (green), and B (blue) color channels of the RGB color feature, respectively. When the fabric type feature is received, it is first processed by one-hot encoding to generate a fixed-dimensional encoding vector. Then, the fixed-dimensional encoding vector is concatenated with the RGB color feature to form an extended original input vector, ensuring that feature data of different types and sources can be uniformly received and standardized.
[0074] S22. The RGB color features in the original input vector are embedded and mapped in a high-dimensional way through the embedding layer to generate a color feature vector.
[0075] In this embodiment, the embedding layer includes a fully connected hidden layer with 128 neurons, which uses the ReLU (Rectified Linear Unit) activation function for nonlinear transformation.
[0076] Specifically, the embedding layer maps the original 3D RGB color features to a 128-dimensional high-dimensional feature space through linear transformation and nonlinear activation. This not only increases the dimensionality of the features but also achieves high-level abstraction and representation learning of color features through learned weight parameters. By mapping the low-dimensional color space to the high-dimensional feature space, the model can capture complex nonlinear relationships between colors, especially significantly improving its sensitivity to subtle changes such as color gradations and color shifts, thereby enhancing the discriminative and expressive capabilities of color features.
[0077] S23. The fabric type features in the original input vector are embedded and mapped by the embedding layer to generate the material feature vector.
[0078] In this embodiment, the embedding layer sets a learnable embedding matrix for fabric type features.
[0079] Specifically, the embedding matrix maps discrete categorical variables representing fabric materials (such as cotton, linen, silk, and synthetic fibers) into a 64-dimensional continuous dense vector through table lookup and linear transformation. This not only completes the conversion from symbolic categories to numerical vectors but also enables the embedding matrix to automatically learn the relative positions and semantic relationships of different materials in the feature space during training through backpropagation and weight updates: materials with similar visual or physical properties (such as cotton and linen) are closer in cosine distance in the embedding space, while materials with significantly different properties (such as cotton and synthetic fibers) are farther apart. Thus, the obtained material feature vectors not only contain the category information of the materials themselves but also imply the similarity relationships between materials, providing structured and quantifiable prior knowledge of materials for subsequent color conversion.
[0080] S24. The color feature vector and the material feature vector are weighted and fused through the feature fusion layer to generate a fused feature vector.
[0081] In the embodiments of this application, the feature fusion layer adopts a dynamic feature fusion strategy based on an attention mechanism.
[0082] Preferably, the feature fusion layer first calculates the attention scores of the color feature vector and the material feature vector respectively through the weight generation network, and then normalizes the scores to the corresponding dynamic fusion weights through the softmax function. Then, the two feature vectors are weighted and summed according to the weights, so that the feature contribution ratio can be adaptively adjusted according to the specific characteristics of the input sample: for fabrics with complex textures, the weight of the material feature is automatically increased, and for fabrics with rich colors, the weight of the color feature is increased, thereby realizing the intelligent collaboration and optimized fusion of color information and material information, providing a highly discriminative joint feature representation for subsequent accurate color mapping.
[0083] S25. By performing layer-by-layer nonlinear transformation and feature extraction on the fused feature vector through multiple hidden layers, a joint feature representation is obtained.
[0084] In this embodiment, the multi-layer hidden layer adopts a four-layer progressive depth structure. Each layer has specific parameter configuration and functional positioning. Through progressive feature refinement from wide to deep and from concrete to abstract, the deep correlation features between color and material can be effectively extracted. This makes the final joint feature representation not only contain the surface color numerical information, but also contain the inherent influence of material on color performance.
[0085] Specifically, the four hidden layers are as follows: The first hidden layer has 128 neurons and uses the ReLU activation function for non-linear transformation. L2 regularization (penalty coefficient λ=0.001) is applied to prevent overfitting. This layer is followed by a batch normalization layer (momentum parameter set to 0.99, minimum constant ε=1e-3) to accelerate training convergence and stabilize gradients, and a Dropout layer (dropout rate set to 0.3) to improve the model's generalization ability.
[0086] The second hidden layer expands to 256 neurons, also using the ReLU activation function and L2 regularization (λ=0.001), and is configured with batch normalization and Dropout layers with the same parameters to further extract and combine higher-order features.
[0087] The third hidden layer has 128 neurons and uses the ReLU activation function. It is mainly responsible for feature refinement and information compression.
[0088] The fourth hidden layer consists of 64 neurons, using the ReLU activation function to achieve the final feature dimensionality reduction and abstract representation.
[0089] Through sequential processing of four hidden layers, the model can perform multi-level transformations on the fused features from broad to deep and from concrete to abstract, gradually eliminating redundant information and strengthening discriminative features, ultimately obtaining a joint feature representation that can comprehensively and deeply characterize the complex intrinsic relationship between color and material.
[0090] S26. Perform linear regression calculation on the joint feature representation through the output layer to obtain the predicted LAB color value.
[0091] In this embodiment, the output layer is a fully connected layer with three neurons, corresponding to the L (lightness), A (red-green hue), and B (yellow-blue hue) channels of the LAB color space. When the output layer receives the 64-dimensional joint feature representation from the previous hidden layer, it directly maps it to 3-dimensional LAB color values through a linear transformation. By accurately and continuously converting the complex joint representation in the high-dimensional feature space into color coordinates conforming to the International Commission on Illumination (CIE) standard, end-to-end accurate prediction from image features to professional color values is achieved.
[0092] Preferably, to avoid introducing unnecessary nonlinear interference, the output layer uses a linear activation function to ensure the numerical stability and physical interpretability of color prediction.
[0093] S27. Based on the activation response distribution of at least one of the multi-layer hidden layers, the prediction confidence is calculated.
[0094] Preferably, in this embodiment, the second hidden layer (256 neurons) is selected as the source layer for confidence calculation, and the degree of certainty of the model for the current prediction result is evaluated by statistically analyzing the activation state of the neurons in this layer.
[0095] In this embodiment of the application, the confidence level calculation includes three steps: 1) Calculate the mean activation value of all neurons in this layer to reflect the overall response strength of the model; 2) Calculate the variance of activation values to measure the dispersion of neuron responses; 3) Calculate the entropy value of the activation distribution to assess the uncertainty of the internal state of the model.
[0096] 4) Simultaneously input the mean, variance, and entropy into a small regression network containing two fully connected layers, and output a normalized confidence score between 0 and 1.
[0097] When the activation response is concentrated and stable, the confidence level approaches 1, indicating that the model is highly confident in the prediction results; when the activation response is dispersed and fluctuates greatly, the confidence level approaches 0, suggesting that the prediction results may have large uncertainties.
[0098] Step 103: Based on the predicted LAB color value and the standard LAB color value, obtain the predicted color difference value.
[0099] In this embodiment, the CIEDE2000 color difference formula conforming to the International Commission on Illumination (ICI) standard is used for calculation to obtain a color difference assessment result that is closer to human visual perception. The predicted LAB color value and the standard LAB color value are compared with the standard CIEDE2000 color difference formula, taking into account the difference in lightness, chromaticity, hue, and human visual nonlinearity correction, to calculate a quantified color difference value that accurately reflects the degree of human visual perception of color difference.
[0100] Step 104: Compare the predicted confidence level with the preset confidence threshold, and compare the predicted color difference value with the preset color difference tolerance threshold.
[0101] In this embodiment, the preset confidence threshold refers to a probability threshold value obtained through extensive experimental verification and statistical analysis. It is used to objectively measure the internal certainty of the neural network model for a single color prediction result, and its value range is typically set to 0.70 to 0.90. Preferably, for the high-precision application scenario of textile fabric color conversion, the preset confidence threshold is set to 0.80, that is, when the prediction confidence is higher than this value, the model is considered to have a high degree of certainty about the current prediction.
[0102] The preset color difference tolerance threshold refers to the upper limit of color difference allowed in advance, set according to industry color management standards and actual quality requirements, and is used to determine whether the color conversion result meets the needs of professional applications. In this embodiment, the preset color difference tolerance threshold uses ΔE. 00 <2.0 is used as a judgment standard. This standard meets the general requirements of the textile industry for color consistency and can ensure that the converted color is basically consistent with the original in human visual perception.
[0103] Specifically, the comparison process employs a dual-path parallel synchronous determination mechanism: In the first comparison, the prediction confidence output in step 102 is compared with the preset confidence threshold (preferably 0.80) in real time to determine whether the model's certainty regarding the prediction result has reached the reliability threshold.
[0104] In the second comparison, the predicted color difference value (ΔE) calculated in step 103 is used. 00 ) and preset color difference tolerance threshold (ΔE) 00 <2.0) Perform real-time comparison to evaluate whether the objective accuracy of the color conversion results meets professional quality requirements.
[0105] In this embodiment, after obtaining the predicted LAB color value and its corresponding prediction confidence and predicted color difference value, the aforementioned dual-path parallel comparison process is initiated, simultaneously performing independent judgments in two dimensions: on the one hand, the reliability of the prediction is evaluated based on the internal state of the model; on the other hand, the accuracy of the prediction is verified based on objective measurements. This approach effectively identifies anomalies where, although the model confidence is high (e.g., influenced by specific training samples), the actual color difference exceeds the tolerance. It also distinguishes prediction results with small color differences but high uncertainty in the model itself, thereby increasing the overall robustness and reliability of color output decisions.
[0106] Step 105: If the prediction confidence level is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold, then the predicted LAB color value is used as the final color output result.
[0107] In this application embodiment, the prediction result is deemed reliable and adopted only if both of the following conditions are met simultaneously: 1) Prediction confidence > preset confidence threshold. This condition ensures that the neural network model has sufficiently high internal determinism for its own prediction results, and eliminates unstable outputs caused by fuzzy input features, insufficient model cognition, or being at the decision boundary.
[0108] 2) The predicted color difference value is less than the preset color difference tolerance threshold (2.0). This condition ensures from an objective measurement perspective that the difference between the predicted color and the standard color is within the error range that is acceptable to the human eye and conforms to professional standards.
[0109] In terms of decision-making logic, a logical AND relationship is used to simultaneously verify the two conditions. Only when both conditions are met is the predicted LAB color value generated by step 102 in the current loop determined as a valid and reliable final color output result. Based on this result, a color report is generated, the color matching system is driven, or the digital color card library is updated. This achieves proactive and strict control over the output quality while utilizing the powerful fitting capabilities of deep learning, effectively balancing the efficiency of automated processing with the accuracy requirements of professional applications. Thus, it ensures high reliability of the output results in the color digitization process in textiles, printing and dyeing, and other fields.
[0110] Step 106: If the prediction confidence level is lower than the preset confidence threshold, or the predicted color difference value is higher than the preset color difference tolerance threshold, then the predicted LAB color value is corrected using the preset color correction rule.
[0111] The preset color correction rules refer to a mapping rule library learned from historical error samples, which associates fabric material type, lighting conditions during image acquisition, and the required LAB color compensation value. When the confidence level or color difference of the model's original prediction result does not meet the standard, the most suitable color compensation value can be retrieved from this rule library and applied to correct the original prediction by matching the current fabric type and lighting conditions, thereby improving the color accuracy of the final output.
[0112] Preferably, step 106 includes the following sub-steps: S61. Extract the illumination condition parameters from the image acquisition data.
[0113] Lighting condition parameters refer to the characteristic values that describe the ambient lighting conditions during shooting, obtained by analyzing the overall brightness distribution, shadow features, and color balance information in the image acquisition data.
[0114] In this embodiment, the global grayscale mean of the image is calculated to quantify the light intensity, the distribution difference of the RGB three-channel histogram is analyzed to evaluate the color temperature of the light source (such as being too cool or too warm), and the uniformity of illumination is evaluated by detecting whether there are areas of highlight overflow or shadow accumulation in the image, so as to accurately characterize the actual lighting environment at the time of image acquisition.
[0115] S62. Based on the fabric type characteristics and lighting condition parameters, match them with the preset color correction rules to obtain the fabric-lighting compensation rules.
[0116] The preset color correction rules refer to a set of rules trained in advance using machine learning methods based on massive historical error sample data. These rules describe the amount of compensation required for the original LAB color prediction value under specific fabric materials and lighting conditions. Preferably, this set of rules can be viewed as a conditional lookup table or a lightweight regression model.
[0117] Fabric-lighting compensation rule refers to a specific compensation rule that is retrieved or calculated from a preset set of color correction rules through a matching process and is most suitable for the current input fabric type features and lighting condition parameters. The fabric-lighting compensation rule can apply compensation amounts (ΔL, Δa, Δb) to the L, a, and b channels of the LAB prediction value for the current situation.
[0118] In this embodiment, a feature vector composed of fabric type features and illumination condition parameters is received as input. After nonlinear mapping through two fully connected layers, a matching score with all rule templates in the preset rule library is output. Then, the rule template with the highest matching score is selected as the current fabric-illumination compensation rule.
[0119] In addition, to ensure effective color correction under various unknown combinations of conditions, if all matching degrees are below a preset threshold, interpolation calculation based on adjacent rules is enabled to generate new compensation rules.
[0120] S63. Perform numerical compensation on the predicted LAB color value according to the fabric-lighting compensation rule to generate the corrected LAB color value.
[0121] In this embodiment, a linear compensation operation is performed, and the three-channel compensation amounts determined by the fabric-lighting compensation rule are superimposed on the corresponding channels of the original predicted LAB color values to directly generate the corrected LAB color values.
[0122] It should be noted that the numerical compensation process is essentially a rule-based translation transformation performed in the LAB color space to specifically counteract systematic color deviations introduced by the optical properties of specific fabric materials or specific shooting lighting conditions. This allows for precise fine-tuning based on the model's initial predictions, thereby improving the color fidelity of the final output.
[0123] S64. Calculate the second confidence level based on the fabric-light compensation rule and lighting condition parameters.
[0124] In this embodiment of the application, the second confidence level is calculated by analyzing the degree of matching between the fabric-light compensation rule and the current lighting condition parameters.
[0125] Specifically, the illumination condition parameter vector is first normalized. Then, the cosine similarity between this vector and the standard illumination vector corresponding to the selected fabric-illumination compensation rule is calculated as a measure of directional consistency. Next, the Euclidean distance between the two vectors in the feature space is calculated as a measure of matching distance. Simultaneously, the proportion of successful corrections when applying the compensation rule under the same or similar illumination parameters is statistically analyzed by querying a historical database. Finally, the directional consistency, the reciprocal of the matching distance, and the historical success rate are weighted and fused, then normalized to the 0-1 range using the Sigmoid function to generate the final second confidence score.
[0126] It should be noted that the higher the second confidence level value, the more applicable the currently selected compensation rule is to the actual lighting environment, and the higher the reliability of the color correction result.
[0127] S65. Compare the second confidence level with the preset confidence threshold.
[0128] S66. If the second confidence level is higher than the preset confidence threshold, then update the corrected LAB color value to the final color output result.
[0129] In this embodiment, the second confidence level is compared with a preset confidence threshold in real time. When the second confidence level is greater than or equal to the preset confidence threshold, it is determined that the reliability of the correction result has reached the output standard, and an output update command is triggered. This command controls the output module to write the temporarily stored correction LAB color value into the final output buffer, overwriting the original prediction result. The correction value, the corresponding second confidence level, and the applied compensation rule identifier are packaged as the final color output result. This is used to intelligently remedy the initial prediction when the confidence level or color difference is insufficient, and the reliability of the remedy result is evaluated again using a strict and unified standard. Only when the reliability of the remedy result itself meets the standard is it adopted as the final output. This increases the practicality and robustness of the system while ensuring professional color accuracy.
[0130] It should be noted that if the second confidence level is lower than the preset confidence threshold, steps S61-S65 are repeated until the second confidence level is higher than the preset confidence threshold.
[0131] Preferably, step 106 can also be used as an online monitoring and dynamic optimization step. In addition to the execution step 106 triggered when the prediction confidence is lower than the preset confidence threshold, a timed monitoring task independent of the regular correction process is set up through continuous monitoring and evaluation of the correction process. This task is triggered periodically and performs decision optimization checks regularly, comparing the currently calculated second confidence with the original prediction confidence in real time.
[0132] At this point, if the second confidence level is greater than the predicted confidence level, the corrected LAB color value is immediately overwritten with the original predicted LAB color value and used as the final color output for the current round. This means that even if the original prediction result is determined to need correction in step 104 because the confidence level or color difference does not simultaneously meet the standard, as long as the confidence level of the rule-corrected result itself (the second confidence level) is higher than the confidence level of the original model prediction, the corrected result is considered more reliable than the original prediction, and thus the corrected result is adopted first. By introducing direct competition between the second confidence level and the predicted confidence level, a more reliable output can be adopted in a timely manner when the rule-corrected result shows higher certainty than the original model prediction. This reduces the recognition error rate caused by the high uncertainty of the model's prediction on certain boundary or difficult samples, and improves the accuracy and decision reliability of the final color output result.
[0133] The implementation principle of this application embodiment is as follows: By constructing a complete technical chain from fabric image acquisition and multi-dimensional feature extraction to neural network nonlinear color space mapping, high-precision conversion of RGB data from general imaging devices to professional LAB color space is achieved. Furthermore, a dual threshold verification mechanism is designed to rigorously control the conversion results from two dimensions: internal model confidence and objective color difference. When the initial prediction results fail to meet the standard, a fabric-lighting compensation rule based on historical error learning is introduced for intelligent correction, and a secondary confidence assessment ensures the reliability of the correction results. Finally, a confidence competition mechanism dynamically optimizes the output decision, forming a color calibration and conversion method with self-correction and continuous optimization capabilities. This ensures professional-grade color accuracy while improving the system's adaptability and overall reliability to different devices, lighting conditions, and fabric materials, solving the technical problems of low efficiency, strong device dependence, and poor cross-scene consistency in traditional methods. Example 2
[0134] Please see Figure 2 This application provides a color calibration and conversion system, comprising: The feature extraction module 201 is used to receive image acquisition data of the target fabric, extract features from the image acquisition data, and obtain RGB color features and fabric type features. The color recognition module 202 is used to identify based on RGB color features and fabric type features through a preset neural network mapping model to obtain the predicted LAB color value and the corresponding prediction confidence. The color difference calculation module 203 is used to obtain the predicted color difference value based on the predicted LAB color value and the standard LAB color value; The comparison and verification module 204 is used to compare the predicted confidence level with the preset confidence threshold and to compare the predicted color difference value with the preset color difference tolerance threshold. The result decision module 205 is used to take the predicted LAB color value as the final color output result if the prediction confidence is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold; if the prediction confidence is lower than the preset confidence threshold or the predicted color difference value is higher than the preset color difference tolerance threshold, the predicted LAB color value is corrected by the preset color correction rule.
[0135] Since the above is a system corresponding to a color calibration and conversion method, and its implementation principle is the same as that of a color calibration and conversion method, for the sake of convenience and brevity, those skilled in the art can clearly understand that the specific working process of the system and modules described above can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here. Example 3
[0136] An electronic device according to an embodiment of the present invention includes: a memory and a processor, wherein the memory stores a computer program; when the computer program is executed by the processor, the processor performs a color calibration and conversion method as described in any of the above embodiments.
[0137] The memory can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. The memory has storage space for program code used to perform any of the method steps described above. For example, the storage space for program code may include individual program codes for implementing the various steps in the methods described above. This program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact discs (CDs), memory cards, or floppy disks. The program code may be compressed, for example, in a suitable form. When run by a computing processing device, this code causes the computing processing device to perform the various steps in the methods described above. Example 4
[0138] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed, implements the color calibration and conversion method as described in any embodiment of this invention.
[0139] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0140] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0141] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0142] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0143] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0144] It should be noted that the terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this disclosure.
[0145] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0146] The embodiments described in this specific implementation are preferred embodiments of this application and are not intended to limit the scope of protection of this application. Identical components are represented by the same reference numerals. Therefore, all equivalent changes made to the structure, shape, and principle of this application should be covered within the scope of protection of this application.
Claims
1. A color calibration and conversion method, characterized in that, include: Receive image acquisition data of the target fabric, extract features from the image acquisition data, and obtain RGB color features and fabric type features; Based on the RGB color features and the fabric type features, a preset neural network mapping model is used for identification to obtain the predicted LAB color value and the corresponding prediction confidence level. Based on the predicted LAB color value and the standard LAB color value, the predicted color difference value is obtained; The predicted confidence level is compared with a preset confidence threshold, and the predicted color difference value is compared with a preset color difference tolerance threshold. If the predicted confidence level is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold, then the predicted LAB color value is used as the final color output result.
2. The color calibration and conversion method according to claim 1, characterized in that, The step of extracting features from the acquired image data to obtain RGB color features and fabric type features includes: The image acquisition data is preprocessed to obtain a fabric color image; The color image of the fabric is extracted to obtain a color histogram and surface texture information; RGB color features are obtained by calculating based on the color histogram. Material classification is performed based on the surface texture information to obtain fabric type characteristics.
3. The color calibration and conversion method according to claim 2, characterized in that, The preprocessing of the acquired image data to obtain the fabric color image includes: The image acquisition data is converted to a standard RGB color space. The standard RGB color space is subjected to illumination normalization processing to obtain a balanced illumination image; The balanced illumination image is segmented to extract the effective color region of the target fabric as the fabric color image.
4. The color calibration and conversion method according to claim 1, characterized in that, The step of extracting features from the acquired image data to obtain RGB color features and fabric type features, followed by: An initial neural network model is constructed, and the network weights of the initial neural network model are initialized using the He normal initialization method; Obtain a training dataset containing multiple sets of training samples, and divide the training dataset into a training subset and a validation subset; wherein each set of training samples includes RGB color features, fabric type features, and standard LAB color values; Based on the training subset, the initial neural network model is iteratively trained, and the training LAB color values are obtained through forward propagation. Calculate the loss function value between the training LAB color value and the corresponding standard LAB color value; Based on the loss function value, the network weights of the initial neural network model are updated using the backpropagation algorithm to obtain the intermediate neural network model; Based on the verification subset, the intermediate neural network model is calculated to obtain the verification LAB color value; The verification LAB color value and the corresponding standard LAB color value are calculated to obtain the verification color difference value; The average color difference is obtained by averaging all the verified color difference values. If the average color difference is lower than a preset accuracy threshold, training is stopped, and the intermediate neural network model is used as the preset neural network mapping model.
5. The color calibration and conversion method according to claim 1, characterized in that, The preset neural network mapping model includes an input layer, an embedding layer, a feature fusion layer, multiple hidden layers, and an output layer; The step of identifying the predicted LAB color value and corresponding prediction confidence level based on the RGB color features and the fabric type features through a preset neural network mapping model includes: The input layer receives the RGB color features and the fabric type features to obtain the original input vector; The embedding layer performs high-dimensional embedding mapping on the RGB color features in the original input vector to generate a color feature vector. The embedding layer performs category embedding mapping on the fabric type features in the original input vector to generate a material feature vector. The color feature vector and the material feature vector are weighted and fused through the feature fusion layer to generate a fused feature vector; The fused feature vector is subjected to layer-by-layer nonlinear transformation and feature extraction through the multi-layer hidden layers to obtain a joint feature representation. The output layer performs linear regression calculation on the joint feature representation to obtain the predicted LAB color value; The prediction confidence is calculated based on the activation response distribution of at least one of the multi-layer hidden layers.
6. The color calibration and conversion method according to claim 1, characterized in that, The step of comparing the predicted confidence level with a preset confidence threshold and comparing the predicted color difference value with a preset color difference tolerance threshold further includes: If the predicted confidence level is lower than the preset confidence threshold, or the predicted color difference value is higher than the preset color difference tolerance threshold, then the predicted LAB color value is corrected using a preset color correction rule.
7. The color calibration and conversion method according to claim 6, characterized in that, The step of correcting the predicted LAB color value using a preset color correction rule includes: Extract the illumination condition parameters from the image acquisition data; Based on the fabric type characteristics and the lighting condition parameters, the fabric-lighting compensation rule is obtained by matching it with the preset color correction rule. The predicted LAB color value is numerically compensated according to the fabric-lighting compensation rule to generate a corrected LAB color value. The second confidence level is obtained by calculating based on the fabric-light compensation rule and the light condition parameters. The second confidence level is compared with the preset confidence threshold. If the second confidence level is higher than the preset confidence threshold, the corrected LAB color value is updated to the final color output result.
8. A color calibration and conversion system, characterized in that, include: The feature extraction module is used to receive image acquisition data of the target fabric, extract features from the image acquisition data, and obtain RGB color features and fabric type features; The color recognition module is used to identify the predicted LAB color value and the corresponding prediction confidence level based on the RGB color features and the fabric type features through a preset neural network mapping model. The color difference calculation module is used to obtain the predicted color difference value based on the predicted LAB color value and the standard LAB color value; The comparison and verification module is used to compare the predicted confidence level with a preset confidence threshold and to compare the predicted color difference value with a preset color difference tolerance threshold. The result decision module is used to output the predicted LAB color value as the final color result if the predicted confidence level is higher than the preset confidence threshold and the predicted LAB color value does not exceed the preset color difference tolerance threshold.
9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the steps of the color calibration and conversion method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the color calibration and conversion method as described in any one of claims 1-7.