CN109800764A - A kind of airport X-ray contraband image detecting method based on attention mechanism - Google Patents

A kind of airport X-ray contraband image detecting method based on attention mechanism Download PDF

Info

Publication number
CN109800764A
CN109800764A CN201910053140.8A CN201910053140A CN109800764A CN 109800764 A CN109800764 A CN 109800764A CN 201910053140 A CN201910053140 A CN 201910053140A CN 109800764 A CN109800764 A CN 109800764A
Authority
CN
China
Prior art keywords
contraband
attention
layer
target
image
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.)
Pending
Application number
CN201910053140.8A
Other languages
Chinese (zh)
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.)
Civil Aviation University of China
Original Assignee
Civil Aviation University of China
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 Civil Aviation University of China filed Critical Civil Aviation University of China
Priority to CN201910053140.8A priority Critical patent/CN109800764A/en
Publication of CN109800764A publication Critical patent/CN109800764A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

A kind of airport X-ray contraband image detecting method based on attention mechanism.It includes constituting safety check image data base;Obtain CNN model;Attention Mechanism Model is constructed, and obtains contraband target and pays attention to trying hard to;To contraband target pay attention to trying hard in noise and background information interference inhibit, contraband target pays attention to trying hard to after being inhibited;Position window is generated, pays attention to trying hard to obtaining contraband target detection figure using contraband target after inhibition.Airport X-ray contraband image detecting method provided by the invention based on attention mechanism was realized and is detected automatically in X-ray safety check image to a variety of contrabands using the advantages that attention Mechanism Model is strong to image characteristics extraction ability, accuracy of identification is high, strong robustness.Simultaneously as the training airplane of attention Mechanism Model is made as Weakly supervised training, so not needing additional artificial mark in the training process.

Description

