Nothing Special   »   [go: up one dir, main page]

CN117809010B - Electronic cigarette smoke analysis and detection method and system - Google Patents

Electronic cigarette smoke analysis and detection method and system Download PDF

Info

Publication number
CN117809010B
CN117809010B CN202410214480.5A CN202410214480A CN117809010B CN 117809010 B CN117809010 B CN 117809010B CN 202410214480 A CN202410214480 A CN 202410214480A CN 117809010 B CN117809010 B CN 117809010B
Authority
CN
China
Prior art keywords
imaging system
smoke
hyperspectral imaging
electronic cigarette
system built
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410214480.5A
Other languages
Chinese (zh)
Other versions
CN117809010A (en
Inventor
赖素浪
蔡金明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Thinking Automation Technology Co ltd
Original Assignee
Shenzhen Thinking Automation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Thinking Automation Technology Co ltd filed Critical Shenzhen Thinking Automation Technology Co ltd
Priority to CN202410214480.5A priority Critical patent/CN117809010B/en
Publication of CN117809010A publication Critical patent/CN117809010A/en
Application granted granted Critical
Publication of CN117809010B publication Critical patent/CN117809010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • G06V10/12Details of acquisition arrangements; Constructional details thereof
    • G06V10/14Optical characteristics of the device performing the acquisition or on the illumination arrangements
    • G06V10/147Details of sensors, e.g. sensor lenses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/273Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion removing elements interfering with the pattern to be recognised
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/58Extraction of image or video features relating to hyperspectral data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • Biochemistry (AREA)
  • Evolutionary Computation (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Databases & Information Systems (AREA)
  • Vascular Medicine (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the field of image processing, in particular to an electronic cigarette smoke analysis and detection method and system. An electronic cigarette smoke analysis detection system comprising: the system comprises an environment data acquisition module, a hyperspectral imaging system built-in parameter adjustment module, a hyperspectral imaging system built-in parameter set library construction module, a smoke region picture output module and an electronic cigarette smoke analysis module. According to the invention, the hyperspectral imaging system can automatically adjust to the built-in parameters most suitable for the current environment by responding to the environmental change in real time through the multiple sensors, so that the negative influence of environmental factors on the quality of the optical data is reduced, the quality of the electronic cigarette smoke picture is improved, the interference of the background spectral characteristics is effectively reduced by combining with time sequence analysis, and the segmentation effect of smoke and non-smoke areas is enhanced.

Description

Electronic cigarette smoke analysis and detection method and system
Technical Field
The invention relates to the field of image processing, in particular to an electronic cigarette smoke analysis and detection method and system.
Background
Currently, a spectrum analysis method is adopted for analyzing components of the electronic cigarette smoke, but in the traditional spectrum imaging analysis, as the spectrum characteristics of the electronic cigarette smoke and background environments (such as other particulate matters in air, ambient light and the like) may overlap, interference occurs in an analysis process, and thus the accuracy of analysis is affected. For example, spectral features of stray light or other chemical substances in the environment may be confused with spectral features of certain components in the electronic cigarette smoke, so that a detection result is not accurate enough, further judgment on the quality of the electronic cigarette is affected, and the quality of pictures obtained by hyperspectral imaging is different in different environments.
Disclosure of Invention
According to the invention, the hyperspectral imaging system can automatically adjust to the built-in parameters most suitable for the current environment by responding to the environment change in real time through the multiple sensors, so that the negative influence of environmental factors on the quality of the data of the electronic cigarette is reduced, the quality of the image of the electronic cigarette is improved, and accurate environmental information is provided for the hyperspectral imaging system by normalizing the environmental data, and the data quality and consistency in the imaging process are ensured; and secondly, a series of hyperspectral smoke images are acquired within preset time, and the time sequence network model is combined, so that the change information of the smoke along with time, such as the diffusion speed and the diffusion direction of the smoke, can be captured and analyzed, key information is provided for the accurate extraction and segmentation of a smoke region, the advantage of hyperspectral imaging is fully utilized by the deep learning of the time sequence data, and the interference of the background spectral characteristics is effectively reduced by combining with the time sequence analysis, so that the segmentation effect of the smoke region and the non-smoke region is enhanced.
An electronic cigarette smoke analysis and detection method, comprising:
Acquiring current environmental data G through a plurality of sensors, wherein the environmental data G is { G 1,g2,g3,…,gm,…,gM }, and G m is an environmental data value of the mth environmental attribute after normalization;
Matching the environment data G with a hyperspectral imaging system built-in parameter set library, outputting a hyperspectral imaging system built-in parameter set, adjusting the hyperspectral imaging system based on the output hyperspectral imaging system built-in parameter set, wherein the hyperspectral imaging system built-in parameter set library comprises standard environment data and a corresponding hyperspectral imaging system built-in parameter set, and the hyperspectral imaging system built-in parameter set corresponding to the standard environment data is obtained by performing simulation calculation through an improved moth flame optimization algorithm;
Acquiring a plurality of electronic cigarette smoke pictures in a preset time, wherein the electronic cigarette smoke pictures are spectrograms, and selecting N electronic cigarette smoke pictures at intervals of a preset period as electronic cigarette smoke pictures F n to be detected, wherein n=1, 2,3, … … and N;
Sending N electronic cigarette smoke pictures F n to be tested into a trained smoke region extraction model, and outputting smoke region pictures;
The smoke region extraction model comprises a change region extraction layer, a smoke region strengthening layer and a smoke region segmentation layer, wherein the change region extraction layer is used for extracting information of smoke changing along with time based on the time sequence network model; the smoke region strengthening layer is used for strengthening a smoke region in the smoke picture of the electronic cigarette to be tested; the smoke region segmentation layer is used for segmenting a smoke region and a non-smoke region of the reinforced electronic cigarette smoke picture to be tested and outputting the smoke region picture;
and sending the smoke region picture into an electronic cigarette smoke analysis model for processing, and outputting the smoke component information of the electronic cigarette.
As a preferred aspect of the present invention, the matching of the environmental data G and the hyperspectral imaging system built-in parameter set library, and the output of the hyperspectral imaging system built-in parameter set, specifically includes the following steps:
Calculating the similarity A between the environment data G and the standard environment data in the hyperspectral imaging system built-in parameter set library one by one, judging whether A is more than B, wherein B is a similarity threshold value which is generally set to be 0.8, and outputting a hyperspectral imaging system built-in parameter set corresponding to the standard environment data if A is more than B; if the value of A > B is not satisfied, calculating the similarity A between the environmental data G and the next standard environmental data in the hyperspectral imaging system built-in parameter set library; and if the standard environmental data meeting the requirement of A & gtB still does not appear, sending the environmental data G into a cloud server, carrying out simulation calculation to output a hyperspectral imaging system built-in parameter set through an improved moth flame optimization algorithm, taking the environmental data G as the standard environmental data, and establishing and mapping with the hyperspectral imaging system built-in parameter set which is simulated and calculated through the improved moth flame optimization algorithm and storing the environment data G into the hyperspectral imaging system built-in parameter set library.
As a preferable aspect of the invention, the environment data G is sent to the cloud server, and the simulation calculation is carried out through the improved moth flame optimization algorithm to output the built-in parameter set of the hyperspectral imaging system, which comprises the following steps:
S1: establishing R hyperspectral imaging system built-in simulation parameter sets P r, r=1, 2,3, … … and R, wherein { P r(1),pr(2),pr(3),…,pr(i),……,pr (I) } is stored in the hyperspectral imaging system built-in simulation parameter sets P r, P r (I) is the ith hyperspectral imaging system built-in simulation parameter in the hyperspectral imaging system built-in simulation parameter sets P r, and i=1, 2,3, … … and I are the total number of hyperspectral imaging system built-in simulation parameters in the hyperspectral imaging system built-in simulation parameter sets P r;
S2: setting a maximum iteration number Iter_max, and enabling w=1, wherein w is used for recording the iteration number;
S3: calculating the corresponding fitness delta r of the hyperspectral imaging system built-in simulation parameter sets P r, arranging all the hyperspectral imaging system built-in simulation parameter sets P r according to the corresponding fitness delta r from large to small, forming a population set by the arranged hyperspectral imaging system built-in simulation parameter sets P r, forming a flame individual set by selecting front zeta hyperspectral imaging system built-in simulation parameter sets P r, and in an initial state, marking the hyperspectral imaging system built-in simulation parameter sets P r in the flame individual set as hyperspectral imaging system built-in target parameter sets Y j, j=1, 2 and 3 … zeta;
S4: the first E hyperspectral imaging system built-in target parameter sets Y j in the flame individual set are respectively marked as elite individuals L e, e=1, 2,3, … …, E and E are the total number of elite individuals; selecting a hyperspectral imaging system built-in simulation parameter set P r from a population set in sequence, recording the sequence position of the hyperspectral imaging system built-in simulation parameter set P r in the population set as tip, judging whether tip > ζ is met, if so, directly selecting a hyperspectral imaging system built-in target parameter set Y j positioned at the tip position from a flame individual set, recording a target flame individual P r_obj corresponding to the hyperspectral imaging system built-in simulation parameter set P r, otherwise, if not, selecting a hyperspectral imaging system built-in target parameter set Y j from a flame individual set except for all elite individuals L e by adopting a roulette selection algorithm as a target flame individual P r_obj corresponding to the hyperspectral imaging system built-in simulation parameter set P r, and updating the selected hyperspectral imaging system built-in simulation parameter set P r based on the elite individuals L e and the target flame individual P r_obj according to the fitness delta r corresponding to the hyperspectral imaging system built-in simulation parameter set P r, by adopting the roulette selection algorithm:
Wherein dis (P r,Le) is the distance between the selected hyperspectral imaging system built-in simulation parameter set P r and the elite individual L e, and dis (P r,Pr_obj) is the distance between the selected hyperspectral imaging system built-in simulation parameter set P r and the target flame individual P r_obj; c is the logarithmic spiral shape constant; t is a random number between intervals [ -1,1 ]; l e (i) is the built-in simulation parameter of the ith hyperspectral imaging system in elite individual L e, P r_obj (i) is the built-in simulation parameter of the ith hyperspectral imaging system in target flame individual P r_obj, And/>Is an intermediate quantity;
s5: updating the number ζ of individual flames R i in the individual flame set by the following formula:
ζ=round[(R-w)(R-1)/Iter_max];
s6: judging whether the 'w < Iter_max' is met or not, if so, entering S7; if "w < Iter_max" is not satisfied, the process proceeds to S8;
S7: calculating the corresponding fitness delta r of the built-in simulation parameter sets P r of the hyperspectral imaging system, arranging all the built-in simulation parameter sets P r of the hyperspectral imaging system from large to small according to the corresponding fitness delta r, reorganizing all the arranged built-in simulation parameter sets P r of the hyperspectral imaging system into a population set, arranging all the built-in simulation parameter sets P r of the hyperspectral imaging system in the population set and all the built-in simulation parameter sets P r of the hyperspectral imaging system in the flame individual set from large to small according to the corresponding fitness delta r, and selecting the front zeta hyperspectral imaging system built-in simulation parameter sets P r to form the flame individual set to return to S4;
S8: and selecting all the hyperspectral imaging system built-in simulation parameter sets P r in the population set and the hyperspectral imaging system built-in simulation parameter set P r with the largest adaptability delta r in the hyperspectral imaging system built-in simulation parameter set P r in the flame individual set as hyperspectral imaging system built-in parameter sets to output.
As a preferred aspect of the present invention, the method for establishing R sets of built-in simulation parameters P r of the hyperspectral imaging system specifically includes the following steps:
S1.1: for each hyperspectral imaging system built-in simulation parameter set P r, carrying out assignment operation according to the following formula:
pr(i)=min(i)+rand(max(i)-min(i));
Wherein min (i) is the lower limit value of the built-in simulation parameter of the ith hyperspectral imaging system, and max (i) is the upper limit value of the built-in simulation parameter of the ith hyperspectral imaging system;
S1.2: and repeating the step S1.1 for R times, and establishing the built-in simulation parameter sets P r of the R hyperspectral imaging systems.
As a preferred aspect of the present invention, the method for calculating the fitness delta r corresponding to the built-in simulation parameter set P r of the hyperspectral imaging system specifically includes the following steps: the environment data G is simulated through simulation software in the cloud server, an electronic cigarette smoke picture acquired by a hyperspectral imaging system corresponding to a hyperspectral imaging system built-in simulation parameter set P r is simulated, a simulated smoke region picture is output based on the simulated electronic cigarette smoke picture and a trained smoke region extraction model, and the coincidence degree is calculated with a standard smoke region picture, namely the fitness delta r corresponding to the hyperspectral imaging system built-in simulation parameter set P r.
As a preferred aspect of the present invention, N electronic cigarette smoke pictures F n to be tested are sent to a trained smoke region extraction model, and smoke region pictures are output, which specifically includes the following steps:
Sending N electronic cigarette smoke pictures to be detected into a change area extraction layer for processing, establishing the change area extraction layer based on a long-short-time memory network (LSTM), outputting a first characteristic diagram, wherein the first characteristic diagram comprises information of smoke change along with time, and strengthening possible smoke image characteristics;
The smoke region strengthening layer comprises N self-attention mechanism units, the smoke pictures F n of the electronic cigarette to be detected are respectively sent into the N self-attention mechanism units according to the time sequence, and in each self-attention mechanism unit, a key value matrix K and a value matrix V are constructed based on the input smoke pictures F n of the electronic cigarette to be detected, and the specific operation is to multiply the input smoke pictures F n of the electronic cigarette to be detected with the key value weight matrix to obtain the key value matrix K; multiplying the input electronic cigarette smoke picture F n to be detected by a value weight matrix to obtain a value matrix V; aiming at a first self-attention mechanism unit, constructing a query matrix Q based on the first feature map in a specific mode that the first feature map is multiplied by a query weight matrix to obtain the query matrix Q; aiming at the rest self-attention mechanism units except the first self-attention mechanism unit, constructing a query matrix Q based on the second feature diagram output by the last self-attention mechanism unit, wherein the specific mode is that the second feature diagram output by the last self-attention mechanism unit is multiplied by the query weight matrix to obtain the query matrix Q; for each self-attention mechanism unit, an attention weight matrix att=softmax ((q·k T)/(μ) 0.5) is calculated, where μ is the number of columns of the key-value matrix K; multiplying the attention weight matrix ATT with the value matrix V to output a second feature map;
and sending the second feature map to a smoke region segmentation layer for processing, wherein the smoke region segmentation layer is established based on U-net, and outputting a smoke region picture.
As a preferred aspect of the invention, training of the extraction model for a smoke region comprises the steps of:
Acquiring a plurality of electronic cigarette smoke pictures marked with smoke areas; forming a first training set by all the electronic cigarette smoke pictures marked with the smoke areas, sending the first training set into a smoke area segmentation layer with initialization parameters for training, calculating a first loss value by taking the marked smoke areas as targets, and outputting the trained smoke area segmentation layer if the first loss value is positioned in a first preset range; otherwise, continuing to train the smoke region segmentation layer through the first training set;
Acquiring a plurality of electronic cigarette smoke picture time sequence sets, wherein the electronic cigarette smoke picture time sequence sets store electronic cigarette smoke pictures which are acquired in the same time period and ordered in time sequence, and the last electronic cigarette smoke picture in the electronic cigarette smoke picture time sequence sets marks a smoke region; forming a second training set by all the electronic cigarette smoke picture time sequence sets, sending the second training set into a smoke region extraction model of initialization parameters for training, directly adopting parameters corresponding to the trained smoke region segmentation layers by the smoke region segmentation layers in the smoke region extraction model of the initialization parameters, calculating a second loss value by taking the marked smoke region as a target in the process, and outputting the trained smoke region extraction model if the second loss value is in a second preset range; otherwise, continuing to train the smoke region extraction model through the second training set.
An electronic cigarette smoke analysis detection system comprising:
the environment data acquisition module is used for acquiring current environment data through a plurality of sensors;
The hyperspectral imaging system built-in parameter adjustment module is used for outputting the environment data G and the hyperspectral imaging system built-in parameter set library to a hyperspectral imaging system built-in parameter set, and adjusting the hyperspectral imaging system based on the output hyperspectral imaging system built-in parameter set;
The hyperspectral imaging system built-in parameter set library construction module is used for constructing a hyperspectral imaging system built-in parameter set library based on an improved moth flame optimization algorithm;
the smoke region picture output module is used for sending the smoke picture of the electronic cigarette to be tested into the trained smoke region extraction model and outputting the smoke region picture;
And the electronic cigarette smoke analysis module is used for sending the smoke region pictures into the electronic cigarette smoke analysis model for processing and outputting the electronic cigarette smoke component information.
The invention has the following advantages:
1. According to the invention, the hyperspectral imaging system can automatically adjust to the built-in parameters most suitable for the current environment by responding to the environment change in real time through the multiple sensors, so that the negative influence of environmental factors on the quality of the data of the electronic cigarette is reduced, the quality of the image of the electronic cigarette is improved, and accurate environmental information is provided for the hyperspectral imaging system by normalizing the environmental data, and the data quality and consistency in the imaging process are ensured; and secondly, a series of hyperspectral smoke images are acquired within preset time, and the time sequence network model is combined, so that the change information of the smoke along with time, such as the diffusion speed and the diffusion direction of the smoke, can be captured and analyzed, key information is provided for the accurate extraction and segmentation of a smoke region, the advantage of hyperspectral imaging is fully utilized by the deep learning of the time sequence data, and the interference of the background spectral characteristics is effectively reduced by combining with the time sequence analysis, so that the segmentation effect of the smoke region and the non-smoke region is enhanced.
2. According to the method, the environment data are matched with the standard environment data in the hyperspectral imaging system built-in parameter set library, if the matching is successful, the corresponding hyperspectral imaging system built-in parameter set library can be directly output, simulation calculation of the hyperspectral imaging system built-in parameter set through the cloud server is not needed each time, the adjustment time of the hyperspectral imaging system is saved, and the overall efficiency is improved.
3. According to the invention, a plurality of built-in simulation parameter sets of the hyperspectral imaging system are established, and iterative optimization calculation is carried out through a moth flame optimization algorithm, so that imaging parameter configuration most suitable for the current environmental condition can be found; meanwhile, an elite strategy and a target flame individual selection mechanism introduced in the algorithm can improve the effectiveness and convergence speed of the parameter optimization process by reducing randomness, and the high efficiency and accuracy of the optimization process are ensured.
4. According to the invention, the dynamic change information of the smoke along with time is captured through the ConvLSTM model, and the self-attention mechanism strengthening is carried out on the smoke picture of the electronic cigarette based on the dynamic change information of the smoke along with time, so that the influence of spectral characteristics in different backgrounds on the segmentation of smoke and non-smoke areas can be reduced, the segmented smoke areas are more accurate, and the accuracy of the subsequent smoke analysis of the electronic cigarette is improved.
Drawings
Fig. 1 is a schematic structural diagram of an electronic cigarette smoke analysis and detection system according to an embodiment of the present invention.
Detailed Description
In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Example 1
An electronic cigarette smoke analysis and detection method, comprising:
acquiring current environmental data G through a plurality of sensors, wherein the environmental data G is { G 1,g2,g3,…,gm,…,gM }, G m is an environmental data value obtained by normalizing an mth environmental attribute, and the environmental attribute comprises illumination intensity, environmental temperature, environmental humidity and the like; in actual operation, when the electronic cigarette for spot check is sent into the smoke analysis device, automatically acquiring environmental data values such as illumination intensity, environmental temperature, environmental humidity and the like through the set multi-sensor;
The environment data G is matched with a hyperspectral imaging system built-in parameter set library, a hyperspectral imaging system built-in parameter set is output, the hyperspectral imaging system is adjusted based on the output hyperspectral imaging system built-in parameter set, the hyperspectral imaging system built-in parameter set library comprises standard environment data and corresponding hyperspectral imaging system built-in parameter sets, in the process of carrying out electronic cigarette smoke analysis, the hyperspectral imaging system is used for acquiring spectrum data, the influence of illumination, temperature, humidity and the like is easily caused, the quality of the spectrum data is low, the analysis result of the electronic cigarette smoke is inaccurate, and therefore the corresponding hyperspectral imaging system built-in parameter set is set according to the current environment condition, the quality of subsequently acquired electronic cigarette smoke pictures can be improved, and the accuracy of electronic cigarette smoke analysis is improved; the hyperspectral imaging system built-in parameter set corresponding to the standard environmental data is obtained by simulation calculation through an improved moth flame optimization algorithm;
Acquiring a plurality of electronic cigarette smoke pictures in preset time, wherein the electronic cigarette smoke pictures are spectral pictures, the preset time is set by a user, N electronic cigarette smoke pictures are selected as electronic cigarette smoke pictures F n to be detected at intervals of a preset period, wherein n=1, 2,3, … … and N are also artificially set, the preset period is generally 1/10 of the preset time, in actual operation, an electronic cigarette ignition program is directly started, an electronic cigarette smoke analysis program is automatically started, a hyperspectral imaging system is controlled to perform hyperspectral imaging on electronic cigarette smoke of electronic cigarettes which are in operation, the electronic cigarette smoke pictures are acquired, the electronic cigarette smoke pictures are influenced by the configuration of different hyperspectral imaging systems, and the electronic cigarette smoke pictures which can be acquired in the preset time are not necessarily identical;
Sending N electronic cigarette smoke pictures F n to be tested into a trained smoke region extraction model, and outputting smoke region pictures; in the process of executing hyperspectral imaging, the analysis of the smoke of the electronic cigarette is inaccurate due to the fact that the hyperspectral imaging is extremely easy to be influenced by the spectral characteristics of the background, the time sequence data of N smoke pictures F n of the electronic cigarette to be detected are learned, the information of the smoke changing along with time is extracted, the segmentation effect of a smoke region and a non-smoke region in the smoke picture of the electronic cigarette to be detected is enhanced based on the information of the smoke changing along with time, the background in the output smoke region picture is less, and the accuracy of the subsequent analysis of the smoke of the electronic cigarette is improved;
The smoke region extraction model comprises a change region extraction layer, a smoke region strengthening layer and a smoke region segmentation layer, wherein the change region extraction layer is used for extracting information of smoke changing along with time based on the time sequence network model; the smoke region strengthening layer is used for strengthening a smoke region in the smoke picture of the electronic cigarette to be tested; the smoke region segmentation layer is used for segmenting a smoke region and a non-smoke region of the reinforced electronic cigarette smoke picture to be tested and outputting the smoke region picture;
And sending the smoke region pictures into an electronic cigarette smoke analysis model for processing, outputting electronic cigarette smoke component information, judging the quality of the electronic cigarette based on the electronic cigarette smoke component information, realizing the spot check of the quality of the electronic cigarette in the preparation process of the electronic cigarette, and saving manpower and improving efficiency without carrying out electronic cigarette detection by a professional chemical analysis method.
According to the application, the hyperspectral imaging system can automatically adjust to the built-in parameters most suitable for the current environment by responding to the environment change in real time through the multiple sensors, so that the negative influence of environmental factors on the quality of the data of the electronic cigarette is reduced, the quality of the image of the electronic cigarette is improved, and accurate environmental information is provided for the hyperspectral imaging system by normalizing the environmental data, and the data quality and consistency in the imaging process are ensured; and secondly, a series of hyperspectral smoke images are acquired within preset time, and the time sequence network model is combined, so that the change information of the smoke along with time, such as the diffusion speed and the diffusion direction of the smoke, can be captured and analyzed, key information is provided for the accurate extraction and segmentation of a smoke region, the advantage of hyperspectral imaging is fully utilized by the deep learning of the time sequence data, and the interference of the background spectral characteristics is effectively reduced by combining with the time sequence analysis, so that the segmentation effect of the smoke region and the non-smoke region is enhanced.
Matching the environment data G with a hyperspectral imaging system built-in parameter set library, and outputting a hyperspectral imaging system built-in parameter set, wherein the method specifically comprises the following steps:
Calculating the similarity A between the environment data G and the standard environment data in the hyperspectral imaging system built-in parameter set library one by one, judging whether A & gtB is established or not by adopting a cosine similarity algorithm, wherein B is a similarity threshold value which is generally set to be 0.8, and outputting a hyperspectral imaging system built-in parameter set corresponding to the standard environment data if A & gtB is established; if the value of A > B is not satisfied, calculating the similarity A between the environmental data G and the next standard environmental data in the hyperspectral imaging system built-in parameter set library; if the standard environmental data meeting the requirement of A & gtB still does not appear, sending the environmental data G into a cloud server, carrying out simulation calculation by using an improved moth flame optimization algorithm to output a hyperspectral imaging system built-in parameter set, taking the environmental data G as the standard environmental data, and establishing and storing a mapping between the environmental data G and the hyperspectral imaging system built-in parameter set which is simulated and calculated by using the improved moth flame optimization algorithm into the hyperspectral imaging system built-in parameter set library;
according to the method, the environment data are matched with the standard environment data in the hyperspectral imaging system built-in parameter set library, if the matching is successful, the corresponding hyperspectral imaging system built-in parameter set library can be directly output, simulation calculation of the hyperspectral imaging system built-in parameter set through the cloud server is not needed each time, the adjustment time of the hyperspectral imaging system is saved, and the overall efficiency is improved.
The environment data G is sent to a cloud server, and simulation calculation is carried out through an improved moth flame optimization algorithm to output a hyperspectral imaging system built-in parameter set, and the method specifically comprises the following steps:
S1: establishing R hyperspectral imaging system built-in simulation parameter sets P r, r=1, 2,3, … …, R, wherein { P r(1),pr(2),pr(3),…,pr(i),……,pr (I) } is stored in the hyperspectral imaging system built-in simulation parameter sets P r, P r (I) is an ith hyperspectral imaging system built-in simulation parameter in the hyperspectral imaging system built-in simulation parameter sets P r, such as exposure time, scanning speed and the like, i=1, 2,3, … …, I is the total number of hyperspectral imaging system built-in simulation parameters in the hyperspectral imaging system built-in simulation parameter sets P r, and each hyperspectral imaging system built-in simulation parameter set P r is regarded as a moth individual in a modified moth flame optimization algorithm;
S2: setting a maximum iteration number Iter_max, and enabling w=1, wherein w is used for recording the iteration number;
S3: calculating the corresponding fitness delta r of the hyperspectral imaging system built-in simulation parameter sets P r, arranging all the hyperspectral imaging system built-in simulation parameter sets P r according to the corresponding fitness delta r from large to small, forming a population set by the arranged hyperspectral imaging system built-in simulation parameter sets P r, forming a flame individual set by selecting front zeta hyperspectral imaging system built-in simulation parameter sets P r, and in an initial state, marking the hyperspectral imaging system built-in simulation parameter sets P r in the flame individual set as hyperspectral imaging system built-in target parameter sets Y j, j=1, 2 and 3 … zeta;
S4: the first E hyperspectral imaging system built-in target parameter sets Y j in the flame individual set are respectively marked as elite individuals L e, e=1, 2,3, … …, E and E are the total number of elite individuals, and E is set by people and is generally 3; selecting a hyperspectral imaging system built-in simulation parameter set P r from a population set in sequence, recording the sequence position of the hyperspectral imaging system built-in simulation parameter set P r in the population set as tip, judging whether tip > ζ is met, if so, directly selecting a hyperspectral imaging system built-in target parameter set Y j positioned at the tip position from a flame individual set, recording a target flame individual P r_obj corresponding to the hyperspectral imaging system built-in simulation parameter set P r, otherwise, if not, selecting a hyperspectral imaging system built-in target parameter set Y j from a flame individual set except for all elite individuals L e by adopting a roulette selection algorithm as a target flame individual P r_obj corresponding to the hyperspectral imaging system built-in simulation parameter set P r, and updating the selected hyperspectral imaging system built-in simulation parameter set P r based on the elite individuals L e and the target flame individual P r_obj according to the fitness delta r corresponding to the hyperspectral imaging system built-in simulation parameter set P r, by adopting the roulette selection algorithm:
Wherein dis (P r,Le) is the distance between the selected hyperspectral imaging system built-in simulation parameter set P r and the elite individual L e, and dis (P r,Pr_obj) is the distance between the selected hyperspectral imaging system built-in simulation parameter set P r and the target flame individual P r_obj; c is the logarithmic spiral shape constant; t is a random number between intervals [ -1,1 ]; l e (i) is the built-in simulation parameter of the ith hyperspectral imaging system in elite individual L e, P r_obj (i) is the built-in simulation parameter of the ith hyperspectral imaging system in target flame individual P r_obj, And/>Is an intermediate quantity; through the teaching of the gray wolf algorithm, an individual with high fitness is used as an elite individual to update the built-in simulation parameter set of the hyperspectral imaging system, so that the randomness of the update of the built-in simulation parameter set of the hyperspectral imaging system can be reduced at the later stage of the moth flame algorithm, and the convergence speed is improved;
s5: updating the number ζ of individual flames R i in the individual flame set by the following formula:
ζ=round[(R-w)(R-1)/Iter_max];
s6: judging whether the 'w < Iter_max' is met or not, if so, entering S7; if "w < Iter_max" is not satisfied, the process proceeds to S8;
S7: calculating the corresponding fitness delta r of the built-in simulation parameter sets P r of the hyperspectral imaging system, arranging all the built-in simulation parameter sets P r of the hyperspectral imaging system from large to small according to the corresponding fitness delta r, reorganizing all the arranged built-in simulation parameter sets P r of the hyperspectral imaging system into a population set, arranging all the built-in simulation parameter sets P r of the hyperspectral imaging system in the population set and all the built-in simulation parameter sets P r of the hyperspectral imaging system in the flame individual set from large to small according to the corresponding fitness delta r, and selecting the front zeta hyperspectral imaging system built-in simulation parameter sets P r to form the flame individual set to return to S4;
S8: and selecting all the hyperspectral imaging system built-in simulation parameter sets P r in the population set and the hyperspectral imaging system built-in simulation parameter set P r with the largest adaptability delta r in the hyperspectral imaging system built-in simulation parameter set P r in the flame individual set as hyperspectral imaging system built-in parameter sets to output.
Preferably, the method for establishing the built-in simulation parameter sets P r of the R hyperspectral imaging systems specifically comprises the following steps:
S1.1: for each hyperspectral imaging system built-in simulation parameter set P r, carrying out assignment operation according to the following formula:
pr(i)=min(i)+rand(max(i)-min(i));
Wherein min (i) is the lower limit value of the built-in simulation parameter of the ith hyperspectral imaging system, and max (i) is the upper limit value of the built-in simulation parameter of the ith hyperspectral imaging system;
S1.2: and repeating the step S1.1 for R times, and establishing the built-in simulation parameter sets P r of the R hyperspectral imaging systems.
Preferably, the calculating the fitness delta r corresponding to the built-in simulation parameter set P r of the hyperspectral imaging system specifically includes the following steps: the environment data G is simulated through simulation software in a cloud server, an electronic cigarette smoke picture acquired by a hyperspectral imaging system corresponding to a hyperspectral imaging system built-in simulation parameter set P r is simulated, the simulation software can adopt HyDICE Simulator, then a simulated smoke region picture is output based on the simulated electronic cigarette smoke picture and a trained smoke region extraction model, and the coincidence ratio is calculated with a standard smoke region picture, namely the coincidence ratio is the fitness delta r corresponding to the hyperspectral imaging system built-in simulation parameter set P r, and the standard smoke region is manually set.
According to the application, a plurality of built-in simulation parameter sets of the hyperspectral imaging system are established, and iterative optimization calculation is carried out through a moth flame optimization algorithm, so that imaging parameter configuration most suitable for the current environmental condition can be found; meanwhile, an elite strategy and a target flame individual selection mechanism introduced in the algorithm can improve the effectiveness and convergence speed of the parameter optimization process by reducing randomness, and the high efficiency and accuracy of the optimization process are ensured.
The method comprises the steps of sending N electronic cigarette smoke pictures F n to be detected into a trained smoke region extraction model, and outputting smoke region pictures, and specifically comprises the following steps:
the method comprises the steps that N electronic cigarette smoke pictures to be detected are sent to a change area extraction layer to be processed, the change area extraction layer is built based on a long and short time memory network (LSTM), a ConvLSTM model can be referred to, a first characteristic diagram is output, information of smoke change along with time is included in the first characteristic diagram, and possible smoke image characteristics are enhanced;
The smoke region strengthening layer comprises N self-attention mechanism units, a reference Transfmoer model is specifically set, the smoke pictures F n of the electronic cigarette to be detected are respectively sent into the N self-attention mechanism units according to time sequence, in each self-attention mechanism unit, a key value matrix K and a value matrix V are constructed based on the input smoke pictures F n of the electronic cigarette to be detected, and specific operation is that the input smoke pictures F n of the electronic cigarette to be detected are multiplied by the key value weight matrix to obtain a key value matrix K; multiplying the input electronic cigarette smoke picture F n to be detected by a value weight matrix to obtain a value matrix V; aiming at a first self-attention mechanism unit, constructing a query matrix Q based on the first feature map in a specific mode that the first feature map is multiplied by a query weight matrix to obtain the query matrix Q; aiming at the rest self-attention mechanism units except the first self-attention mechanism unit, constructing a query matrix Q based on the second feature diagram output by the last self-attention mechanism unit, wherein the specific mode is that the second feature diagram output by the last self-attention mechanism unit is multiplied by the query weight matrix to obtain the query matrix Q; calculating an attention weight matrix att=softmax ((q·k T)/(μ)0.5) for each self-attention mechanism unit, wherein μ is the number of columns of the key-value matrix K;
and sending the second feature map to a smoke region segmentation layer for processing, wherein the smoke region segmentation layer is established based on U-net, and outputting a smoke region picture.
According to the application, the dynamic change information of the smoke along with time is captured through the ConvLSTM model, and the self-attention mechanism strengthening is carried out on the smoke picture of the electronic cigarette based on the dynamic change information of the smoke along with time, so that the influence of spectral characteristics in different backgrounds on the segmentation of smoke and non-smoke areas can be reduced, the segmented smoke areas are more accurate, and the accuracy of the subsequent smoke analysis of the electronic cigarette is improved.
Training of the extraction model for smoke areas comprises the following steps:
Acquiring a plurality of electronic cigarette smoke pictures marked with smoke areas, wherein the marking mode can be a manual operation or script automatic marking mode; forming a first training set by all the electronic cigarette smoke pictures marked with the smoke areas, sending the first training set into a smoke area dividing layer with initialization parameters for training, calculating a first loss value by taking the marked smoke areas as targets, and if the first loss value is located in a first preset range, manually setting the first preset range and outputting the trained smoke area dividing layer; otherwise, continuing to train the smoke region segmentation layer through the first training set;
acquiring a plurality of electronic cigarette smoke picture time sequence sets, wherein the electronic cigarette smoke picture time sequence sets store electronic cigarette smoke pictures which are acquired in the same time period and ordered in time sequence, and the last electronic cigarette smoke picture in the electronic cigarette smoke picture time sequence sets marks a smoke region in a manual operation or script automatic marking mode; forming a second training set by all the electronic cigarette smoke picture time sequence sets, sending the second training set into a smoke region extraction model of initialization parameters for training, directly adopting parameters corresponding to the trained smoke region segmentation layers by the smoke region segmentation layers in the smoke region extraction model of the initialization parameters, calculating a second loss value by taking the marked smoke region as a target in the process, if the second loss value is positioned in a second preset range, manually setting the second preset range, and outputting the trained smoke region extraction model; otherwise, continuing to train the smoke region extraction model through the second training set.
Example 2
An e-cigarette smoke analysis detection system, see fig. 1, comprising:
the environment data acquisition module is used for acquiring current environment data through a plurality of sensors;
The hyperspectral imaging system built-in parameter adjustment module is used for outputting the environment data G and the hyperspectral imaging system built-in parameter set library to a hyperspectral imaging system built-in parameter set, and adjusting the hyperspectral imaging system based on the output hyperspectral imaging system built-in parameter set;
The hyperspectral imaging system built-in parameter set library construction module is used for constructing a hyperspectral imaging system built-in parameter set library based on an improved moth flame optimization algorithm;
the smoke region picture output module is used for sending the smoke picture of the electronic cigarette to be tested into the trained smoke region extraction model and outputting the smoke region picture;
And the electronic cigarette smoke analysis module is used for sending the smoke region pictures into the electronic cigarette smoke analysis model for processing and outputting the electronic cigarette smoke component information.
It will be understood that modifications and variations will be apparent to those skilled in the art from the foregoing description, and it is intended that all such modifications and variations be included within the scope of the following claims. Parts of the specification not described in detail belong to the prior art known to those skilled in the art.

Claims (7)

1. The electronic cigarette smoke analysis and detection method is characterized by comprising the following steps of:
Acquiring current environmental data G through a plurality of sensors, wherein the environmental data G is { G 1,g2,g3,…,gm,…,gM }, and G m is an environmental data value of the mth environmental attribute after normalization;
Matching the environment data G with a hyperspectral imaging system built-in parameter set library, outputting a hyperspectral imaging system built-in parameter set, adjusting the hyperspectral imaging system based on the output hyperspectral imaging system built-in parameter set, wherein the hyperspectral imaging system built-in parameter set library comprises standard environment data and a corresponding hyperspectral imaging system built-in parameter set, and the hyperspectral imaging system built-in parameter set corresponding to the standard environment data is obtained by performing simulation calculation through an improved moth flame optimization algorithm;
Acquiring a plurality of electronic cigarette smoke pictures in a preset time, wherein the electronic cigarette smoke pictures are spectrograms, and selecting N electronic cigarette smoke pictures at intervals of a preset period as electronic cigarette smoke pictures F n to be detected, wherein n=1, 2,3, … … and N;
Sending N electronic cigarette smoke pictures F n to be tested into a trained smoke region extraction model, and outputting smoke region pictures;
The smoke region extraction model comprises a change region extraction layer, a smoke region strengthening layer and a smoke region segmentation layer, wherein the change region extraction layer is used for extracting information of smoke changing along with time based on the time sequence network model; the smoke region strengthening layer is used for strengthening a smoke region in the smoke picture of the electronic cigarette to be tested; the smoke region segmentation layer is used for segmenting a smoke region and a non-smoke region of the reinforced electronic cigarette smoke picture to be tested and outputting the smoke region picture;
Sending the smoke region picture into an electronic cigarette smoke analysis model for processing, and outputting electronic cigarette smoke component information;
the environment data G is sent to a cloud server, and simulation calculation is carried out through an improved moth flame optimization algorithm to output a hyperspectral imaging system built-in parameter set, and the method specifically comprises the following steps:
S1: establishing R hyperspectral imaging system built-in simulation parameter sets P r, r=1, 2,3, … … and R, wherein { P r(1),pr(2),pr(3),…,pr(i),……,pr (I) } is stored in the hyperspectral imaging system built-in simulation parameter sets P r, P r (I) is the ith hyperspectral imaging system built-in simulation parameter in the hyperspectral imaging system built-in simulation parameter sets P r, and i=1, 2,3, … … and I are the total number of hyperspectral imaging system built-in simulation parameters in the hyperspectral imaging system built-in simulation parameter sets P r;
S2: setting a maximum iteration number Iter_max, and enabling w=1, wherein w is used for recording the iteration number;
S3: calculating the corresponding fitness delta r of the hyperspectral imaging system built-in simulation parameter sets P r, arranging all the hyperspectral imaging system built-in simulation parameter sets P r according to the corresponding fitness delta r from large to small, forming a population set by the arranged hyperspectral imaging system built-in simulation parameter sets P r, forming a flame individual set by selecting front zeta hyperspectral imaging system built-in simulation parameter sets P r, and in an initial state, marking the hyperspectral imaging system built-in simulation parameter sets P r in the flame individual set as hyperspectral imaging system built-in target parameter sets Y j, j=1, 2 and 3 … zeta;
S4: the first E hyperspectral imaging system built-in target parameter sets Y j in the flame individual set are respectively marked as elite individuals L e, e=1, 2,3, … …, E and E are the total number of elite individuals; selecting a hyperspectral imaging system built-in simulation parameter set P r from a population set in sequence, recording the sequence position of the hyperspectral imaging system built-in simulation parameter set P r in the population set as tip, judging whether tip > ζ is met, if so, directly selecting a hyperspectral imaging system built-in target parameter set Y j positioned at the tip position from a flame individual set, recording a target flame individual P r_obj corresponding to the hyperspectral imaging system built-in simulation parameter set P r, otherwise, if not, selecting a hyperspectral imaging system built-in target parameter set Y j from a flame individual set except for all elite individuals L e by adopting a roulette selection algorithm as a target flame individual P r_obj corresponding to the hyperspectral imaging system built-in simulation parameter set P r, and updating the selected hyperspectral imaging system built-in simulation parameter set P r based on the elite individuals L e and the target flame individual P r_obj according to the fitness delta r corresponding to the hyperspectral imaging system built-in simulation parameter set P r, by adopting the roulette selection algorithm:
Wherein dis (P r,Le) is the distance between the selected hyperspectral imaging system built-in simulation parameter set P r and the elite individual L e, and dis (P r,Pr_obj) is the distance between the selected hyperspectral imaging system built-in simulation parameter set P r and the target flame individual P r_obj; c is the logarithmic spiral shape constant; t is a random number between intervals [ -1,1 ]; l e (i) is the built-in simulation parameter of the ith hyperspectral imaging system in elite individual L e, P r_obj (i) is the built-in simulation parameter of the ith hyperspectral imaging system in target flame individual P r_obj, And/>Is an intermediate quantity;
s5: updating the number ζ of individual flames R i in the individual flame set by the following formula:
ζ=round[(R-w)(R-1)/Iter_max];
s6: judging whether the 'w < Iter_max' is met or not, if so, entering S7; if "w < Iter_max" is not satisfied, the process proceeds to S8;
S7: calculating the corresponding fitness delta r of the built-in simulation parameter sets P r of the hyperspectral imaging system, arranging all the built-in simulation parameter sets P r of the hyperspectral imaging system from large to small according to the corresponding fitness delta r, reorganizing all the arranged built-in simulation parameter sets P r of the hyperspectral imaging system into a population set, arranging all the built-in simulation parameter sets P r of the hyperspectral imaging system in the population set and all the built-in simulation parameter sets P r of the hyperspectral imaging system in the flame individual set from large to small according to the corresponding fitness delta r, and selecting the front zeta hyperspectral imaging system built-in simulation parameter sets P r to form the flame individual set to return to S4;
S8: and selecting all the hyperspectral imaging system built-in simulation parameter sets P r in the population set and the hyperspectral imaging system built-in simulation parameter set P r with the largest adaptability delta r in the hyperspectral imaging system built-in simulation parameter set P r in the flame individual set as hyperspectral imaging system built-in parameter sets to output.
2. The method for analyzing and detecting the smoke of the electronic cigarette according to claim 1, wherein the method for matching the environmental data G with a database of the hyperspectral imaging system built-in parameter set and outputting the hyperspectral imaging system built-in parameter set comprises the following steps:
Calculating the similarity A between the environment data G and the standard environment data in the hyperspectral imaging system built-in parameter set library one by one, judging whether A is more than B or not, wherein B is a similarity threshold value, and if A is more than B, outputting a hyperspectral imaging system built-in parameter set corresponding to the standard environment data; if the value of A > B is not satisfied, calculating the similarity A between the environmental data G and the next standard environmental data in the hyperspectral imaging system built-in parameter set library; and if the standard environmental data meeting the requirement of A & gtB still does not appear, sending the environmental data G into a cloud server, carrying out simulation calculation to output a hyperspectral imaging system built-in parameter set through an improved moth flame optimization algorithm, taking the environmental data G as the standard environmental data, and establishing and mapping with the hyperspectral imaging system built-in parameter set which is simulated and calculated through the improved moth flame optimization algorithm and storing the environment data G into the hyperspectral imaging system built-in parameter set library.
3. The method for analyzing and detecting the smoke of the electronic cigarette according to claim 2, wherein the step of establishing the built-in simulation parameter sets P r of the R hyperspectral imaging systems comprises the following steps:
S1.1: for each hyperspectral imaging system built-in simulation parameter set P r, carrying out assignment operation according to the following formula:
pr(i)=min(i)+rand(max(i)-min(i));
Wherein min (i) is the lower limit value of the built-in simulation parameter of the ith hyperspectral imaging system, and max (i) is the upper limit value of the built-in simulation parameter of the ith hyperspectral imaging system;
S1.2: and repeating the step S1.1 for R times, and establishing the built-in simulation parameter sets P r of the R hyperspectral imaging systems.
4. The method for analyzing and detecting the smoke of the electronic cigarette according to claim 3, wherein the step of calculating the fitness delta r corresponding to the built-in simulation parameter set P r of the hyperspectral imaging system comprises the following steps: the environment data G is simulated through simulation software in the cloud server, an electronic cigarette smoke picture acquired by a hyperspectral imaging system corresponding to a hyperspectral imaging system built-in simulation parameter set P r is simulated, a simulated smoke region picture is output based on the simulated electronic cigarette smoke picture and a trained smoke region extraction model, and the coincidence degree is calculated with a standard smoke region picture, namely the fitness delta r corresponding to the hyperspectral imaging system built-in simulation parameter set P r.
5. The method for analyzing and detecting the smoke of the electronic cigarette according to claim 4, wherein the steps of sending the N pictures F n of the smoke of the electronic cigarette to be detected into the trained smoke region extraction model and outputting the pictures of the smoke region comprise the following steps:
sending N electronic cigarette smoke pictures to be detected into a change area extraction layer for processing, establishing the change area extraction layer based on a long-short-time memory network, outputting a first characteristic diagram, wherein the first characteristic diagram comprises information of smoke change along with time, and strengthening possible smoke image characteristics;
The smoke region strengthening layer comprises N self-attention mechanism units, the smoke pictures F n of the electronic cigarette to be detected are respectively sent into the N self-attention mechanism units according to the time sequence, and in each self-attention mechanism unit, a key value matrix K and a value matrix V are constructed based on the input smoke pictures F n of the electronic cigarette to be detected, and the specific operation is to multiply the input smoke pictures F n of the electronic cigarette to be detected with the key value weight matrix to obtain the key value matrix K; multiplying the input electronic cigarette smoke picture F n to be detected by a value weight matrix to obtain a value matrix V; aiming at a first self-attention mechanism unit, constructing a query matrix Q based on the first feature map in a specific mode that the first feature map is multiplied by a query weight matrix to obtain the query matrix Q; aiming at the rest self-attention mechanism units except the first self-attention mechanism unit, constructing a query matrix Q based on the second feature diagram output by the last self-attention mechanism unit, wherein the specific mode is that the second feature diagram output by the last self-attention mechanism unit is multiplied by the query weight matrix to obtain the query matrix Q; for each self-attention mechanism unit, an attention weight matrix att=softmax ((q·k T)/(μ) 0.5) is calculated, where μ is the number of columns of the key-value matrix K; multiplying the attention weight matrix ATT with the value matrix V to output a second feature map;
and sending the second feature map to a smoke region segmentation layer for processing, wherein the smoke region segmentation layer is established based on U-net, and outputting a smoke region picture.
6. The method of claim 5, wherein the training of the extraction model for the smoke region comprises the steps of:
Acquiring a plurality of electronic cigarette smoke pictures marked with smoke areas; forming a first training set by all the electronic cigarette smoke pictures marked with the smoke areas, sending the first training set into a smoke area segmentation layer with initialization parameters for training, calculating a first loss value by taking the marked smoke areas as targets, and outputting the trained smoke area segmentation layer if the first loss value is positioned in a first preset range; otherwise, continuing to train the smoke region segmentation layer through the first training set;
Acquiring a plurality of electronic cigarette smoke picture time sequence sets, wherein the electronic cigarette smoke picture time sequence sets store electronic cigarette smoke pictures which are acquired in the same time period and ordered in time sequence, and the last electronic cigarette smoke picture in the electronic cigarette smoke picture time sequence sets marks a smoke region; forming a second training set by all the electronic cigarette smoke picture time sequence sets, sending the second training set into a smoke region extraction model of initialization parameters for training, directly adopting parameters corresponding to the trained smoke region segmentation layers by the smoke region segmentation layers in the smoke region extraction model of the initialization parameters, calculating a second loss value by taking the marked smoke region as a target in the process, and outputting the trained smoke region extraction model if the second loss value is in a second preset range; otherwise, continuing to train the smoke region extraction model through the second training set.
7. An electronic cigarette smoke analysis and detection system, characterized in that the system applies an electronic cigarette smoke analysis and detection method according to any one of the preceding claims 1-6, comprising:
the environment data acquisition module is used for acquiring current environment data through a plurality of sensors;
The hyperspectral imaging system built-in parameter adjustment module is used for outputting the environment data G and the hyperspectral imaging system built-in parameter set library to a hyperspectral imaging system built-in parameter set, and adjusting the hyperspectral imaging system based on the output hyperspectral imaging system built-in parameter set;
The hyperspectral imaging system built-in parameter set library construction module is used for constructing a hyperspectral imaging system built-in parameter set library based on an improved moth flame optimization algorithm;
the smoke region picture output module is used for sending the smoke picture of the electronic cigarette to be tested into the trained smoke region extraction model and outputting the smoke region picture;
And the electronic cigarette smoke analysis module is used for sending the smoke region pictures into the electronic cigarette smoke analysis model for processing and outputting the electronic cigarette smoke component information.
CN202410214480.5A 2024-02-27 2024-02-27 Electronic cigarette smoke analysis and detection method and system Active CN117809010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410214480.5A CN117809010B (en) 2024-02-27 2024-02-27 Electronic cigarette smoke analysis and detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410214480.5A CN117809010B (en) 2024-02-27 2024-02-27 Electronic cigarette smoke analysis and detection method and system

Publications (2)

Publication Number Publication Date
CN117809010A CN117809010A (en) 2024-04-02
CN117809010B true CN117809010B (en) 2024-05-03

Family

ID=90432148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410214480.5A Active CN117809010B (en) 2024-02-27 2024-02-27 Electronic cigarette smoke analysis and detection method and system

Country Status (1)

Country Link
CN (1) CN117809010B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112435257A (en) * 2020-12-14 2021-03-02 武汉纺织大学 Smoke detection method and system based on multispectral imaging
CN117455516A (en) * 2023-12-21 2024-01-26 深圳市思维自动化科技有限公司 Electronic cigarette information tracing method and system
CN117475353A (en) * 2023-11-09 2024-01-30 应急管理部大数据中心 Video-based abnormal smoke identification method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112435257A (en) * 2020-12-14 2021-03-02 武汉纺织大学 Smoke detection method and system based on multispectral imaging
CN117475353A (en) * 2023-11-09 2024-01-30 应急管理部大数据中心 Video-based abnormal smoke identification method and system
CN117455516A (en) * 2023-12-21 2024-01-26 深圳市思维自动化科技有限公司 Electronic cigarette information tracing method and system

Also Published As

Publication number Publication date
CN117809010A (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN110334765B (en) Remote sensing image classification method based on attention mechanism multi-scale deep learning
Gijsenij et al. Color constancy using natural image statistics and scene semantics
CN111401246B (en) Smoke concentration detection method, device, equipment and storage medium
CN108960269B (en) Feature acquisition method and device for data set and computing equipment
CN112633354B (en) Pavement crack detection method, device, computer equipment and storage medium
CN114565826A (en) Agricultural pest and disease identification and diagnosis method, system and device
CN115331124A (en) Invasive plant biomass estimation method based on unmanned aerial vehicle remote sensing
CN113312999A (en) High-precision detection method and device for diaphorina citri in natural orchard scene
CN116958961A (en) Lightweight pomegranate identification method based on improved YOLOv8s
CN114419468A (en) Paddy field segmentation method combining attention mechanism and spatial feature fusion algorithm
CN112989932A (en) Improved prototype network-based less-sample forest fire smoke identification method and device
CN114078218A (en) Self-adaptive fusion forest smoke and fire identification data augmentation method
CN113220915A (en) Remote sensing image retrieval method and device based on residual attention
CN113850632B (en) User category determination method, device, equipment and storage medium
CN110399970B (en) Wavelet convolution wavelet neural network and information analysis method and system
CN113989536A (en) Tomato disease identification method based on cuckoo search algorithm
CN101388067B (en) Implantation method for interaction entertainment trademark advertisement
CN118262149A (en) Crop disease and pest image recognition method and system based on deep learning
CN118196712A (en) Smart city fire detection method and device and readable storage medium
CN117809010B (en) Electronic cigarette smoke analysis and detection method and system
CN114140663A (en) Multi-scale attention and learning network-based pest identification method and system
CN115858846B (en) Skier image retrieval method and system based on deep learning
CN109034033B (en) Smoke discharge video detection method based on improved VGG16 convolutional network
CN115620050A (en) Improved YOLOv5 aphid identification and counting method based on climate chamber environment
CN115690546A (en) Shrimp length measuring method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant