CN110766703A - GPU-based intelligent image recognition method of computer Shader - Google Patents

GPU-based intelligent image recognition method of computer Shader Download PDF

Info

Publication number
CN110766703A
CN110766703A CN201910999880.0A CN201910999880A CN110766703A CN 110766703 A CN110766703 A CN 110766703A CN 201910999880 A CN201910999880 A CN 201910999880A CN 110766703 A CN110766703 A CN 110766703A
Authority
CN
China
Prior art keywords
gpu
output
picture
image
image recognition
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
CN201910999880.0A
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.)
Hefei Chengfang Information Technology Co Ltd
Original Assignee
Hefei Chengfang Information 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 Hefei Chengfang Information Technology Co Ltd filed Critical Hefei Chengfang Information Technology Co Ltd
Priority to CN201910999880.0A priority Critical patent/CN110766703A/en
Publication of CN110766703A publication Critical patent/CN110766703A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Abstract

The invention discloses an intelligent image recognition method of computer Shader based on a GPU, and relates to the technical field of image recognition. The invention comprises the following steps: extracting the features of the picture in a computer shader; carrying out normalization pretreatment on the picture; and training the extracted features in a GPU by using a BP neural network algorithm to obtain interconnection weights, so that one input sample corresponds to one expected output. According to the invention, the edge segmentation is carried out on the image in the GPU through the computer Shader technology, and then the image is identified by using the identification algorithm based on the wavelet distance characteristic and the neural network, so that the conversion times of data are reduced, any type of data can be directly calculated without being limited by the image rendering process, the data can be written in and written out at any time, the general calculation efficiency of the GPU is improved, and the image processing efficiency is improved.

Description