A kind of airport X-ray contraband image detecting method based on attention mechanism
Technical field
The invention belongs to X-ray safety check image detections and depth learning technology field, are based on attention more particularly to one kind The airport X-ray contraband image detecting method of mechanism.
Background technique
In airport security, X-ray screening machine is largely used in the detection to cargo luggage.And current X-ray safety check image The detection work of middle contraband is completed by safety inspector.Single artificial safety check mode have the disadvantage in that 1) manually at This height, every X-ray screening machine are required by least a safety inspector manipulates and processing speed is limited.2) detection accuracy is unstable Fixed, detection accuracy is influenced by various uncontrollable factors, such as the state of mind, professional ability and flow of freight of safety inspector Deng.With increasing for traffic and cargo transport flow, common artificial safety check can no longer meet people for aviation safety Demand.
Convolutional neural networks (CNN) achieve great achievement in image characteristics extraction and field of image recognition.Based on attention The feedback-type CNN of power mechanism is also able to achieve target detection and segmentation on the basis of image recognition, also obtains at present extensive Concern and in-depth study.Since it has the characteristics such as the training small, strong robustness of cost, the convolutional Neural based on attention mechanism Network has unique advantage to the target detection of image background complexity.But up to the present not yet discovery is based on attention mechanism Airport X-ray contraband image detecting method in terms of report.
Summary of the invention
To solve the above-mentioned problems, the purpose of the present invention is to provide a kind of airport X-ray based on attention mechanism is violated Product image detecting method.
In order to achieve the above object, the airport X-ray contraband image detection side provided by the invention based on attention mechanism Method includes the following steps carried out in order:
Step 1 obtains original contraband image using X-ray screening machine, original contraband image is then carried out classification mark It infuses and carries out data enhancing processing and obtain contraband image, by institute's any contraband image construction safety check image data base;
Step 2 obtains CNN pre-training model and modifies network parameter, then using in above-mentioned safety check image data base Contraband image is finely adjusted CNN pre-training model and obtains CNN model;
Step 3 constructs attention Mechanism Model on above-mentioned CNN model, and obtains contraband target and pay attention to trying hard to;
Step 4, to above-mentioned contraband target pay attention to trying hard in noise and background information interference inhibit, pressed down Contraband target pays attention to trying hard to after system, to optimize to attention Mechanism Model;
Step 5 generates position window, and contraband target pays attention to trying hard to obtain contraband after the inhibition obtained using step 4 Target detection figure.
In step 1, the method for original contraband image being subjected to classification mark and carry out data enhancing processing Be: classification mark is different classes of original contraband image to be put into different files, and file is disobeyed with corresponding Contraband goods classification mark;Data enhancing processing includes that shearing, scaling, translation rotation, Gauss add and make an uproar and color jitter.
In step 2, the acquisition CNN pre-training model simultaneously modifies network parameter, then utilizes above-mentioned safety check image The method that contraband image in database is finely adjusted to CNN pre-training model and obtains CNN model is: first from Caffe- The CNN pre-training model of Googlenet is downloaded on zoo;Then the network parameter for modifying CNN pre-training model adapts it to safety check Image data base, method are that the decision-making level in CNN pre-training model is substituted for convolutional layer by full articulamentum, and will be original 1000 output nodes are changed to eight output nodes with corresponding eight class contrabands;
Contraband image obtained in step 1 is inputted into CNN pre-training model and the model is finely adjusted, obtains CNN Model.
It is described that attention Mechanism Model is constructed on CNN model in step 3, and obtain contraband target attention The method of figure is: building attention Mechanism Model is the process of a reverse conduction, specific in each network layer of CNN model It operates as follows:
1) in CNN model output layer, the feature vector that CNN model is exported is normalized, and numerical value in feature vector is maximum Element be set to 1, other elements are set to 0, and believe the feature vector after the normalization as the input of attention reverse conduction Number;
2) in convolutional layer, the attention that upper one layer is passed back is tried hard to carry out de-convolution operation with the weight of this layer of convolution kernel and Eigenmatrix is obtained, if upper one layer is CNN model output layer, the feature vector passed back is converted into eigenmatrix and carries out the behaviour Make, this feature matrix is identical as the scale that this layer inputs, and tries hard to reversely be passed to next layer as attention;
Top-down attention calculating is concentrated mainly on convolutional layer, Computing Principle are as follows: as given contraband image x0 When, the feature vector S=f (x of CNN model output layer output0) it is represented by the semantic information of contraband image;Wherein f (x) Indicate the mapping function of CNN model;And non-linear unit --- pond layer after carrying out a forward conduction, in CNN model State it has been determined that therefore contraband image x in CNN model0Mapping relations between feature vector S can be by following formula table Show:
S=∑ijcαijc*xijc (2)
Wherein (i, j, c) indicates point of the coordinate for (i, j), α in the channel input space cijcIndicate input layer in CNN model The weight of neuron can also indicate the correlation of each pixel and output node in input contraband image;xijcIndicate CNN The output valve of input layer in model;In order to obtain the weight α of input layerijc, it needs to be derived as follows:
WhereinIndicate the weight of l layers of neuron in CNN model,Indicate the defeated of l layers of neuron in CNN model It is worth out, while by the weight α of input layerijcPay attention to trying hard to as contraband target being reversely passed to next layer.
3) in the layer of pond, when CNN model carries out forward conduction, each mind of pond layer is recorded using an index matrix State of activation through member;When upper one layer of attention is tried hard to pass back, attention is tried hard to adopt using the index matrix of this layer Sample;The eigenmatrix obtained after up-sampling will be consistent with the input scale of this layer and try hard to reversely be passed to as attention next Layer;
It 4),, only need to be into so when upper one layer of attention is tried hard to pass back due to using ReLU function in active coating ReLU mapping of row, then tries hard to reversely be passed to next layer as attention;
5) in network input layer, when paying attention to trying hard to reversely pass to network input layer, scale tried hard to etc. is paid attention at this time In the scale of contraband image;To attention try hard in screen greater than 0 point, generate contraband target and pay attention to trying hard to, thus The classification information of contraband target is mapped to image space.
In step 4, it is described to contraband target pay attention to trying hard in noise and background information interference inhibit, Contraband target notices that the method tried hard to is after being inhibited:
Using it is lateral inhibit filtering method inhibit contraband target pay attention to trying hard in noise, utilize comparison suppressing method Inhibit contraband target pay attention to trying hard in background information interference, detailed process is as follows:
1) using it is lateral inhibit filtering method seek contraband target pay attention to trying hard in each neighborhood of a point mean value, and substitute into Formula (5) calculates the mean value rejection coefficient of the point;The edge rejection coefficient as shown in formula (6) is added in mean value rejection coefficient, so Afterwards using after weighting mean value rejection coefficient and edge rejection coefficient to contraband target pay attention to trying hard in neuron sieve Choosing, as shown in formula (7);
Wherein,Indicate that contraband target pays attention to trying hard to the neighborhood of a point mean value that middle coordinate is (i, j);Indicate CNN mould Coordinate is the neighborhood of a point mean value of (i, j) in the output matrix of type current layer;The mean value rejection coefficient of indicates coordinate (i, j); U, v indicates coordinate are the neighborhood of a point range of (i, j);wuvIndicate that contraband target pays attention to trying hard in the neighborhood of middle coordinate (i, j) The value of certain point;duvIndicate the distance of certain point in point (i, j) to its neighborhood;The edge rejection coefficient of indicates coordinate (i, j); A, b respectively indicate the weight of mean value rejection coefficient and edge rejection coefficient, and value determines when being tested by experiment;w′ijIt indicates to pass through Contraband target pays attention to trying hard to the value of middle coordinate (i, j) after lateral inhibition.
2) Deconvolution Algorithm Based on Frequency when replacing output layer contraband target to pay attention to trying hard to reverse conduction with formula (8), it is therefore an objective to be The normalized attention force signal of acquisition, and background information obtained by the negative parameter of this layer of weight;
Wherein, WNIndicate the weight of CNN model n-th layer, ANIndicate the output of CNN model n-th layer, P0Indicate violated items Target semantic information;
The signal of the target information containing any contraband can be obtained as shown in formula (8) and formula (9) by reverse conduction twice P, and the signal P' containing background information;Then P-P' is made the difference, background letter can be removed from contraband target information Breath.
In step 5, the generation position window, contraband target pays attention to trying hard to after the inhibition obtained using step 4 The method for obtaining contraband target detection figure is:
1) contraband target after inhibiting is calculated to pay attention to the energy summation tried hard to and be denoted as sum;
2) pay attention to trying hard to using contraband target after position window line by line traversal inhibition from top to bottom, when top, each row energy is total And sum1/sum >=0.5% when, obtain current line number, be denoted as u;Continue contraband target after traversal inhibits to pay attention to trying hard to, when upper Each row energy summation sum2/sum in side >=99.5% when, obtain current line number, be denoted as d;
3) it traverses contraband target after inhibiting from left to right by column using position window to pay attention to trying hard to, when the left side, each column energy is total And sum3/sum >=0.5% when, obtain current columns, be denoted as l;Continue contraband target after traversal inhibits to pay attention to trying hard to, works as a left side Each row energy summation sum4/sum in side >=99.5% when, obtain current line number, be denoted as r;
4) using inhibit after contraband target pay attention to trying hard to left upper apex as origin, if set position window upper left side apex coordinate as Q1 (x1, y1), lower right vertex are q2 (x2, y2), then know x1=l, y1=u, x2=r, y2=d;Since position window is square Shape, so using q1, two vertex q2 be can determine that position window contraband target after inhibition pay attention to trying hard in coordinate;
5) contraband target after inhibition is noticed that Gaussian window is reused after trying hard to be normalized enhances it, then It is fused in input contraband target image according to a certain percentage, it is final to obtain the violated items with good interactivity Mark detection figure.
Airport X-ray contraband image detecting method provided by the invention based on attention mechanism is to utilize attention mechanism The advantages that model is strong to image characteristics extraction ability, accuracy of identification is high, strong robustness, realizes in X-ray safety check image to more Kind contraband detects automatically.Simultaneously as the training airplane of attention Mechanism Model is made as Weakly supervised training, so in training process In do not need additional artificial mark.
Detailed description of the invention
Fig. 1 is to carry out data enhanced processes schematic diagram to original contraband image.
Fig. 2 (a) is the process schematic that CNN pre-training model carries out forward conduction;Fig. 2 (b) is attention Mechanism Model Schematic diagram.
Fig. 3 (a) is original contraband image;3 (b) be that the contraband target tentatively extracted pays attention to trying hard to.
Fig. 4 (a) is original contraband image;Fig. 4 (b) is mean value rejection coefficient energy diagram;Fig. 4 (c) is that edge inhibits system Number energy diagram;Fig. 4 (d) is that the contraband target obtained after inhibiting pays attention to trying hard to;
Fig. 5 is attention Mechanism Model prioritization scheme schematic diagram.
Fig. 6 (a) is original contraband image;Fig. 6 (b) is that contraband target pays attention to trying hard to after inhibiting.
Fig. 7 is normalized and uses the enhanced contraband target detection figure of Gaussian window.
Specific embodiment
Airport X-ray contraband figure to provided by the invention based on attention mechanism in the following with reference to the drawings and specific embodiments As detection method is described in detail.
Airport X-ray contraband image detecting method provided by the invention based on attention mechanism includes carrying out in order The following steps:
Step 1 obtains original contraband image using X-ray screening machine, original contraband image is then carried out classification mark It infuses and carries out data enhancing processing and obtain contraband image, by institute's any contraband image construction safety check image data base;
By the package containing pistol, pliers, fork, spanner, scissors, lighter, charger baby and cutter totally eight class contrabands It is imaged using X-ray screening machine and obtains original contraband image.In order to increase the diversity of image, original contraband figure is being acquired As when same class contraband is put into different packages, and constantly transformation package background, the position of contraband and posture etc..So Different classes of original contraband image is put into different files afterwards, and by file with corresponding contraband classification mark Note.There is over-fitting when in addition, training below in order to prevent, as shown in Figure 1, being included to above-mentioned original contraband image Shearing, scaling, translation rotation, Gauss add make an uproar and color jitter including data enhancing processing and obtain contraband image, by Institute's any contraband image construction safety check image data base.
Step 2 obtains CNN pre-training model and modifies network parameter, then using in above-mentioned safety check image data base Contraband image is finely adjusted CNN pre-training model and obtains CNN model;
The CNN pre-training model of Googlenet has been downloaded from Caffe-zoo.In order to preferably in CNN pre-training mould Attention model is established in type, and the network parameter of suitably modified CNN pre-training model is needed to adapt it to safety check image data base, Method is the decision-making level in CNN pre-training model to be substituted for convolutional layer by full articulamentum, and 1000 original outputs are saved Point is changed to eight output nodes with corresponding eight class contrabands.
Since CNN pre-training model was trained on natural image collection-imagenet, characteristics of image is mentioned Ability is taken adequately to be trained, and in order to make CNN pre-training model can be suitably used for contraband image, it will be obtained in step 1 To contraband image input CNN pre-training model and the model is finely adjusted, obtain CNN model.CNN model output layer is defeated Feature vector out is to input the semantic information of contraband image, exportable each classification contraband after full articulamentum Probability value, CNN pre-training model carry out shown in process such as Fig. 2 (a) of forward conduction.CNN model can be effectively to contraband image In contraband identified.
Step 3 constructs attention Mechanism Model on above-mentioned CNN model, and obtains contraband target and pay attention to trying hard to;
Shown in attention Mechanism Model such as Fig. 2 (b).Building attention Mechanism Model is the process of a reverse conduction, Concrete operations in each network layer of CNN model are as follows:
1) in CNN model output layer, the feature vector that CNN model is exported is normalized, and numerical value in feature vector is maximum Element be set to 1, other elements are set to 0, and believe the feature vector after the normalization as the input of attention reverse conduction Number.
2) in convolutional layer, the attention that upper one layer is passed back is tried hard to carry out de-convolution operation with the weight of this layer of convolution kernel and Eigenmatrix is obtained, if upper one layer is CNN model output layer, the feature vector passed back is converted into eigenmatrix and carries out the behaviour Make, this feature matrix is identical as the scale that this layer inputs, and tries hard to reversely be passed to next layer as attention.
Top-down attention calculating is concentrated mainly on convolutional layer, Computing Principle are as follows: as given contraband image x0 When, the feature vector S=f (x of CNN model output layer output0) it is represented by the semantic information of contraband image.Wherein f (x) Indicate the mapping function of CNN model.And non-linear unit --- pond layer after carrying out a forward conduction, in CNN model State it has been determined that therefore contraband image x in CNN model0Mapping relations between feature vector S can be by following formula table Show:
S=∑ijcαijc*xijc (2)
Wherein (i, j, c) indicates point of the coordinate for (i, j), α in the channel input space cijcIndicate input layer in CNN model The weight of neuron can also indicate the correlation of each pixel and output node in input contraband image;xijcIndicate CNN The output valve of input layer in model.In order to obtain the weight α of input layerijc, it needs to be derived as follows:
WhereinIndicate the weight of l layers of neuron in CNN model,Indicate the defeated of l layers of neuron in CNN model It is worth out, while by the weight α of input layerijcPay attention to trying hard to as contraband target being reversely passed to next layer.
3) in the layer of pond, when CNN model carries out forward conduction, each mind of pond layer is recorded using an index matrix State of activation through member.When upper one layer of attention is tried hard to pass back, attention is tried hard to adopt using the index matrix of this layer Sample.The eigenmatrix obtained after up-sampling will be consistent with the input scale of this layer and try hard to reversely be passed to as attention next Layer.
It 4),, only need to be into so when upper one layer of attention is tried hard to pass back due to using ReLU function in active coating ReLU mapping of row, then tries hard to reversely be passed to next layer as attention.
5) in network input layer, when paying attention to trying hard to reversely pass to network input layer, scale tried hard to etc. is paid attention at this time In the scale of contraband image.To attention try hard in screen greater than 0 point, generate contraband target and pay attention to trying hard to, thus The classification information of contraband target is mapped to image space.
Step 4, to above-mentioned contraband target pay attention to trying hard in noise and background information interference inhibit, pressed down Contraband target pays attention to trying hard to after system, to optimize to attention Mechanism Model;
As shown in Fig. 3 (b), step 3 extract contraband target pay attention to trying hard to it is relatively rough, wherein being mixed with noise and back The interference of scape information.Pay attention to trying hard to obtain the contraband target of more distinction, this step inhibits filtering method using lateral Come inhibit contraband target pay attention to trying hard in noise, using comparison suppressing method inhibit contraband target pay attention to trying hard in back The interference of scape information, detailed process is as follows:
1) using it is lateral inhibit filtering method seek contraband target pay attention to trying hard in each neighborhood of a point mean value, and substitute into Formula (5) calculates the mean value rejection coefficient of the point.In order to retain the edge letter of contraband target as much as possible in the process of inhibition The edge rejection coefficient as shown in formula (6) is added in breath in mean value rejection coefficient, then utilizes the mean value rejection coefficient after weighting With edge rejection coefficient to contraband target pay attention to trying hard in neuron screen, as shown in formula (7).Wherein Fig. 4 (b) is Mean value rejection coefficient energy diagram, Fig. 4 (c) are edge rejection coefficient energy diagram, and Fig. 4 (d) is the contraband target obtained after inhibiting Pay attention to trying hard to, it can be seen that after inhibiting contraband target pay attention to trying hard in noise significantly reduce.
Wherein,Indicate that contraband target pays attention to trying hard to the neighborhood of a point mean value that middle coordinate is (i, j);Indicate CNN mould Coordinate is the neighborhood of a point mean value of (i, j) in the output matrix of type current layer;The mean value rejection coefficient of indicates coordinate (i, j); U, v indicates coordinate are the neighborhood of a point range of (i, j);wuvIndicate that contraband target pays attention to trying hard in the neighborhood of middle coordinate (i, j) The value of certain point;duvIndicate the distance of certain point in point (i, j) to its neighborhood;The edge rejection coefficient of indicates coordinate (i, j); A, b respectively indicate the weight of mean value rejection coefficient and edge rejection coefficient, and value determines when being tested by experiment, in the present invention will It is set as a=0.2 b=0.8;w′ijExpression contraband target after laterally inhibiting pays attention to trying hard to the value of middle coordinate (i, j).
2) using comparison suppressing method inhibit contraband target pay attention to trying hard in background information interfere when, need in CNN The background information wherein adulterated is inhibited when the contraband target of model output layer pays attention to trying hard to reverse conduction.With formula (8) Deconvolution Algorithm Based on Frequency when paying attention to trying hard to reverse conduction instead of output layer contraband target, in order to obtain normalized attention Force signal, and background information is obtained by the negative parameter of this layer of weight.
Wherein, WNIndicate the weight of CNN model n-th layer, ANIndicate the output of CNN model n-th layer, P0Indicate violated items Target semantic information.
The signal of the target information containing any contraband can be obtained as shown in formula (8) and formula (9) by reverse conduction twice P, and the signal P' containing background information.Then P-P' is made the difference, background letter can be removed from contraband target information Breath.
Attention Mechanism Model prioritization scheme is as shown in figure (5), from figure (6) it can be seen that contraband target pays attention to after inhibiting The distinction tried hard to significantly improves.
Step 5 generates position window, and contraband target pays attention to trying hard to obtain contraband after the inhibition obtained using step 4 Target detection figure.
Concrete operations are as follows:
1) contraband target after inhibiting is calculated to pay attention to the energy summation tried hard to and be denoted as sum;
2) pay attention to trying hard to using contraband target after position window line by line traversal inhibition from top to bottom, when top, each row energy is total And sum1/sum >=0.5% when, obtain current line number, be denoted as u;Continue contraband target after traversal inhibits to pay attention to trying hard to, when upper Each row energy summation sum2/sum in side >=99.5% when, obtain current line number, be denoted as d;
3) it traverses contraband target after inhibiting from left to right by column using position window to pay attention to trying hard to, when the left side, each column energy is total And sum3/sum >=0.5% when, obtain current columns, be denoted as l;Continue contraband target after traversal inhibits to pay attention to trying hard to, works as a left side Each row energy summation sum4/sum in side >=99.5% when, obtain current line number, be denoted as r;
4) using inhibit after contraband target pay attention to trying hard to left upper apex as origin, if set position window upper left side apex coordinate as Q1 (x1, y1), lower right vertex are q2 (x2, y2), then know x1=l, y1=u, x2=r, y2=d;Since position window is square Shape, so using q1, two vertex q2 be can determine that position window contraband target after inhibition pay attention to trying hard in coordinate;
5) contraband target after inhibition is noticed that reusing Gaussian window after trying hard to be normalized enhances it, such as schemed It shown in 7, is then fused to according to a certain percentage in input contraband target image, final obtain has good interactivity Contraband target detection figure.
Experimental result
In order to verify the effect of the method for the present invention, what the present inventor chose 1000 224*224 altogether contains eight class contrabands Original contraband image as test set, and according to aforementioned present invention method obtain contraband target detection figure.And it utilizes and disobeys Contraband goods target detection figure assesses the discrimination, positioning accuracy IoU and timeliness of eight class contrabands.As a result such as 1 He of table Shown in Fig. 7,
1 eight class contraband discrimination of table and positioning IoU precision
Pistol Pliers Fork Spanner Scissors Lighter Charger baby Cutter
Sample number 125 125 125 125 125 125 125 125
Discrimination 97.6% 99.2% 92.0% 97.6% 94.4% 95.2% 96.8% 99.2%
IoU 73.6% 78.5% 45.2% 49.5% 42.8% 60.5% 68.5% 55.3%
In this experiment, 1000 original contraband images are carried out detecting average recognition rate obtained being 96.5%, The frame IoU precision that is averaged in position is 59.24%, altogether time-consuming 873s, and average treatment one opens original contraband image time-consuming 0.873s.On It states the results show that the method for the present invention can effectively detect the contraband in original contraband image, there is centainly feasible Property.

