CN107992821B - Image identification method and system - Google Patents

Image identification method and system Download PDF

Info

Publication number
CN107992821B
CN107992821B CN201711242391.8A CN201711242391A CN107992821B CN 107992821 B CN107992821 B CN 107992821B CN 201711242391 A CN201711242391 A CN 201711242391A CN 107992821 B CN107992821 B CN 107992821B
Authority
CN
China
Prior art keywords
memory
image
input image
memory block
information
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
CN201711242391.8A
Other languages
Chinese (zh)
Other versions
CN107992821A (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.)
Ningxia Hengxinrong Network Technology Co ltd
Original Assignee
Ningxia Hengxinrong Network 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 Ningxia Hengxinrong Network Technology Co ltd filed Critical Ningxia Hengxinrong Network Technology Co ltd
Priority to CN201711242391.8A priority Critical patent/CN107992821B/en
Publication of CN107992821A publication Critical patent/CN107992821A/en
Application granted granted Critical
Publication of CN107992821B publication Critical patent/CN107992821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/94Hardware or software architectures specially adapted for image or video understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses an image identification method and system, which are based on the forward calculation of a deep neural network: dividing a scaling factor of an input image, wherein the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range in which the input image is located; carrying out scale transformation on the input image according to the divided scaling factors; constructing a network memory pool, wherein the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same number and size; and inputting the image information after the scale transformation into the network memory pool for processing. The original image is converted, the converted image is input into a network for processing, and the memory blocks in the network memory pool can be acquired or released according to the image data processing requirement by constructing the network memory pool, so that the memory utilization rate is improved, and the image processing speed is accelerated.

Description

Image identification method and system
Technical Field
The present application relates to the field of image recognition technologies, and in particular, to an image recognition method and system.
Background
Image recognition refers to a technique of processing, analyzing and understanding an image with a computer to recognize various different modes of objects and objects. Image recognition is an important area of artificial intelligence. At present, the main image recognition methods include an image recognition method based on a neural network, an image recognition method based on a wavelet moment, and the like. The face automatic detection mode in the image identification method can conveniently improve the accuracy of a module for identifying attributes such as the identity (black list and white list) and the gender and age of a person in a security system.
The traditional image recognition method is mainly based on the characteristics of manual design, the calculated amount is relatively small, and the recognition speed is high. However, the conventional image recognition method has low image recognition accuracy due to the imperfection of feature design. The image recognition method based on the deep neural network can improve the accuracy of image recognition, but the image recognition method based on the deep neural network has large calculation amount, so that the running speed on a CPU is slow.
Most of the existing image recognition methods for the deep neural network are optimized in the parameter training of a network model, such as optimization of training bandwidth occupation, optimization of training speed, optimization of the network model and the like of a distributed parameter server, but only forward calculation is involved in practical application, and the traditional method basically calls some open-source deep learning frames without considering the problem of resources and directly runs on a GPU.
Disclosure of Invention
The application provides an image identification method and system, which aim to solve the problems of complexity and low processing speed of the traditional image identification method for deep neural network forward calculation.
In order to solve the technical problem, the embodiment of the application discloses the following technical scheme:
an image recognition method based on a deep neural network forward computation, the method comprising: dividing a scaling factor of an input image, wherein the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range in which the input image is located; carrying out scale transformation on the input image according to the divided scaling factors; constructing a network memory pool, wherein the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same number and size; and inputting the image information after the scale transformation into the network memory pool for processing.
Optionally, the dividing the scaling factor of the input image includes: acquiring the resolution of the input image and the planar space range of the input image according to the image information of the input image; dividing the plane space range of the input image according to the resolution of the input image in the x and y directions of a preset coordinate axis; determining an interval coefficient corresponding to each divided interval; and determining the scaling factor of each interval according to the interval coefficient.
Optionally, the performing scale transformation on the input image according to the divided scaling factor includes: pre-acquiring transformed image information according to the interval coefficient and the image information of the input image; and carrying out bilinear interpolation processing on the input image according to the pre-acquired and transformed image information.
Optionally, the constructing a network memory pool includes: acquiring storage space information of a network memory; dividing the storage space information into a plurality of memory blocks according to a first preset length, wherein each memory block is configured with memory block header information, and the memory block header information is used for marking the storage space information of the current memory pool; and dividing each memory block into a plurality of memory pool units according to a second preset length.
Optionally, the inputting the image information after the scale transformation into the network memory pool for processing includes: requesting a required memory block from the memory pool according to the input image information; and when the input image information is continuously enlarged, requesting to acquire a new memory block.
Optionally, after any memory block is used, the occupation of the corresponding memory block is released, and the memory block header information of the corresponding memory block unit is marked.
Optionally, all the memory block header information is traversed, and the idle memory block is obtained according to the memory block header information.
Alternatively, if the current image information processing task is in a multi-threaded mode, each thread requests a different memory block.
Optionally, when the deep neural network is in a cascade state and a large amount of image information exists to be processed, dividing the corresponding filters according to the cascade number of the deep neural network, wherein each filter corresponds to one deep neural network.
An image recognition system based on a deep neural network forward computation, the system comprising: the device comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is used for dividing a scaling factor of an input image, the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range where the input image is located; the image scale changing unit is used for carrying out scale transformation on the input image according to the divided scaling factors; the network memory pool building unit is used for building a network memory pool, the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same quantity and size; and the image processing unit is used for inputting the image information after the scale transformation into the network memory pool for processing.
As can be seen from the above technical solutions, the image recognition method and system provided in the embodiments of the present application, based on the forward computation of the deep neural network, include: dividing a scaling factor of an input image, wherein the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range in which the input image is located; carrying out scale transformation on the input image according to the divided scaling factors; constructing a network memory pool, wherein the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same number and size; and inputting the image information after the scale transformation into the network memory pool for processing. The original image is converted, the converted image is input into a network for processing, and the memory blocks in the network memory pool can be acquired or released according to the image data processing requirement by constructing the network memory pool, so that the memory utilization rate is improved, and the image processing speed is accelerated.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a schematic flowchart of an embodiment of an image recognition method based on a forward computation of a deep neural network provided in the present application;
fig. 2 is a schematic structural diagram of an embodiment of a network memory pool provided in the present application;
FIG. 3 is a schematic diagram illustrating one embodiment of parallel processing of multiple images provided herein;
fig. 4 is a schematic structural diagram of an embodiment of an image recognition system based on a deep neural network forward computation provided in the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a schematic flowchart of an embodiment of an image identification method based on a forward computation of a deep neural network provided in the present application is shown in fig. 1, where the method includes:
s101, dividing a scaling factor of an input image, wherein the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and the planar space range of the input image.
Specifically, the resolution of the input image and the planar space range in which the input image is located are obtained according to the image information of the input image. Dividing the plane space range of the input image according to the resolution of the input image in the x and y directions of a preset coordinate axis, determining an interval coefficient corresponding to each divided interval, and determining a scaling factor of each interval according to the interval coefficient.
The input image information is not set as
Figure DEST_PATH_IMAGE001
The size of the image is
Figure DEST_PATH_IMAGE002
In a planar space of
Figure DEST_PATH_IMAGE003
. To pair
Figure DEST_PATH_IMAGE004
Division of direction into
Figure DEST_PATH_IMAGE005
The interval corresponds to a coefficient of
Figure DEST_PATH_IMAGE006
(ii) a At the same time to
Figure DEST_PATH_IMAGE007
Division of direction into
Figure DEST_PATH_IMAGE008
The coefficients corresponding to the intervals are respectively
Figure DEST_PATH_IMAGE009
(ii) a Thus, resolution
Figure DEST_PATH_IMAGE010
Corresponding image scale factors can be obtained, where the scale factor is not set to
Figure DEST_PATH_IMAGE011
And S102, carrying out scale transformation on the input image according to the divided scaling factors. Pre-acquiring transformed image information according to the interval coefficient and the image information of the input image; and carrying out bilinear interpolation processing on the input image according to the pre-acquired and transformed image information.
Setting the information of the transformed image as
Figure DEST_PATH_IMAGE012
Known point of
Figure DEST_PATH_IMAGE013
In the original image
Figure DEST_PATH_IMAGE014
Four points of
Figure DEST_PATH_IMAGE015
Respectively have values of
Figure DEST_PATH_IMAGE016
Carrying out bilinear interpolation on the original image, wherein the calculation formula is as follows:
Figure DEST_PATH_IMAGE017
Figure DEST_PATH_IMAGE018
, (1)
Figure DEST_PATH_IMAGE019
, (2)
Figure DEST_PATH_IMAGE020
, (3)
Figure DEST_PATH_IMAGE021
, (4)
obtaining a proper detection image after image preprocessing; the forward calculation of the deep neural network includes a large amount of data exchange processes, and if the allocation and the release are performed by using an automatic memory allocation function of the system each time, a large amount of memory heap fragments are inevitably generated, so that the processing speed of the machine of the system is slower and slower along with the passage of time, and therefore, a memory pool needs to be designed to solve the problems of memory fragments and memory utilization rate.
S103, constructing a network memory pool, wherein the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same quantity and size. Acquiring storage space information of a network memory; dividing the storage space information into a plurality of memory blocks according to a first preset length, wherein each memory block is configured with memory block head information, and the memory block head information is used for marking the storage space information of the current memory block; and dividing each memory block into a plurality of memory pool units according to a second preset length.
The network memory pool constructed by the application adopts a fixed memory pool; it consists of a series of fixed-size memory blocks, each of which contains a fixed number and size of memory cells. As shown in fig. 2, the memory pool includes a total of 5 memory blocks. According to the network memory list storage information, 5 memory blocks are distributed with the same length, and each memory block is provided with memory block head information. For the 3 rd memory block analysis, it is composed of memory pool block header information and 3 memory pool units with equal size. The above is merely illustrative, and in practice, the network memory pool may include more memory blocks, and each memory block may also include more memory pool units.
And S104, inputting the image information after the scale transformation into the network memory pool for processing. Requesting a required memory block from the memory pool according to the input image information; and when the input image information is continuously enlarged, requesting to acquire a new memory block.
During the initialization phase of the program, it only applies for one memory block to the system. Then, with the continuous demand of the network for the memory, when the memory pool needs to be dynamically expanded in judgment, a new memory block is applied to the system again. Because the size is fixed, the distribution speed is faster, so that the performance of the corresponding network is improved. For example, memory blocks 1, 2, 4, 5 in fig. 2 are free and memory block 3 has been allocated. When a new memory block needs to be allocated, all the memory pool block header information is traversed, and the memory pool block of the idle unit is quickly positioned according to the memory pool block header information. After any memory block is used, the occupation of the corresponding memory block is released, the memory block head information of the corresponding memory block unit is marked, and the mark in the corresponding memory block head information is in an idle state.
The method comprises the steps of carrying out multi-scale deep neural network algorithm detection on one image, wherein the images share the same network structure, so that a plurality of images with different scales need to be processed at the same time. If the current image information processing task is in a multi-threaded mode, each thread requests a different memory block. As shown in fig. 3, it is set that the current processing task performs network forward computing processing under several cores; when the network computing in the step is started, each scale image is processed in the corresponding core, and the processing of the scale image and the processing of other scales do not interfere with each other.
When the deep neural network is a cascade (an end-to-end network can be said to be a special case of a cascade network), in a task of detecting a large number of submitted images and video sequences, a software pipeline is required to be used for dividing the images and the video sequences into a corresponding number of filters according to the cascade number of the network, and each Filter is a corresponding deep neural network, so that when one image is processed in a certain Filter, the processing of other images on other filters is not influenced.
As can be seen from the foregoing embodiments, the image recognition method and system provided by the present embodiment, the forward computation based on the deep neural network includes: dividing a scaling factor of an input image, wherein the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range in which the input image is located; carrying out scale transformation on the input image according to the divided scaling factors; constructing a network memory pool, wherein the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same number and size; and inputting the image information after the scale transformation into the network memory pool for processing. The original image is converted, the converted image is input into a network for processing, and the memory blocks in the network memory pool can be acquired or released according to the image data processing requirement by constructing the network memory pool, so that the memory utilization rate is improved, and the image processing speed is accelerated.
Corresponding to the method for measuring the parameters of the power distribution network, the embodiment of the application also provides an image identification system based on the forward calculation of the deep neural network. As shown in fig. 4, the system includes: the system comprises a dividing unit 201, an image scale changing unit 202, a network memory pool constructing unit 203 and an image processing unit 204.
The dividing unit 201 is configured to divide a scaling factor of an input image, where the scaling factor is determined according to image information of the input image, and the image information includes a resolution of the input image and a planar space range in which the input image is located. The image scale changing unit 202 is configured to perform scale transformation on the input image according to the divided scaling factor. The network memory pool constructing unit 203 is configured to construct a network memory pool, where the network memory pool includes a plurality of memory blocks with fixed sizes, and each memory block includes memory units with the same number and size. The image processing unit 204 is configured to input the image information after the scale transformation into the network memory pool for processing.
In a specific implementation provided by this embodiment, the present application further provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments of the calling method provided by this application when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will clearly understand that the techniques in the embodiments of the present application may be implemented by way of software plus a required general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and the relevant points can be referred to the description in the method embodiment.
The above-described embodiments of the present application do not limit the scope of the present application.

