Water dispenser water outlet automatic control method based on neural network

文档序号:1837299 发布日期:2021-11-16 浏览:34次 中文

阅读说明:本技术 一种基于神经网络的饮水机出水自动控制方法 (Water dispenser water outlet automatic control method based on neural network ) 是由 王文韬 赵亚丽 缪炜 于 2021-08-27 设计创作,主要内容包括:本发明公开了一种基于神经网络的饮水机出水自动控制方法,构建了用户指令识别模型和水位检测模型。本发明中,神经网络模型一作为用户指令识别模型,能够识别人声,解放双手,而且不受光线的限制,可在黑暗环境下使用,神经网络模型二作为水位检测模型,能够代替人工判断杯中水位,更好地泛化于多种类型的杯子上,不因杯子类型区别而影响判断的准确程度,具有更好的用户体验。(The invention discloses a water dispenser water outlet automatic control method based on a neural network, and a user instruction identification model and a water level detection model are established. In the invention, the first neural network model serves as a user instruction identification model, can identify voice, liberates hands, is not limited by light, can be used in a dark environment, and the second neural network model serves as a water level detection model, can replace manual judgment of water level in cups, is better generalized on various types of cups, does not influence the accuracy of judgment due to cup type difference, and has better user experience.)

1. A water dispenser water outlet automatic control method based on a neural network is characterized by comprising the following steps:

building user instruction recognition model

a. Collecting a voice control instruction supported by the water dispenser;

b. and training a first neural network model by using the collected voice data of the user instruction, and modeling the voice mode of the user instruction.

(II) establishing a water level detection model

c. Collecting the sound generated when various types of cups receive water when the water dispenser discharges water;

d. and training a neural network model II by using the collected data, and modeling the sound under the condition of different water levels in the cup during water receiving.

2. The automatic water dispenser water outlet control method based on the neural network as claimed in claim 1, wherein the collected voice is preprocessed before the step b.

3. The automatic water outlet control method for the water dispenser based on the neural network as claimed in claim 2, wherein the neural network model I in the step b is sequentially provided with 40 x 100 dimensional input, CNN layer 1, ReLU layer 2, CNN layer 3, ReLU layer 4, linear conversion layer 5, ReLU layer 6, linear conversion layer 7, ReLU layer 8, linear conversion layer 9, softmax layer 10 and 11 dimensional output along the output direction.

4. The automatic water outlet control method for the water dispenser based on the neural network as claimed in claim 3, wherein the neural network model II in the step d is sequentially provided with 1200-dimensional input, a linear transformation layer 1, an LSTM structure 2, a linear transformation layer 3, a sigmoid function layer 4 and 1-dimensional output along the output direction.

5. The automatic water dispenser water outlet control method based on the neural network as claimed in claim 4, wherein in the steps b and d, Adam optimizer is used for the first neural network model and the second neural network model, and the loss function is cross entropy.

Technical Field

The invention relates to the technical field of water outlet of water dispensers, in particular to a water outlet automatic control method of a water dispenser based on a neural network.

Background

When the water dispenser is used for receiving water, if water with a specified water level is required to be filled in the cup, people are usually required to manually judge the water level in the cup by eyes and ears, so that when the water dispenser discharges water, people need to manually turn on the water outlet switch, pay attention to the water level in the cup constantly and judge whether the water level reaches the water level required by the people or not, the people are required to distribute attention at the water level, and the water dispenser is very inconvenient. In addition, sometimes people need to receive water in a dark environment, and the water level is difficult to judge only by hearing.

In order to solve the problem that people need to pay attention to observe the water level when the water dispenser is used for receiving water, the existing water dispenser adopts a method of flowing out the specified water quantity, and the specified water quantity flows out every time. But this method is not applicable to cups of different sizes. With the same amount of water, the water may overflow for a cup with a smaller volume and too little for a cup with a larger volume. When people receive water, people generally pay more attention to the percentage of the height of the current water level to the height of the cup. The amount of water required to fill 50% height, 70% height or full is not the same for different sized cups. If the method is used, for cups with different sizes, if a person wants to receive water with the height of 50%, water with the height of 70% or full water, or needs to distribute attention to manually control the water flow, the problem that the water level needs to be observed by the person when the water dispenser is used for receiving water still cannot be solved.