Claims (6)

1. a kind of airport X-ray contraband image detecting method based on attention mechanism, it is characterised in that: the detection method Including the following steps carried out in order:
Step 1 obtains original contraband image using X-ray screening machine, and original contraband image is then carried out classification mark simultaneously It carries out data enhancing processing and obtains contraband image, by institute's any contraband image construction safety check image data base;
Step 2 obtains CNN pre-training model and modifies network parameter, then using violated in above-mentioned safety check image data base Product image is finely adjusted CNN pre-training model and obtains CNN model;
Step 3 constructs attention Mechanism Model on above-mentioned CNN model, and obtains contraband target and pay attention to trying hard to;
Step 4, to above-mentioned contraband target pay attention to trying hard in noise and background information interference inhibit, after being inhibited Contraband target pays attention to trying hard to, to optimize to attention Mechanism Model;
Step 5 generates position window, and contraband target pays attention to trying hard to obtain contraband target after the inhibition obtained using step 4 Detection figure.
2. the airport X-ray contraband image detecting method according to claim 1 based on attention mechanism, feature exist In: in step 1, the method that original contraband image is carried out classification mark and carries out data enhancing processing is: class It Biao Zhu not be that different classes of original contraband image is put into different files, and by file with corresponding violated category It does not mark;Data enhancing processing includes that shearing, scaling, translation rotation, Gauss add and make an uproar and color jitter.
3. the airport X-ray contraband image detecting method according to claim 1 based on attention mechanism, feature exist In: in step 2, the acquisition CNN pre-training model simultaneously modifies network parameter, then utilizes above-mentioned safety check image data The method that contraband image in library is finely adjusted to CNN pre-training model and obtains CNN model is: first from Caffe-zoo The CNN pre-training model of upper downloading Googlenet;Then the network parameter for modifying CNN pre-training model adapts it to safety check figure As database, method is that the decision-making level in CNN pre-training model is substituted for convolutional layer by full articulamentum, and by original 1000 A output node is changed to eight output nodes with corresponding eight class contrabands;
Contraband image obtained in step 1 is inputted into CNN pre-training model and the model is finely adjusted, obtains CNN mould Type.
4. the airport X-ray contraband image detecting method according to claim 1 based on attention mechanism, feature exist In: it is described that attention Mechanism Model is constructed on CNN model in step 3, and obtain what contraband target paid attention to trying hard to Method is: building attention Mechanism Model is the process of a reverse conduction, the concrete operations in each network layer of CNN model It is as follows:
1) in CNN model output layer, the feature vector that CNN model is exported is normalized, by the maximum member of numerical value in feature vector Element is set to 1, and other elements are set to 0, and using the feature vector after the normalization as the input signal of attention reverse conduction;
2) in convolutional layer, try hard to the attention that upper one layer is passed back to carry out de-convolution operation with the weight of this layer of convolution kernel and obtain The feature vector passed back is converted to eigenmatrix and carries out the operation by eigenmatrix if upper one layer is CNN model output layer, This feature matrix is identical as the scale that this layer inputs, and tries hard to reversely be passed to next layer as attention;
Top-down attention calculating is concentrated mainly on convolutional layer, Computing Principle are as follows: as given contraband image x0When, CNN Feature vector S=f (the x of model output layer output0) it is represented by the semantic information of contraband image;Wherein f (x) is indicated The mapping function of CNN model;And non-linear unit --- the shape of pond layer after carrying out a forward conduction, in CNN model State is it has been determined that therefore contraband image x in CNN model0Mapping relations between feature vector S can be expressed from the next:
S=∑ijcαijc*xijc (2)
Wherein (i, j, c) indicates point of the coordinate for (i, j), α in the channel input space cijcIndicate input layer nerve in CNN model The weight of member can also indicate the correlation of each pixel and output node in input contraband image;xijcIndicate CNN model The output valve of middle input layer;In order to obtain the weight α of input layerijc, it needs to be derived as follows:
WhereinIndicate the weight of l layers of neuron in CNN model,Indicate the output of l layers of neuron in CNN model Value, while by the weight α of input layerijcPay attention to trying hard to as contraband target being reversely passed to next layer.
3) in the layer of pond, when CNN model carries out forward conduction, each neuron of pond layer is recorded using an index matrix State of activation;When upper one layer of attention is tried hard to pass back, attention is tried hard to up-sample using the index matrix of this layer; The eigenmatrix obtained after up-sampling will be consistent with the input scale of this layer and try hard to reversely be passed to next layer as attention;
4) in active coating, due to using ReLU function, so need to only carry out one when upper one layer of attention is tried hard to pass back Secondary ReLU mapping, then tries hard to reversely be passed to next layer as attention;
5) in network input layer, when paying attention to trying hard to reversely pass to network input layer, notice that the scale tried hard to is equal at this time and disobey The scale of contraband goods image;To attention try hard in screen greater than 0 point, generate contraband target and pay attention to trying hard to, to will disobey The classification information of contraband goods target is mapped to image space.
5. the airport X-ray contraband image detecting method according to claim 1 based on attention mechanism, feature exist In: in step 4, it is described to contraband target pay attention to trying hard in noise and background information interference inhibit, pressed down Contraband target notices that the method tried hard to is after system:
Using it is lateral inhibit filtering method inhibit contraband target pay attention to trying hard in noise, utilize comparison suppressing method to inhibit Contraband target pay attention to trying hard in background information interference, detailed process is as follows:
1) using it is lateral inhibit filtering method seek contraband target pay attention to trying hard in each neighborhood of a point mean value, and substitute into formula (5) the mean value rejection coefficient of the point is calculated;The edge rejection coefficient as shown in formula (6) is added in mean value rejection coefficient, then Using after weighting mean value rejection coefficient and edge rejection coefficient to contraband target pay attention to trying hard in neuron screen, As shown in formula (7);
Wherein,Indicate that contraband target pays attention to trying hard to the neighborhood of a point mean value that middle coordinate is (i, j);Indicate that CNN model is worked as Coordinate is the neighborhood of a point mean value of (i, j) in the output matrix of front layer;The mean value rejection coefficient of indicates coordinate (i, j);u,v Indicates coordinate is the neighborhood of a point range of (i, j);wuvIt is a certain in the neighborhood of middle coordinate (i, j) to indicate that contraband target pays attention to trying hard to The value of point;duvIndicate the distance of certain point in point (i, j) to its neighborhood;The edge rejection coefficient of indicates coordinate (i, j);a,b The weight of mean value rejection coefficient and edge rejection coefficient is respectively indicated, value determines when being tested by experiment;w′ijIt indicates by lateral Contraband target pays attention to trying hard to the value of middle coordinate (i, j) after inhibition.
2) Deconvolution Algorithm Based on Frequency when replacing output layer contraband target to pay attention to trying hard to reverse conduction with formula (8), in order to obtain Normalized attention force signal is taken, and background information is obtained by the negative parameter of this layer of weight;
Wherein, WNIndicate the weight of CNN model n-th layer, ANIndicate the output of CNN model n-th layer, P0Indicate contraband target Semantic information;
By reverse conduction twice, as shown in formula (8) and formula (9), the signal P of the target information containing any contraband can be obtained, with And the signal P' containing background information;Then P-P' is made the difference, background information can be removed from contraband target information.
6. the airport X-ray contraband image detecting method according to claim 1 based on attention mechanism, feature exist In: in step 5, the generation position window, contraband target pays attention to trying hard to obtain disobeying after the inhibition obtained using step 4 The method of contraband goods target detection figure is:
1) contraband target after inhibiting is calculated to pay attention to the energy summation tried hard to and be denoted as sum;
2) pay attention to trying hard to using contraband target after position window line by line traversal inhibition from top to bottom, when each row energy summation in top Sum1/sum >=0.5% when, obtain current line number, be denoted as u;Continue contraband target after traversal inhibits to pay attention to trying hard to, works as top Each row energy summation sum2/sum >=99.5% when, obtain current line number, be denoted as d;
3) it traverses contraband target after inhibiting from left to right by column using position window to pay attention to trying hard to, when each column energy summation in the left side Sum3/sum >=0.5% when, obtain current columns, be denoted as l;Continue contraband target after traversal inhibits to pay attention to trying hard to, works as the left side Each row energy summation sum4/sum >=99.5% when, obtain current line number, be denoted as r;
4) pay attention to trying hard to left upper apex as origin using contraband target after inhibiting, if setting position window upper left side apex coordinate as q1 (x1, y1), lower right vertex are q2 (x2, y2), then know x1=l, y1=u, x2=r, y2=d;Since position window is rectangle, So using q1, two vertex q2 be can determine that position window contraband target after inhibition pay attention to trying hard in coordinate;
5) contraband target after inhibition is noticed that Gaussian window is reused after trying hard to be normalized enhances it, then according to Certain ratio is fused in input contraband target image, and there is final obtain the contraband target of good interactivity to examine Mapping.
CN201910053140.8A 2019-01-21 2019-01-21 A kind of airport X-ray contraband image detecting method based on attention mechanism Pending CN109800764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910053140.8A CN109800764A (en) 2019-01-21 2019-01-21 A kind of airport X-ray contraband image detecting method based on attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910053140.8A CN109800764A (en) 2019-01-21 2019-01-21 A kind of airport X-ray contraband image detecting method based on attention mechanism