Claims (6)

1. An image identification method based on forward computation of a deep neural network is characterized by comprising the following steps:
dividing a scaling factor of an input image, wherein the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range in which the input image is located;
carrying out scale transformation on the input image according to the divided scaling factors;
constructing a network memory pool, wherein the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same number and size;
inputting the image information after the scale transformation into the network memory pool for processing;
the constructing of the network memory pool comprises the following steps:
acquiring storage space information of a network memory;
dividing the storage space information into a plurality of memory blocks according to a first preset length, wherein each memory block is configured with memory block header information, and the memory block header information is used for marking the storage space information of the current memory pool;
dividing each memory block into a plurality of memory pool units according to a second preset length;
the inputting the image information after the scale transformation into the network memory pool for processing comprises:
requesting a required memory block from the memory pool according to the input image information;
when the input image information is continuously enlarged, traversing all memory block header information, and acquiring idle memory blocks according to the memory block header information;
after any memory block is used, the occupation of the corresponding memory block is released, and the memory block head information of the corresponding memory block unit is marked.
2. The image recognition method of claim 1, wherein the dividing the scaling factor of the input image comprises:
acquiring the resolution of the input image and the planar space range of the input image according to the image information of the input image;
dividing the plane space range of the input image according to the resolution of the input image in the x and y directions of a preset coordinate axis;
determining an interval coefficient corresponding to each divided interval;
and determining the scaling factor of each interval according to the interval coefficient.
3. The image recognition method of claim 2, wherein the scaling the input image according to the divided scaling factors comprises:
pre-acquiring transformed image information according to the interval coefficient and the image information of the input image;
and carrying out bilinear interpolation processing on the input image according to the pre-acquired and transformed image information.
4. The image recognition method of claim 1, wherein if the current image information processing task is in a multi-threaded mode, each thread requests a different memory block.
5. The image recognition method of claim 4, wherein when the deep neural network is in a cascade state and there is a large amount of image information to be processed, the corresponding filters are divided according to the cascade number of the deep neural network, and each filter corresponds to one deep neural network.
6. An image recognition system based on a deep neural network forward computation, the system comprising:
the device comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is used for dividing a scaling factor of an input image, the scaling factor is determined according to image information of the input image, and the image information comprises the resolution of the input image and a plane space range where the input image is located;
the image scale changing unit is used for carrying out scale transformation on the input image according to the divided scaling factors;
the network memory pool building unit is used for building a network memory pool, the network memory pool comprises a plurality of memory blocks with fixed sizes, and each memory block comprises memory units with the same quantity and size;
the constructing of the network memory pool comprises the following steps:
acquiring storage space information of a network memory;
dividing the storage space information into a plurality of memory blocks according to a first preset length, wherein each memory block is configured with memory block header information, and the memory block header information is used for marking the storage space information of the current memory pool;
dividing each memory block into a plurality of memory pool units according to a second preset length;
the image processing unit is used for inputting the image information after the scale transformation into the network memory pool for processing;
the inputting the image information after the scale transformation into the network memory pool for processing comprises:
requesting a required memory block from the memory pool according to the input image information;
when the input image information is continuously enlarged, traversing all memory block header information, and acquiring idle memory blocks according to the memory block header information;
after any memory block is used, the occupation of the corresponding memory block is released, and the memory block head information of the corresponding memory block unit is marked.
CN201711242391.8A 2017-11-30 2017-11-30 Image identification method and system Active CN107992821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711242391.8A CN107992821B (en) 2017-11-30 2017-11-30 Image identification method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711242391.8A CN107992821B (en) 2017-11-30 2017-11-30 Image identification method and system