GPU-based intelligent image recognition method of computer Shader
Technical Field
The invention belongs to the technical field of image recognition, and particularly relates to an intelligent image recognition method of computer Shader based on a GPU.
Background
The prior intelligent image recognition method mainly comprises an image recognition method based on a neural network, an image recognition method based on wavelet moments, an image recognition method based on fractal characteristics and the like. The pattern recognition is realized based on a neural network method, some contents with complex environmental information can be processed, and a general neural network image recognition system consists of preprocessing, feature extraction and a neural network classifier. But the disadvantage is that the pattern classes which can be identified at present are not enough, and the relevant models are still being perfected.
The image identification method based on the wavelet moment comprises the following steps: the wavelet moment features have good resolution capability on samples with translation, scaling and rotation, the wavelet moment features can correctly resolve test samples under the condition of no noise, the recognition rate is superior to the geometric moment, and the difference reaches 30 percentage points. Not only the global features of the image but also the local features of the image can be obtained.
Before the invention of computer Shader, the GPU can not perform the complex algorithm. The GPU is a graphic processor, the conventional general computation of the GPU requires a programmer to firstly disguise data into an image which can be recognized by the GPU and then convert the image output by the GPU into a desired result, the writing method is complex and low in efficiency, and the computation consumes resources.
The CPU has a strong arithmetic logic unit, so that the operation delay is reduced; a huge Cache for reducing the delay of memory access; complex controllers use branch prediction to reduce branch latency and data forwarding to reduce data latency. CPUs are good at handling computational tasks with complex computational steps and complex data dependencies, such as distributed computing, data compression, artificial intelligence, physical simulation, and many other computational tasks.
GPUs have been generated for video games for historical reasons, and one type of operation that often occurs in three-dimensional games is to perform the same operation on a large amount of data, such as: and performing the same coordinate transformation on each vertex, and calculating color values of each vertex according to the same illumination model. The many-core architecture of the GPU is very suitable for sending the same instruction stream to many cores in parallel and executing by adopting different input data.
In contrast, the invention provides an intelligent image recognition method of the computer Shader based on the GPU, which is characterized in that the image is subjected to edge segmentation in the GPU through the computer Shader technology, and then the image is recognized by using a recognition algorithm based on wavelet distance features and a neural network, so that the conversion times of data are reduced, any type of data can be directly calculated, the data is not limited by a graph rendering process, the data can be written in and written out at any time, the general calculation efficiency of the GPU is improved, and the image processing efficiency is improved.
Disclosure of Invention
The invention aims to provide an intelligent image recognition method of computer Shader based on a GPU, which is characterized in that the edge segmentation is carried out on an image in the GPU through the computer Shader technology, and then the image is recognized by using a recognition algorithm based on wavelet distance characteristics and a neural network, so that the conversion times of data are reduced, any type of data can be directly calculated, and the data is not limited by a graph rendering process and can be written in and written out at any time.
In order to solve the technical problems, the invention is realized by the following technical scheme:
the invention relates to an intelligent image recognition method of computer Shader based on a GPU, which comprises the following steps:
s00: extracting the characteristics of the picture in a computer shader, and carrying out normalization pretreatment on the picture;
s01: performing polar coordinate processing on the picture in a computer shader;
s02: extraction of small distance features in the GPU, i.e.
Figure BDA0002240961960000031
The angle interval delta theta is 2 pi/N, and N is the number of image pixel points;
the method specifically comprises the following steps:
a00: the calculation angle integral algorithm is as follows:
Figure BDA0002240961960000032
a01: extracting features in a radial region (gamma is more than or equal to 0 and less than or equal to 1) by utilizing a wavelet function for the obtained angle integral; the method comprises the following specific steps:
Figure BDA0002240961960000033
therein, Ψm.n(r) represents a wavelet function, m is a scaling factor and n is a translation factor; q represents the FFT harmonic order taken (typically 0,1,2, 3);
Figure BDA0002240961960000034
is Sq(r) wavelet transform of r; sq(r) r represents the characteristic distribution of f (gamma, theta) in a radial region (0. ltoreq. r.ltoreq.1);
s03: and training the extracted features in a GPU by using a BP neural network algorithm to obtain interconnection weights, so that one input sample corresponds to one expected output.
Preferably, the step of performing normalization preprocessing on the picture in S00 specifically includes the following steps:
determining a centroid coordinate of the picture and a scaling factor α, wherein the scaling factor α is a ratio of an image size and a standard size.
Preferably, the BP neural network algorithm in S03 includes the following steps:
b00: initializing all W by adopting random numbers; w is the interconnection weight from the current neuron to the next layer neuron;
b01: selecting an input pattern P from a training data set m and materializing an expected output; wherein, the output of the m output node is 1, and the outputs of all other output nodes are 0;
b02: calculating all node outputs using the current W; wherein, the total input value of the node j is net; the output of the node j is a nonlinear function of the total input value net; the nonlinear function is a sigmoid function, and is specifically as follows:
oj=f(netj)=1/(1+exp((-netjj)/θ0));
wherein the parameter thetajRepresents a threshold value; theta0The number is a normal number and can be selected randomly, and the shape of the sigmoid function is adjusted;
b03: comparing the activation generated by the output layer with the expected value to obtain the input mode error:
wherein, tpjIs the jth component of the target pattern P; opjIs the jth component of the output pattern resulting from the current input pattern p;
b04: calculating corresponding input mode errors of all input modes in the training data set m by adopting B01-B03, and calculating system errors
Figure BDA0002240961960000042
B05: and obtaining an image identification result through a gradient descent iteration process in the weight space, and outputting the corresponding Type to the console.
The invention has the following beneficial effects:
1. according to the invention, the edge segmentation is carried out on the image in the GPU through the computer Shader technology, and then the image is identified by using an identification algorithm based on the wavelet distance characteristic and the neural network, so that the conversion times of data are reduced, any type of data can be directly calculated without being constrained by a graph rendering process, the data can be written in and written out at any time, the general calculation efficiency of the GPU is improved, and the image processing efficiency is improved;
2. the invention can directly use the GPU as a parallel processor to be utilized after using the computer Shader, the GPU not only has 3D rendering capability, but also has other operational capability, and the multithread processing technology can better utilize a plurality of cores of the system, thereby improving the processing efficiency and the identification accuracy.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of the intelligent image recognition method of GPU-based computer Shader of the present invention;
FIG. 2 is a flow chart of the BP neural network algorithm of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, the present invention is an intelligent image recognition method based on GPU computer Shader, including the following processes:
s00, extracting the features of the picture in a computer shader, carrying out normalization preprocessing on the picture, and preparing for later translation and scaling, specifically, determining the centroid coordinate of the picture and a scaling factor α, wherein the centroid of the picture has the invariance of translation, scaling and rotation, and the scaling factor α is the ratio of the image size to the standard size;
s01: performing polar coordinate processing on the picture in a computer shader; for example, f (x, y) is a two-dimensional binary image on a rectangular coordinate system, and its corresponding polar coordinate form is f (γ, θ), where x is γ sin (θ); because the image is discrete, a proper angle interval delta theta is selected, and the polar coordinate conversion error is controlled to be minimum;
s02: extraction of small distance features in the GPU, i.e.
Figure BDA0002240961960000061
Namely discrete processing is carried out; the angle interval delta theta is 2 pi/N, and N is the number of image pixel points;
the method specifically comprises the following steps:
a00: the calculation angle integral algorithm is as follows:
a01: extracting features in a radial region (gamma is more than or equal to 0 and less than or equal to 1) by utilizing a wavelet function for the obtained angle integral; the method comprises the following specific steps:
Figure BDA0002240961960000063
therein, Ψm.n(r) represents a wavelet function, m is a scaling factor and n is a translation factor; q represents the FFT harmonic order taken (typically 0,1,2, 3);
Figure BDA0002240961960000064
is Sq(r) wavelet transform of r; sq(r) r represents the characteristic distribution of f (gamma, theta) in a radial region (0. ltoreq. r.ltoreq.1); the wavelet invariant moment can be found to have rotation invariance, and rough to fine processing of the object can be realized by using different scaling factors, and the features are gradually extracted until the required resolution is realized. For GPU multithreading processing, each data block is processed by one thread, and in addition, the global data block can better support multi-resolution operation, so that the algorithm has the capability of realizing multi-resolution parallel observation;
s03: training the extracted features in a GPU by using a BP neural network algorithm to obtain interconnection weights, so that one input sample corresponds to one expected output; the multi-layer feedforward neural network classifier realized by the BP neural network algorithm comprises three layers of feedforward networks; the bottommost layer is an input layer, the second layer is a hidden layer, the third layer is an output layer, and all units take continuous values in an interval [0,1 ];
referring to fig. 2, the BP neural network algorithm includes the following steps:
b00: initializing all W by adopting random numbers; w is the interconnection weight from the current neuron to the next layer neuron;
b01: selecting an input pattern P from a training data set m and materializing an expected output; wherein, the output of the m output node is 1, and the outputs of all other output nodes are 0;
b02: calculating all node outputs using the current W; wherein, the total input value of the node j is net; the output of the node j is a nonlinear function of the total input value net; the nonlinear function is a sigmoid function, and is specifically as follows:
oj=f(netj)=1/(1+exp((-netjj)/θ0));
wherein the parameter thetajRepresents a threshold value; theta0The number is a normal number and can be selected randomly, and the shape of the sigmoid function is adjusted;
b03: comparing the activation generated by the output layer with the expected value to obtain the input mode error:
Figure BDA0002240961960000071
wherein, tpjIs the jth component of the target pattern P; opjIs the jth component of the output pattern resulting from the current input pattern p;
b04: calculating corresponding input mode errors of all input modes in the training data set m by adopting B01-B03, and calculating system errors
Figure BDA0002240961960000072
B05: and obtaining an image identification result through a gradient descent iteration process in the weight space, and outputting the corresponding Type to the console.
It should be noted that, in the above system embodiment, each included unit is only divided according to functional logic, but is not limited to the above division as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
In addition, it is understood by those skilled in the art that all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing associated hardware, and the corresponding program may be stored in a computer-readable storage medium.
The preferred embodiments of the invention disclosed above are intended to be illustrative only. The preferred embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims (3)

1. The intelligent image recognition method of the computer Shader based on the GPU is characterized by comprising the following steps:
s00: extracting the characteristics of the picture in a computer shader, and carrying out normalization pretreatment on the picture;
s01: performing polar coordinate processing on the picture in a computer shader;
s02: extraction of small distance features in the GPU, i.e.
Figure FDA0002240961950000011
The angle interval delta theta is 2 pi/N, and N is the number of image pixel points;
the method specifically comprises the following steps:
a00: the calculation angle integral algorithm is as follows:
Figure FDA0002240961950000012
a01: extracting features in a radial region (gamma is more than or equal to 0 and less than or equal to 1) by utilizing a wavelet function for the obtained angle integral; the method comprises the following specific steps:
Figure FDA0002240961950000013
therein, Ψm.n(r) represents a wavelet function, m is a scalingFactor, n is a translation factor; q represents the FFT harmonic order taken (typically 0,1,2, 3);
Figure FDA0002240961950000014
is Sq(r) wavelet transform of r; sq(r) r represents the characteristic distribution of f (gamma, theta) in a radial region (0. ltoreq. r.ltoreq.1);
s03: and training the extracted features in a GPU by using a BP neural network algorithm to obtain interconnection weights, so that one input sample corresponds to one expected output.
2. The intelligent image recognition method of GPU-based computer Shader, as recited in claim 1, wherein the step of normalizing preprocessing the picture in S00 specifically includes the following steps:
determining a centroid coordinate of the picture and a scaling factor α, wherein the scaling factor α is a ratio of an image size and a standard size.
3. The intelligent image recognition method of GPU-based computer Shader, as claimed in claim 1, wherein the BP neural network algorithm in S03 comprises the following steps:
b00: initializing all W by adopting random numbers; w is the interconnection weight from the current neuron to the next layer neuron;
b01: selecting an input pattern P from a training data set m and materializing an expected output; wherein, the output of the m output node is 1, and the outputs of all other output nodes are 0;
b02: calculating all node outputs using the current W; wherein, the total input value of the node j is net; the output of the node j is a nonlinear function of the total input value net; the nonlinear function is a sigmoid function, and is specifically as follows:
oj=f(netj)=1/(1+exp((-netjj)/θ0));
wherein the parameter thetajRepresents a threshold value; theta0The number is a normal number and can be selected randomly, and the shape of the sigmoid function is adjusted;
b03: comparing the activation generated by the output layer with the expected value to obtain the input mode error:
Figure FDA0002240961950000021
wherein, tpjIs the jth component of the target pattern P; opjIs the jth component of the output pattern resulting from the current input pattern p;
b04: calculating corresponding input mode errors of all input modes in the training data set m by adopting B01-B03, and calculating system errors
Figure FDA0002240961950000022
B05: and obtaining an image identification result through a gradient descent iteration process in the weight space, and outputting the corresponding Type to the console.
CN201910999880.0A 2019-10-21 2019-10-21 GPU-based intelligent image recognition method of computer Shader Pending CN110766703A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910999880.0A CN110766703A (en) 2019-10-21 2019-10-21 GPU-based intelligent image recognition method of computer Shader

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910999880.0A CN110766703A (en) 2019-10-21 2019-10-21 GPU-based intelligent image recognition method of computer Shader

