Training method of oil fume concentration detection model and control method of range hood gear position
By using a neural network to identify the oil smoke concentration in the image and control the hood gear, the existing hood sensing system solves the problem of poor oil smoke concentration detection and improves the accuracy and response speed of oil smoke concentration detection.
Patent Information
- Application Number
- CN202010662251.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-10
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-07-10
AI Technical Summary
The existing smoke machine sensing system cannot effectively detect the concentration of oil smoke, resulting in users needing to use naked eyes or sensors with short service life, high cost, and slow response speed.
The oil smoke concentration detection model is used to identify the oil smoke concentration in the image through neural network training, including the input layer, classification network layer, smoke removal network layer and output layer. Image feature extraction and smoke removal processing are used to realize oil smoke concentration detection, and based on the detection results Control the range of the hood.
It does not require the user's human eyes to judge, achieving the accuracy and reliability of oil smoke concentration detection, reducing the use cost and maintenance difficulty of the sensor, and improving the response speed.
Smart Images

Figure CN111783900B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a training method for an oil fume concentration detection model and a method for controlling a range hood gear position. Background Art
[0002] The concentration of oil smoke generated during cooking changes dynamically. In order to achieve excellent kitchen smoke removal effects, the air volume of the range hood needs to be adjusted accordingly according to the concentration of oil smoke. However, at present, the range hood's own sensing system has gaps or poor performance in judging the concentration of oil smoke, for example:
[0003] For range hoods that cannot detect the concentration of oil smoke, users are required to judge the concentration of oil smoke in the kitchen with their naked eyes, which increases the burden on users.
[0004] For range hoods that include oil fume sensors, they use oil fume sensors to detect the oil fume concentration in the kitchen. However, the oil fume sensors based on gas sensitivity and light sensitivity have a short lifespan and a high cost. Moreover, they are installed inside the exhaust duct of the range hood, making subsequent replacement and maintenance difficult and having a slow response speed. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the defect in the prior art that the range hood's own sensing system has a vacancy or poor performance in judging the oil fume concentration, and to provide a training method for an oil fume concentration detection model and a method for controlling the range hood gear position.
[0006] The present invention solves the above technical problems through the following technical solutions:
[0007] A method for training a fume concentration detection model, comprising:
[0008] Acquire multiple groups of original image data, wherein each group of original image data includes an original image and a fume concentration category corresponding to the original image;
[0009] Using the acquired multiple groups of original image data to train an oil fume concentration detection model, the oil fume concentration detection model is used to output the oil fume concentration category of the currently input original image;
[0010] Wherein, the oil fume concentration detection model includes:
[0011] Input layer, used to input the original image;
[0012] A first classification network layer, used to obtain a first classification result of the original image;
[0013] The smoke removal network layer is used to obtain a smoke-removed image of the original image after smoke removal processing;
[0014] A fume image acquisition layer, used for acquiring a fume image according to the original image and the image after smoke removal;
[0015] A second classification network layer, used to obtain a second classification result of the oil smoke image;
[0016] The output layer is used to output the oil smoke concentration category of the original image according to the first classification result and the second classification result.
[0017] Preferably, the oil fume concentration detection model also includes:
[0018] A first feature extraction layer, used to obtain a first feature image of the original image;
[0019] A second feature extraction layer, used for obtaining a second feature image of the smoke-removed image;
[0020] The first classification network layer is specifically used to obtain a first classification result of the first feature image;
[0021] The oil smoke image acquisition layer is specifically used to acquire the oil smoke image according to the first characteristic image and the second characteristic image;
[0022] and / or,
[0023] The step of using the acquired multiple groups of original image data to train the oil smoke concentration detection model includes:
[0024] Extracting a target image corresponding to the oil smoke generation area from the original image;
[0025] The oil fume concentration detection model is trained with the target image corresponding to the same original image as input and the oil fume concentration category as output.
[0026] A method for controlling the gear position of a range hood, comprising:
[0027] Collect the image to be detected in the area where the range hood is located;
[0028] Detecting the oil fume concentration category of the image to be detected by using an oil fume concentration detection model, wherein the oil fume concentration detection model is trained by using any of the above-mentioned oil fume concentration detection model training methods;
[0029] The gear position of the range hood is controlled according to the detected oil fume concentration category.
[0030] Preferably, after the step of collecting the image to be detected in the area where the range hood is located, the method further includes:
[0031] Extracting a target image to be detected corresponding to the oil smoke generation area from the image to be detected;
[0032] The step of using the oil smoke concentration detection model to detect the oil smoke concentration category of the image to be detected specifically includes:
[0033] Detecting the oil fume concentration category of the target image to be detected by using an oil fume concentration detection model;
[0034] The step of controlling the gear position of the range hood according to the detected oil fume concentration category comprises:
[0035] The gear position of the range hood is controlled according to the detected oil smoke concentration category of the target image to be detected.
[0036] Preferably, the step of extracting the target image to be detected corresponding to the oil smoke generation area from the image to be detected specifically includes:
[0037] Identifying a pot area where the pot is located in the image to be detected;
[0038] The oil smoke generating area is determined according to the cookware area.
[0039] Preferably, the step of collecting the image to be detected in the area where the range hood is located specifically includes:
[0040] Collect the image to be detected in the area where the range hood is located according to the sampling period;
[0041] The step of controlling the gear position of the range hood according to the detected oil fume concentration category specifically includes:
[0042] According to the oil fume concentration category corresponding to the current sampling period and the oil fume concentration category corresponding to the previous sampling period, it is determined whether the oil fume concentration increases or decreases compared with the previous sampling period;
[0043] If it rises, the gear position of the range hood is raised;
[0044] If it decreases, determine whether the oil smoke concentration category has changed within the preset time period;
[0045] If not, lower the gear of the range hood.
[0046] A range hood gear position control system, comprising:
[0047] A collection module, used for collecting images to be detected in the area where the range hood is located;
[0048] A detection module, used for detecting the oil fume concentration category of the image to be detected by using an oil fume concentration detection model, wherein the oil fume concentration detection model is trained by using any of the above-mentioned oil fume concentration detection model training methods;
[0049] The control module is used to control the gear position of the range hood according to the detected oil fume concentration category.
[0050] Preferably, the control system further comprises:
[0051] An extraction module, used for extracting a target image to be detected corresponding to the oil smoke generation area from the image to be detected;
[0052] The detection module is specifically used to detect the oil fume concentration category of the target image to be detected by using an oil fume concentration detection model;
[0053] The control module is specifically used to control the gear position of the range hood according to the detected oil smoke concentration category of the target image to be detected;
[0054] and / or,
[0055] The acquisition module is specifically used to acquire the image to be detected in the area where the range hood is located according to the sampling period;
[0056] The control module specifically includes:
[0057] The first judgment unit is used to judge whether the oil fume concentration in the current sampling period increases or decreases compared with the previous sampling period according to the oil fume concentration category corresponding to the current sampling period and the oil fume concentration category corresponding to the previous sampling period;
[0058] If it rises, the gear raising unit is called to raise the gear of the range hood;
[0059] If it decreases, the second judgment unit is called to judge whether the oil smoke concentration category changes within a preset time period;
[0060] If not, the gear lowering unit is called to lower the gear of the range hood.
[0061] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned methods for controlling the gear position of a range hood when executing the computer program.
[0062] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for controlling the gear position of a range hood.
[0063] The positive progressive effect of the present invention is that the present invention converts the oil fume concentration detection problem into an image classification problem, and the user does not need to judge by human eyes. In addition, the oil fume concentration detection model in the present invention autonomously learns the image features of different oil fume concentration categories through a neural network. Specifically, a dual-channel network learning model is adopted, which can better learn the features of the original image and the oil fume image, and the oil fume concentration detection that integrates the first classification result corresponding to the original image and the second classification result corresponding to the oil fume image is more accurate, and can effectively and reliably perform oil fume concentration detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 Flow chart of the training method of the oil smoke concentration detection model according to Example 1 of the present invention.
[0065] Figure 2 Schematic diagram of the structure of the oil fume concentration detection model trained according to the oil fume concentration detection model training method of Example 1 of the present invention.
[0066] Figure 3 Flow chart of the training method of the oil smoke concentration detection model according to Example 2 of the present invention.
[0067] Figure 4 Flow chart of a method for controlling the range hood gear position according to embodiment 3 of the present invention.
[0068] Figure 5 The figure is a specific flow chart of the method for controlling the range hood gear position according to embodiment 3 of the present invention.
[0069] Figure 6 Flow chart of a method for controlling the range hood position according to embodiment 4 of the present invention.
[0070] Figure 7 Schematic diagram of the modules of the training system of the smoke concentration detection model according to Example 5 of the present invention.
[0071] Figure 8 Schematic diagram of the modules of the training system of the smoke concentration detection model according to Example 6 of the present invention.
[0072] Fig. 9 Schematic diagram of the modules of the range hood gear control system according to Embodiment 7 of the present invention.
[0073] Fig.10 Schematic diagram of the installation position of the acquisition module in the range hood gear control system according to Example 7 of the present invention.
[0074] Fig.11 Schematic diagram of the modules of the range hood gear control system according to Example 8 of the present invention.
[0075] Fig.12Schematic diagram of the structure of an electronic device according to Embodiment 9 of the present invention. DETAILED DESCRIPTION
[0076] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0077] Example 1
[0078] This embodiment provides a method for training a fume concentration detection model. Figure 1 , the training method of this embodiment includes:
[0079] S101, obtaining multiple groups of original image data;
[0080] S102: Using the acquired multiple groups of original image data to train a fume concentration detection model.
[0081] In this embodiment, each set of original image data includes an original image and a fume concentration category corresponding to the original image, wherein the original image is an image including fume, for example, an image collected in a kitchen scene. In this embodiment, several fume concentration categories can be set according to actual applications, for example, the fume concentration category corresponding to the original image can be marked as no smoke, small smoke, medium smoke, large smoke, etc.
[0082] In this embodiment, the oil smoke concentration detection model is used to output the oil smoke concentration category of the current input original image. Figure 2 , the oil fume concentration detection model of this embodiment includes:
[0083] Input layer, used to input the original image X;
[0084] The first feature extraction layer, which may specifically include a convolution layer and a pooling layer, is used to obtain a first feature image I of the original image X. X ;
[0085] The first classification network layer can use a softmax layer (for multi-classification) or a fully connected layer or a convolutional layer to obtain the first feature image I X The first classification result C 1 ;
[0086] The smoke removal network layer is used to obtain the smoke-removed image X' after the original image X is processed by smoke removal;
[0087] The second feature extraction layer may include a convolution layer and a pooling layer, which is used to obtain the second feature image R of the smoke-free image X'. X ;
[0088] The oil smoke image acquisition layer is used to obtain the oil smoke image according to the first feature image I X and the second feature image RX Get the smoke image Y = I X -R X ;
[0089] The second classification network layer can use a softmax layer, a fully connected layer, or a convolutional layer, etc., to obtain the second classification result C of the oil smoke image Y 2 ;
[0090] The output layer is used to classify the first classification result C 1 and the second classification result C 2 Output the oil smoke concentration category of the original image C = αC 1 +βC 2 .
[0091] In this embodiment, the first feature extraction layer and the second feature extraction layer differ in the number and arrangement order of each layer; the first classification network layer and the second classification network layer use the same network structure to keep the output tensor shape consistent.
[0092] Specifically, in this embodiment, the original image X may be an RGB image (an image that uses the components of the three color channels of red, green, and blue to identify the color of a pixel), and the smoke removal network layer is intended to obtain a clear smoke-free smoke-free image X'. The first classification result C 1 Used to characterize the first feature image I X The maximum probability in the probability distribution corresponding to different oil smoke concentration categories, the second classification result C 2 Used to characterize the second feature image R X The maximum probability in the probability distribution corresponding to different oil fume concentration categories, α is used to characterize the image feature weight, and β is used to characterize the oil fume feature weight. When training the oil fume concentration detection model based on the original image data, α and β are set as randomly initialized trainable parameters.
[0093] After the structure of the oil fume concentration detection model is built, the multiple sets of original image data obtained are sent to the oil fume concentration detection model to be trained in batches for training. The neural network optimizer adjusts the parameters of each layer in the network in the direction of reducing the loss value. After meeting a certain number of iterations or accuracy requirements, the trained oil fume concentration detection model can be obtained.
[0094] In this embodiment, the loss function of the oil smoke concentration detection model can use a cross entropy loss function, and the corresponding formula is as follows:
[0095]
[0096] Among them, m represents the number of original images in a single batch used to train the oil fume concentration detection model, n represents the number of oil fume concentration categories, p represents the probability of the real oil fume concentration category annotated in the original image, and q represents the probability of the oil fume concentration category predicted by the oil fume concentration detection model.
[0097] In this embodiment, the setting of the first feature extraction layer and the second feature extraction layer is conducive to filtering redundant information, reducing the amount of calculation, and further improving the accuracy of the oil fume concentration detection model of this embodiment. In other embodiments, the setting of the first feature extraction layer and the second feature extraction layer can also be omitted.
[0098] This embodiment uses a large amount of original image data to train the oil fume concentration detection model. Furthermore, this embodiment can use an offline method to train the oil fume concentration detection model. In addition, in the field of images, convolutional neural networks have a strong ability to represent image information, and by extracting features from a large number of original images, the obtained features have good universality, eliminating the limitations and complexity of artificially designed image features.
[0099] Specifically, traditional image-based oil fume concentration detection methods, such as pixel grayscale statistics, frame difference method dynamic target extraction, feature operator calculation, etc., need to preset a threshold and determine the oil fume concentration by comparing the preset threshold with the oil fume concentration results extracted from the actual user image. However, these traditional methods are easily affected by environmental differences such as light and background, and thus have poor universality and accuracy. The present embodiment uses a large amount of original image data to train the neural network, and overcomes the complexity of the use environment with the data scale and the learning ability of the neural network model, so that the universality and accuracy are better.
[0100] The present embodiment transforms the oil fume concentration detection problem into an image classification problem, and the user does not need to judge by the human eye. In addition, the oil fume concentration detection model in the present embodiment autonomously learns the image features of different oil fume concentration categories through a neural network. Specifically, a dual-channel network learning model is adopted, which can better learn the features of the original image and the oil fume image, and the oil fume concentration category that integrates the first classification result corresponding to the original image and the second classification result corresponding to the oil fume image is more accurate, and can effectively and reliably detect the oil fume concentration.
[0101] Example 2
[0102] This embodiment provides a method for training a fume concentration detection model based on embodiment 1. Figure 3 In this embodiment, step S102 specifically includes:
[0103] S1021, extracting a target image corresponding to the oil smoke generation area from the original image;
[0104] S1022. Train an oil fume concentration detection model using a target image corresponding to the same original image as input and an oil fume concentration category as output.
[0105] Since the original image may include a sink, a chopping board, etc. in addition to oil smoke, and oil smoke is usually generated above the cooker, the oil smoke generating area in this embodiment is preferably determined based on the cooker area where the cooker is located. For example, the cooker area in the original image can be expanded as the oil fume generating area, and the target image correspondingly includes a large number of oil fume features.
[0106] Specifically, in this embodiment, the video including oil smoke can be directly separated into several frames of original images, and then the target image corresponding to the oil smoke generation area can be used as a training sample by using the pot detection model and / or based on manual cropping, wherein the oil smoke generation area can include the pot area, for example. In particular, for the original image with excessive oil smoke concentration such as heavy smoke, which makes it difficult to extract the oil smoke generation area, the entire original image can be selected as the training sample. After that, all training samples are uniformly scaled to a pixel size consistent with the input size of the neural network.
[0107] In this embodiment, extracting the target image corresponding to the oil fume generation area from the original image can further filter redundant information, reduce the amount of calculation, and improve the accuracy of the oil fume concentration detection model of this embodiment.
[0108] Example 3
[0109] This embodiment provides a method for controlling the gear position of a range hood. Specifically, the control method of this embodiment is implemented using the oil fume concentration detection model trained by Embodiment 1, and referring to Figure 4 , the control method of this embodiment includes:
[0110] S301, collecting images to be detected in the area where the range hood is located;
[0111] S302, using a fume concentration detection model to detect the fume concentration category of the image to be detected;
[0112] S303, controlling the gear position of the range hood according to the detected oil fume concentration category.
[0113] Since the control of the range hood position requires knowledge of the actual smoke volume, and the actual smoke volume can be approximately represented by the oil fume concentration, the trained oil fume concentration detection model can be used to detect the collected images to be detected in the area where the range hood is located to obtain the oil fume concentration category of the area where the range hood is located, and then realize the logical control of the range hood position according to the oil fume concentration category obtained online.
[0114] Further, in this embodiment, referring to Figure 5 , step S301 specifically includes:
[0115] S3011. Collect the image to be detected in the area where the range hood is located according to the sampling period.
[0116] Reference Figure 5 , step S303 specifically includes:
[0117] S3031. According to the oil fume concentration category corresponding to the current sampling period and the oil fume concentration category corresponding to the previous sampling period, determine whether the oil fume concentration increases or decreases between the current sampling period and the previous sampling period;
[0118] If it is rising, execute step S3032; if it is falling, execute step S3033;
[0119] S3032, raise the range hood position;
[0120] S3033, determining whether the oil smoke concentration category changes within a preset time period;
[0121] If not, execute step S3034;
[0122] S3034. Lower the range hood position.
[0123] In this embodiment, both the collection period and the preset duration can be customized according to the actual application. However, the value of the collection period must be smaller than the value of the preset duration. For example, the collection period can be 20s and the preset duration can be 3min.
[0124] After starting the range hood, the oil fume concentration is first detected using the oil fume concentration detection model to obtain the initial oil fume concentration category that characterizes the initial oil fume state, and then the range hood is controlled to run at the specified gear according to the correspondence between the preset initial oil fume concentration category and the range hood gear, thereby completing the range hood startup initialization process.
[0125] The logic control of the range hood position in this embodiment is exemplified as follows:
[0126] When the oil fume concentration category corresponding to the current sampling period is low smoke and the oil fume concentration category corresponding to the previous sampling period is no smoke, it can be determined that the oil fume concentration has increased compared with the previous sampling period, so the range hood gear is increased, and further, the range hood gear is increased by one gear when the oil fume concentration increases by one gear;
[0127] When the oil fume concentration category corresponding to the current sampling period is medium smoke and the oil fume concentration category corresponding to the previous sampling period is no smoke, it can be determined that the oil fume concentration has increased compared with the previous sampling period, so the range hood gear is increased. Further, when the oil fume concentration increases by two gears, the range hood gear is increased by two gears.
[0128] When the oil fume concentration category corresponding to the current sampling period is low smoke and the oil fume concentration category corresponding to the previous sampling period is medium smoke, it can be determined that the oil fume concentration decreases compared with the previous sampling period, and then, it is determined whether the oil fume concentration category changes within the preset time. If the oil fume concentration category changes within the preset time, the range hood gear is maintained unchanged, and if the oil fume concentration category does not change within the preset time, the range hood gear can be lowered;
[0129] When the oil fume concentration category corresponding to the current sampling cycle is low smoke and the oil fume concentration category corresponding to the previous sampling cycle is low smoke, it can be determined that the oil fume concentration is unchanged compared with the previous sampling cycle, so the range hood gear is maintained unchanged.
[0130] This embodiment controls the range hood gear position according to the oil fume concentration category monitored in real time, and further controls the switching of the range hood gear position according to the change of the oil fume concentration category to adjust the range hood to the best working state. Furthermore, this embodiment is also helpful to identify the rising trend of oil fume concentration in advance, so as to help switch the range hood gear position before the oil fume spreads to avoid the spread of oil fume. Therefore, this embodiment realizes the establishment of a mapping relationship between the oil fume concentration category and the range hood gear position, and further realizes the stable control of the operation of the fan in the range hood.
[0131] Example 4
[0132] This embodiment provides a method for controlling the range hood position based on the embodiment 3. The difference between this embodiment and the embodiment 3 is that this embodiment is implemented by using the oil fume concentration detection model obtained by training in the embodiment 2, and referring to Figure 6 , the control method of this embodiment further includes, after step S301:
[0133] S304, extracting a target image to be detected corresponding to the oil smoke generation area from the image to be detected;
[0134] Step S302 specifically includes:
[0135] S3021, using the oil smoke concentration detection model to detect the oil smoke concentration category of the target image to be detected;
[0136] Step S303 specifically includes:
[0137] S3035. Control the gear position of the range hood according to the detected oil smoke concentration category of the target image to be detected.
[0138] This embodiment extracts the target image to be detected corresponding to the oil fume generation area from the collected image to be detected, and then performs oil fume concentration detection on the target image to be detected corresponding to the oil fume generation area, so as to obtain a relatively stable and reliable oil fume concentration detection result.
[0139] Specifically, in this embodiment, since oil smoke is usually generated above the pot, step S402 may include the steps of identifying the pot area where the pot is located in the image to be detected and determining the oil smoke generation area according to the pot area, so as to determine the oil smoke generation area. For example, the pot area in the original image may be expanded as the oil smoke generation area. In particular, if it is difficult to identify the pot area in the current image to be detected due to excessive oil smoke concentration (for example, the oil smoke concentration category is heavy smoke), the oil smoke generation area determined in the previous sampling cycle may be used as the oil smoke generation area corresponding to the current sampling cycle.
[0140] In this embodiment, the startup initialization process of the range hood may specifically include, first, checking the identified cookware area with the previously saved cookware area to ensure the credibility of the new cookware area, then using the oil fume concentration detection model to perform oil fume concentration detection on the new oil fume generating area to obtain an initial oil fume concentration category that characterizes the initial oil fume state, and finally, according to the correspondence between the preset initial oil fume concentration category and the range hood gear position, controlling the range hood to run at the specified gear.
[0141] Furthermore, in this embodiment, the extracted target image to be detected needs to be normalized to the network input size of the oil fume concentration detection model before being input into the oil fume concentration detection model.
[0142] Furthermore, since the positions of stoves, range hoods, etc. are relatively fixed during the actual cooking process, the position of the oil fume generating area in the image to be detected is also relatively fixed. Therefore, the oil fume generating area does not need to be determined in real time. For example, the oil fume generating area can be determined according to a preset interval to save computing resources and reduce the amount of calculation.
[0143] This embodiment performs oil fume concentration detection on the target image to be detected corresponding to the oil fume generating area, and the obtained oil fume concentration category is more accurate and reliable, so that the control of the range hood gear position is more stable and reliable, which is conducive to improving the user experience.
[0144] Example 5
[0145] This embodiment provides a training system for a fume concentration detection model. Figure 7 , the training system of this embodiment includes:
[0146] An acquisition module 501 is used to acquire multiple sets of original image data;
[0147] The training module 502 is used to train the oil smoke concentration detection model using the acquired multiple groups of original image data.
[0148] In this embodiment, each set of original image data includes an original image and a fume concentration category corresponding to the original image, wherein the original image is an image including fume, for example, an image collected in a kitchen scene. In this embodiment, several fume concentration categories can be set according to actual applications, for example, the fume concentration category corresponding to the original image can be marked as no smoke, small smoke, medium smoke, large smoke, etc.
[0149] In this embodiment, the oil smoke concentration detection model is used to output the oil smoke concentration category of the current input original image. Figure 2 , the oil fume concentration detection model of this embodiment includes:
[0150] Input layer, used to input the original image X;
[0151] The first feature extraction layer, which may specifically include a convolution layer and a pooling layer, is used to obtain a first feature image I of the original image X. X ;
[0152] The first classification network layer can be a softmax layer, a fully connected layer, or a convolutional layer, etc., used to obtain the first feature image I X The first classification result C 1 ;
[0153] The smoke removal network layer is used to obtain the smoke-removed image X' after the original image X is processed by smoke removal;
[0154] The second feature extraction layer may include a convolution layer and a pooling layer, which is used to obtain the second feature image R of the smoke-free image X'. X ;
[0155] The oil smoke image acquisition layer is used to obtain the oil smoke image according to the first feature image I X and the second feature image R X Get the smoke image Y = I X -R X ;
[0156] The second classification network layer can use a softmax layer, a fully connected layer, or a convolutional layer, etc., to obtain the second classification result C of the oil smoke image Y 2 ;
[0157] The output layer is used to classify the first classification result C 1 and the second classification result C 2 Output the oil smoke concentration category of the original image C = αC 1 +βC 2 .
[0158] In this embodiment, the first feature extraction layer and the second feature extraction layer differ in the number and arrangement order of each layer; the first classification network layer and the second classification network layer use the same network structure to keep the output tensor shape consistent.
[0159] Specifically, in this embodiment, the original image X may be an RGB image (an image that uses the components of the three color channels of red, green, and blue to identify the color of a pixel), and the smoke removal network layer is intended to obtain a clear smoke-free smoke-free image X'. The first classification result C 1 Used to characterize the first feature image I X The maximum probability in the probability distribution corresponding to different oil smoke concentration categories, the second classification result C 2 Used to characterize the second feature image R X The maximum probability in the probability distribution corresponding to different oil fume concentration categories, α is used to characterize the image feature weight, and β is used to characterize the oil fume feature weight. When training the oil fume concentration detection model based on the original image data, α and β are set as randomly initialized trainable parameters.
[0160] After the structure of the oil fume concentration detection model is built, the multiple sets of original image data obtained are sent to the oil fume concentration detection model to be trained in batches for training. The neural network optimizer adjusts the parameters of each layer in the network in the direction of reducing the loss value. After meeting a certain number of iterations or accuracy requirements, the trained oil fume concentration detection model can be obtained.
[0161] In this embodiment, the loss function of the oil smoke concentration detection model can use a cross entropy loss function, and the corresponding formula is as follows:
[0162]
[0163] Among them, m represents the number of original images in a single batch used to train the oil fume concentration detection model, n represents the number of oil fume concentration categories, p represents the probability of the real oil fume concentration category annotated in the original image, and q represents the probability of the oil fume concentration category predicted by the oil fume concentration detection model.
[0164] In this embodiment, the setting of the first feature extraction layer and the second feature extraction layer is conducive to filtering redundant information, reducing the amount of calculation, and further improving the accuracy of the oil fume concentration detection model of this embodiment. In other embodiments, the setting of the first feature extraction layer and the second feature extraction layer can also be omitted.
[0165] This embodiment uses a large amount of original image data to train the oil fume concentration detection model. Furthermore, this embodiment can use an offline method to train the oil fume concentration detection model. In addition, in the field of images, convolutional neural networks have a strong ability to represent image information, and by extracting features from a large number of original images, the obtained features have good universality, eliminating the limitations and complexity of artificially designed image features.
[0166] Specifically, traditional image-based oil fume concentration detection methods, such as pixel grayscale statistics, frame difference method dynamic target extraction, feature operator calculation, etc., need to preset a threshold and determine the oil fume concentration by comparing the preset threshold with the oil fume concentration results extracted from the actual user image. However, these traditional methods are easily affected by environmental differences such as light and background, and thus have poor universality and accuracy. The present embodiment uses a large amount of original image data to train the neural network, and overcomes the complexity of the use environment with the data scale and the learning ability of the neural network model, so that the universality and accuracy are better.
[0167] The present embodiment transforms the oil fume concentration detection problem into an image classification problem, and the user does not need to judge by the human eye. In addition, the oil fume concentration detection model in the present embodiment autonomously learns the image features of different oil fume concentration categories through a neural network. Specifically, a dual-channel network learning model is adopted, which can better learn the features of the original image and the oil fume image, and the oil fume concentration category that integrates the first classification result corresponding to the original image and the second classification result corresponding to the oil fume image is more accurate, and can effectively and reliably detect the oil fume concentration.
[0168] Example 6
[0169] This embodiment provides a training system for a fume concentration detection model based on Embodiment 5. Figure 8 In this embodiment, the training module 502 specifically includes:
[0170] An extraction unit 5021 is used to extract a target image corresponding to the oil smoke generation area from the original image;
[0171] The training unit 5022 is used to train the oil fume concentration detection model by taking the target image corresponding to the same original image as input and the oil fume concentration category as output.
[0172] Since the original image may include a sink, a chopping board, etc. in addition to oil smoke, and oil smoke is usually generated above the cooker, the oil smoke generating area in this embodiment is preferably determined based on the cooker area where the cooker is located. For example, the cooker area in the original image can be expanded as the oil fume generating area, and the target image correspondingly includes a large number of oil fume features.
[0173] Specifically, in this embodiment, the video including oil smoke can be directly separated into several frames of original images, and then the target image corresponding to the oil smoke generation area can be used as a training sample by using the pot detection model and / or based on manual cropping, wherein the oil smoke generation area can include the pot area, for example. In particular, for the original image with excessive oil smoke concentration such as heavy smoke, which makes it difficult to extract the oil smoke generation area, the entire original image can be selected as the training sample. After that, all training samples are uniformly scaled to a pixel size consistent with the input size of the neural network.
[0174] In this embodiment, extracting the target image corresponding to the oil fume generation area from the original image can further filter redundant information, reduce the amount of calculation, and improve the accuracy of the oil fume concentration detection model of this embodiment.
[0175] Example 7
[0176] This embodiment provides a range hood position control system. Specifically, the control system of this embodiment is implemented using the oil fume concentration detection model trained by Embodiment 1 or Embodiment 5, and refers to Fig. 9 , the control system of this embodiment includes:
[0177] The acquisition module 701 is used to acquire the image to be detected in the area where the range hood is located;
[0178] The detection module 702 is used to detect the oil fume concentration category of the image to be detected by using the oil fume concentration detection model;
[0179] The control module 703 is used to control the gear position of the range hood according to the detected oil fume concentration category.
[0180] In this embodiment, the acquisition module 701 may be a camera, and its installation position relative to the range hood may be customized according to actual application. Fig.10 The figure shows an installation position of a camera relative to a range hood.
[0181] Since the control of the range hood position requires knowledge of the actual amount of smoke, and the actual amount of smoke can be approximately represented by the oil fume concentration, in this embodiment, the trained oil fume concentration detection model can be used to detect the collected images to be detected in the area where the range hood is located to obtain the oil fume concentration category of the area where the range hood is located, and then realize the logical control of the range hood position according to the oil fume concentration category obtained online.
[0182] Furthermore, in this embodiment, the acquisition module 701 is specifically used to acquire the image to be detected in the area where the range hood is located according to the sampling period;
[0183] Reference Fig. 9 , the control module 703 specifically includes:
[0184] The first judgment unit 7031 is used to judge whether the oil fume concentration in the current sampling period increases or decreases compared with the previous sampling period according to the oil fume concentration category corresponding to the current sampling period and the oil fume concentration category corresponding to the previous sampling period;
[0185] If it rises, the gear raising unit 7032 is called to raise the gear of the range hood;
[0186] If it decreases, the second judgment unit 7033 is called to judge whether the oil smoke concentration category changes within a preset time period;
[0187] If not, the gear reduction unit 7034 is called to reduce the gear of the range hood.
[0188] In this embodiment, both the collection period and the preset duration can be customized according to the actual application. However, the value of the collection period must be smaller than the value of the preset duration. For example, the collection period can be 20s and the preset duration can be 3min.
[0189] After starting the range hood, the oil fume concentration is first detected using the oil fume concentration detection model to obtain the initial oil fume concentration category that characterizes the initial oil fume state, and then the range hood is controlled to run at the specified gear according to the correspondence between the preset initial oil fume concentration category and the range hood gear, thereby completing the range hood startup initialization process.
[0190] After the range hood is started, the logic control of the range hood position in this embodiment is exemplified as follows:
[0191] When the oil fume concentration category corresponding to the current sampling period is low smoke and the oil fume concentration category corresponding to the previous sampling period is no smoke, it can be determined that the oil fume concentration has increased compared with the previous sampling period, so the range hood gear is increased, and further, the range hood gear is increased by one gear when the oil fume concentration increases by one gear;
[0192] When the oil fume concentration category corresponding to the current sampling period is medium smoke and the oil fume concentration category corresponding to the previous sampling period is no smoke, it can be determined that the oil fume concentration has increased compared with the previous sampling period, so the range hood gear is increased. Further, when the oil fume concentration increases by two gears, the range hood gear is increased by two gears.
[0193] When the oil fume concentration category corresponding to the current sampling period is low smoke and the oil fume concentration category corresponding to the previous sampling period is medium smoke, it can be determined that the oil fume concentration decreases compared with the previous sampling period, and then, it is determined whether the oil fume concentration category changes within the preset time. If the oil fume concentration category changes within the preset time, the range hood gear is maintained unchanged, and if the oil fume concentration category does not change within the preset time, the range hood gear can be lowered;
[0194] When the oil fume concentration category corresponding to the current sampling cycle is low smoke and the oil fume concentration category corresponding to the previous sampling cycle is low smoke, it can be determined that the oil fume concentration is unchanged compared with the previous sampling cycle, so the range hood gear is maintained unchanged.
[0195] This embodiment controls the range hood gear position according to the oil fume concentration category monitored in real time, and further controls the switching of the range hood gear position according to the change of the oil fume concentration category to adjust the range hood to the best working state. Furthermore, this embodiment is also helpful to identify the rising trend of oil fume concentration in advance, so as to help switch the range hood gear position before the oil fume spreads to avoid the spread of oil fume. Therefore, this embodiment realizes the establishment of a mapping relationship between the oil fume concentration category and the range hood gear position, and further realizes the stable control of the operation of the fan in the range hood.
[0196] Example 8
[0197] This embodiment provides a range hood gear control system based on the embodiment 7. The difference between this embodiment and the embodiment 7 is that this embodiment is implemented by using the oil fume concentration detection model obtained by training in the embodiment 2 or the embodiment 6, and referring to Fig.11 , the control system of this embodiment also includes:
[0198] The extraction module 704 is used to extract the target image to be detected corresponding to the oil smoke generation area from the image to be detected.
[0199] In this embodiment, the detection module 702 is specifically configured to detect the oil fume concentration category of the target image to be detected by using an oil fume concentration detection model.
[0200] In this embodiment, the control module 703 is specifically configured to control the gear position of the range hood according to the detected oil fume concentration category of the target image to be detected.
[0201] This embodiment extracts the target image to be detected corresponding to the oil fume generation area from the collected image to be detected, and then performs oil fume concentration detection on the target image to be detected corresponding to the oil fume generation area, so as to obtain a relatively stable and reliable oil fume concentration detection result.
[0202] Specifically, in this embodiment, since oil smoke is usually generated above the pot, the extraction module 704 may include an identification unit for identifying the pot area where the pot is located in the image to be detected and a determination unit for determining the oil smoke generation area according to the pot area, so as to determine the oil smoke generation area. For example, the pot area in the original image may be expanded as the oil smoke generation area. In particular, if it is difficult to identify the pot area in the current image to be detected due to excessive oil smoke concentration (for example, the oil smoke concentration category is heavy smoke), the oil smoke generation area determined in the previous sampling cycle may be used as the oil smoke generation area corresponding to the current sampling cycle.
[0203] In this embodiment, the startup initialization process of the range hood may specifically include, first, checking the identified cookware area with the previously saved cookware area to ensure the credibility of the new cookware area, then using the oil fume concentration detection model to perform oil fume concentration detection on the new oil fume generating area to obtain an initial oil fume concentration category that characterizes the initial oil fume state, and finally, according to the correspondence between the preset initial oil fume concentration category and the range hood gear position, controlling the range hood to run at the specified gear.
[0204] Furthermore, in this embodiment, the extracted target image to be detected needs to be normalized to the network input size of the oil fume concentration detection model before being input into the oil fume concentration detection model.
[0205] Furthermore, since the positions of stoves, range hoods, etc. are relatively fixed during the actual cooking process, the position of the oil fume generating area in the image to be detected is also relatively fixed. Therefore, the oil fume generating area does not need to be determined in real time. For example, the oil fume generating area can be determined according to a preset interval to save computing resources and reduce the amount of calculation.
[0206] This embodiment performs oil fume concentration detection on the target image to be detected corresponding to the oil fume generating area, and the obtained oil fume concentration category is more accurate and reliable, so that the control of the range hood gear position is more stable and reliable, which is conducive to improving the user experience.
[0207] Example 9
[0208] This embodiment provides an electronic device, which can be expressed in the form of a computing device (for example, a server device), including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the training method of the oil fume concentration detection model provided in Embodiment 1 or 2 can be implemented, or the control method of the range hood gear provided in Embodiment 3 or 4 can be implemented.
[0209] Fig.12 FIG. 4 shows a schematic diagram of the hardware structure of this embodiment. Fig.12 As shown, the electronic device 9 specifically includes:
[0210] At least one processor 91, at least one memory 92, and a bus 93 for connecting different system components (including the processor 91 and the memory 92), wherein:
[0211] The bus 93 includes a data bus, an address bus, and a control bus.
[0212] The memory 92 includes a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0213] Memory 92 also includes a program / utility 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0214] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the training method of the oil fume concentration detection model provided in Example 1 or 2 of the present invention, or the control method of the range hood gear provided in Example 3 or 4.
[0215] The electronic device 9 can further communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication can be performed through an input / output (I / O) interface 95. In addition, the electronic device 9 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 96. The network adapter 96 communicates with other modules of the electronic device 9 through a bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
[0216] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0217] Example 10
[0218] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the training method of the oil fume concentration detection model provided in Example 1 or 2, or can implement the steps of the range hood gear control method provided in Example 3 or 4.
[0219] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0220] In a possible implementation, the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the training method of the oil fume concentration detection model provided in Example 1 or 2, or can implement the steps of the range hood gear control method provided in Example 3 or 4.
[0221] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on a user device, partially on a user device, as an independent software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0222] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A method for training a fume concentration detection model, characterized in that: include: Acquire multiple groups of original image data, wherein each group of original image data includes an original image and a fume concentration category corresponding to the original image; Using the acquired multiple groups of original image data to train an oil fume concentration detection model, the oil fume concentration detection model is used to output the oil fume concentration category of the currently input original image; Wherein, the oil fume concentration detection model includes: Input layer, used to input the original image; A first classification network layer, used to obtain a first classification result of the original image; The smoke removal network layer is used to obtain a smoke-removed image of the original image after smoke removal processing; A fume image acquisition layer, used for acquiring a fume image according to the original image and the image after smoke removal; A second classification network layer, used to obtain a second classification result of the oil smoke image; An output layer, used for outputting the oil smoke concentration category of the original image according to the first classification result and the second classification result; The oil fume concentration detection model also includes: A first feature extraction layer, used to obtain a first feature image of the original image; A second feature extraction layer, used for obtaining a second feature image of the smoke-removed image; There are differences in the number and arrangement order of each layer between the first feature extraction layer and the second feature extraction layer; The first classification network layer is specifically used to obtain a first classification result of the first feature image; The oil smoke image acquisition layer is specifically used to acquire the oil smoke image according to the first characteristic image and the second characteristic image; The first classification result is used to represent the maximum probability in the probability distribution of the first feature image corresponding to different oil smoke concentration categories; The second classification result is used to represent the maximum probability in the probability distribution of the second feature image corresponding to different oil smoke concentration categories.
2. The method for training a fume concentration detection model according to claim 1, characterized in that: The step of using the acquired multiple groups of original image data to train the oil smoke concentration detection model includes: Extracting a target image corresponding to the oil smoke generation area from the original image; The oil fume concentration detection model is trained with the target image corresponding to the same original image as input and the oil fume concentration category as output.
3. A method for controlling the gear position of a range hood, characterized in that: include: Collect the image to be detected in the area where the range hood is located; Detecting the oil fume concentration category of the image to be detected by using an oil fume concentration detection model, wherein the oil fume concentration detection model is trained by using the oil fume concentration detection model training method according to claim 1 or 2; The gear position of the range hood is controlled according to the detected oil fume concentration category.
4. The method for controlling the range hood position according to claim 3, characterized in that: After the step of collecting the image to be detected in the area where the smoke exhaust fan is located, the method further includes: Extracting a target image to be detected corresponding to the oil smoke generation area from the image to be detected; The step of using the oil smoke concentration detection model to detect the oil smoke concentration category of the image to be detected specifically includes: Detecting the oil fume concentration category of the target image to be detected by using an oil fume concentration detection model; The step of controlling the gear position of the range hood according to the detected oil fume concentration category comprises: The gear position of the range hood is controlled according to the detected oil smoke concentration category of the target image to be detected.
5. The method for controlling the range hood position according to claim 4, characterized in that: The step of extracting the target image to be detected corresponding to the oil smoke generation area from the image to be detected specifically includes: Identifying a pot area where the pot is located in the image to be detected; The oil smoke generating area is determined according to the cookware area.
6. The method for controlling the range hood position according to claim 3, characterized in that: The step of collecting the image to be detected in the area where the range hood is located specifically includes: Collect the image to be detected in the area where the range hood is located according to the sampling period; The step of controlling the gear position of the range hood according to the detected oil fume concentration category specifically includes: According to the oil fume concentration category corresponding to the current sampling period and the oil fume concentration category corresponding to the previous sampling period, it is determined whether the oil fume concentration increases or decreases compared with the previous sampling period; If it rises, the gear position of the range hood is raised; If it decreases, determine whether the oil smoke concentration category has changed within the preset time period; If not, lower the gear of the range hood.
7. A range hood gear control system, characterized in that: include: A collection module, used for collecting images to be detected in the area where the range hood is located; a detection module, configured to detect the oil fume concentration category of the image to be detected by using an oil fume concentration detection model, wherein the oil fume concentration detection model is trained by using the oil fume concentration detection model training method according to claim 1 or 2; The control module is used to control the gear position of the range hood according to the detected oil fume concentration category.
8. The range hood gear position control system according to claim 7, characterized in that: The control system further comprises: An extraction module, used for extracting a target image to be detected corresponding to the oil smoke generation area from the image to be detected; The detection module is specifically used to detect the oil fume concentration category of the target image to be detected by using an oil fume concentration detection model; The control module is specifically used to control the gear position of the range hood according to the detected oil smoke concentration category of the target image to be detected; and / or, The acquisition module is specifically used to acquire the image to be detected in the area where the range hood is located according to the sampling period; The control module specifically includes: The first judgment unit is used to judge whether the oil fume concentration in the current sampling period increases or decreases compared with the previous sampling period according to the oil fume concentration category corresponding to the current sampling period and the oil fume concentration category corresponding to the previous sampling period; If it rises, the gear raising unit is called to raise the gear of the range hood; If it decreases, the second judgment unit is called to judge whether the oil smoke concentration category changes within a preset time period; If not, the gear lowering unit is called to lower the gear of the range hood.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for controlling the range hood gear position according to any one of claims 3 to 6 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for controlling the gear position of the range hood as claimed in any one of claims 3 to 6 are implemented.