Publications (2)

Publication Number Publication Date
CN107992821A CN107992821A (en) 2018-05-04
CN107992821B true CN107992821B (en) 2021-12-03

Family

ID=62034860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711242391.8A Active CN107992821B (en) 2017-11-30 2017-11-30 Image identification method and system

Country Status (1)

Country Link
CN (1) CN107992821B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314650B (en) * 2018-12-11 2021-04-20 浙江宇视科技有限公司 Image display method and device
CN109815162A (en) * 2019-01-28 2019-05-28 Oppo广东移动通信有限公司 EMS memory management process, device, mobile terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0775972A2 (en) * 1995-11-27 1997-05-28 Canon Kabushiki Kaisha Digital image processor comprising a neural network
CN101478643A (en) * 2009-01-08 2009-07-08 华中科技大学 Method and system for data collecting
CN105551036A (en) * 2015-12-10 2016-05-04 中国科学院深圳先进技术研究院 Training method and device for deep learning network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0775972A2 (en) * 1995-11-27 1997-05-28 Canon Kabushiki Kaisha Digital image processor comprising a neural network
CN101478643A (en) * 2009-01-08 2009-07-08 华中科技大学 Method and system for data collecting
CN105551036A (en) * 2015-12-10 2016-05-04 中国科学院深圳先进技术研究院 Training method and device for deep learning network