Publications (1)

Publication Number Publication Date
CN110766703A true CN110766703A (en) 2020-02-07

Family

ID=69332806

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910999880.0A Pending CN110766703A (en) 2019-10-21 2019-10-21 GPU-based intelligent image recognition method of computer Shader

Country Status (1)

Country Link
CN (1) CN110766703A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697006A (en) * 2009-09-18 2010-04-21 北京航空航天大学 Target identification method based on data fusion of airborne radar and infrared imaging sensor
CN106973298A (en) * 2008-11-04 2017-07-21 先进微装置公司 The software video transcoder accelerated with GPU
CN110120021A (en) * 2019-05-05 2019-08-13 腾讯科技(深圳)有限公司 Method of adjustment, device, storage medium and the electronic device of brightness of image

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106973298A (en) * 2008-11-04 2017-07-21 先进微装置公司 The software video transcoder accelerated with GPU
CN101697006A (en) * 2009-09-18 2010-04-21 北京航空航天大学 Target identification method based on data fusion of airborne radar and infrared imaging sensor
CN110120021A (en) * 2019-05-05 2019-08-13 腾讯科技(深圳)有限公司 Method of adjustment, device, storage medium and the electronic device of brightness of image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
秦晨光: ""GPU通用计算在游戏中的应用案例研究"", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 *

Similar Documents

Publication Publication Date Title
US11763168B2 (en) Progressive modification of generative adversarial neural networks
US11475542B2 (en) Neural network system with temporal feedback for adaptive sampling and denoising of rendered sequences
CN109949255B (en) Image reconstruction method and device
US10783394B2 (en) Equivariant landmark transformation for landmark localization
US10157309B2 (en) Online detection and classification of dynamic gestures with recurrent convolutional neural networks
US11557022B2 (en) Neural network system with temporal feedback for denoising of rendered sequences
US11880927B2 (en) Three-dimensional object reconstruction from a video
US11620521B2 (en) Smoothing regularization for a generative neural network
US20220222832A1 (en) Machine learning framework applied in a semi-supervised setting to perform instance tracking in a sequence of image frames
CN111178394A (en) Feature point extraction method based on self-adaptive image information entropy
CN113837942A (en) Super-resolution image generation method, device, equipment and storage medium based on SRGAN
CN113449784B (en) Image multi-classification method, device, equipment and medium based on priori attribute map
Qian et al. Mask R-CNN for object detection in multitemporal SAR images
Zhao et al. Traffic signs and markings recognition based on lightweight convolutional neural network
CN116452599A (en) Contour-based image instance segmentation method and system
CN110766703A (en) GPU-based intelligent image recognition method of computer Shader
CN106846366B (en) TLD video moving object tracking method using GPU hardware
CN113408694A (en) Weight demodulation for generative neural networks
CN110533176B (en) Caching device for neural network computation and related computing platform thereof
Guo et al. Face illumination normalization based on generative adversarial network
Nam et al. Improvement in object detection using multi-scale RoI pooling and feature pyramid network
CN113222100A (en) Training method and device of neural network model
Yang et al. A deep reconstruction CNN for illumination-robust face image recovery and recognition
CN116957045B (en) Neural network quantization method and system based on optimal transmission theory and electronic equipment
US11861811B2 (en) Neural network system with temporal feedback for denoising of rendered sequences

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200207

RJ01 Rejection of invention patent application after publication