When the water dispenser is used for receiving water, sound can be generated due to the vibration of the air column in the water cup, and the sound mode can be changed along with the height of the water level in the water cup. By utilizing the characteristic, the water level detection is carried out through the sound mode during water receiving, and then the water dispenser is controlled to stop water outlet. For the detection mode of the sound mode during water receiving, if the traditional audio algorithm is used for modeling the sound during water receiving of a water cup, good effects on different types of cups are difficult to achieve, and in addition, a water outlet button is generally required to be manually pressed when a water dispenser is used at present, so that the water dispenser is not convenient enough.

Therefore, the automatic water outlet control method of the water dispenser based on the neural network is provided.

Disclosure of Invention

The invention aims to: in order to solve the problems, the invention provides a water outlet automatic control method of a water dispenser based on a neural network.

In order to achieve the purpose, the invention adopts the following technical scheme: a water dispenser water outlet automatic control method based on a neural network comprises the following steps:

building user instruction recognition model

a. Collecting a voice control instruction supported by the water dispenser;

b. and training a first neural network model by using the collected voice data of the user instruction, and modeling the voice mode of the user instruction.

(II) establishing a water level detection model

c. Collecting the sound generated when various types of cups receive water when the water dispenser discharges water;

d. and training a neural network model II by using the collected data, and modeling the sound under the condition of different water levels in the cup during water receiving.

As a further description of the above technical solution:

and c, preprocessing the collected voice before the step b.

As a further description of the above technical solution:

and the first neural network model in the step b is sequentially provided with 40 × 100 dimensional input, CNN layer 1, ReLU layer 2, CNN layer 3, ReLU layer 4, linear conversion layer 5, ReLU layer 6, linear conversion layer 7, ReLU layer 8, linear conversion layer 9, softmax layer 10 and 11 dimensional output along the output direction.

As a further description of the above technical solution:

and d, sequentially arranging 1200-dimensional input, a linear transformation layer 1, an LSTM structure 2, a linear transformation layer 3, a sigmoid function layer 4 and 1-dimensional output along the output direction of the neural network model II in the step d.

As a further description of the above technical solution:

in the steps b and d, the first neural network model and the second neural network model use an Adam optimizer, and the loss function is cross entropy.

In summary, due to the adoption of the technical scheme, the invention has the beneficial effects that:

in the invention, the first neural network model serves as a user instruction identification model, can identify voice, liberates hands, is not limited by light, can be used in a dark environment, and the second neural network model serves as a water level detection model, can replace manual judgment of water level in cups, is better generalized on various types of cups, does not influence the accuracy of judgment due to cup type difference, and has better user experience.

Drawings

FIG. 1 is a schematic diagram of a neural network model according to an embodiment of the present invention;

FIG. 2 is a schematic structural diagram of a neural network model II provided in an embodiment of the present invention;

fig. 3 shows a schematic diagram of an automatic water outlet flow of a water dispenser according to an embodiment of the invention.

Detailed Description

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.

Referring to fig. 1-3, the present invention provides a technical solution: a water dispenser water outlet automatic control method based on a neural network comprises the following steps:

building user instruction recognition model

a. Collecting voice control instructions supported by the water dispenser, specifically collecting voice data of more than 300 speakers, wherein the voice data comprises instructions for supporting the voice control of the water dispenser, such as terms of '50% water receiving height', '70% water receiving height', 'automatic water full', 'stop water receiving', and the like;

b. training a neural network model I by using collected user instruction voice data, modeling a voice mode of a user instruction, preprocessing the collected voice before the step b, adding some common noises in daily life to the collected command word data, and combining original recorded data to serve as training data; extracting 40-dimensional fbank characteristics of the voice by taking 25ms as a window length, and moving the window once every 10 ms;

when the user instruction recognition model is used after training is completed, an instruction word awakening threshold value needs to be set for the instruction word. When the output of the model on the dimension of a certain instruction word is larger than or equal to the instruction word awakening threshold value, the instruction is considered to be effective. For example, setting an instruction word awakening threshold value to be 0.9, setting the output of the model on the dimension corresponding to the '80% height of water receiving' to be 0.95, and if the output is greater than 0.9, considering that the '80% height of water receiving' instruction is effective, and obtaining a threshold value of 0.8 for stopping water outlet;

the first neural network model in the step b is sequentially provided with 40 × 100 dimensional input, CNN layer 1, ReLU layer 2, CNN layer 3, ReLU layer 4, linear conversion layer 5, ReLU layer 6, linear conversion layer 7, ReLU layer 8, linear conversion layer 9, softmax layer 10 and 11 dimensional output along the output direction;

specifically, the 40-dimensional fbank features are spliced into a total of 100 frames, and are output in a softmax layer 10 to obtain 11-dimensional output after passing through 64 CNN layers 1 and ReLU layers 2 with convolution kernels of 40 × 7, passing through 128 CNN layers 3 and ReLU layers 4 with convolution kernels of 64 × 7, passing through linear conversion layers 5 and ReLU layers 6, linear conversion layers 7 and ReLU layers 8, and linear conversion layers 9. Wherein, each dimension of the 11-dimensional output respectively indicates the probability (between 0 and 1) that each instruction word is recognized.

(II) establishing a water level detection model

c. Collecting the sound generated when various types of cups receive water when the water dispenser discharges water, wherein the sound data comprises the data of the whole time period from empty cup to full cup, and marking the sound moment at different water levels when collecting the data, for example, marking the water level height once every 10% till the water level reaches full water, namely 100%, when the water level height in the water cup is 30%, the water receiving audio frequency is 2s moment;

d. training a neural network model II by using the collected data, and modeling the sounds in the cup at different water levels during water receiving;

wherein, the water level detection model comprises an LSTM structure for modeling time sequence information. The output is water level. The model output layer is a sigmoid function, output is restricted between 0 and 1, and the proportion of the height of the current water level to the height of the water cup is conveniently represented.

The recorded audio is 48kHz sampled audio. And framing is carried out according to the frame length of 25ms and the frame shift of 10ms, each frame comprises 1200 sampling points, and the number of the sampling points between adjacent frames is 480 at intervals. Then every 10ms, i.e. 480 sampling points, the model inputs 25ms of audio data, i.e. 1200 sampling points;

d, sequentially arranging 1200-dimensional input, a linear transformation layer, an LSTM structure, a linear transformation layer, a sigmoid function layer and 1-dimensional output along the output direction of the neural network model II;

specifically, 1200 sample point data is input as 1200 dimensions of the model, and the 1200 dimensional input is first passed through the linear transformation layer 1 to transform the input from 1200 dimensions to 64 dimensions. The output of the linear transformation layer 1 is input into the LSTM structure 2, and the output of the LSTM structure 2 has 64 dimensions. The output of the LSTM structure 2 enters a linear transformation layer 3, the linear transformation layer 3 transforms 64-dimensional data into 1-dimensional data, the output of the linear transformation layer 3 is input into a sigmoid function layer 4, and the final result is output by the sigmoid function layer 4. The final output is 1-dimensional, a value between 0 and 1.

In steps b and d, using an Adam optimizer for the first neural network model and the second neural network model, the loss function is cross entropy.

The water receiving flow of the water dispenser is as follows:

step 1, placing the cup at a water receiving position.

And 2, the user sends a voice instruction to set a desired water level as a threshold for stopping water outlet, such as water receiving height of 80%, at the moment, the corresponding threshold is 0.8, and the water dispenser starts to discharge water after the user sends the voice instruction.

And 3, recording the sound generated when the cup receives water when the water dispenser discharges water, and transmitting the sound to the water level detection model in real time.

And 4, judging the current water level in the cup through the water level detection model, and outputting a result every 10ms, wherein the result is a numerical value between 0 and 1. 0 is the lowest water level and 1 is the highest water level. For example, a value of 0.6, the water level is considered to reach 60% of the height of the cup.

Step 5, judging once when the result is output once, and when the result is greater than or equal to the threshold value, the water outlet switch receives a closing signal, and the water dispenser automatically stops water outlet; when the water level has the highest limit value and the value reaches 0.95, the water level is close to the maximum value 1, the water is considered to be full, the water outlet switch receives a closing signal, and the water dispenser automatically stops water outlet.

In addition, at any time when the water dispenser discharges water, as long as a user gives a command of stopping water discharge, the water dispenser stops water discharge.

The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention should be equivalent or changed within the scope of the present invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:冲奶配比控制方法、智能冲泡设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类