Publications (1)

Publication Number Publication Date
CN109800764A true CN109800764A (en) 2019-05-24

Family

ID=66559931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910053140.8A Pending CN109800764A (en) 2019-01-21 2019-01-21 A kind of airport X-ray contraband image detecting method based on attention mechanism

Country Status (1)

Country Link
CN (1) CN109800764A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110097145A (en) * 2019-06-20 2019-08-06 江苏德劭信息科技有限公司 One kind being based on CNN and the pyramidal traffic contraband recognition methods of feature
CN110309823A (en) * 2019-06-26 2019-10-08 浙江大华技术股份有限公司 A kind of method and device of safety inspection
CN110428007A (en) * 2019-08-01 2019-11-08 科大讯飞(苏州)科技有限公司 X-ray image object detection method, device and equipment
CN110533582A (en) * 2019-08-15 2019-12-03 中国民航大学 A kind of safety check X-ray contraband image composition method based on production confrontation network
CN110533045A (en) * 2019-07-31 2019-12-03 中国民航大学 A kind of luggage X-ray contraband image, semantic dividing method of combination attention mechanism
WO2021008398A1 (en) * 2019-07-12 2021-01-21 五邑大学 Multiscale sar image recognition method and device based on attention mechanism
CN115620066A (en) * 2022-10-26 2023-01-17 北京声迅电子股份有限公司 Article detection method and device based on X-ray image and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250936A (en) * 2016-08-16 2016-12-21 广州麦仑信息科技有限公司 Multiple features multithreading safety check contraband automatic identifying method based on machine learning
CN108198227A (en) * 2018-03-16 2018-06-22 济南飞象信息科技有限公司 Contraband intelligent identification Method based on X-ray screening machine image

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250936A (en) * 2016-08-16 2016-12-21 广州麦仑信息科技有限公司 Multiple features multithreading safety check contraband automatic identifying method based on machine learning
CN108198227A (en) * 2018-03-16 2018-06-22 济南飞象信息科技有限公司 Contraband intelligent identification Method based on X-ray screening machine image

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
CHUNSHUI CAO等: "Lateral Inhibition-Inspired Convolutional Neural Network for Visual Attention and Saliency Detection", 《THE THIRTY-SECOND AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE (AAAI-18)》 *
CHUNSHUI CAO等: "Look and Think Twice: Capturing Top-Down Visual Attention with Feedback Convolutional Neural Networks", 《2015 IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION》 *
JIANMING ZHANG等: "Top-down Neural Attention by Excitation Backprop", 《ARXIV:1608.00507V1 [CS.CV]》 *
MAOSHU XU等: "Prohibited Item Detection in Airport X-Ray Security Images via Attention Mechanism Based CNN", 《PATTERN RECOGNITION AND COMPUTER VISION》 *
QIBIN HOU等: "Self-Erasing Network for Integral Object Attention", 《32ND CONFERENCE ON NEURAL INFORMATION PROCESSING SYSTEMS》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110097145A (en) * 2019-06-20 2019-08-06 江苏德劭信息科技有限公司 One kind being based on CNN and the pyramidal traffic contraband recognition methods of feature
CN110309823A (en) * 2019-06-26 2019-10-08 浙江大华技术股份有限公司 A kind of method and device of safety inspection
CN110309823B (en) * 2019-06-26 2022-10-18 浙江大华技术股份有限公司 Safety inspection method and device
WO2021008398A1 (en) * 2019-07-12 2021-01-21 五邑大学 Multiscale sar image recognition method and device based on attention mechanism
CN110533045A (en) * 2019-07-31 2019-12-03 中国民航大学 A kind of luggage X-ray contraband image, semantic dividing method of combination attention mechanism
CN110533045B (en) * 2019-07-31 2023-01-17 中国民航大学 Luggage X-ray contraband image semantic segmentation method combined with attention mechanism
CN110428007A (en) * 2019-08-01 2019-11-08 科大讯飞(苏州)科技有限公司 X-ray image object detection method, device and equipment
CN110533582A (en) * 2019-08-15 2019-12-03 中国民航大学 A kind of safety check X-ray contraband image composition method based on production confrontation network
CN115620066A (en) * 2022-10-26 2023-01-17 北京声迅电子股份有限公司 Article detection method and device based on X-ray image and electronic equipment

