CN111601418B - Color temperature adjusting method and device, storage medium and processor - Google Patents

Color temperature adjusting method and device, storage medium and processor Download PDF

Info

Publication number
CN111601418B
CN111601418B CN202010451708.4A CN202010451708A CN111601418B CN 111601418 B CN111601418 B CN 111601418B CN 202010451708 A CN202010451708 A CN 202010451708A CN 111601418 B CN111601418 B CN 111601418B
Authority
CN
China
Prior art keywords
color temperature
model
picture
classification model
environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010451708.4A
Other languages
Chinese (zh)
Other versions
CN111601418A (en
Inventor
孙博闻
乔志强
刘然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Boyan Colorful Data Technology Co ltd
Original Assignee
Boyan Colorful Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Boyan Colorful Data Technology Co ltd filed Critical Boyan Colorful Data Technology Co ltd
Priority to CN202010451708.4A priority Critical patent/CN111601418B/en
Publication of CN111601418A publication Critical patent/CN111601418A/en
Application granted granted Critical
Publication of CN111601418B publication Critical patent/CN111601418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/20Controlling the colour of the light
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Abstract

The invention discloses a color temperature adjusting method, a color temperature adjusting device, a storage medium and a processor. The method comprises the following steps: training a pre-classification model of color temperature in a machine learning manner based on a first training data set, wherein the pre-classification model comprises a plurality of convolutional layers, each convolutional layer has corresponding model parameters, and the first training set comprises: a plurality of first pictures, and a color temperature category of each first picture; applying the model parameters in the pre-classification model to a color temperature classification model, wherein the color temperature classification model is used for representing the corresponding relation between the second picture collected in the specified environment and the color temperature category; identifying a color temperature category corresponding to an environment picture collected in a specified environment based on a color temperature classification model; adjusting the color temperature of the light fixtures in the designated environment based on the color temperature category of the environment picture. The invention solves the technical problem that the color temperature measurement adjustment can not be carried out based on a small amount of color temperature adjustment data samples in the prior art by a machine learning mode.

Description

Color temperature adjusting method and device, storage medium and processor
Technical Field
The invention relates to the field of control, in particular to a color temperature adjusting method, a color temperature adjusting device, a storage medium and a processor.
Background
In the present phase, research on intelligent lighting technology of office buildings is more and more extensive, and as an important parameter besides illuminance, color temperature adjustment of an LED lighting lamp is more and more concerned by people, and meanwhile, the adjustment of the color temperature is more and more important in the aspect of guaranteeing the visual health of office staff. How to apply the outdoor color temperature condition to the indoor environment to support healthy and intelligent lighting is also more important.
Conventional color temperature calculations are based on color sensors, calculated from tristimulus values. Compared with the traditional methods, the traditional methods are low in precision and high in cost, and the traditional measuring methods are basically tested manually, so that the efficiency cannot be guaranteed when the color temperature is adjusted, and the randomness is high.
After investigation, the problem of small sample classification can be found due to the fact that the number of samples used for training a machine learning model is small because the acquisition period is long when color temperature measurement and adjustment are actually carried out.
In view of the above-mentioned problem that the color temperature measurement adjustment cannot be performed based on a small number of color temperature adjustment data samples in the prior art through a machine learning method, an effective solution has not been proposed yet.
Disclosure of Invention
The embodiment of the invention provides a color temperature adjusting method, a color temperature adjusting device, a storage medium and a processor, which at least solve the technical problem that the prior art cannot carry out color temperature measurement adjustment based on a small amount of color temperature adjusting data samples in a machine learning mode.
According to an aspect of an embodiment of the present invention, there is provided a color temperature adjusting method including: training a pre-classification model of color temperature by means of machine learning based on a first training data set, wherein the pre-classification model comprises a plurality of convolutional layers, each convolutional layer having corresponding model parameters, and the first training set comprises: a plurality of first pictures, and a color temperature category of each first picture; applying model parameters in the pre-classification model to a color temperature classification model, wherein the color temperature classification model is used for representing the corresponding relation between a second picture acquired in a specified environment and a color temperature category; identifying a color temperature category corresponding to an environmental picture acquired in the specified environment based on the color temperature classification model; adjusting a color temperature of a light fixture within the designated environment based on a color temperature category of the environment picture.
Optionally, applying the model parameters in the pre-classification model to a color temperature classification model comprises: transferring the model parameters in the pre-classification model to a preset network model to obtain an initial color temperature model; correcting the model parameters based on a second training data set to obtain the color temperature classification model, wherein the second training data set comprises: a plurality of second pictures taken within the specified environment, and a color temperature category for each second picture.
Optionally, migrating the model parameters in the pre-classification model to a predetermined model template, and obtaining an initial color temperature model includes: and migrating the model parameters in other convolution layers except the last layer in the pre-classification model to the preset network model.
Optionally, modifying the model parameters based on a second set of training data comprises: and training the model parameters of the last convolutional layer in the predetermined network model based on the second training data set.
Optionally, a fully connected layer and a classifier are provided after the last convolutional layer in the predetermined network model.
Optionally, before the model parameters are modified based on the second training data set, the method further comprises: capturing a plurality of second pictures within the specified environment; measuring the color temperature value of the designated environment when each second picture is collected by a color temperature meter; and determining the color temperature category corresponding to each second picture based on the color temperature value corresponding to each second picture to obtain the second training data set.
Optionally, adjusting the color temperature of the light fixtures within the designated environment based on the color temperature category of the environment picture comprises: detecting whether the color temperature category corresponding to the environment picture meets a preset color temperature requirement or not; and under the condition that the color temperature category corresponding to the environment picture does not meet the preset color temperature requirement, adjusting the color temperature of the lamps in the specified environment.
According to another aspect of the embodiments of the present invention, there is also provided a color temperature adjusting apparatus including: a first model training unit, configured to train a pre-classification model of color temperature in a machine learning manner based on a first training data set, where the pre-classification model includes a plurality of convolutional layers, each convolutional layer having a corresponding model parameter, and the first training set includes: a plurality of first pictures, and a color temperature category of each first picture; the second model training unit is used for applying the model parameters in the pre-classification model to a color temperature classification model, wherein the color temperature classification model is used for indicating the corresponding relation between a second picture acquired in a specified environment and a color temperature class; the identification unit is used for identifying the color temperature category corresponding to the environmental picture acquired in the specified environment based on the color temperature classification model; and the adjusting unit is used for adjusting the color temperature of the lamps in the specified environment based on the color temperature category of the environment picture.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, the storage medium including a stored program, wherein when the program runs, a device on which the storage medium is located is controlled to execute the color temperature adjusting method described above.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to run a program, where the program is executed to perform the color temperature adjustment method described above.
In the embodiment of the invention, the pre-classification model can be trained in a machine learning manner based on a large number of data samples in the first training data set; the method comprises the steps of training a color temperature classification model, wherein the color temperature classification model is used for detecting color temperature types of lamps in a specified environment, the color temperature classification model is used for detecting color temperature types of environment pictures collected at various moments in the specified environment based on trained model parameters corresponding to each convolution layer in the pre-classification model, the color temperature types of the environment pictures collected at various moments in the specified environment can be detected based on the color temperature classification model, and the color temperature of the lamps in the specified environment is detected based on the color temperature types of the environment pictures, so that the color temperature classification model is specially used for the color temperature classification model in the specified environment and can be determined by sample data provided by other environments except the specified environment, the training of the color temperature classification model can be not limited by the sample data provided by the specified environment, the technical effect of measuring and adjusting the color temperature based on a small amount of color temperature adjusting data samples and applying a machine learning mode is achieved, and the technical problem that the color temperature measuring and adjusting cannot be performed based on a small amount of color temperature adjusting data samples in the machine learning mode in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
fig. 1 is a flow chart of a color temperature adjusting method according to an embodiment of the invention;
FIG. 2a is a diagram of a VGG16 macro model according to an embodiment of the invention;
FIG. 2b is a schematic diagram of a VGG16 model structure according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a color temperature adjustment method based on transfer learning and deep learning according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a color temperature adjusting apparatus according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present invention, there is provided an embodiment of a color temperature adjusting method, it should be noted that the steps shown in the flowchart of the attached drawings may 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 an order different from that shown or described herein.
Fig. 1 is a flowchart of a color temperature adjusting method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, training a color temperature pre-classification model in a machine learning mode based on a first training data set, wherein the pre-classification model comprises a plurality of convolutional layers, each convolutional layer has corresponding model parameters, and the first training set comprises: a plurality of first pictures, and a color temperature category of each first picture;
step S104, applying model parameters in the pre-classification model to a color temperature classification model, wherein the color temperature classification model is used for indicating the corresponding relation between a second picture acquired in a specified environment and a color temperature category;
step S106, identifying the color temperature category corresponding to the environment picture collected in the designated environment based on the color temperature classification model;
and S108, adjusting the color temperature of the lamps in the designated environment based on the color temperature category of the environment picture.
In the embodiment of the invention, the pre-classification model can be trained in a machine learning manner based on a large number of data samples in the first training data set; the method comprises the steps of training a color temperature classification model, wherein the color temperature classification model is used for detecting color temperature types of lamps in a specified environment, the color temperature classification model is used for detecting color temperature types of environment pictures collected at various moments in the specified environment based on trained model parameters corresponding to each convolution layer in the pre-classification model, the color temperature types of the environment pictures collected at various moments in the specified environment can be detected based on the color temperature classification model, and the color temperature of the lamps in the specified environment is detected based on the color temperature types of the environment pictures, so that the color temperature classification model is specially used for the color temperature classification model in the specified environment and can be determined by sample data provided by other environments except the specified environment, the training of the color temperature classification model can be not limited by the sample data provided by the specified environment, the technical effect of measuring and adjusting the color temperature based on a small amount of color temperature adjusting data samples and applying a machine learning mode is achieved, and the technical problem that the color temperature measuring and adjusting cannot be performed based on a small amount of color temperature adjusting data samples in the machine learning mode in the prior art is solved.
It should be noted that the pre-classification model determines the correspondence between the picture and the color temperature category based on the model parameters.
It should be noted that the first picture in the first training data set may be a picture acquired in an environment other than the specified environment, and the first training data set may be an already published ImageNet data set (having more than 1 million pictures, more than 1000 classes).
Alternatively, the pre-classification model may be a pre-trained VGG16 model.
Alternatively, the designated environment may be a room in which the light fixtures are located.
Alternatively, the light fixture may be an LED light fixture.
Optionally, in the process of adjusting the color temperature of the lamp, after receiving a trigger instruction of a user, an environment picture of the specified environment at the current time may be taken, the color temperature category may be identified based on the environment picture at the current time, and the color temperature of the lamp may be adjusted based on the identification result of the color temperature category.
Alternatively, the user's trigger command may be identified by means of infrared sensing. For example, whether a user appears in the designated environment or not can be judged in an infrared induction mode, and when the user appears in the designated environment, a trigger instruction is generated.
As an alternative embodiment, applying the model parameters in the pre-classification model to the color temperature classification model comprises: transferring the model parameters in the pre-classification model to a preset network model to obtain an initial color temperature model; and correcting the model parameters based on a second training data set to obtain a color temperature classification model, wherein the second training data set comprises: a plurality of second pictures captured within a specified environment, and a color temperature category for each of the second pictures.
It should be noted that the second picture is an image acquired under a specified environment.
According to the technical scheme, the pre-classification model can be trained based on the first training data set, the model parameters in the pre-classification model are transferred to the initial color temperature model suitable for the specified environment, and the initial color temperature model is adjusted based on a small amount of data samples (namely, the second training data set) provided under the specified environment, so that the color temperature classification model special for the specified environment can be trained based on the small amount of data samples under the specified environment.
As an alternative embodiment, migrating the model parameters in the pre-classification model to a predetermined model template, and obtaining the initial color temperature model includes: and migrating the model parameters in other convolution layers except the last layer in the pre-classification model to a preset network model.
As an alternative embodiment, the modifying the model parameters based on the second set of training data comprises: model parameters of a last convolutional layer in the predetermined network model are trained based on the second training data set.
As an alternative embodiment, the fully connected layer and the classifier are set after the last convolutional layer in the predetermined network model.
As an alternative embodiment, before the modifying the model parameters based on the second set of training data, the method further comprises: acquiring a plurality of second pictures within a specified environment; measuring the color temperature value of the designated environment when each second picture is collected by a color temperature meter; and determining the color temperature category corresponding to each second picture based on the color temperature value corresponding to each second picture to obtain a second training data set.
As an alternative embodiment, adjusting the color temperature of the light fixtures within the designated environment based on the color temperature category of the environment picture comprises: detecting whether the color temperature category corresponding to the environment picture meets the preset color temperature requirement or not; and under the condition that the color temperature category corresponding to the environment picture does not meet the preset color temperature requirement, adjusting and setting the color temperature of the lamps in the specified environment.
The invention also provides a preferred embodiment, which provides a color temperature adjusting method based on the transfer learning and the deep learning.
The color temperature adjusting method based on the migration learning and the deep learning can support the intelligent color temperature adjusting method with higher precision and higher efficiency based on the LED lamp capable of being intelligently regulated and controlled.
The color temperature adjusting method based on the transfer learning and the deep learning comprises the following steps:
step 1: and (4) outdoor image acquisition.
Optionally, 1 unobstructed high definition camera outside the building can be selected, and simultaneously, the conditions that the camera is in different positions and can rotate 360 degrees are met, video sampling in the horizontal direction at equal intervals for 1 hour is performed, and the camera is rotated forward at random by a certain degree every hour to perform video picture sampling (i.e., acquiring a second picture). While picture sampling is carried out each time, a worker uses a color temperature meter to measure a real-time color temperature value, and the whole picture sampling process lasts for 2 weeks. And (3) corresponding the measured color temperature value with the acquired picture (namely, the second picture) to form a corresponding table of the picture and the color temperature value (namely, determining the color temperature value corresponding to the second picture and each second image).
Alternatively, a color temperature range of 0-15000K may be established according to specific values of color temperature values, and 10 color temperature categories may be formed according to 1500K as one category. The training set samples of the final color temperature picture occupy 80% of the sample volume and the validation samples occupy 20%.
Step 1.1, data enhancement may be performed on the acquired picture sample (i.e. the second picture).
Because the problem of small samples (i.e. the number of the second picture samples collected is small) is faced when the pictures are sampled, it is necessary to use a data enhancement method to increase the sample capacity and reduce the over-fitting phenomenon.
Alternatively, the sample number of pictures required for color temperature training may be increased by using methods such as rotation (which rotates the image by a certain angle, changes the image orientation), flip transformation (which flips the image in the horizontal or vertical direction), scaling transformation (which scales down or enlarges the image) and the like on the sample picture (i.e., the second picture).
Step 1.2, the collected sample picture (i.e. the second picture) may be preprocessed.
Optionally, the pixel values of the sample picture (i.e., the second picture) may be subjected to gray level variation and normalization processing, so as to ensure that the temperature data in all dimensions are at a variation range. The formula is as follows:
Figure BDA0002507833280000061
wherein x is i Representing image pixel point values, max (x), min (x) representing maximum and minimum values of image pixels.
And 2, step: and (3) pre-training the VGG16 model by using a transfer learning method for solving the problem of insufficient samples.
FIG. 2a is a VGG16 macro model diagram according to an embodiment of the invention, as shown in FIG. 2a, including a convolutional layer + ReLU, a max-pooling layer, a fully-connected layer + ReLU, and a classifier.
Fig. 2b is a schematic diagram of a VGG16 model structure according to an embodiment of the invention, and as shown in fig. 2b, the VGG16 model comprises an eight-layer convolutional neural network.
Alternatively, a published ImageNet dataset (with over 1 million pictures, over 1000 classes) can be used and pre-trained on the VGG16 model. Because the VGG16 model is large, the number of model parameters to be trained is large, a server with huge computing power is needed to complete model training, the training process is complex, the requirement technology for parameter adjustment and the like is high, and time is consumed, so that the problem can be solved by using the model which is pre-trained.
And 2.1, after each convolution layer of the pre-trained VGG16 model, using a ReLu activation function to modify a linear unit for hidden layer neuron output. The formula is as follows:
f(x)=max(0,x)
the model after realizing sparseness through the ReLU can better mine relevant characteristics and fit training data.
Step 2.2, selecting input samples (x, y), wherein y is a sample class, and obtaining f of the VGG16 model through forward calculation by the convolutional neural network c8 Layer characteristics, then f c8 The output of the layer is Z = [ Z = [ ] 1 ,z 2 ,...,z k ]∈R k Then the convolutional neural network predicts the color temperature class k epsilon 1,k, calculated from the formula:
Figure BDA0002507833280000071
the final output of the pre-trained VGG16 model is what each value represents the probability of each class.
Step 2.3, using the cross entropy function as a loss function, the formula is as follows:
Figure BDA0002507833280000072
q (k) =1 when k = y, and q (k) =0 when k ≠ y. Until the cross entropy function is minimized to ensure that the predicted strive label is maximized.
And 2.4, adjusting model parameters by using a gradient descent method to optimize the objective function J (f, y). The formula is as follows:
Figure BDA0002507833280000073
Figure BDA0002507833280000074
in the formula, a is a learning rate, a back propagation algorithm is adopted to perform partial derivative calculation on the two formulas, iteration is performed for multiple times until model parameters are converged, and training is finished to obtain optimal model parameters, wherein the model parameters comprise a weight parameter W (weight) and a bias parameter b (bias).
And step 3: and establishing a color temperature classification network.
Optionally, after obtaining the optimal model parameters (i.e., the weight parameter W and the bias parameter b), all model parameters except the model parameter corresponding to the last layer in the pre-trained VGG16 model are migrated to the classification network of the outdoor color temperature (i.e., the predetermined network model). Finally, a 10-class full connection layer is accessed. And thus constitutes an initial color temperature classification model (i.e., an initial color temperature model).
And 3.1, inputting the color temperature training sample (namely a second training data set) processed in advance in the step 1, and further fitting the extracted features. Through a color temperature training sample (namely a second training data set), model parameters of the last convolution block in the convolution neural network are adjusted, and the accuracy and the stability of classification are further improved; and continuously training the fully connected layer through the color temperature sample (namely, the second training data set), and performing fine adjustment on the model parameters by using the gradient descent method mentioned in the step 2.4.
And 3.2, setting a softmax classifier after the full connection layer. The (— infinity, + ∞) scores can be converted to a set of probabilities and their sum is a normalized function of 1, with the following specific formula:
Figure BDA0002507833280000081
wherein s is i The score value of the model on the ith category for input x is represented. And the class with the highest probability is the selected class. On the other hand, after the classification result is obtained, the loss error is calculated by using the cross entropy loss function which is the same as that of the pre-training through the real class label distribution and the prediction label distribution of the color temperature sample (namely, the second picture), and the cross entropy loss function is reversely transferred to each layer of parameters to be updated until the optimal color temperature classification network (namely, the color temperature classification model) is obtained. Each value finally output by the Softmax classifier represents the probability that the color temperature corresponding to the picture should be of the class.
And 4, step 4: and actually collecting indoor environment pictures, and inputting the indoor environment pictures into a trained color temperature classification network (namely a color temperature classification model).
And (4) shooting according to an indoor infrared probe to confirm whether people exist indoors. Because the specific color temperature is established by the environment and is irrelevant to the outdoor factors such as people and temperature, the infrared detector is only needed to be added to control the switch of the LED lamp, and whether the external factors can influence the classification of the color temperature is not needed to be considered. If no person is detected and displayed by the infrared detection, the LED lamp is turned off; if the infrared detection shows that people exist, the LED lamp is turned on, and indoor environment pictures are collected.
According to the technical scheme provided by the invention, the acquired environmental picture is input into a trained VGG16 color temperature classification network (namely a color temperature classification model) after being subjected to gray level change and normalization processing, the color temperature classification network is output by a softmax classifier through network learning, and the output value is the color temperature classification probability corresponding to the acquired environmental picture.
And selecting the category group with the maximum probability, and inputting the color temperature category corresponding to the category into the LED lamp through the communication module to finish intelligent control.
Fig. 3 is a schematic diagram of a color temperature adjustment method based on transfer learning and deep learning according to an embodiment of the present invention, as shown in fig. 3, the method mainly includes: the method comprises a VGG16 model pre-training part based on ImageNet, an outdoor color temperature classification grid training part and an indoor color temperature adjusting network part.
Optionally, the pre-training of the VGG16 model based on ImageNet part comprises: collecting ImageNet data set, preprocessing image data, pre-training a VGG16 model & & feature extraction, and establishing all convolutional layer parameters except the last layer, wherein the preprocessing image data further comprises the following steps: the error is optimized using a cross entropy function and the ReLU activation function is used.
Optionally, based on the ImageNet pre-trained VGG16 model portion, the outdoor color temperature image pre-trained completed VGG model may be transmitted to the trained outdoor color temperature classification grid portion.
Optionally, the color temperature classification grid part comprises: collecting an outdoor color temperature picture, preprocessing image data, training the last layer of convolution parameters & & applying pre-training VGG16 parameters as initial parameters, fully connecting layers, a Softmax classifier and finishing network training.
Wherein, the last layer of convolution parameter training & & application pre-training VGG16 parameter as the initial parameter further comprises: the ReLU activation function is used.
Wherein after the Softmax classifier, the error is optimized based on the loss function & & gradient descent.
Alternatively, the outdoor color temperature classification mesh part is trained, and the outdoor temperature application color temperature classification mesh may be transmitted to the indoor color temperature adjustment mesh part.
Optionally, the color temperature classification grid part comprises: detecting whether a person exists based on an infrared detector, and if the person does not exist, confirming to turn off the LED lamp; if the person is in the VGG16 network, the prediction probability is output by a Softmax classifier, and the corresponding type with the highest probability is transmitted to the LED lamp, the LED and the like through the communication module to adjust the color temperature to the color temperature value corresponding to the color temperature category.
According to the invention, in the color temperature adjustment, based on the problem of small sample, the transfer learning method and the deep learning method based on the VGG16 model are used, so that the whole working process is more flexible, the accuracy of the whole working process can be improved, and meanwhile, the whole working efficiency can be further improved when the problem of small sample classification is solved by the pre-trained VGG16 model. On the other hand, when the small sample problem is processed, a picture data enhancement method is used, and overfitting of a convolutional neural network is prevented.
According to still another embodiment of the present invention, there is also provided a storage medium including a stored program, wherein the program executes the color temperature adjusting method of any one of the above.
According to still another embodiment of the present invention, there is also provided a processor for executing a program, wherein the program executes to perform the color temperature adjustment method of any one of the above.
According to an embodiment of the present invention, an embodiment of an apparatus for adjusting color temperature is further provided, and it should be noted that the apparatus for adjusting color temperature may be configured to execute a method for adjusting color temperature in the embodiment of the present invention, and the method for adjusting color temperature in the embodiment of the present invention may be executed in the apparatus for adjusting color temperature.
Fig. 4 is a schematic diagram of a color temperature adjusting apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus may include: a first model training unit 42, configured to train a pre-classification model of color temperature in a machine learning manner based on a first training data set, where the pre-classification model includes a plurality of convolutional layers, each convolutional layer has a corresponding model parameter, and the pre-classification model determines a correspondence between a picture and a color temperature category based on the model parameters, and the first training set includes: a plurality of first pictures, and a color temperature category of each first picture; a second model training unit 44, configured to apply the model parameters in the pre-classification model to a color temperature classification model, where the color temperature classification model is used to represent a correspondence between a second picture acquired in a specified environment and a color temperature category; the identification unit 46 is used for identifying the color temperature category corresponding to the environment picture collected in the specified environment based on the color temperature classification model; and an adjusting unit 48, configured to adjust the color temperature of the light fixture in the specified environment based on the color temperature category of the environment picture.
It should be noted that the first model training unit 42 in this embodiment may be configured to execute step S102 in this embodiment, the second model training unit 44 in this embodiment may be configured to execute step S104 in this embodiment, the identifying unit 46 in this embodiment may be configured to execute step S106 in this embodiment, and the adjusting unit 48 in this embodiment may be configured to execute step S108 in this embodiment. The modules are the same as the corresponding steps in the realized examples and application scenarios, but are not limited to the disclosure of the above embodiments.
In the embodiment of the invention, the pre-classification model can be trained in a machine learning manner based on a large number of data samples in the first training data set; the color temperature classification model is specially used for the color temperature classification model under the appointed environment and can be determined by sample data provided by other environments except the appointed environment, so that the training of the color temperature classification model can be not limited by the sample data provided by the appointed environment, the technical effect of performing color temperature measurement and adjustment by applying a machine learning mode on the basis of a small amount of color temperature adjustment data samples is realized, and the technical problem that the color temperature measurement and adjustment cannot be performed on the basis of a small amount of color temperature adjustment data samples in the prior art by the machine learning mode is solved.
As an alternative embodiment, the second model training unit comprises: the migration module is used for migrating the model parameters in the pre-classification model to a preset network model to obtain an initial color temperature model; and the correction module is used for correcting the model parameters based on a second training data set to obtain a color temperature classification model, wherein the second training data set comprises: a plurality of second pictures captured within a specified environment, and a color temperature category for each of the second pictures.
As an alternative embodiment, the migration module includes: and the migration sub-module is used for migrating the model parameters in other convolutional layers except the last convolutional layer in the pre-classification model to a preset network model.
As an alternative embodiment, the modification module includes: and the correction submodule is used for training the model parameters of the last convolutional layer in the preset network model based on the second training data set.
As an alternative embodiment, the fully-connected layer and the classifier are set after the last convolutional layer in the predetermined network model.
As an alternative embodiment, the adjusting unit comprises: a first picture acquisition unit for acquiring a plurality of second pictures within a specified environment before the model parameters are corrected based on the second training data set; the color temperature measuring unit is used for measuring the color temperature value of the designated environment during the acquisition of each second picture through the color temperature measuring meter; and the determining unit is used for determining the color temperature category corresponding to each second picture based on the color temperature value corresponding to each second picture to obtain a second training data set.
As an optional embodiment, the adjusting unit further comprises: the judging module is used for detecting whether the color temperature category corresponding to the environment picture meets the requirement of the preset color temperature; and the adjusting module is used for adjusting and setting the color temperature of the lamps in the designated environment under the condition that the color temperature category corresponding to the environment picture does not meet the requirement of the preset color temperature.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (9)

1. A color temperature adjustment method, comprising:
training a pre-classification model of color temperature by means of machine learning based on a first training data set, wherein the pre-classification model comprises a plurality of convolutional layers, each convolutional layer having corresponding model parameters, and the first training data set comprises: a plurality of first pictures, and a color temperature category of each first picture;
applying model parameters in the pre-classification model to a color temperature classification model, wherein the color temperature classification model is used for representing the corresponding relation between a second picture acquired in a specified environment and a color temperature category;
identifying a color temperature category corresponding to an environmental picture acquired in the specified environment based on the color temperature classification model;
adjusting a color temperature of a luminaire within the specified environment based on a color temperature category of the environment picture;
wherein applying the model parameters in the pre-classification model to a color temperature classification model comprises:
transferring the model parameters in the pre-classification model to a preset network model to obtain an initial color temperature model;
correcting the model parameters based on a second training data set to obtain the color temperature classification model, wherein the second training data set comprises: a plurality of second pictures taken within the specified environment, and a color temperature category for each second picture.
2. The method of claim 1, wherein migrating the model parameters in the pre-classification model to a predetermined model template to obtain an initial color temperature model comprises:
and migrating the model parameters in other convolution layers except the last layer in the pre-classification model to the preset network model.
3. The method of claim 2, wherein modifying the model parameters based on a second set of training data comprises:
and training the model parameters of the last convolutional layer in the predetermined network model based on the second training data set.
4. A method according to any of claims 1-3, characterized in that a fully connected layer and a classifier are provided after the last convolutional layer in the predetermined network model.
5. The method of claim 1, wherein prior to modifying the model parameters based on a second set of training data, the method further comprises:
capturing a plurality of second pictures within the specified environment;
measuring the color temperature value of the designated environment when each second picture is collected by a color temperature measuring meter;
and determining the color temperature category corresponding to each second picture based on the color temperature value corresponding to each second picture to obtain the second training data set.
6. The method of claim 1, wherein adjusting the color temperature of a luminaire within the specified environment based on the color temperature category of the environment picture comprises:
detecting whether the color temperature category corresponding to the environment picture meets a preset color temperature requirement or not;
and under the condition that the color temperature category corresponding to the environment picture does not meet the preset color temperature requirement, adjusting the color temperature of the lamps in the specified environment.
7. A color temperature adjusting apparatus, characterized by comprising:
a first model training unit, configured to train a pre-classification model of color temperature in a machine learning manner based on a first training data set, where the pre-classification model includes a plurality of convolutional layers, each convolutional layer has corresponding model parameters, and the first training data set includes: a plurality of first pictures, and a color temperature category of each first picture;
the second model training unit is used for applying the model parameters in the pre-classification model to a color temperature classification model, wherein the color temperature classification model is used for indicating the corresponding relation between a second picture acquired in a specified environment and a color temperature class;
the identification unit is used for identifying a color temperature category corresponding to the environmental picture collected in the specified environment based on the color temperature classification model;
an adjusting unit, configured to adjust color temperatures of light fixtures within the specified environment based on the color temperature category of the environment picture;
wherein the second model training unit comprises:
the migration module is used for migrating the model parameters in the pre-classification model to a preset network model to obtain an initial color temperature model;
a modification module, configured to modify the model parameter based on a second training data set to obtain the color temperature classification model, where the second training data set includes: a plurality of second pictures taken within the specified environment, and a color temperature category for each second picture.
8. A storage medium, characterized in that the storage medium includes a stored program, wherein when the program is executed, a device in which the storage medium is located is controlled to execute the color temperature adjustment method according to any one of claims 1 to 6.
9. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to execute the color temperature adjusting method according to any one of claims 1 to 6 when running.
CN202010451708.4A 2020-05-25 2020-05-25 Color temperature adjusting method and device, storage medium and processor Active CN111601418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010451708.4A CN111601418B (en) 2020-05-25 2020-05-25 Color temperature adjusting method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010451708.4A CN111601418B (en) 2020-05-25 2020-05-25 Color temperature adjusting method and device, storage medium and processor

Publications (2)

Publication Number Publication Date
CN111601418A CN111601418A (en) 2020-08-28
CN111601418B true CN111601418B (en) 2022-11-22

Family

ID=72186231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010451708.4A Active CN111601418B (en) 2020-05-25 2020-05-25 Color temperature adjusting method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN111601418B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112188694A (en) * 2020-09-29 2021-01-05 上海佳勒电子有限公司 Lamplight color temperature correction method, system and device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105869580A (en) * 2016-06-15 2016-08-17 京东方科技集团股份有限公司 Color temperature adjusting method and device, backlight source and display equipment
CN110111341A (en) * 2019-04-30 2019-08-09 北京百度网讯科技有限公司 Display foreground acquisition methods, device and equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8817128B2 (en) * 2010-06-09 2014-08-26 International Business Machines Corporation Real-time adjustment of illumination color temperature for digital imaging applications
CN107506775A (en) * 2016-06-14 2017-12-22 北京陌上花科技有限公司 model training method and device
US10049302B1 (en) * 2017-07-17 2018-08-14 Sas Institute Inc. Classification system training
CN107452315B (en) * 2017-08-04 2021-03-12 Oppo广东移动通信有限公司 Color temperature adjusting method and device, mobile terminal, electronic terminal and system
US20190095764A1 (en) * 2017-09-26 2019-03-28 Panton, Inc. Method and system for determining objects depicted in images
CN109726287A (en) * 2018-12-25 2019-05-07 银江股份有限公司 A kind of people's mediation case classification system and method based on transfer learning and deep learning
CN112689361A (en) * 2018-12-29 2021-04-20 中国计量大学 Integrative classroom scene formula self-adaptation lighting control device in kindergarten
CN109858376A (en) * 2019-01-02 2019-06-07 武汉大学 A kind of intelligent desk lamp with child healthy learning supervisory role
CN110807760B (en) * 2019-09-16 2022-04-08 北京农业信息技术研究中心 Tobacco leaf grading method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105869580A (en) * 2016-06-15 2016-08-17 京东方科技集团股份有限公司 Color temperature adjusting method and device, backlight source and display equipment
CN110111341A (en) * 2019-04-30 2019-08-09 北京百度网讯科技有限公司 Display foreground acquisition methods, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LED家居室内照明光色设计;王香娟;《照明工程学报》;20111015;全文 *
Towards Smart Lighting System without Using Chroma Meter in Workplace;M. Hajjaj;《2018 IEEE 7th Global Conference on Consumer Electronics (GCCE)》;20181213;全文 *

Also Published As

Publication number Publication date
CN111601418A (en) 2020-08-28

Similar Documents

Publication Publication Date Title
CN109614996B (en) Weak visible light and infrared image fusion identification method based on generation countermeasure network
CN108921203B (en) Detection and identification method for pointer type water meter
CN107229930B (en) Intelligent identification method for numerical value of pointer instrument
He et al. Application of deep learning in integrated pest management: A real-time system for detection and diagnosis of oilseed rape pests
CN111274860B (en) Recognition method for online automatic tobacco grade sorting based on machine vision
CN108875522A (en) Face cluster methods, devices and systems and storage medium
CN109858569A (en) Multi-tag object detecting method, system, device based on target detection network
CN109086754A (en) A kind of human posture recognition method based on deep learning
CN109325495A (en) A kind of crop image segmentation system and method based on deep neural network modeling
CN110826453A (en) Behavior identification method by extracting coordinates of human body joint points
CN106250819A (en) Based on face's real-time monitor and detection facial symmetry and abnormal method
CN106874929B (en) Pearl classification method based on deep learning
CN109344738A (en) The recognition methods of crop diseases and pest crop smothering and device
CN107180245A (en) A kind of indoor and outdoor scene recognition method and device
CN114359727A (en) Tea disease identification method and system based on lightweight optimization Yolo v4
CN101828905B (en) Chinese medicine color inspection system
CN112215129A (en) Crowd counting method and system based on sequencing loss and double-branch network
CN108604040A (en) By expose management effectively using capturing the image used in face recognition
CN115222896B (en) Three-dimensional reconstruction method, three-dimensional reconstruction device, electronic equipment and computer readable storage medium
CN109919246A (en) Pedestrian's recognition methods again based on self-adaptive features cluster and multiple risks fusion
CN113688787A (en) Peanut leaf disease identification method
CN111601418B (en) Color temperature adjusting method and device, storage medium and processor
CN110688955A (en) Building construction target detection method based on YOLO neural network
CN108960413A (en) A kind of depth convolutional neural networks method applied to screw surface defects detection
CN116321620A (en) Intelligent lighting switch control system and method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201012

Address after: Room 410, 4 / F, Boyan science and technology building, No.7 building, East District, No.10 courtyard, northwest Wangdong Road, Haidian District, Beijing 100193

Applicant after: Boyan colorful Data Technology Co.,Ltd.

Address before: 401120 building 18, No.106, west section of Jinkai Avenue, Yubei District, Chongqing

Applicant before: Boyan Jizhi Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant