A method and device for model training and odor source localization
Through model training and prediction model optimization, an accurate odor distribution map is generated, which solves the problem of inaccurate odor source positioning in the existing technology and achieves accurate positioning of odor source.
Patent Information
- Application Number
- CN202411335928.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The prior art is difficult to generate an accurate odor distribution map that can be combined with environmental changes, resulting in insufficient positioning of odor source.
Through the model training method, sample environment data is obtained, environmental status information is determined, and odor distribution map is predicted through the prediction model, combined with the discriminant model for training, and the prediction model is optimized to generate a more accurate odor distribution map.
It realizes the generation of more accurate odor distribution maps, adapt to dynamic environmental changes, and accurately locate odor sources.
Smart Images

Figure CN118861650B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the technical field of bionic olfactory navigation, and particularly to a method and device for model training and odor source localization. Background Art
[0002] Bionic olfactory navigation technology is an interdisciplinary comprehensive technology that uses carriers with autonomous movement capabilities such as unmanned vehicles, equipped with bionic olfactory sensors, to detect the odor concentration in the environment and locate and approach the odor source. This technology helps to accurately and sensitively identify odor sources with special odor characteristics such as toxic and harmful gases and contraband items, helps to improve the efficiency of odor source localization and search, enhances the emergency response ability to emergencies, and at the same time can reduce the safety risks of personnel and eliminate potential disaster hazards, which has important practical significance for ensuring the safety of people's lives and property. Therefore, this technology has great application prospects in fields such as safety inspections and rescue operations.
[0003] Currently, most of the existing technologies are under certain constraints for the gas leakage environment where the carrier is located. First, a static odor distribution map corresponding to the gas leakage environment is constructed, and then the odor source is located according to the static odor distribution map. However, the static odor distribution map obtained under certain constraints usually cannot accurately match the actual application environment and cannot update the odor distribution map in combination with the dynamic changes of the environment, resulting in inaccurate odor source localization.
[0004] Based on this, how to generate an accurate odor distribution map that combines environmental changes to locate the correct odor source is an urgent problem to be solved. Summary of the Invention
[0005] This specification provides a method and device for model training and odor source localization to partially solve the above problems existing in the prior art.
[0006] This specification adopts the following technical solutions:
[0007] This specification provides a model training method, including:
[0008] Obtain sample environmental data corresponding to a first set time;
[0009] Determine first environmental state information at the first set time in the environment corresponding to the sample environmental data according to the sample environmental data;
[0010] Input the first environmental state information into a prediction model to be trained, so that the prediction model predicts an odor distribution map of the environment at a second set time under the first environmental state information, where the second set time is the next moment of the first set time;
[0011] Input the odor distribution map into a preset first discrimination model, so that the first discrimination model outputs a first discrimination result for the odor distribution map, and the first discrimination result is used to represent the first probability that the odor distribution map is a real odor distribution map;
[0012] Determine a first loss value according to the first probability, and train the prediction model according to the first loss value. There is a negative correlation between the first probability and the first loss value.
[0013] Optionally, training the prediction model according to the first loss value specifically includes:
[0014] For each round of training, in this round of training, fix the model parameters of the prediction model after the previous round of training, and take minimizing the determined first auxiliary loss value as the optimization goal to train the first discrimination model after the previous round of training to obtain the first discrimination model after this round of training. The first auxiliary loss value is determined by the first deviation between the first auxiliary discrimination result obtained by the first discrimination model after the previous round of training for the input odor distribution map and the discrimination label corresponding to the odor distribution map input into the first discrimination model after the previous round of training. The first auxiliary discrimination result is used to represent whether the odor distribution map input into the first discrimination model after the previous round of training is a real odor distribution map, and the discrimination label is used to indicate whether the odor distribution map input into the first discrimination model after the previous round of training is actually a real odor distribution map. There is a positive correlation between the first auxiliary loss value and the first deviation. Among them, the odor distribution map input into the first discrimination model after the previous round of training includes a real odor distribution map or the odor distribution map output by the prediction model after the previous round of training;
[0015] Fix the model parameters of the first discrimination model after this round of training, and take minimizing the first loss value as the optimization goal to train the prediction model after the previous round of training to obtain the prediction model after this round of training.
[0016] Optionally, obtain the sample odor distribution map corresponding to the second set time;
[0017] Input the sample odor distribution map into the trained generation model, so that the generation model determines, according to the sample odor distribution map, the environmental state information corresponding to the environment presenting the sample odor distribution map at the first set time as the second environmental state information;
[0018] Input the second environmental state information into the prediction model, so that the prediction model predicts the odor distribution map of the environment corresponding to the second environmental state information at the second set time as the sample control odor distribution map, and input the odor distribution map into the generation model, so that the generation model generates the environmental state information of the environment presenting the odor distribution map at the first set time as the first control state information;
[0019] Determine the combined loss value according to the deviation between the first environmental state information and the first control state information, and the deviation between the sample odor distribution map and the sample control odor distribution map;
[0020] Train the prediction model according to the first loss value, specifically including:
[0021] Train the prediction model according to the first loss value and the combined loss value.
[0022] Optionally, training the generation model specifically includes:
[0023] For each round of training, in this round of training, fix the model parameters of the generation model after the previous round of training, and take minimizing the determined second auxiliary loss value as the optimization goal to train the second discriminant model after the previous round of training to obtain the second discriminant model after this round of training. The second auxiliary loss value is determined by the second deviation between the second discriminant result obtained by the second discriminant model after the previous round of training for the input environmental state information and the discriminant label corresponding to the environmental state information input into the second discriminant model after the previous round of training. The second discriminant result is used to characterize the probability that the environmental state information input into the second discriminant model after the previous round of training is the real environmental state information, and the discriminant label corresponding to the environmental state information input into the second discriminant model after the previous round of training is used to indicate whether the environmental state information input into the second discriminant model after the previous round of training is actually the real environmental state information. The second auxiliary loss value has a positive correlation with the second deviation, where the environmental state information input into the second discriminant model after the previous round of training includes real environmental state information or the environmental state information output by the generation model after the previous round of training;
[0024] Input the preset odor distribution map into the generation model after the previous round of training to obtain the environmental state information of the environment presenting the preset odor distribution map at the previous moment as the second environmental state information;
[0025] Input the second environmental status information into the second discriminant model after this round of training to obtain a second auxiliary discrimination result, where the second auxiliary discrimination result is used to represent the second probability that the second discriminant model after this round of training determines that the second environmental status information is real environmental status information;
[0026] Determine a second loss value according to the second probability, and fix the model parameters of the second discriminant model after this round of training. With the goal of minimizing the second loss value, train the generation model after the previous round of training to obtain the generation model after this round of training.
[0027] This specification provides a method for locating an odor source, including:
[0028] Obtain environmental data corresponding to the environment where the carrier searching for the odor source is located at a first set time;
[0029] Input the environmental data into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data;
[0030] Input the environmental features into a preset time series network so that the time series network outputs environmental status information of the environmental features at the first set time based on the environmental features at each set time before the first set time;
[0031] Input the environmental status information into a trained prediction model so that the prediction model predicts an odor distribution map of the environmental status information at a second set time according to the environmental status information. The second set time is the next moment of the first set time, and the prediction model is trained by the above model training method;
[0032] Determine the target position of the odor source according to the odor distribution map.
[0033] Optionally, the environmental data includes obstacle data, wind field distribution data, and odor concentration data;
[0034] Inputting the environmental data into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data specifically includes:
[0035] Perform normalization processing on the wind field distribution data and the odor concentration data;
[0036] Input the obstacle data, the normalized wind field distribution data, and the normalized odor concentration data into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data.
[0037] Optionally, according to the odor distribution map, determine the target position of the odor source, specifically including:
[0038] According to the odor distribution map, determine each candidate position of the odor source;
[0039] According to the odor distribution maps at each set time before the second set time, screen out the target position of the odor source from the candidate positions.
[0040] This specification provides a model training device, including:
[0041] An acquisition module, configured to acquire sample environment data corresponding to a first set time;
[0042] A determination module, configured to determine first environment state information at the first set time in the environment corresponding to the sample environment data according to the sample environment data;
[0043] A prediction module, configured to input the first environment state information into a prediction model to be trained, so that the prediction model predicts an odor distribution map at a second set time in the environment under the first environment state information according to the first environment state information, where the second set time is the next moment of the first set time;
[0044] A discrimination module, configured to input the odor distribution map into a preset first discrimination model, so that the first discrimination model outputs a first discrimination result for the odor distribution map, and the first discrimination result is used to represent a first probability that the odor distribution map is a true odor distribution map;
[0045] A training module, configured to determine a first loss value according to the first probability, and train the prediction model according to the first loss value, and there is a negative correlation between the first probability and the first loss value.
[0046] This specification provides a computer-readable storage medium, where the storage medium stores a computer program, and when the computer program is executed by a processor, the above model training method or the method for locating an odor source is implemented.
[0047] This specification provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above model training method or the method for locating an odor source is implemented.
[0048] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0049] In the method for model training and odor source localization provided in this specification, environmental data corresponding to the environment where the carrier for searching for the odor source is located at a first set time is obtained, and the environmental data is input into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data. Then, the environmental features are input into a preset time series network so that the time series network outputs environmental state information of the environmental features at the first set time based on the environmental features at each set time before the first set time. Further, the environmental state information is input into a trained prediction model so that the prediction model predicts an odor distribution map of the environmental state information at a second set time according to the environmental state information, and determines the target position of the odor source according to the odor distribution map.
[0050] As can be seen from the above method, in the method for model training and odor source localization provided in this specification, through the trained prediction model, an odor distribution map of the environmental state information at the second set time can be obtained. The odor distribution map obtained in this way is more accurate and can adapt to dynamic changes in the environment, so that the target position of the odor source can be accurately determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of this specification, and constitute a part of this specification. The schematic embodiments and descriptions thereof of this specification are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:
[0052] Figure 1 is a schematic flowchart of a model training method provided in this specification;
[0053] Figure 2 is a schematic diagram of obtaining environmental features provided in this specification;
[0054] Figure 3 is a schematic diagram of a time series network provided in this specification;
[0055] Figure 4 is a schematic diagram of a model training process provided in this specification;
[0056] Figure 5 is a schematic flowchart of a method for localizing an odor source provided in this specification;
[0057] Figure 6 is a schematic diagram of a model training device provided in this specification;
[0058] Figure 7 is a schematic diagram of a device for localizing an odor source provided in this specification;
[0059] Figure 8A schematic diagram of an electronic device provided in this specification corresponding to Figure 1 or Figure 5 is shown. Specific Embodiments
[0060] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this specification.
[0061] Bionic olfactory navigation technology is an interdisciplinary comprehensive technology that uses carriers with autonomous movement capabilities such as unmanned vehicles to carry bionic olfactory sensors to detect the odor concentration in the environment and locate and approach the odor source. This technology helps to accurately and sensitively identify odor sources with special odor characteristics such as toxic and harmful gases and contraband items, helps to improve the efficiency of locating and searching for odor sources, enhances the emergency response ability to emergencies, and at the same time can reduce the safety risks of personnel and eliminate potential disaster hazards, which has important practical significance for ensuring the safety of people's lives and property. Therefore, this technology has great application prospects in fields such as safety inspections and rescue operations.
[0062] Among them, in bionic olfactory navigation technology, the odor source can be located by constructing an odor distribution map corresponding to the environment in which a carrier with autonomous movement capabilities such as an unmanned vehicle is located. However, the current method of constructing the odor distribution map cannot well integrate the current environmental data corresponding to the environment in which the carrier is located, and an accurate odor distribution map cannot be obtained.
[0063] Based on this, this specification provides a model training method, a method and device for locating an odor source, obtaining environmental data corresponding to the environment in which a carrier searching for an odor source is located at a first set time, inputting the environmental data into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data. Then, the environmental features are input into a preset time series network so that the time series network outputs environmental state information of the environmental features at the first set time based on the environmental features at each set time before the first set time. Further, the environmental state information is input into a trained prediction model so that the prediction model predicts an odor distribution map of the environmental state information at a second set time according to the environmental state information, and determines the target position of the odor source according to the odor distribution map. In this way, the obtained odor distribution map is more accurate and can adapt to dynamic changes in the environment, so that the target position of the odor source can be accurately determined.
[0064] The following will describe in detail the technical solutions provided in each embodiment of this specification in conjunction with the accompanying drawings.
[0065] Figure 1 The following is a schematic flowchart of a model training method provided in this specification, including the following steps:
[0066] S101: Obtain sample environmental data corresponding to the first set time.
[0067] In this specification, the execution subject for implementing a model training method can be a terminal device such as a laptop or a tablet computer. Of course, it can also be a server. For the sake of convenience in description, this specification only takes the server as an example of the execution subject to describe a model training method provided in this specification.
[0068] The server obtains sample environmental data corresponding to the first set time, where the sample environmental data may include obstacle data, wind field distribution data, and odor concentration data.
[0069] S102: Determine the first environmental state information at the first set time in the environment corresponding to the sample environmental data according to the sample environmental data.
[0070] The server determines the first environmental state information at the first set time in the environment corresponding to the sample environmental data according to the sample environmental data. Specifically, the server can directly input the sample environmental data into the state extraction model so that the state extraction model outputs the first environmental state information at the first set time in the environment corresponding to the sample environmental data according to the sample environmental data.
[0071] In order to obtain more accurate first environmental state information, the server can also represent the sample environmental data using two-dimensional data and input the sample environmental data into a preset feature fusion model so that the feature fusion model outputs the environmental features corresponding to the sample environmental data. Further, the server inputs the environmental features into a preset time series network to obtain the first environmental state information of the environmental features at the first set time based on the environmental features at each set time before the first set time output by the time series network.
[0072] Next, a detailed example will be used to explain the process of determining the first environmental state information at the first set time in the environment corresponding to the sample environmental data according to the sample environmental data. First, the server obtains the environmental features corresponding to the sample environmental data according to the sample environmental data, as Figure 2 shown.
[0073] Figure 2 The following is a schematic diagram of obtaining environmental features provided in this specification.
[0074] FromFigure 2 As can be seen, if the sample environmental data includes three types of data: obstacle data, wind field distribution data, and odor concentration data, the representation of these three types of data can be in the form of a two-dimensional grid as shown on the left. Further, the two-dimensional grid can be stored in the format of a two-dimensional array. That is, each element in the two-dimensional array can represent a grid cell in the corresponding two-dimensional grid. For the two-dimensional grid of obstacle data, when the grid cell is black, it indicates that there is an obstacle at the position corresponding to the grid cell, and the element corresponding to the grid cell in the two-dimensional array is 0; when the grid cell is gray, it indicates that the situation of whether there is an obstacle at the position corresponding to the grid cell is unknown, and the element corresponding to the grid cell in the two-dimensional array is 128; when the grid cell is white, it indicates that there is no obstacle at the position corresponding to the grid cell, and the element corresponding to the grid cell in the two-dimensional array is 255. For the two-dimensional grid of wind field distribution data, the shade of each grid cell represents the magnitude of the wind speed at the corresponding position, and the element corresponding to each grid cell in the two-dimensional array is the wind speed value. For the two-dimensional grid of odor concentration data, the shade of each grid cell represents the magnitude of the odor concentration at the corresponding position, and the element corresponding to each grid cell in the two-dimensional array is the odor concentration value. Figure 2 As can be seen, if the sample environmental data includes three types of data: obstacle data, wind field distribution data, and odor concentration data, the representation of these three types of data can be in the form of a two-dimensional grid as shown on the left. Further, the two-dimensional grid can be stored in the format of a two-dimensional array. That is, each element in the two-dimensional array can represent a grid cell in the corresponding two-dimensional grid. For the two-dimensional grid of obstacle data, when the grid cell is black, it indicates that there is an obstacle at the position corresponding to the grid cell, and the element corresponding to the grid cell in the two-dimensional array is 0; when the grid cell is gray, it indicates that the situation of whether there is an obstacle at the position corresponding to the grid cell is unknown, and the element corresponding to the grid cell in the two-dimensional array is 128; when the grid cell is white, it indicates that there is no obstacle at the position corresponding to the grid cell, and the element corresponding to the grid cell in the two-dimensional array is 255. For the two-dimensional grid of wind field distribution data, the shade of each grid cell represents the magnitude of the wind speed at the corresponding position, and the element corresponding to each grid cell in the two-dimensional array is the wind speed value. For the two-dimensional grid of odor concentration data, the shade of each grid cell represents the magnitude of the odor concentration at the corresponding position, and the element corresponding to each grid cell in the two-dimensional array is the odor concentration value.
[0075] Further, the server inputs the obstacle data, wind field distribution data, and odor concentration data into the feature fusion model, and obtains environmental features through the channel attention module and the spatial attention module in the feature fusion model. Among them, the channel attention module is used to focus on the importance of different channels in the input sample environmental data. Different channels may contain information of different types of data, and some channels may be more important for the current task. The channel attention module learns the importance of each channel and adjusts the output weights of different channels accordingly, so that the feature fusion model can pay more attention to the features beneficial to the current task. The spatial attention module, on the other hand, focuses on the importance of different spatial positions in the input sample environmental data. Different spatial positions may contain different key information. The spatial attention module learns the importance of different spatial positions and adjusts the output weights of different spatial positions accordingly, so that the network can pay more attention to the spatial positions beneficial to the current task. That is to say, the channel attention module and the spatial attention module determine the weights of each channel and each spatial position corresponding to the input sample environmental data, and then perform weighted processing on each channel and each spatial position according to the weights, so that the feature fusion model can pay more attention to the features corresponding to the channels and spatial positions more beneficial to the current task.
[0076] It should be noted that for the wind field distribution data and the odor concentration data, in order to facilitate the feature fusion model to obtain accurate environmental features, the server can first perform normalization processing on the wind field distribution data and the odor concentration data. For example, if the range of the wind field distribution data is [0, 5], then each element in the two-dimensional array corresponding to the wind field distribution data needs to be scaled so that the range becomes [0, 255]. Then, the obstacle data, the normalized wind field distribution data, and the normalized odor concentration data are input into the feature fusion model, so that the feature fusion model outputs the environmental features corresponding to the sample environmental data.
[0077] Then, the server inputs the environmental features output by the feature fusion model into the time series network, so that the time series network outputs the first environmental state information of the environmental features at the first set time based on the environmental features at each set time before the first set time, as Figure 3 shown.
[0078] Figure 3 It is a schematic diagram of a time series network provided in this specification.
[0079] From Figure 3 it can be seen that i is the i-th set time, and h i (i = 1, 2, 3 ···) is the hidden layer state of the time series network at the i-th set time, and x i (i = 1, 2, 3 ···) is the environmental feature input into the time series network at the i-th set time, and s i (i = 1, 2, 3 ···) is the first environmental state information at the i-th set time (the first environmental state information at the i-th set time integrates the environmental features at each set time before the i-th set time). For example, when the server inputs the environmental feature at the i-th set time into the time series network, the time series network obtains the hidden layer state of the time series network at the i-th set time according to the environmental feature input into the time series network at the i-th set time and the hidden layer state of the time series network at the (i - 1)-th set time, and then obtains the first environmental state information at the i-th set time according to the hidden layer state of the time series network at the i-th set time. Among them, the time series network can adopt the structure of recurrent neural networks such as long short-term memory networks and gated recurrent units. The above process can be expressed by the formula:
[0080]
[0081]
[0082]
[0083] where i represents the i-th set time, represents the intermediate quantity at the i-th set time, , , are weight matrices, , are bias quantities, is an activation function, x i is the environmental feature input into the time-series network at the i-th set time, h i is the hidden layer state of the time-series network at the i-th set time, s i is the first environmental state information at the i-th set time.
[0084] S103: Input the first environmental state information into the prediction model to be trained, so that the prediction model predicts the odor distribution map of the environment at the second set time under the first environmental state information, where the second set time is the next moment of the first set time.
[0085] The server inputs the first environmental state information into the prediction model to be trained, so that the prediction model predicts the odor distribution map of the environment at the second set time under the first environmental state information, where the second set time is the next moment of the first set time.
[0086] S104: Input the odor distribution map into the preset first discriminant model, so that the first discriminant model outputs a first discriminant result for the odor distribution map, and the first discriminant result is used to represent the first probability that the odor distribution map is a real odor distribution map.
[0087] The server inputs the odor distribution map of the environment at the second set time under the first environmental state information into the preset first discriminant model, so that the first discriminant model outputs a first discriminant result for the odor distribution map of the environment at the second set time under the first environmental state information, where the first discriminant result is used to represent the first probability that the first discriminant model determines the odor distribution map of the environment at the second set time under the first environmental state information as a real odor distribution map.
[0088] S105: Determine a first loss value according to the first probability, and train the prediction model according to the first loss value, and there is a negative correlation between the first probability and the first loss value.
[0089] The server determines a first loss value according to a first probability, where there is a negative correlation between the first probability and the first loss value. That is to say, the greater the first probability that the first discrimination result output by the first discrimination model considers the odor distribution map of the environment under the first environmental state information at the second set time to be the real odor distribution map, the smaller the first loss value.
[0090] The server trains the prediction model with the goal of minimizing the first loss value. That is to say, during the training process, in order to improve the prediction ability of the prediction model so that the odor distribution map output by the prediction model is closer to the real odor distribution map, it is necessary to make the first probability that the first discrimination model considers the odor distribution map output by the prediction model to be the real odor distribution map larger and the first loss value smaller.
[0091] Of course, in order to make the trained prediction model able to output an odor distribution map closer to the real one, during the training process, the server can alternately train the prediction model and the first discrimination model together.
[0092] Specifically, for each round of training, in this round of training, the server fixes the model parameters of the prediction model after the previous round of training and trains the first discrimination model after the previous round of training with the goal of minimizing the determined first auxiliary loss value to obtain the first discrimination model after this round of training. The first auxiliary loss value is determined by the first deviation between the first auxiliary discrimination result obtained by the first discrimination model after the previous round of training for the input odor distribution map and the discrimination label corresponding to the odor distribution map input to the first discrimination model after the previous round of training. The first auxiliary discrimination result is used to represent whether the odor distribution map input to the first discrimination model after the previous round of training is the real odor distribution map, and the discrimination label is used to indicate whether the odor distribution map input to the first discrimination model after the previous round of training is actually the real odor distribution map. There is a positive correlation between the first auxiliary loss value and the first deviation.
[0093] It should be noted that the odor distribution map input to the first discrimination model after the previous round of training can be the real odor distribution map or the odor distribution map output by the prediction model after the previous round of training. The first deviation can be expressed by the formula:
[0094]
[0095] where Loss1 represents the first deviation, represents the first discrimination model, y represents the odor distribution map input to the first discrimination model after the previous round of training, It represents the discrimination label corresponding to the odor distribution map input into the first discrimination model after the previous round of training. It should be noted that the smaller the first deviation, the higher the probability that the first discrimination model can discriminate the true odor distribution map as a true odor distribution map, and the higher the probability that the odor distribution map output by the prediction model is discriminated as a false odor distribution map.
[0096] Then, the server can train the prediction model. The server fixes the model parameters of the first discrimination model after this round of training, and takes minimizing the first loss value as the optimization objective to train the prediction model after the previous round of training, and obtains the prediction model after this round of training.
[0097] That is to say, in each round of training, the server first fixes the model parameters of the prediction model, takes minimizing the determined first auxiliary loss value as the optimization objective to train the first discrimination model, and then fixes the model parameters of the first discrimination model, and takes minimizing the first loss value as the optimization objective to train the prediction model.
[0098] Of course, in order to further improve the accuracy of the trained prediction model, the method provided in this specification can also introduce a generative model to jointly train the prediction model. Specifically, the server obtains the sample odor distribution map corresponding to the second set time, and inputs the sample odor distribution map into the trained generative model, so that the generative model determines the environmental state information corresponding to the environment presenting the sample odor distribution map at the first set time according to the sample odor distribution map, as the second environmental state information.
[0099] Furthermore, the server inputs the second environmental state information into the prediction model, so that the prediction model predicts the odor distribution map of the environment corresponding to the second environmental state information at the second set time as the sample control odor distribution map. And, the odor distribution map obtained by inputting the first environmental state information through the prediction model into the generative model, so that the generative model generates the environmental state information of the environment presenting the odor distribution map obtained by inputting the first environmental state information through the prediction model at the first set time as the first control state information.
[0100] Then, the server determines a combined loss value based on the deviation between the first environmental status information and the first reference status information, and the deviation between the sample odor distribution map and the sample reference odor distribution map. The combined loss value has a positive correlation with the deviation between the first environmental status information and the first reference status information, and also has a positive correlation with the deviation between the sample odor distribution map and the sample reference odor distribution map. Further, the server trains the prediction model and the generation model with the optimization objectives of minimizing the first loss value and minimizing the combined loss value.
[0101] The generation model mentioned above can also be pre-trained so that the generation model outputs more accurate environmental status information based on the input odor distribution map. During the training process, the server can alternately train the generation model and the second discriminant model together.
[0102] Specifically, for each round of training, in this round of training, the model parameters of the generation model after the previous round of training are fixed, and the second discriminant model after the previous round of training is trained with the optimization objective of minimizing the determined second auxiliary loss value to obtain the second discriminant model after this round of training.
[0103] The second auxiliary loss value is determined by the second deviation between the second discriminant result obtained by the second discriminant model after the previous round of training for the input environmental status information and the discriminant label corresponding to the environmental status information input to the second discriminant model after the previous round of training. The second discriminant result is used to represent the probability that the environmental status information input to the second discriminant model after the previous round of training is the true environmental status information. The discriminant label corresponding to the environmental status information input to the second discriminant model after the previous round of training is used to indicate whether the environmental status information input to the second discriminant model after the previous round of training is actually the true environmental status information. The second auxiliary loss value has a positive correlation with the second deviation.
[0104] It should be noted that the environmental status information input to the second discriminant model after the previous round of training can be the true environmental status information or the environmental status information output by the generation model after the previous round of training. The second deviation can be expressed by the formula:
[0105]
[0106] where Loss2 represents the second deviation, represents the second discriminant model, represents the environmental status information input to the second discriminant model after the previous round of training, It represents the discriminant label corresponding to the environmental state information input into the second discriminant model after the previous round of training. It should be noted that the smaller the second deviation is, the higher the probability that the second discriminant model can identify the true environmental state information as the true environmental state information, and the higher the probability that the environmental state information output by the generation model is identified as false environmental state information.
[0107] The server inputs the preset odor distribution map into the generation model after the previous round of training to obtain the environmental state information of the environment at the previous moment that presents the environmental state of the preset odor distribution map as the second environmental state information. The server inputs the second environmental state information into the second discriminant model after this round of training to obtain a second auxiliary discriminant result, where the second auxiliary discriminant result is used to represent the second probability that the second discriminant model after this round of training determines that the second environmental state information is the true environmental state information. Further, the server determines a second loss value according to the second probability, where there is a negative correlation between the second probability and the second loss value.
[0108] Then, the server can train the generation model. The server can fix the model parameters of the second discriminant model after this round of training, and take minimizing the second loss value as the optimization goal to train the generation model after the previous round of training to obtain the generation model after this round of training.
[0109] That is to say, in order to improve the ability of the generation model to output environmental state information and make the environmental state information output by the generation model closer to the true environmental state information, when training the generation model, minimizing the second loss value is taken as the optimization goal. This is because when the second discriminant model believes that the second probability that the environmental state information output by the generation model is the true environmental state information is greater, the second auxiliary loss value is smaller, and the environmental state data output by the generation model is more accurate.
[0110] It can be seen that in each round of training, the server first fixes the model parameters of the generation model, takes minimizing the determined second auxiliary loss value as the optimization goal to train the second discriminant model, and then fixes the model parameters of the second discriminant model, takes minimizing the second loss value as the optimization goal to train the generation model.
[0111] Of course, during the training process of the generation model, the server can also train the generation model according to the second loss value and the joint loss value. Specifically, it can be to train the generation model by minimizing the second loss value and the joint loss value.
[0112] In summary, the server can train the prediction model only based on the first loss value. However, in practical applications, the server can also introduce a generation model and a second discriminant model, and train the prediction model by minimizing the first loss value and the joint loss value. Of course, in order to enable the prediction model to output a more accurate odor distribution map according to the environmental state information, the server can train the four models, namely the prediction model, the first discriminant model, the generation model, and the second discriminant model, simultaneously based on the first loss value, the first auxiliary loss value, the joint loss value, the second loss value, and the second auxiliary loss value, so as to obtain a trained prediction model.
[0113] To illustrate the above model training process more clearly, this specification will use a specific example for explanation, as Figure 4 shown.
[0114] Figure 4 is a schematic diagram of a model training process provided in this specification.
[0115] From Figure 4 it can be seen that there are a total of four models, namely the prediction model ( Figure 4 G in Figure 4 ), the generation model ( Figure 4 F in Y ), the first discriminant model ( Figure 4 D in S ), and the second discriminant model ( Figure 4 D in i ). The server trains these four models together to obtain a trained prediction model. Figure 4 S in i+1 represents the environmental state information at the i-th set time, and
[0116] Y in
[0117]
[0118] represents the odor distribution map at the (i + 1)-th set time. When training the prediction model and the first discriminant model, the first optimization function can be expressed by the formula: where i represents the i-th set time, is used to represent the odor distribution map output by the prediction model, and is used to represent the first probability that the first discriminant model judges the odor distribution map output by the prediction model as the true odor distribution map. )Corresponding to the first loss value mentioned in the above content.
[0119] Represents the real odor distribution map, Represents the probability that the first discriminant model judges the real odor distribution map as the real odor distribution map, Represents the expectation of the real odor distribution map, that is, on all real odor distribution maps, the expectation of the probability that the first discriminant model judges the real odor distribution map as the real odor distribution map. It has a negative correlation with the first auxiliary loss value mentioned in the above content. That is, the smaller the first deviation between the first auxiliary discriminant result obtained by the first discriminant model for the input odor distribution map and the discriminant label corresponding to the odor distribution map input to the first discriminant model, the smaller the first auxiliary loss value, The larger it is, the higher the discriminant ability of the first discriminant model (here it can be understood that the higher the probability that the first discriminant model can judge the real odor distribution map as the real odor distribution map, and the higher the probability that it can judge the odor distribution map output by the prediction model as the false odor distribution map).
[0120] For each round of training, in this round of training, the server fixes the model parameters of G after the previous round of training and maximizes as the optimization objective (that is, with minimizing the first auxiliary loss value as the optimization objective), and trains after the previous round of training to obtain after this round of training. Then, the server fixes the model parameters of after this round of training and minimizes as the optimization objective (that is, with minimizing the first loss value as the optimization objective), and trains G after the previous round of training to obtain G after this round of training.
[0121] When training the generative model and the second discriminant model, the second optimization function can be expressed by the formula:
[0122]
[0123] where i represents the i-th set time, is used to represent the environmental state information output by the generative model, is used to represent the second probability that the second discriminant model judges the environmental state information output by the generative model as the real environmental state information. is used to represent the expectation of that is, on all environmental state information output by the generative model, the expectation of the probability that the second discriminant model judges the environmental state information output by the generative model as the false environmental state information. This part of the loss function (that is, ) corresponding to the second loss value mentioned in the above content.
[0124] represents the true environmental state information, represents the probability that the second discriminant model judges the true environmental state information as the true environmental state information, represents the expectation of the true environmental state information, that is, the expectation of the probability that the second discriminant model judges the true environmental state information as the true environmental state information over all true environmental state information. is negatively correlated with the second auxiliary loss value mentioned in the above content. That is, the smaller the second deviation between the second discriminant result obtained by the second discriminant model for the input environmental state information and the discriminant label corresponding to the environmental state information input to the second discriminant model, the smaller the second auxiliary loss value, the larger, the higher the discrimination ability of the second discriminant model (here it can be understood that the higher the probability that the second discriminant model can judge the true environmental state information as the true environmental state information, and the higher the probability that the environmental state information output by the generation model is judged as the false environmental state information).
[0125] For each round of training, in this round of training, the server fixes the model parameters of F after the previous round of training and maximizes as the optimization objective (that is, with minimizing the second auxiliary loss value as the optimization objective), and trains after the previous round of training to obtain after this round of training. Then, the server fixes the model parameters of after this round of training and minimizes as the optimization objective (that is, with minimizing the second loss value as the optimization objective), and trains F after the previous round of training to obtain F after this round of training.
[0126] When training the prediction model and the generation model, the third optimization function can be expressed by the formula:
[0127]
[0128] where, represents the sample odor distribution map; represents the environmental state information corresponding to the environment where the generation model outputs the environmental state presenting the sample odor distribution map at the first set time, as the second environmental state information; represents the odor distribution map predicted by the prediction model for the environment corresponding to the second environmental state information at the second set time, as the sample control odor distribution map; Represents the expectation of the deviation between the sample odor distribution map and the sample control odor distribution map; Represents the first environmental state information corresponding to the sample environmental data; Represents the odor distribution map of the environment at the second set time under the first environmental state information output by the prediction model; Represents the environmental state information of the environment presenting the odor distribution map output by the generation model at the first set time, as the first control state information; Represents the expectation of the deviation between the first environmental state information and the first control state information. Corresponds to the joint loss value mentioned in the above content.
[0129] The server minimizes (i.e., the joint loss value) as the optimization objective to train G and F.
[0130] After the above training process, according to , and , the server can obtain the trained prediction model, generation model, first discriminant model and second discriminant model.
[0131] It should be noted that the structures of G and F can adopt the U-net structure or other decoding and encoding structures. For example, for the prediction model, the features of the environmental state information from shallow to deep are obtained by downsampling through the encoder module, and the features extracted by the encoder are connected to the corresponding level decoder with short lines, and the deep and shallow features are fused element by element, so that the deep odor diffusion law acts on the shallow environmental state information, realizing the mutual migration between the environmental state information at the first set time and the odor distribution map at the second set time.
[0132] It should also be noted that the first discriminant model can obtain the block region feature map by downsampling through the deep convolutional network. Each element region of the feature map corresponds to a specific region of the input odor distribution map, that is, the receptive field region. The output value of each element in the feature map is the confidence of the authenticity of the odor distribution map input in the receptive field region. By taking the weighted average of all elements in the feature map, the confidence of the authenticity of the entire input odor distribution map is obtained. In this way, the method of block region discrimination helps to capture the detailed information in the odor distribution map, can evaluate the quality of the generated odor distribution map more carefully, and can judge whether the odor distribution map input into the first discriminant model is a real odor distribution map.
[0133] In the model training method provided in this specification, the server can optimize the training of the prediction model with the objective of maximizing the first probability that the first discriminant model determines the odor distribution map output by the prediction model as the true odor distribution map. In this way, a prediction model that outputs a more accurate odor distribution map can be obtained.
[0134] Moreover, the method in this specification can also alternately train the prediction model and the first discriminant model. While obtaining a prediction model with stronger prediction ability, a first discriminant model with stronger discrimination ability is also obtained. In the subsequent training process, in order to make the first discriminant model unable to distinguish the difference between the odor distribution map output by the prediction model and the true odor distribution map, the prediction model will output an odor distribution map closer to the actual situation.
[0135] Of course, in order to generate a more accurate odor distribution map, a generation model and a second discriminant model can also be added to jointly train the prediction model, the generation model, the first discriminant model, and the second discriminant model together.
[0136] According to the above model training method, a trained prediction model is obtained, and then a method for locating the odor source can be obtained. The specific process is shown in the following figure.
[0137] Figure 5 It is a schematic flowchart of a method for locating an odor source provided in this specification, including the following steps:
[0138] S501: Obtain the environmental data corresponding to the environment where the carrier searching for the odor source is located at the first set moment.
[0139] In this specification, the execution subject for implementing a method for locating an odor source can be a terminal device such as a laptop computer or a tablet computer. Of course, it can also be a server. For the convenience of description, this specification only takes the server as an example of the execution subject to illustrate a method for locating an odor source provided in this specification.
[0140] The server obtains the environmental data corresponding to the environment where the carrier searching for the odor source is located at the first set moment. Among them, the carrier searching for the odor source can be a carrier with autonomous movement ability such as an unmanned vehicle. The server can collect the environmental data corresponding to the environment where the carrier is located at the first set moment through various environmental perception sensors on the carrier, such as lidar, cameras, anemometers, odor concentration sensors, etc.
[0141] S502: Input the environmental data into a preset feature fusion model so that the feature fusion model outputs the environmental features corresponding to the environmental data.
[0142] The server inputs the environmental data collected by the carrier into a preset feature fusion model, so that the feature fusion model outputs the environmental features corresponding to the environmental data.
[0143] In this specification, the environmental data may include obstacle data, wind field distribution data, and odor concentration data. The server normalizes the wind field distribution data and the odor concentration data, and inputs the obstacle data, the normalized wind field distribution data, and the normalized odor concentration data into a preset feature fusion model, so that the feature fusion model outputs the environmental features corresponding to the environmental data. The process of obtaining the environmental features corresponding to the environmental data through the feature fusion model has been described in S102 above and will not be elaborated here.
[0144] It should be noted that the obstacle data may further include global obstacle data and local obstacle data. When searching for an odor source in the global map, the range of the global map where the carrier is located may be very large, and the carrier may not be able to collect all the data within all ranges in the global map at one time. The local obstacle data, wind field distribution data, and odor distribution data refer to the data within the range that the carrier can collect, while the global obstacle data may refer to the obstacle data for the global map obtained by the server before starting to search for the odor source. As the carrier moves, the range of data that the carrier can collect also changes, and in the global map, dynamic obstacles may also change. Therefore, the local obstacle data, wind field distribution data, and odor distribution data are all dynamically changing.
[0145] S503: Input the environmental features into a preset temporal network, so that the temporal network outputs the environmental state information of the environmental features at the first set time based on the environmental features at each set time before the first set time.
[0146] In order to enable the environmental features to combine with the environmental features at each set time before the first set time, the server may also input the environmental features into a preset temporal network, so that the temporal network outputs the environmental state information of the environmental features at the first set time based on the environmental features at each set time before the first set time. Through the temporal network, by combining the hidden layer state at the previous set time of the first set time with the environmental features at the first set time, after weighted, activation and other processes, the environmental state information at the first set time and integrating the environmental features at each set time before the first set time is obtained. Among them, the temporal network may adopt the structure of recurrent neural networks such as long short-term memory networks and gated recurrent units. The specific process of obtaining the environmental state information through the temporal network has been described in S102 above and will not be elaborated here.
[0147] S504: Input the environmental status information into the trained prediction model, so that the prediction model predicts the odor distribution map of the environmental status information at a second set time according to the environmental status information. The second set time is the next moment of the first set time, and the prediction model is trained by the above model training method.
[0148] The server inputs the environmental status information into the trained prediction model, so that the prediction model predicts the odor distribution map of the environmental status information at a second set time according to the environmental status information. The second set time is the next moment of the first set time, and the training process of the prediction model has been specifically described in S103, S104, and S105 above, and will not be elaborated here.
[0149] S505: Determine the target position of the odor source according to the odor distribution map.
[0150] The server determines the target position of the odor source according to the odor distribution map output by the prediction model at the second set time. Then, the server judges and determines the position of the odor source in the global map to send a control instruction to the carrier to make the carrier move to the position of the odor source. During the movement of the carrier towards the odor source, the server can dynamically collect the environmental data within the range that the carrier can collect through the carrier. As the environmental data is updated, the odor distribution map determined by the server is also updated. Therefore, the target position of the odor source determined according to the odor distribution map is also updated to make the determined target position of the odor source more accurate.
[0151] Of course, in this specification, in order to determine a more accurate target position of the odor source according to the odor distribution map, it can also be to adopt search algorithms such as the Genetic Algorithm (GA) to determine the points with higher odor concentration in the odor distribution map as the candidate positions of the odor source according to the odor distribution map at the second set time. Then, the server screens the target position of the odor source from the candidate odor sources according to the odor distribution maps at each set time before the second set time. In this way, the server can combine the changes in the odor concentration in the odor distribution maps at each set time before the second set time to determine a more accurate target position of the odor source, avoiding misjudging the position with excessively high local odor concentration caused by environmental factors as the target position of the odor source. Among them, GA is a computational model that simulates the natural selection and genetic mechanism of Darwin's theory of biological evolution in the biological evolution process. It searches for the optimal solution or approximate optimal solution by simulating the natural evolution process.
[0152] In this specification, the server extracts the environmental features corresponding to the environmental data at the first set time through a feature fusion model, and then obtains the environmental state information corresponding to the environmental features through a time series network. At this time, the environmental state information incorporates the environmental features at each set time before the first set time. Then, the environmental state information is input into the trained prediction model so that the prediction model outputs the odor distribution map of the environmental state information at the second set time. Such a method enables the server to more accurately locate the target position of the odor source based on the obtained dynamically updated odor distribution map.
[0153] Moreover, the environmental data can include obstacle data, wind field distribution data, and odor concentration data. The method in this specification combines multiple types of environmental data to obtain environmental features in order to exclude the influence of obstacles and wind fields in the environment on determining the odor source.
[0154] In addition, when determining the odor source, the server can combine the odor distribution maps at each set time before the second set time to screen out the target position from the candidate positions. Compared with determining the target position of the odor source only through the odor distribution map at the second set time, the screened target position is more accurate.
[0155] The above is the method for training one or more implementation models in this specification and locating the odor source. Based on the same idea, this specification also provides a corresponding device for training the prediction model and locating the odor source, as Figure 6 、 Figure 7 shown.
[0156] Figure 6 It is a schematic diagram of a model training device provided in this specification, including:
[0157] An acquisition module 601, configured to acquire sample environmental data corresponding to the first set time;
[0158] A determination module 602, configured to determine, according to the sample environmental data, the first environmental state information at the first set time in the environment corresponding to the sample environmental data;
[0159] A prediction module 603, configured to input the first environmental state information into a prediction model to be trained, so that the prediction model predicts the odor distribution map of the environment at the second set time under the first environmental state information according to the first environmental state information, where the second set time is the next moment of the first set time;
[0160] A discrimination module 604, configured to input the odor distribution map into a preset first discrimination model, so that the first discrimination model outputs a first discrimination result for the odor distribution map, and the first discrimination result is used to represent a first probability that the odor distribution map is a true odor distribution map;
[0161] A training module 605, configured to determine a first loss value according to the first probability, and train the prediction model according to the first loss value, and there is a negative correlation between the first probability and the first loss value.
[0162] Optionally, the training module 605 is specifically configured to, for each round of training, in this round of training, fix the model parameters of the prediction model after the previous round of training, and use minimizing the determined first auxiliary loss value as the optimization objective to train the first discrimination model after the previous round of training to obtain the first discrimination model after this round of training. The first auxiliary loss value is determined by a first deviation between a first auxiliary discrimination result obtained by the first discrimination model after the previous round of training for the input odor distribution map and the discrimination label corresponding to the odor distribution map input into the first discrimination model after the previous round of training. The first auxiliary discrimination result is used to represent whether the odor distribution map input into the first discrimination model after the previous round of training is a true odor distribution map, and the discrimination label is used to indicate whether the odor distribution map input into the first discrimination model after the previous round of training is actually a true odor distribution map. There is a positive correlation between the first auxiliary loss value and the first deviation. Among them, the odor distribution map input into the first discrimination model after the previous round of training includes a true odor distribution map or an odor distribution map output by the prediction model after the previous round of training; fix the model parameters of the first discrimination model after this round of training, and use minimizing the first loss value as the optimization objective to train the prediction model after the previous round of training to obtain the prediction model after this round of training.
[0163] Optionally, the training module 605 is further configured to obtain a sample odor distribution map corresponding to the second set time; input the sample odor distribution map into the trained generation model, so that the generation model determines, according to the sample odor distribution map, the environmental state information corresponding to the environment presenting the sample odor distribution map at the first set time as the second environmental state information; input the second environmental state information into the prediction model, so that the prediction model predicts, according to the second environmental state information, the odor distribution map of the environment corresponding to the second environmental state information at the second set time as the sample control odor distribution map, and input the odor distribution map into the generation model, so that the generation model generates, according to the odor distribution map, the environmental state information of the environment presenting the odor distribution map at the first set time as the first control state information; determine a joint loss value according to the deviation between the first environmental state information and the first control state information, and the deviation between the sample odor distribution map and the sample control odor distribution map;
[0164] Specifically, the training module 605 is configured to train the prediction model according to the first loss value and the joint loss value.
[0165] Optionally, the training module 605 is specifically configured to, for each round of training, in this round of training, fix the model parameters of the generation model after the previous round of training, and use minimizing the determined second auxiliary loss value as the optimization objective to train the second discriminant model after the previous round of training to obtain the second discriminant model after this round of training. The second auxiliary loss value is determined by the second deviation between the second discriminant result obtained by the second discriminant model after the previous round of training for the input environmental state information and the discriminant label corresponding to the environmental state information input to the second discriminant model after the previous round of training. The second discriminant result is used to represent the probability that the environmental state information input to the second discriminant model after the previous round of training is the real environmental state information. The discriminant label corresponding to the environmental state information input to the second discriminant model after the previous round of training is used to indicate whether the environmental state information input to the second discriminant model after the previous round of training is actually the real environmental state information. There is a positive correlation between the second auxiliary loss value and the second deviation. Among them, the environmental state information input to the second discriminant model after the previous round of training includes real environmental state information or environmental state information output by the generation model after the previous round of training; input the preset odor distribution map into the generation model after the previous round of training to obtain the environmental state information of the environment at the previous moment presenting the preset odor distribution map as the second environmental state information; input the second environmental state information into the second discriminant model after this round of training to obtain a second auxiliary discriminant result, and the second auxiliary discriminant result is used to represent the second probability that the second discriminant model after this round of training determines that the second environmental state information is the real environmental state information; determine a second loss value according to the second probability, and fix the model parameters of the second discriminant model after this round of training, and use minimizing the second loss value as the optimization objective to train the generation model after the previous round of training to obtain the generation model after this round of training.
[0166] Figure 7 It is a schematic diagram of a device for locating an odor source provided in this specification, including:
[0167] An acquisition module 701, configured to acquire environmental data corresponding to the environment where the carrier searching for the odor source is located at a first set moment;
[0168] A fusion module 702, configured to input the environmental data into a preset feature fusion model, so that the feature fusion model outputs environmental features corresponding to the environmental data;
[0169] An input module 703 for inputting the environmental features into a preset time series network, so that the time series network outputs environmental state information of the environmental features at a first set time based on the environmental features at each set time before the first set time;
[0170] A prediction module 704 for inputting the environmental state information into a trained prediction model, so that the prediction model predicts an odor distribution map of the environmental state information at a second set time according to the environmental state information, where the second set time is the next moment of the first set time, and the prediction model is trained by the above model training method;
[0171] A determination module 705 for determining a target position of an odor source according to the odor distribution map.
[0172] Optionally, the environmental data includes obstacle data, wind field distribution data, and odor concentration data; the fusion module 702 is specifically configured to perform normalization processing on the wind field distribution data and the odor concentration data; input the obstacle data, the normalized wind field distribution data, and the normalized odor concentration data into a preset feature fusion model, so that the feature fusion model outputs environmental features corresponding to the environmental data.
[0173] Optionally, the determination module 705 is specifically configured to determine each candidate position of the odor source according to the odor distribution map; screen out the target position of the odor source from the candidate positions according to the odor distribution maps at each set time before the second set time.
[0174] This specification also provides a computer-readable storage medium storing a computer program, which can be used to execute the above Figure 1 provided model training method or Figure 5 provided method for locating an odor source.
[0175] This specification also provides Figure 8 shown a schematic structural diagram of an electronic device corresponding to Figure 1 or Figure 5 As Figure 8 described, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above Figure 1 described model training method or Figure 5The method for locating an odor source. Of course, in addition to the software implementation, this specification does not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
[0176] For an improvement in a technology, it can be clearly distinguished whether it is a hardware improvement (e.g., improvement in circuit structures such as diodes, transistors, switches, etc.) or a software improvement (improvement in method flows). However, with the development of technology, many improvements in method flows today can be regarded as direct improvements in hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented with a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user's programming of the device. The designer can program by himself to "integrate" a digital system on a piece of PLD without having to ask the chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called Hardware Description Language (HDL), and there is not only one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be clear that as long as the method flow is slightly logically programmed with the above-mentioned several hardware description languages and programmed into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.
[0177] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to implement the same function by logically programming the method steps so that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers, etc. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.
[0178] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0179] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0180] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0181] This specification is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0182] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0183] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0184] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0185] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0186] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information accessible by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0187] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.
[0188] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, system or computer program product. Therefore, this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0189] This specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0190] Each embodiment in this specification is described in a progressive manner. For the identical or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the corresponding descriptions in the method embodiments.
[0191] The above description is only for the embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various modifications and changes can be made to this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.
Claims
1. A model training method, characterized in that: include: Acquire sample environment data corresponding to a first set time, wherein the sample environment data includes obstacle data, wind field distribution data, and odor concentration data; Determine, according to the sample environment data, first environment state information at the first set time in the environment corresponding to the sample environment data, wherein the sample environment data is input into a preset feature fusion model so that the feature fusion model outputs environment features corresponding to the sample environment data, and the environment features are input into a preset timing network so that the timing network outputs the first environment state information of the environment features at the first set time based on the environment features at each set time before the first set time; Inputting the first environmental state information into a prediction model to be trained, so that the prediction model predicts the odor distribution map of the environment under the first environmental state information at a second set time according to the first environmental state information, where the second set time is the next time after the first set time; Inputting the odor distribution map into a preset first discriminant model so that the first discriminant model outputs a first discriminant result for the odor distribution map, wherein the first discriminant result is used to characterize a first probability that the odor distribution map is a true odor distribution map; According to the first probability, a first loss value is determined, and a sample odor distribution map corresponding to the second set moment is obtained, and the sample odor distribution map is input into the trained generation model so that the generation model determines the environmental state information corresponding to the first set moment when the environment presents the environmental state of the sample odor distribution map at the second set moment according to the sample odor distribution map, as the second environmental state information, and the second environmental state information is input into the prediction model so that the prediction model predicts the odor distribution map of the environment corresponding to the second environmental state information at the second set moment according to the second environmental state information, as the sample control odor distribution map, and the odor distribution map is input into the generation model so that the generation model generates the environmental state information of the environment presenting the environmental state of the odor distribution map at the first set moment according to the odor distribution map, as the first control state information, and determines the joint loss value according to the deviation between the first environmental state information and the first control state information, and the deviation between the sample odor distribution map and the sample control odor distribution map, and trains the prediction model according to the first loss value and the joint loss value, and there is a negative correlation between the first probability and the first loss value.
2. The method according to claim 1, characterized in that Training the prediction model according to the first loss value specifically includes: For each round of training, in this round of training, the model parameters of the prediction model after the previous round of training are fixed, and the first discriminant model after the previous round of training is trained with minimization of the first auxiliary loss value determined as the optimization target to obtain the first discriminant model after this round of training, wherein the first auxiliary loss value is determined by the first deviation between the first auxiliary discrimination result obtained by the first discriminant model after the previous round of training for the input odor distribution map and the discrimination label corresponding to the odor distribution map input to the first discriminant model after the previous round of training, the first auxiliary discrimination result is used to characterize whether the odor distribution map input to the first discriminant model after the previous round of training is a real odor distribution map, and the discrimination label is used to indicate whether the odor distribution map input to the first discriminant model after the previous round of training is actually a real odor distribution map, and there is a positive correlation between the first auxiliary loss value and the first deviation, wherein the odor distribution map input to the first discriminant model after the previous round of training includes a real odor distribution map or an odor distribution map output by the prediction model after the previous round of training; The model parameters of the first discriminant model after this round of training are fixed, and the prediction model after the previous round of training is trained with minimizing the first loss value as the optimization goal to obtain the prediction model after this round of training.
3. The method according to claim 1, characterized in that Train the generative model, including: For each round of training, in this round of training, the model parameters of the generative model after the previous round of training are fixed, and the second discriminant model after the previous round of training is trained with minimization of the second auxiliary loss value determined as the optimization target, to obtain the second discriminant model after the training in this round, the second auxiliary loss value is determined by the second deviation between the second discrimination result obtained by the second discriminant model after the previous round of training for the input environmental state information and the discrimination label corresponding to the environmental state information input to the second discriminant model after the previous round of training, the second discrimination result is used to characterize the probability that the environmental state information input to the second discriminant model after the previous round of training is the real environmental state information, the discrimination label corresponding to the environmental state information input to the second discriminant model after the previous round of training is used to indicate whether the environmental state information input to the second discriminant model after the previous round of training is actually the real environmental state information, and there is a positive correlation between the second auxiliary loss value and the second deviation, wherein the environmental state information input to the second discriminant model after the previous round of training includes the real environmental state information or the environmental state information output by the generative model after the previous round of training; Inputting the preset odor distribution map into the generation model after the previous round of training to obtain the environmental state information of the environment presenting the preset odor distribution map at the previous moment as the second environmental state information; Inputting the second environmental state information into the second discriminant model after the round of training to obtain a second auxiliary discrimination result, wherein the second auxiliary discrimination result is used to represent a second probability that the second environmental state information judged by the second discriminant model after the round of training is true environmental state information; According to the second probability, the second loss value is determined, and the model parameters of the second discriminant model after this round of training are fixed. The generative model after the previous round of training is trained with minimizing the second loss value as the optimization goal to obtain the generative model after this round of training.
4. A method for locating an odor source, characterized in that: include: Acquire environmental data corresponding to the environment in which the carrier searching for the odor source is located at a first set time; Inputting the environmental data into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data; Inputting the environmental characteristics into a preset timing network, so that the timing network outputs environmental state information of the environmental characteristics at the first set time based on the environmental characteristics at each set time before the first set time; Inputting the environmental state information into a trained prediction model so that the prediction model predicts the odor distribution map of the environmental state information at a second set time according to the environmental state information, wherein the second set time is a time after the first set time, and the prediction model is trained by the method according to any one of claims 1 to 3; According to the odor distribution map, the target location of the odor source is determined.
5. The method according to claim 4, characterized in that The environmental data includes obstacle data, wind field distribution data and odor concentration data; Inputting the environmental data into a preset feature fusion model so that the feature fusion model outputs environmental features corresponding to the environmental data specifically includes: Normalizing the wind field distribution data and the odor concentration data; The obstacle data, the normalized wind field distribution data, and the normalized odor concentration data are input into a preset feature fusion model so that the feature fusion model outputs the environmental features corresponding to the environmental data.
6. The method according to claim 4, characterized in that Determining the target location of the odor source according to the odor distribution map specifically includes: Determining candidate locations of the odor source according to the odor distribution map; According to the odor distribution map at each set time before the second set time, the target position of the odor source is screened out from the candidate positions.
7. A model training device, characterized in that: include: An acquisition module, used to acquire sample environment data corresponding to a first set time, wherein the sample environment data includes obstacle data, wind field distribution data, and odor concentration data; A determination module, used to determine, based on the sample environment data, first environment state information under the environment corresponding to the sample environment data at the first set time, wherein the sample environment data is input into a preset feature fusion model so that the feature fusion model outputs environment features corresponding to the sample environment data, and the environment features are input into a preset timing network so that the timing network outputs the first environment state information of the environment features at the first set time based on the environment features at each set time before the first set time; A prediction module, used for inputting the first environmental state information into a prediction model to be trained, so that the prediction model predicts the odor distribution map of the environment under the first environmental state information at a second set time according to the first environmental state information, and the second set time is the next time after the first set time; A discrimination module, used for inputting the odor distribution map into a preset first discrimination model, so that the first discrimination model outputs a first discrimination result for the odor distribution map, wherein the first discrimination result is used for representing a first probability that the odor distribution map is a true odor distribution map; A training module is used to determine a first loss value according to the first probability, and to obtain a sample odor distribution map corresponding to the second set moment, and to input the sample odor distribution map into the trained generation model so that the generation model determines the environmental state information corresponding to the first set moment when the environment presents the environmental state of the sample odor distribution map at the second set moment according to the sample odor distribution map, as the second environmental state information, and to input the second environmental state information into the prediction model so that the prediction model predicts the odor distribution map of the environment corresponding to the second environmental state information at the second set moment according to the second environmental state information, as the sample control odor distribution map, and to input the odor distribution map into the generation model so that the generation model generates the environmental state information of the environment presenting the environmental state of the odor distribution map at the first set moment according to the odor distribution map, as the first control state information, and to determine the joint loss value according to the deviation between the first environmental state information and the first control state information, and the deviation between the sample odor distribution map and the sample control odor distribution map, and to train the prediction model according to the first loss value and the joint loss value, and there is a negative correlation between the first probability and the first loss value.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 6 is implemented.
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 program, the method described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for predicting concentration of dissolved gas in transformer oil and medium
CN114418166A
Environmental monitoring method based on Transform time sequence prediction
CN114580710A
Imaging method and device based on adversarial model
CN115576006A
Odor detection method, system and equipment based on LSTM (Long Short Term Memory) and medium
CN117763307A