Similar Documents

Publication Publication Date Title
CN109800764A (en) A kind of airport X-ray contraband image detecting method based on attention mechanism
CN109740463A (en) A kind of object detection method under vehicle environment
CN106815566A (en) A kind of face retrieval method based on multitask convolutional neural networks
CN110378297A (en) A kind of Remote Sensing Target detection method based on deep learning
US9224207B2 (en) Segmentation co-clustering
CN104102920A (en) Pest image classification method and pest image classification system based on morphological multi-feature fusion
CN113283599B (en) Attack resistance defense method based on neuron activation rate
CN104156730B (en) A kind of antinoise Research of Chinese Feature Extraction method based on skeleton
CN103020582A (en) Method for computer to identify vehicle type by video image
CN107239759A (en) A kind of Hi-spatial resolution remote sensing image transfer learning method based on depth characteristic
Nguyen et al. Satellite image classification using convolutional learning
CN114724189B (en) Method, system and application for training confrontation sample defense model for target recognition
Kruthi et al. Offline signature verification using support vector machine
CN111046949A (en) Image classification method, device and equipment
Cai et al. Vehicle Detection Based on Deep Dual‐Vehicle Deformable Part Models
CN115937698A (en) Self-adaptive tailing pond remote sensing deep learning detection method
Chawda et al. Extracting building footprints from satellite images using convolutional neural networks
CN104050460A (en) Pedestrian detection method with multi-feature fusion
Lidasan et al. Mushroom recognition using neural network
Lajish Handwritten character recognition using perceptual fuzzy-zoning and class modular neural networks
Boyle et al. Vehicle subtype, make and model classification from side profile video
CN106203349A (en) Face identification method based on sparse error matrix
Soundararajan et al. Analysis of mincut, average cut, and normalized cut measures
Adly et al. A hybrid deep learning approach for texture analysis
CN108364027B (en) Rapid forward multi-vehicle-type vehicle detection method

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190524

WD01 Invention patent application deemed withdrawn after publication