Also Published As

Publication number Publication date
CN107992821A (en) 2018-05-04

Similar Documents

Publication Publication Date Title
CN109993299B (en) Data training method and device, storage medium and electronic device
CN106855952B (en) Neural network-based computing method and device
US20140355899A1 (en) Video enhancement using related content
CN111444807B (en) Target detection method, device, electronic equipment and computer readable medium
WO2023050651A1 (en) Semantic image segmentation method and apparatus, and device and storage medium
CN107992821B (en) Image identification method and system
WO2022152104A1 (en) Action recognition model training method and device, and action recognition method and device
CN109255438A (en) The method and apparatus for adjusting tensor data
WO2023116632A1 (en) Video instance segmentation method and apparatus based on spatio-temporal memory information
CN111914908A (en) Image recognition model training method, image recognition method and related equipment
CN111523642B (en) Data reuse method, operation method and device and chip for convolution operation
US9875528B2 (en) Multi-frame patch correspondence identification in video
CN116468967B (en) Sample image screening method and device, electronic equipment and storage medium
CN117193992A (en) Model training method, task scheduling device and computer storage medium
CN112614108A (en) Method and device for detecting nodules in thyroid ultrasound image based on deep learning
CN114820755B (en) Depth map estimation method and system
CN107977980A (en) A kind of method for tracking target, equipment and computer-readable recording medium
US9940718B2 (en) Apparatus and method for extracting peak image from continuously photographed images
CN108520532B (en) Method and device for identifying motion direction of object in video
CN110781223A (en) Data processing method and device, processor, electronic equipment and storage medium
CN116129325A (en) Urban treatment image target extraction method and device and application thereof
CN113903016B (en) Bifurcation point detection method, bifurcation point detection device, computer equipment and storage medium
CN107622037A (en) The method and apparatus that a kind of Matrix Multiplication for improving graphics processing unit calculates performance
CN111753722B (en) Fingerprint identification method and device based on feature point type
CN114021031A (en) Financial product information pushing method and device

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