Fabric color management configuration file generation method and device and storage medium
By acquiring the spectral data of basic color blocks on the target fabric and using a trained model to predict color management profiles, the problem of low generation efficiency and high cost in existing technologies is solved, realizing efficient and low-cost generation of color management profiles that can adapt to the changes in different fabrics.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, generating color management profiles relies on a large amount of physical printing, resulting in low generation efficiency and high costs, and it cannot flexibly adapt to changes in the physical and chemical properties of different fabrics.
By acquiring the spectral data of the basic color patch set on the target fabric, and using a pre-trained target model to predict the spectral data of the target color patch set, a target color management profile is generated, reducing the number of physical printing and measurement operations.
It improves the efficiency of color management profile generation, reduces costs, and can flexibly adapt to changes in the physical and chemical properties of different fabrics, thereby enhancing the efficiency of new product development and the application flexibility of digital printing technology.
Smart Images

Figure CN121848831A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of inkjet printing technology, and more specifically, to a method, apparatus, and storage medium for generating color management profiles for fabrics. Background Technology
[0002] In the field of digital printing on textiles, generating color management profiles is a core step in ensuring accurate color reproduction. Currently, the mainstream method for generating profiles in the industry relies on large-scale physical printing and measurement. For example, the IT8.7 / 4 test version developed by the Committee on Printing Technology Standards (CGATS) requires as many as 1617 color patches. Specifically, this involves printing a large number of color patches on the target fabric using all the required color inks in various combinations of ink volumes. Then, a spectrophotometer is used to measure the spectral reflectance data of each color patch individually, finally generating the necessary color management profile.
[0003] However, this traditional method has significant limitations. First, it is extremely costly in terms of both economy and time. Printing and measuring a large number of color blocks consumes a significant amount of ink and fabric resources, and slows down the process, making it difficult to meet the demands of modern production for rapid response. An even more prominent problem is its severe lack of flexibility. Because different fabrics differ in their physicochemical properties such as ink absorption, whiteness, and texture, once the fabric is changed, the entire time-consuming and labor-intensive printing, measurement, and modeling process must be completely repeated, making it impossible to reuse existing data. This greatly restricts the efficiency of new product development and the flexibility of digital printing technology.
[0004] There is currently no effective solution to the problem that existing technologies rely on a large amount of physical printing to generate color management profiles, resulting in low generation efficiency and high costs. Summary of the Invention
[0005] The main objective of this application is to provide a method, apparatus, and storage medium for generating color management profiles for fabrics, in order to solve the problems of low efficiency and high cost caused by relying on a large amount of physical printing to generate color management profiles in the prior art.
[0006] To achieve the above objectives, according to one aspect of this application, a method for generating a color management profile for a fabric is provided. The method includes: determining a target fabric for which a color management profile is to be generated; acquiring spectral data of a set of basic color blocks on the target fabric, wherein the set of basic color blocks includes N basic color blocks of different ink amounts printed on the target fabric by each of M types of ink, the set of basic color blocks including X basic color blocks, X=M×N, where X, M, and N are natural numbers greater than 1; inputting the spectral data of the set of basic color blocks into a target model, wherein the target model is a model trained based on training samples, the training samples including spectral data of a first training color block set, spectral data of a second training color block set, and color formula information of Q training mixed color blocks in the second training color block set, the first training color block set including M... Each of the three ink colors is used to print P different monochrome color patches on the training fabric. The first training color patch set includes R monochrome color patches, where R = M × P. The second training color patch set includes Q training mixed color patches printed on the training fabric by different combinations of ink colors from the M ink colors. P, R, and Q are natural numbers greater than 1, and Q is greater than R. The spectral data of the target color patch set is output by the target model. The spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric by different combinations of ink colors from the M ink colors, as predicted by the target model. Y is a natural number greater than X. The target color management configuration file for the target fabric is generated based on the spectral data of the target color patch set.
[0007] Optionally, the target model is trained through the following steps: acquiring training samples; inputting the spectral data of the first training color patch set and the color formula information of Q training mixed color patches into the initial model, the initial model outputs the spectral data of the predicted color patch set, wherein the spectral data of the predicted color patch set includes the spectral data of the Q predicted mixed color patches predicted by the initial model; calculating the loss value of the spectral data of the second training color patch set and the spectral data of the predicted color patch set according to the loss function; adjusting the parameters of the initial model according to the loss value, and repeatedly executing the steps of inputting the spectral data of the first training color patch set and the color formula information of Q training mixed color patches into the adjusted initial model, the adjusted initial model outputting the spectral data of the new predicted color patch set, and calculating the new loss value of the spectral data of the second training color patch set and the new predicted color patch set according to the loss function, until the preset conditions are met, and the target model is obtained.
[0008] Optionally, after obtaining the target model, the method further includes: acquiring test samples, wherein the test samples include spectral data of a first set of test color blocks, spectral data of a second set of test color blocks, and color formula information of U test mixed color blocks in the second set of test color blocks. The first set of test color blocks includes S monochrome color blocks printed on the test fabric with different ink amounts by each of M color inks, and includes T monochrome color blocks, T=M×S. The second set of test color blocks includes U test mixed color blocks printed on the test fabric with different ink amounts of M color inks, where U, S, and T are natural numbers greater than 1, and U is greater than T. The spectral data of the first set of test color blocks and the color formula information of the U test mixed color blocks are input into the target model, and the target model outputs spectral data of a verification color block set, wherein the spectral data of the verification color block set includes the spectral data of the U verification mixed color blocks predicted by the target model. The error between the spectral data of the U verification mixed color blocks and the spectral data of the U test mixed color blocks is calculated. If the error is greater than a preset threshold, the target model is optimized.
[0009] Optionally, the spectral data of the first training color patch set and the color recipe information of Q training mixed color patches are input into the initial model. The initial model outputs the spectral data of the predicted color patch set, which includes: converting the spectral data of the first training color patch set into an input matrix through the initial model, wherein the spectral data of the first training color patch set includes R spectral vectors, each spectral vector including L bands; inputting the input matrix into the self-attention module to generate a query matrix, key matrix, and value matrix corresponding to the input matrix; calculating the similarity between the query matrix and the key matrix; generating self-attention weights based on the similarity between the query matrix and the key matrix using a normalized exponential function; multiplying the self-attention weights by the value matrix to obtain the weighted input matrix; and the initial model outputs the spectral data of the predicted color patch set according to the weighted input matrix and the color recipe information of the Q training mixed color patches.
[0010] Optionally, obtaining the spectral data of the set of basic color blocks on the target fabric includes: printing X basic color blocks on the target fabric using a printing device; and collecting the spectral data of each of the X basic color blocks using a spectrophotometer to obtain the spectral data of the set of basic color blocks.
[0011] Optionally, generating the target color management configuration file for the target fabric based on the spectral data of the target color patch set includes: obtaining the color data of the target color patch set based on the spectral data of the target color patch set; and generating the target color management configuration file for the target fabric based on the color data of the target color patch set.
[0012] Optionally, after obtaining the spectral data of the basic color patch set on the target fabric, the method includes: smoothing the spectral data of the basic color patch set using the Savitzky-Golay filtering algorithm.
[0013] Optionally, before generating the target color management profile for the target fabric based on the spectral data of the target color patch set, the method includes: performing outlier detection on the spectral data of the target color patch set and removing abnormal spectral data from the spectral data of the target color patch set.
[0014] According to another aspect of this application, a fabric color management profile generation apparatus is provided, comprising: a determining unit for determining a target fabric for which a color management profile is to be generated; a first acquiring unit for acquiring spectral data of a set of basic color blocks on the target fabric, wherein the set of basic color blocks includes N basic color blocks of different ink amounts printed on the target fabric by each of M kinds of ink, the set of basic color blocks includes X basic color blocks, X=M×N, and X, M and N are natural numbers greater than 1; and a first input unit for inputting the spectral data of the set of basic color blocks into a target model, wherein the target model is a model trained based on training samples, the training samples including spectral data of a first training color block set, spectral data of a second training color block set, and Q training mixed color blocks in the second training color block set. The color formula information includes: a first training color patch set comprising P single-color patches with different ink amounts printed on the training fabric using each of the M color inks, and R single-color patches, where R = M × P; and a second training color patch set comprising Q training mixed color patches printed on the training fabric using different combinations of ink amounts of the M color inks, where P, R, and Q are natural numbers greater than 1, and Q is greater than R; an output unit for outputting the spectral data of the target color patch set through the target model, wherein the spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric using different combinations of ink amounts of the M color inks, as predicted by the target model, where Y is a natural number greater than X; and a generation unit for generating the target color management configuration file for the target fabric based on the spectral data of the target color patch set.
[0015] According to another aspect of this application, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, it controls the device where the computer-readable storage medium is located to execute the above-described method for generating a color management profile for fabric.
[0016] According to another aspect of this application, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the above-described method for generating a color management profile for fabrics during runtime.
[0017] In this embodiment, the target fabric for which the color management configuration file is to be generated is determined; the spectral data of the basic color block set on the target fabric is obtained, wherein the basic color block set includes N basic color blocks with different ink amounts printed on the target fabric by each of M color inks, and the basic color block set includes X basic color blocks, X=M×N, where X, M, and N are natural numbers greater than 1; the spectral data of the basic color block set is input into the target model, wherein the target model is a model trained based on training samples, the training samples include the spectral data of the first training color block set, the spectral data of the second training color block set, and the color formula information of Q training mixed color blocks in the second training color block set, the first training color block set including the spectral data of each of M color inks printed on the training fabric by each of M color inks, and the color formula information of Q training mixed color blocks in the second training color block set. The system prints P monochrome color blocks with different ink volumes. The first training color block set includes R monochrome color blocks, where R = M × P. The second training color block set includes Q training mixed color blocks printed on the training fabric using different combinations of M color inks. P, R, and Q are natural numbers greater than 1, and Q is greater than R. The system outputs the spectral data of the target color block set through the target model. The spectral data of the target color block set is the spectral data of Y target predicted color blocks printed on the target fabric using different combinations of M color inks, as predicted by the target model. Y is a natural number greater than X. The system generates a target color management configuration file for the target fabric based on the spectral data of the target color block set. This solves the technical problem in the prior art that relies on a large amount of physical printing to generate color management configuration files, resulting in low generation efficiency and high cost. In this application, by inputting the spectral data of the basic color block set on the target fabric into the target model, which is a pre-trained model used to predict the spectral data of the mixed color blocks, the target model outputs the predicted spectral data of the target color block set. Based on the spectral data of the target color block set, a target color management configuration file can be generated, thereby achieving the technical effect of improving the efficiency of generating color management configuration files. Attached Figure Description
[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 A hardware block diagram of a computer terminal for implementing a method for generating color management profiles for fabrics is shown. Figure 2 This is a flowchart of an optional method for generating a color management profile for a fabric according to an embodiment of this application; Figure 3 This is a schematic diagram of an optional fabric color management profile generation device according to an embodiment of this application; Figure 4 A schematic diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0019] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] Example 1 According to an embodiment of this application, a method embodiment for generating a color management profile for a fabric is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0022] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a method for generating color management profiles for fabrics is shown. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0023] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0024] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the fabric color management configuration file generation method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned fabric color management configuration file generation method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0025] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0026] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0027] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for generating color management profiles for the fabric shown. Figure 2 This is a flowchart of a method for generating a color management configuration file for fabrics according to Embodiment 1 of this application.
[0028] Step S201: Determine the target fabric for which the color management configuration file is to be generated.
[0029] Optionally, the target fabric refers to a specific textile material for which a color management profile needs to be generated. For example, a newly arrived batch of cotton, silk, or synthetic fabrics.
[0030] Step S202: Obtain the spectral data of the basic color block set on the target fabric. The basic color block set includes N basic color blocks with different ink amounts printed on the target fabric by each of the M color inks. The basic color block set includes X basic color blocks, X=M×N, where X, M and N are natural numbers greater than 1.
[0031] Optionally, the basic color patch set includes N basic color patches of different ink amounts printed individually on the target fabric by each color ink (M types). The ink amount ranges from 0% to 100%. During the printing process, the color depth of a specific color ink is represented by the accumulation of ink amount per unit area. 0% represents no ink output, and 100% represents the preset maximum ink output. M color inks refer to the primary color inks used in the printing system. For example, in the CMYK system, M=4 (cyan, magenta, yellow, black). N different ink amounts refer to multiple ink amounts of each color ink from low to high (e.g., from 1% to 100%). For example, N=10, where the ink amounts of each color ink are 10%, 20%,...100%. For example, with 4 color inks, if each is printed with 10 different ink amounts, then X=40. This number is much smaller than the hundreds or thousands of color patches that traditional methods would require printing and measuring. The spectral data of the basic color patch set refers to the reflectance values of each basic color patch at different wavelengths, measured using a spectrophotometer. Spectral data contains rich physical information, is unaffected by the illumination source, and has high prediction accuracy. By printing the basic color patch set on the actual target fabric and measuring its spectral data, it is equivalent to collecting the "fingerprint" of the target fabric's most basic response characteristics to each color ink, which can reflect the target fabric's ink absorption, background color, texture, and other characteristics.
[0032] Step S203: Input the spectral data of the basic color patch set into the target model. The target model is a model trained based on training samples. The training samples include the spectral data of the first training color patch set, the spectral data of the second training color patch set, and the color formula information of Q training mixed color patches in the second training color patch set. The first training color patch set includes P single-color patches with different ink amounts printed on the training fabric by each of the M color inks. The first training color patch set includes R single-color patches, R=M×P. The second training color patch set includes Q training mixed color patches printed on the training fabric by different combinations of ink amounts of the M color inks. P, R, and Q are natural numbers greater than 1, and Q is greater than R.
[0033] Optionally, the target model is a pre-trained model used to predict spectral data of mixed color patches. Training samples are derived from one or more training fabrics. The training fabric, used to collect training data, can be of the same type as the target fabric, sharing similarities in key color reproduction properties. This similarity ensures that the ink-color mapping rules learned from the training fabric provide a high-quality starting point for prediction on the target fabric. The training and target fabrics can be fabrics with the same base material, sharing the same fiber composition (e.g., both pure cotton, polyester, or silk), ensuring a consistent basic mechanism for ink absorption and fixation. The training and target fabrics can also have similar surface structures, possessing similar surface textures and weave structures (e.g., both plain weave, twill weave, or satin weave), resulting in similar light scattering behavior on the fabric surface, thus affecting the visual representation of color. Furthermore, the training and target fabrics do not exhibit extreme differences in base hue (e.g., off-white, bleached) and optical brightener content, ensuring that the target model can effectively calibrate its base color deviation using basic color patches. This solution can be flexibly applied to different sub-categories or different production batches of fabrics within the same major material category, achieving a significant improvement in the efficiency of color management profile generation while ensuring accuracy.
[0034] Optionally, the first training color patch set is a set of monochrome color patches printed on the training fabric, containing R = M × P monochrome color patches. The second training color patch set is a set of Q training mixed color patches obtained by printing different combinations of ink amounts of M colors on the training fabric. Color formula information refers to the ink color and ink amount ratio used to generate each training mixed color patch. For example, color formula information of [C=10%, M=20%] means that the amount of cyan ink is 20% and the amount of magenta ink is 20%. Through the color formula information of the first training color patch set, the second training color patch set, and the Q training mixed color patches in the second training color patch set, the target model learns the complex optical interactions of different combinations of ink amounts during training.
[0035] Step S204: Output the spectral data of the target color patch set through the target model. The spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric by different ink amounts of M color inks, as predicted by the target model. Y is a natural number greater than X.
[0036] Optionally, the target color patch set includes Y target predicted color patches predicted by the target model, which are printed on the target fabric by different combinations of ink amounts of M color inks. Y is a natural number greater than X (the number of base color patches). Y can be set according to actual needs. The Y target predicted color patches contain the color patches corresponding to all color recipes required to generate the target color management configuration file.
[0037] Optionally, the target model internally calculates a large number of preset color formulas (which can be color formulas from a second training set of color patches or entirely new color formulas generated by the system as needed) based on the spectral data of the basic color patches of the input target fabric and the color mixing rules learned during the target model's training. It then outputs the spectral data that each color formula should present on the target fabric, i.e., the spectral data of the Y target predicted color patches. Through the prediction of the target model, the spectral data of multiple color patches that would otherwise require actual printing and measurement on the target fabric in existing technologies can be obtained. Compared to existing technologies, this application consumes less ink and fabric, significantly reducing both time and fabric costs.
[0038] Step S205: Generate a target color management configuration file for the target fabric based on the spectral data of the target color patch set. Optionally, the color management profile is a data file compliant with the ICC standard, which encapsulates the color gamut characteristics and color features of the device. Its core function is to perform precise color data conversion between different device color spaces under the control of the color management module, so as to ensure the consistency of color information across devices in the image capture, display and output process.
[0039] The method for generating a color management configuration file for fabric provided in this application embodiment involves: determining the target fabric for which a color management configuration file is to be generated; acquiring the spectral data of a set of basic color blocks on the target fabric, wherein the set of basic color blocks includes N basic color blocks of different ink amounts printed on the target fabric by each of M color inks, the set of basic color blocks including X basic color blocks, X=M×N, where X, M, and N are natural numbers greater than 1; inputting the spectral data of the set of basic color blocks into a target model, wherein the target model is a model trained based on training samples, the training samples including the spectral data of a first training color block set, the spectral data of a second training color block set, and the color formula information of Q training mixed color blocks in the second training color block set, the first training color block set including P basic color blocks printed on the training fabric by each of M color inks. The training set consists of R monochrome color patches with different ink volumes. The first training set includes R monochrome color patches (R = M × P). The second training set includes Q mixed color patches printed on the training fabric using different combinations of M ink colors in varying amounts. P, R, and Q are natural numbers greater than 1, with Q greater than R. The target model outputs the spectral data of the target color patch set, where the spectral data is the spectral data of Y target predicted color patches printed on the target fabric using different combinations of M ink colors in varying amounts, predicted by the target model. Y is a natural number greater than X. Based on the spectral data of the target color patch set, a target color management configuration file for the target fabric is generated. This solves the technical problem of low efficiency and high cost in existing technologies that rely on extensive physical printing to generate color management configuration files, thus improving the efficiency of color management configuration file generation.
[0040] Optionally, in the fabric color management profile generation method provided in this application embodiment, the target model is trained through the following steps: The first step is to obtain training samples.
[0041] Optionally, the training samples include spectral data of a first training color patch set, spectral data of a second training color patch set, and color formula information of Q training mixed color patches in the second training color patch set. The first training color patch set includes monochrome color patches printed on the training fabric, and the second training color patch set includes training mixed color patches printed on the same training fabric. The first training color patch set allows the model to understand the basic properties of the training fabric, while the second training color patch set and its color formula information allow the model to learn the complex optical laws of ink mixing.
[0042] The second step involves inputting the spectral data of the first training color patch set and the color recipe information of the Q training mixed color patches into the initial model. The initial model outputs the spectral data of the predicted color patch set, which includes the spectral data of the Q predicted mixed color patches predicted by the initial model.
[0043] Optionally, the initial model is an untrained neural network with randomly initialized parameters, which is a deep learning model containing a self-attention module.
[0044] The third step is to calculate the loss value of the spectral data of the second training color patch set and the spectral data of the predicted color patch set based on the loss function.
[0045] Optionally, the loss function is a mathematical function used to quantify the difference between the model's predicted values and the actual values. The larger the loss value calculated by the loss function, the less accurate the model's prediction; the smaller the loss value, the more accurate the prediction.
[0046] The fourth step is to adjust the parameters of the initial model based on the loss value. This involves repeatedly inputting the spectral data of the first training color patch set and the color recipe information of Q training mixed color patches into the adjusted initial model, and having the adjusted initial model output the spectral data of the new predicted color patch set. The next step is to calculate the new loss value of the spectral data of the second training color patch set and the spectral data of the new predicted color patch set based on the loss function, until the preset conditions are met, and the target model is obtained.
[0047] Optionally, based on the loss value, the gradient is calculated through backpropagation. The optimizer uses the gradient to update the parameters of the initial model. Then, the second step is repeated with the updated initial model to make new predictions. The third step is repeated again to calculate a new loss value, and so on. In each iteration, the model is fine-tuned based on the loss value. Finally, when a preset condition is met, the prediction result of the target model will become increasingly closer to the true answer. The preset condition may be that the loss value is below a certain threshold (e.g., 0.001), the training reaches a preset number of iterations (e.g., 1000 times), or the loss value no longer decreases significantly in multiple consecutive iterations. The trained target model can capture the complex and non-linear mapping relationship between color formulas and output spectra.
[0048] Optionally, in the fabric color management profile generation method provided in this application embodiment, after obtaining the target model, the method further includes: The first step is to obtain test samples, which include spectral data of the first test color block set, spectral data of the second test color block set, and color formula information of U test mixed color blocks in the second test color block set. The first test color block set includes S single-color blocks with different ink amounts printed on the test fabric by each of the M color inks. The first test color block set includes T single-color blocks, where T = M × S. The second test color block set includes U test mixed color blocks printed on the test fabric by different combinations of ink amounts of the M color inks. U, S, and T are natural numbers greater than 1, and U is greater than T.
[0049] Optionally, after training the target model, to further test its performance, a completely new test sample that the target model has not learned during training is first obtained. This test sample is entirely independent of the training sample, preventing the target model from merely memorizing training data instead of learning general rules. The test fabric can be a different batch of the same material as the training fabric, or it can be another fabric with similar properties (such as pure cotton plain weave). The first test color patch set includes T single-color patches (T = M × S) printed on the test fabric. The second test color patch set includes U mixed-color patches printed on the test fabric, satisfying U > T, to ensure sufficient data to evaluate the color mixing prediction capability.
[0050] The second step involves inputting the spectral data of the first set of test color patches and the color formula information of the U test mixed color patches into the target model. The target model outputs the spectral data of the verification color patch set, which includes the spectral data of the U verification mixed color patches predicted by the target model.
[0051] Optionally, the target model can use the knowledge learned during training to predict the spectral data of U verification mixed color patches based on the spectral data of the monochromatic color patches in the first test color patch set and the color formula.
[0052] The third step is to calculate the error between the spectral data of the U verification color mixing patches and the spectral data of the U test color mixing patches.
[0053] Optionally, the error between the spectral data of U verification color mixing patches and U test color mixing patches can be quantitatively calculated using mathematical methods. This could be the spectral mean square error, calculated directly by measuring the mean square error of the spectral data of the U verification and test color mixing patches in each band. Alternatively, it could be the CIEDE2000 color difference, which involves first converting the spectral data of the U verification and test color mixing patches into CIELAB color values and then calculating the color difference between them. This method is more in line with human visual perception. The calculated error can be used to accurately determine whether the performance of the target model meets the precision level required for industrial production.
[0054] If the error exceeds a preset threshold, optimize the target model.
[0055] Optionally, for example, if the mean square error of the spectral data of U validation color mixing patches and U test color mixing patches in each band is 0.0004, which is greater than the preset threshold of 0.0003, then the target model needs to be optimized. Optimization of the target model can be achieved through fine-tuning. The acquired test samples can be used as a new training dataset. Starting with the parameters of the current target model, and with a small learning rate, the target model can be trained on this new training dataset for a few rounds, thereby improving the generalization ability and accuracy of the target model.
[0056] In summary, the above steps further ensure the performance of the target model, and the feasibility and credibility of the target model are fully guaranteed.
[0057] Optionally, in the fabric color management configuration file generation method provided in this application embodiment, the spectral data of the first training color patch set and the color formula information of Q training mixed color patches are input into the initial model, and the spectral data of the predicted color patch set output by the initial model includes: The first step is to transform the spectral data of the first training color patch set into an input matrix using an initial model. The spectral data of the first training color patch set includes R spectral vectors, and each spectral vector includes L bands.
[0058] Optionally, the spectral data of the first training color patch set includes R spectral vectors, with each monochromatic color patch in the first training color patch set having its own spectral data as a single spectral vector. Each spectral vector includes L bands, where L bands refer to the number of wavelength sampling points contained in each spectral data point. For example, from 400nm to 700nm, one point is taken every 10nm, so L=31. The unstructured spectral data of the first training color patch set can be converted into a standardized mathematical form that the model can process (i.e., converted into an input matrix), with the input matrix having dimensions of R rows × L columns. The spectral reflectance data of each monochromatic basic color patch is represented as a spectral vector with L values. Stacking the spectral vectors of all R basic color patches row by row can form an input matrix representing the spectral data of the first training color patch set. This input matrix constitutes a digital feature library of the basic optical properties of the current training fabric, characterizing the spectral reflectance behavior of the training fabric for M color inks at P ink amounts.
[0059] The second step is to input the input matrix into the self-attention module to generate the query matrix, key matrix, and value matrix corresponding to the input matrix.
[0060] Optionally, the initial model includes a self-attention module, whose purpose is to enable each spectral vector to interact with all other spectral vectors to dynamically calculate the importance of each spectral vector. By multiplying the same input matrix by three different trained weight matrices respectively, three independent matrices, namely the query matrix Q, the key matrix K, and the value matrix V, can be linearly transformed and generated.
[0061] For example, the transformation method is: Q = XW , , , , ,
[0066] ,
[0068] ,
[0067] , K = XW K , V = XW V where, W Q , W K , W V are the trained weight matrices, and the dimensions of W Q , W K , W V are L×d. The parameter d enables the model to freely control the capacity of the internal representation. If d > L, it is equivalent to dimensionality increase in the feature space, enabling the model to learn more complex functions; if d < L, it is equivalent to a lossy compression or dimensionality reduction, which can help the model focus on key information.
[0062] The third step is to calculate the similarity between the query matrix and the key matrix.
[0063] Optionally, by calculating the dot product of the query matrix and the key matrix, that is, multiplying the query matrix by the transpose of the key matrix, the similarity between the query matrix and the key matrix can be calculated. Through the similarity between the query matrix and the key matrix, the internal connections between the basic color blocks can be discovered. For example, it may be found that the cyan color block with high ink amount is highly correlated with the cyan color block with low ink amount, or there is a specific interaction pattern when a certain magenta color block is mixed with a certain yellow color block.
[0064] For example, the similarity between the query matrix and the key matrix can be calculated by the following formula:
[0065] The fourth step is to generate self-attention weights based on the similarity between the query matrix and the key matrix through the normalization exponential function.
[0066] Optionally, the normalization exponential function, that is, the softmax function, can generate self-attention weights through the following formula:
[0067] The fifth step is to multiply the self-attention weights by the value matrix to obtain the weighted input matrix.
[0068] Optionally, multiplying the self-attention weight matrix generated in step four with the value matrix results in a weighted input matrix that no longer simply uses the original basic color patch data, but rather a more informative and representative feature matrix. Each feature in the weighted input matrix contains information about the global context. For example, a feature of high-ink-weight cyan might incorporate information about related medium-to-low-ink-weight cyan and potentially mixed magenta.
[0069] Step 6: The initial model outputs the spectral data of the predicted color patch set based on the weighted input matrix and the color recipe information of the Q training color mixing patches.
[0070] Optionally, the color formula information refers to the specific ink ratios of the Q training color mixing patches (e.g., [C=50%, M=25%, Y=10%]). The initial model fuses the weighted input matrix obtained in step five with the specific color formula information. This fused information is then mapped to the final prediction output, i.e., the spectral data of the predicted color mixing patches, through subsequent fully connected layers and other network structures. Repeating this process for the Q color formula information yields the spectral data of the Q predicted color mixing patches.
[0071] In summary, through the above steps, the introduction of the self-attention mechanism enables the initial model to dynamically and intelligently extract the deepest information from a limited number of basic color blocks, understand the complex patterns of ink-fabric interaction, and thus accurately predict the spectral data of a large number of mixed color blocks based on only a small amount of monochrome color block spectral data.
[0072] Optionally, in the fabric color management profile generation method provided in this application embodiment, obtaining the spectral data of the basic color block set on the target fabric includes: The first step is to print X basic color blocks on the target fabric using a printing device.
[0073] Optionally, the printing device refers to an industrial-grade printer used for digital inkjet printing, capable of precisely controlling the ejection position and ink volume of tiny ink droplets. For example, for cyan ink, N steps are evenly selected from the lowest ink volume (e.g., 1%) to the highest ink volume (100%). These basic color blocks directly reflect the basic response characteristics of the target fabric to each color ink, exhibiting unique color performance due to differences in fabric absorbency, background color, texture, etc. Compared to traditional methods that require printing a large number of mixed color blocks, printing only X basic color blocks significantly saves ink, fabric, and time.
[0074] The second step is to collect the spectral data of each of the X basic color patches using a spectrophotometer to obtain the spectral data of the set of basic color patches.
[0075] Optionally, a spectrophotometer can be used to measure the reflectance of an object's color at different wavelengths. The spectrophotometer's light source illuminates a base color patch, and the internal sensor captures the reflected light, decomposing it into components of different wavelengths. The light intensity of each band is precisely measured, thus obtaining the spectral reflectance curve of the base color patch. Compared to simply measuring CIELAB values, spectral data contains richer information, is unaffected by the illumination source, and enables higher-precision color reproduction and prediction.
[0076] Optionally, in the fabric color management profile generation method provided in this application embodiment, generating the target color management profile for the target fabric based on the spectral data of the target color patch set includes: The first step is to obtain the color data of the target color patch set based on the spectral data of the target color patch set.
[0077] Optionally, the color data of the target color patch set is represented in a standard color space, most commonly CIELAB. CIELAB is an internationally recognized standard color space, and the data generated therein can be recognized and processed by all standard-compliant color management software and systems, ensuring the universality and interoperability of the generated configuration file. First, the CIE standard chromaticity observer function (such as the CIE 1931 2° standard observer) can be used to convert each spectral data into CIE XYZ tristimulus values through integration under a specified standard illuminant (such as D50 or D65). Then, the XYZ values are converted to the CIELAB color space to obtain the color data of the target color patch set.
[0078] The second step is to generate a target color management configuration file for the target fabric based on the color data of the target color patch set.
[0079] Optionally, the color management profile is a file conforming to the ICC (International Color Consortium) standard, namely ICCProfile. The color profile generation engine receives the color data of the target color patch set obtained in the first step. Using this data, it constructs a high-precision, multi-dimensional lookup table through interpolation, smoothing, and other algorithms. Then, this lookup table, along with relevant metadata (such as profile name, creator, device type, conversion intent, etc.), is encapsulated according to the ICC standard file format to generate the target color management profile. This final target color management profile can be directly used to control the printer's output on the target fabric, ensuring high color consistency and accuracy.
[0080] Optionally, in the fabric color management profile generation method provided in this application embodiment, after obtaining the spectral data of the basic color block set on the target fabric, the method includes: smoothing the spectral data of the basic color block set using the Savitzky-Golay filtering algorithm.
[0081] Optionally, after obtaining the basic color block spectral data of the target fabric, the Savitzky-Golay filtering algorithm can be used for smoothing. The purpose is to filter out random noise while preserving the essential shape of the spectral curve, thereby providing cleaner and more reliable data input for the subsequent target model.
[0082] Optionally, in the fabric color management configuration file generation method provided in this application embodiment, before generating the target color management configuration file of the target fabric based on the spectral data of the target color block set, the method includes: performing outlier detection on the spectral data of the target color block set and removing abnormal spectral data from the spectral data of the target color block set.
[0083] Optionally, an outlier detection step is introduced before generating the final color management profile based on the spectral data of the target color patch set. The purpose is to identify and remove unreliable or physically unreasonable spectral data predicted by the target model, ensuring that the dataset used to generate the profile has the highest quality and physical authenticity.
[0084] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0085] Example 2 This application also provides a fabric color management profile generation apparatus. It should be noted that the fabric color management profile generation apparatus of this application can be used to execute the fabric color management profile generation method provided in this application. The fabric color management profile generation apparatus provided in this application will be described below.
[0086] According to an embodiment of this application, an apparatus for implementing the above-described method for generating color management profiles for fabrics is also provided, such as... Figure 3 As shown, the device includes: a determining unit 301, a first acquiring unit 302, a first input unit 303, an output unit 304, and a generating unit 305.
[0087] Specifically, the determining unit 301 is used to determine the target fabric for which the color management configuration file is to be generated; The first acquisition unit 302 is used to acquire the spectral data of the basic color block set on the target fabric. The basic color block set includes N basic color blocks with different ink amounts printed on the target fabric by each of the M color inks. The basic color block set includes X basic color blocks, X=M×N, where X, M and N are natural numbers greater than 1. The first input unit 303 is used to input the spectral data of the basic color patch set into the target model. The target model is a model trained based on training samples. The training samples include the spectral data of the first training color patch set, the spectral data of the second training color patch set, and the color formula information of Q training mixed color patches in the second training color patch set. The first training color patch set includes P single-color patches with different ink amounts printed on the training fabric by each of the M color inks. The first training color patch set includes R single-color patches, R=M×P. The second training color patch set includes Q training mixed color patches printed on the training fabric by different combinations of ink amounts of the M color inks. P, R, and Q are natural numbers greater than 1, and Q is greater than R. The output unit 304 is used to output the spectral data of the target color patch set through the target model. The spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric by different ink amounts of M color inks, as predicted by the target model. Y is a natural number greater than X. The generation unit 305 is used to generate a target color management configuration file for the target fabric based on the spectral data of the target color patch set. The fabric color management configuration file generation device provided in this application embodiment determines the target fabric for which a color management configuration file is to be generated through a determining unit 301; a first acquiring unit 302 acquires the spectral data of a set of basic color blocks on the target fabric, wherein the set of basic color blocks includes N basic color blocks with different ink amounts printed on the target fabric by each of M color inks, and the set of basic color blocks includes X basic color blocks, X=M×N, where X, M, and N are natural numbers greater than 1; a first input unit 303 inputs the spectral data of the set of basic color blocks into a target model, wherein the target model is a model trained based on training samples, the training samples include the spectral data of a first training color block set, the spectral data of a second training color block set, and the color formula information of Q training mixed color blocks in the second training color block set, the first training color block set including the spectral data of each of M color inks printed on the training fabric by each of M color inks, and the color formula information of Q training mixed color blocks in the second training color block set. The first training color block set includes R monochrome color blocks with different ink amounts printed on the fabric, where R = M × P. The second training color block set includes Q training mixed color blocks printed on the fabric using different combinations of M colors of ink. P, R, and Q are natural numbers greater than 1, and Q is greater than R. The output unit 304 outputs the spectral data of the target color block set through the target model. The spectral data of the target color block set is the spectral data of Y target predicted color blocks printed on the target fabric using different combinations of M colors of ink, as predicted by the target model. Y is a natural number greater than X. The generation unit 305 generates the target color management configuration file for the target fabric based on the spectral data of the target color block set. This solves the problem of low generation efficiency and high cost caused by relying on a large amount of physical printing to generate the color management configuration file in the prior art, and achieves the technical effect of improving the efficiency of generating the color management configuration file.
[0088] Optionally, in the fabric color management configuration file generation device provided in this application embodiment, the device includes: a second acquisition unit for acquiring training samples; a second input unit for inputting the spectral data of a first training color patch set and the color formula information of Q training mixed color patches into an initial model, wherein the initial model outputs the spectral data of a predicted color patch set, wherein the spectral data of the predicted color patch set includes the spectral data of the Q predicted mixed color patches predicted by the initial model; a first calculation unit for calculating the loss value of the spectral data of the second training color patch set and the spectral data of the predicted color patch set according to a loss function; and an adjustment unit for adjusting the parameters of the initial model according to the loss value, repeatedly executing the steps of inputting the spectral data of the first training color patch set and the color formula information of the Q training mixed color patches into the adjusted initial model, the adjusted initial model outputting the spectral data of a new predicted color patch set, and calculating the new loss value of the spectral data of the second training color patch set and the new predicted color patch set according to the loss function, until a preset condition is met to obtain a target model.
[0089] Optionally, in the fabric color management configuration file generation device provided in this application embodiment, the device further includes: a third acquisition unit, used to acquire test samples, wherein the test samples include spectral data of a first test color block set, spectral data of a second test color block set, and color formula information of U test mixed color blocks in the second test color block set; the first test color block set includes S monochrome color blocks with different ink amounts printed on the test fabric by each of M color inks; the first test color block set includes T monochrome color blocks, T=M×S; the second test color block set includes different ink amount groups of M color inks. The test involves printing U test color mixing patches on a test fabric, where U, S, and T are natural numbers greater than 1, with U greater than T. A third input unit is used to input the spectral data of the first set of test color patches and the color formula information of the U test color mixing patches into the target model. The target model outputs the spectral data of the verification color patch set, which includes the spectral data of the U verification color mixing patches predicted by the target model. A second calculation unit is used to calculate the error between the spectral data of the U verification color mixing patches and the spectral data of the U test color mixing patches. An optimization unit is used to optimize the target model if the error exceeds a preset threshold.
[0090] Optionally, in the fabric color management configuration file generation device provided in this application embodiment, the second input unit includes: a conversion module, used to convert the spectral data of the first training color patch set into an input matrix through an initial model, wherein the spectral data of the first training color patch set includes R spectral vectors, and each spectral vector includes L bands; a first generation module, used to input the input matrix into a self-attention module to generate a query matrix, a key matrix, and a value matrix corresponding to the input matrix; a calculation module, used to calculate the similarity between the query matrix and the key matrix; a second generation module, used to generate self-attention weights based on the similarity between the query matrix and the key matrix using a normalized exponential function; a weighting module, used to multiply the self-attention weights by the value matrix to obtain a weighted input matrix; and an output module, used by the initial model to output the spectral data of the predicted color patch set according to the weighted input matrix and the color formula information of the Q training color mixing patches.
[0091] Optionally, in the fabric color management configuration file generation device provided in this application embodiment, the first acquisition unit 302 includes: a printing module, used to print X basic color blocks on the target fabric through a printing device; and an acquisition module, used to acquire the spectral data of each of the X basic color blocks through a spectrophotometer to obtain the spectral data of the set of basic color blocks.
[0092] Optionally, in the fabric color management profile generation apparatus provided in this application embodiment, the generation unit 305 includes: a determination module, used to obtain color data of the target color block set based on the spectral data of the target color block set; and a third generation module, used to generate a target color management profile of the target fabric based on the color data of the target color block set.
[0093] Optionally, in the fabric color management profile generation apparatus provided in this application embodiment, the apparatus includes: a smoothing processing unit, used to smooth the spectral data of the basic color block set on the target fabric using the Savitzky-Golay filtering algorithm after obtaining the spectral data of the basic color block set.
[0094] Optionally, in the fabric color management profile generation apparatus provided in this application embodiment, the apparatus includes: a removal unit, used to perform outlier detection on the spectral data of the target color block set and remove abnormal spectral data in the spectral data of the target color block set before generating the target color management profile of the target fabric based on the spectral data of the target color block set.
[0095] It should be noted that the aforementioned determining unit 301, first acquiring unit 302, first input unit 303, output unit 304, and generating unit 305 correspond to steps S201 to S205 in Embodiment 1. The five units and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the aforementioned modules or units can be hardware or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). These modules can also run as part of a device in the computer terminal 10 provided in Embodiment 1.
[0096] Example 3 Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.
[0097] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0098] In this embodiment, the aforementioned computer terminal can execute the program code for the following steps in the fabric color management configuration file generation method: determining the target fabric for which the color management configuration file is to be generated; acquiring the spectral data of the basic color block set on the target fabric, wherein the basic color block set includes N basic color blocks with different ink amounts printed on the target fabric by each of M color inks, the basic color block set including X basic color blocks, X=M×N, where X, M, and N are natural numbers greater than 1; inputting the spectral data of the basic color block set into the target model, wherein the target model is a model trained based on training samples, the training samples including the spectral data of the first training color block set, the spectral data of the second training color block set, and the spectral data of Q training mixed color blocks in the second training color block set. Color formula information: The first training color patch set includes P single-color patches with different ink amounts printed on the training fabric using each of the M color inks, and the first training color patch set includes R single-color patches, R = M × P. The second training color patch set includes Q training mixed color patches printed on the training fabric using different combinations of ink amounts of the M color inks, where P, R, and Q are natural numbers greater than 1, and Q is greater than R. The target model outputs the spectral data of the target color patch set, where the spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric using different combinations of ink amounts of the M color inks, as predicted by the target model, where Y is a natural number greater than X. The target color management configuration file for the target fabric is generated based on the spectral data of the target color patch set. Optionally, the aforementioned computer terminal can execute the program code for the following steps in the fabric color management configuration file generation method: The target model is trained through the following steps: acquiring training samples; inputting the spectral data of the first training color patch set and the color formula information of Q training mixed color patches into the initial model, the initial model outputs the spectral data of the predicted color patch set, wherein the spectral data of the predicted color patch set includes the spectral data of the Q predicted mixed color patches predicted by the initial model; calculating the loss value of the spectral data of the second training color patch set and the spectral data of the predicted color patch set according to the loss function; adjusting the parameters of the initial model according to the loss value, and repeatedly executing the steps of inputting the spectral data of the first training color patch set and the color formula information of Q training mixed color patches into the adjusted initial model, the adjusted initial model outputting the spectral data of the new predicted color patch set, and calculating the new loss value of the spectral data of the second training color patch set and the new predicted color patch set according to the loss function, until the preset conditions are met, and the target model is obtained.
[0099] Optionally, the aforementioned computer terminal can execute program code for the following steps in the fabric color management configuration file generation method: After obtaining the target model, the method further includes: acquiring test samples, wherein the test samples include spectral data of a first test color block set, spectral data of a second test color block set, and color formula information of U test mixed color blocks in the second test color block set; the first test color block set includes S monochrome color blocks with different ink amounts printed on the test fabric by each of M color inks; the first test color block set includes T monochrome color blocks, T=M×S; the second test color block set includes... The block set includes U test mixed color blocks printed on the test fabric using different combinations of M color inks, where U, S, and T are natural numbers greater than 1, and U is greater than T. The spectral data of the first test color block set and the color formula information of the U test mixed color blocks are input into the target model. The target model outputs the spectral data of the verification color block set, which includes the spectral data of the U verification mixed color blocks predicted by the target model. The error between the spectral data of the U verification mixed color blocks and the spectral data of the U test mixed color blocks is calculated. If the error is greater than a preset threshold, the target model is optimized.
[0100] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the fabric color management configuration file generation method: inputting the spectral data of the first training color patch set and the color formula information of Q training mixed color patches into the initial model, and the initial model outputting the spectral data of the predicted color patch set includes: converting the spectral data of the first training color patch set into an input matrix through the initial model, wherein the spectral data of the first training color patch set includes R spectral vectors, each spectral vector including L bands; inputting the input matrix into the self-attention module to generate the query matrix, key matrix, and value matrix corresponding to the input matrix; calculating the similarity between the query matrix and the key matrix; generating self-attention weights based on the similarity between the query matrix and the key matrix using a normalized exponential function; multiplying the self-attention weights by the value matrix to obtain the weighted input matrix; and the initial model outputting the spectral data of the predicted color patch set according to the weighted input matrix and the color formula information of the Q training mixed color patches.
[0101] Optionally, the aforementioned computer terminal can execute program code for the following steps in the fabric color management configuration file generation method: obtaining spectral data of the basic color block set on the target fabric includes: printing X basic color blocks on the target fabric using a printing device; collecting spectral data of each of the X basic color blocks using a spectrophotometer to obtain the spectral data of the basic color block set.
[0102] Optionally, the computer terminal described above can execute program code for the following steps in the method for generating a color management configuration file for a fabric: generating a target color management configuration file for a target fabric based on the spectral data of the target color patch set includes: obtaining color data of the target color patch set based on the spectral data of the target color patch set; and generating a target color management configuration file for the target fabric based on the color data of the target color patch set.
[0103] Optionally, the aforementioned computer terminal can execute program code for the following steps in the fabric color management configuration file generation method: after obtaining the spectral data of the basic color patch set on the target fabric, the method includes: smoothing the spectral data of the basic color patch set using the Savitzky-Golay filtering algorithm.
[0104] Optionally, the computer terminal described above can execute program code for the following steps in the method for generating a color management profile for a fabric: before generating a target color management profile for the target fabric based on the spectral data of the target color patch set, the method includes: performing outlier detection on the spectral data of the target color patch set and removing abnormal spectral data from the spectral data of the target color patch set.
[0105] Optionally, Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 (Only one is shown) Processor 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0106] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the fabric color management profile generation method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned fabric color management profile generation method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0107] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the method for generating the color management profile for the fabric.
[0108] This application provides a scheme for generating a color management profile for a fabric. The scheme involves: determining the target fabric for which the color management profile is to be generated; obtaining the spectral data of a set of basic color blocks on the target fabric, wherein the set of basic color blocks includes N basic color blocks with different ink amounts printed on the target fabric using each of M different colored inks, and the set of basic color blocks includes X basic color blocks, where X = M × N, and X, M, and N are natural numbers greater than 1; inputting the spectral data of the set of basic color blocks into a target model, wherein the target model is a model trained based on training samples, the training samples including the spectral data of a first training color block set, the spectral data of a second training color block set, and the color formula information of Q training mixed color blocks in the second training color block set, the first training color block set including P single-color color blocks with different ink amounts printed on the training fabric using each of M different colored inks, the first... The training color patch set includes R monochromatic color patches, where R = M × P. The second training color patch set includes Q training mixed color patches printed on the training fabric using different combinations of M color inks, where P, R, and Q are natural numbers greater than 1, and Q is greater than R. The target model outputs the spectral data of the target color patch set, where the spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric using different combinations of M color inks, as predicted by the target model, where Y is a natural number greater than X. Based on the spectral data of the target color patch set, a target color management configuration file for the target fabric is generated. This solves the technical problem in existing technologies that rely on a large amount of physical printing to generate color management configuration files, resulting in low generation efficiency and high cost, and achieves the technical effect of improving the efficiency of generating color management configuration files.
[0109] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only; the electronic device can also be a smartphone, tablet, or other terminal device. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.
[0110] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0111] Example 4 Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the fabric color management profile generation method provided in Embodiment 1.
[0112] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0113] Optionally, in the fabric color management profile generation method provided in the embodiments of this application, this application also provides a computer program product, which, when executed on a data processing device, is a program suitable for executing the steps of the fabric color management profile generation method.
[0114] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0115] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0116] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, 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 through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0117] 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.
[0118] Furthermore, the functional units in the various embodiments of this application 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.
[0119] 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 this application, 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0120] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating a color management configuration file for a fabric, characterized in that, include: Determine the target fabric for which the color management profile is to be generated; Obtain spectral data of the basic color block set on the target fabric, wherein the basic color block set includes N basic color blocks with different ink amounts printed on the target fabric by each of M color inks, and the basic color block set includes X basic color blocks, X=M×N, where X, M and N are natural numbers greater than 1. The spectral data of the basic color patch set is input into the target model, wherein the target model is a model trained based on training samples. The training samples include the spectral data of the first training color patch set, the spectral data of the second training color patch set, and the color formula information of Q training mixed color patches in the second training color patch set. The first training color patch set includes P single-color patches with different ink amounts printed on the training fabric by each of the M color inks. The first training color patch set includes R single-color patches, R=M×P. The second training color patch set includes Q training mixed color patches printed on the training fabric by different combinations of ink amounts of the M color inks. P, R, and Q are natural numbers greater than 1, and Q is greater than R. The target model outputs the spectral data of the target color patch set, wherein the spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric by different ink amounts of M color inks, as predicted by the target model, where Y is a natural number greater than X. A target color management configuration file for the target fabric is generated based on the spectral data of the target color patch set.
2. The method according to claim 1, characterized in that, The target model is trained through the following steps: Obtain the training samples; The spectral data of the first training color patch set and the color recipe information of the Q training mixed color patches are input into the initial model. The initial model outputs the spectral data of the predicted color patch set, wherein the spectral data of the predicted color patch set includes the spectral data of the Q predicted mixed color patches predicted by the initial model. The loss value of the spectral data of the second training color patch set and the spectral data of the predicted color patch set is calculated based on the loss function; The parameters of the initial model are adjusted according to the loss value. The process of inputting the spectral data of the first training color patch set and the color recipe information of the Q training mixed color patches into the adjusted initial model, the adjusted initial model outputs the spectral data of the new predicted color patch set, and the new loss value of the spectral data of the second training color patch set and the new predicted color patch set is calculated according to the loss function until the preset condition is met, and the target model is obtained.
3. The method according to claim 2, characterized in that, After obtaining the target model, the method further includes: Obtain test samples, wherein the test samples include spectral data of a first set of test color blocks, spectral data of a second set of test color blocks, and color formula information of U test mixed color blocks in the second set of test color blocks. The first set of test color blocks includes S single-color blocks with different ink amounts printed on the test fabric by each of M color inks. The first set of test color blocks includes T single-color blocks, T=M×S. The second set of test color blocks includes U test mixed color blocks printed on the test fabric by different combinations of ink amounts of M color inks. U, S, and T are natural numbers greater than 1, and U is greater than T. The spectral data of the first test color patch set and the color formula information of the U test mixed color patches are input into the target model. The target model outputs the spectral data of the verification color patch set, wherein the spectral data of the verification color patch set includes the spectral data of the U verification mixed color patches predicted by the target model. Calculate the error between the spectral data of the U verification color mixing patches and the spectral data of the U test color mixing patches; If the error exceeds a preset threshold, the target model is optimized.
4. The method according to claim 2, characterized in that, The spectral data of the first training color patch set and the color recipe information of the Q training mixed color patches are input into the initial model. The initial model outputs the spectral data of the predicted color patch set, including: The initial model transforms the spectral data of the first training color patch set into an input matrix, wherein the spectral data of the first training color patch set includes R spectral vectors, and each spectral vector includes L bands. The input matrix is input into the self-attention module to generate the query matrix, key matrix, and value matrix corresponding to the input matrix; Calculate the similarity between the query matrix and the key matrix; Self-attention weights are generated based on the similarity between the query matrix and the key matrix using a normalized exponential function. Multiply the self-attention weights by the value matrix to obtain the weighted input matrix; The initial model outputs the spectral data of the predicted color patch set based on the weighted input matrix and the color recipe information of the Q training color mixing patches.
5. The method according to claim 1, characterized in that, Obtaining the spectral data of the basic color patch set on the target fabric includes: The X basic color blocks are printed on the target fabric using a printing device; The spectral data of the set of basic color patches is obtained by collecting the spectral data of each of the X basic color patches using a spectrophotometer.
6. The method according to claim 1, characterized in that, Generating the target color management configuration file for the target fabric based on the spectral data of the target color patch set includes: The color data of the target color patch set is obtained based on the spectral data of the target color patch set; Generate a target color management configuration file for the target fabric based on the color data of the target color patch set.
7. The method according to claim 1, characterized in that, After acquiring the spectral data of the basic color patch set on the target fabric, the method includes: The Savitzky-Golay filtering algorithm is used to smooth the spectral data of the basic color patch set.
8. The method according to claim 1, characterized in that, Before generating the target color management profile for the target fabric based on the spectral data of the target color patch set, the method includes: Anomaly detection is performed on the spectral data of the target color patch set to remove abnormal spectral data.
9. A fabric color management profile generation device, characterized in that, include: The determination unit is used to determine the target fabric for which the color management profile is to be generated. The first acquisition unit is used to acquire the spectral data of the basic color block set on the target fabric, wherein the basic color block set includes N basic color blocks with different ink amounts printed on the target fabric by each of the M color inks, and the basic color block set includes X basic color blocks, X=M×N, where X, M and N are natural numbers greater than 1. The first input unit is used to input the spectral data of the basic color patch set into the target model, wherein the target model is a model trained based on training samples. The training samples include the spectral data of the first training color patch set, the spectral data of the second training color patch set, and the color formula information of Q training mixed color patches in the second training color patch set. The first training color patch set includes P single-color patches with different ink amounts printed on the training fabric by each of the M color inks. The first training color patch set includes R single-color patches, R=M×P. The second training color patch set includes Q training mixed color patches printed on the training fabric by different combinations of ink amounts of the M color inks. P, R, and Q are natural numbers greater than 1, and Q is greater than R. The output unit is used to output the spectral data of the target color patch set through the target model, wherein the spectral data of the target color patch set is the spectral data of Y target predicted color patches printed on the target fabric by different ink amounts of M color inks as predicted by the target model, where Y is a natural number greater than X. The generation unit is used to generate a target color management configuration file for the target fabric based on the spectral data of the target color patch set.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the fabric color management profile generation method according to any one of claims 1 to 8.
11. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the method for generating a color management profile for fabrics according to any one of claims 1 to 8.