WO2019151841A1 - 전자 장치 및 그 제어 방법 - Google Patents

전자 장치 및 그 제어 방법 Download PDF

Info

Publication number
WO2019151841A1
WO2019151841A1 PCT/KR2019/001510 KR2019001510W WO2019151841A1 WO 2019151841 A1 WO2019151841 A1 WO 2019151841A1 KR 2019001510 W KR2019001510 W KR 2019001510W WO 2019151841 A1 WO2019151841 A1 WO 2019151841A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
image
processor
filtering
bias
Prior art date
Application number
PCT/KR2019/001510
Other languages
English (en)
French (fr)
Inventor
임태규
송의현
한승훈
문보석
Original Assignee
삼성전자주식회사
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 삼성전자주식회사 filed Critical 삼성전자주식회사
Publication of WO2019151841A1 publication Critical patent/WO2019151841A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4046Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • 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/20024Filtering details
    • 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]

Definitions

  • the present invention utilizes a machine learning algorithm such as deep learning, an artificial intelligence (AI) system that simulates the functions of the human brain, such as cognition and judgment, and an electronic device and control method for providing an image processing model among the applications.
  • a machine learning algorithm such as deep learning
  • an artificial intelligence (AI) system that simulates the functions of the human brain, such as cognition and judgment
  • an electronic device and control method for providing an image processing model among the applications.
  • the present invention relates to an electronic device using a CNN trained image processing model and a control method thereof.
  • AI Artificial Intelligence
  • AI technology is composed of elementary technologies that utilize machine learning (deep learning) and machine learning.
  • Machine learning is an algorithm technology that classifies / learns characteristics of input data by itself
  • element technology is a technology that simulates the functions of human brain cognition and judgment by using machine learning algorithms such as deep learning. It consists of technical areas such as understanding, reasoning / prediction, knowledge representation, and motion control.
  • Linguistic understanding is a technology for recognizing and applying / processing human language / characters and includes natural language processing, machine translation, dialogue system, question and answer, speech recognition / synthesis, and the like.
  • Visual understanding is a technology that recognizes and processes objects as human vision, and includes object recognition, object tracking, image retrieval, person recognition, scene understanding, spatial understanding, and image enhancement.
  • Inference Prediction is a technique for judging, logically inferring, and predicting information. It includes knowledge / probability-based inference, optimization prediction, preference-based planning, and recommendation.
  • Knowledge expression is a technology that automatically processes human experience information into knowledge data, and includes knowledge construction (data generation / classification) and knowledge management (data utilization).
  • Motion control is a technology for controlling autonomous driving of a vehicle and movement of a robot, and includes motion control (navigation, collision, driving), operation control (action control), and the like.
  • the artificial intelligence system can be applied to learning various images and generating an image processing model according to the learning result.
  • the image may be filtered, classified, and provided.
  • An object of the present invention is to provide an electronic device and a method of controlling the same, which provide a filtering result without deterioration by using a convolutional neural network (CNN) trained weight matrix and a bias matrix.
  • CNN convolutional neural network
  • an electronic device includes a memory in which a convolutional neural network (CNN) trained weight matrix is stored, and when an image is received, configures each pixel of the image.
  • a processor for converting the matrices representing the color components into one unified matrix an image processor performing filtering on the image using the unified matrix converted by the processor, and a filtering result of the image processor according to control of the processor
  • the image processor is configured to perform a matrix multiplication on the integration matrix and the weight matrix to obtain a convolution matrix, filter the characteristics of each pixel region of the image using the convolution matrix
  • Weighting matrix Is a matrix in which a plurality of CNN-learned matrices are integrated in an interleaved form
  • the unified matrix is a matrix having a number of rows and columns operable with the weight matrix.
  • the image processor may include a plurality of cores each performing in parallel a matrix product between each row constituting the unified matrix and a corresponding column of the weight matrix.
  • the memory may further include a bias matrix, and the image processor may add the bias matrix to the convolution matrix.
  • the memory may further include a first bias matrix and a second bias matrix, wherein the image processor may selectively sum one of the first and second bias matrices into the convolution matrix.
  • the image processor is configured to apply an activation function to a convolution matrix summed with one of the first and second bias matrices, to obtain a plurality of output layers, and to fully-connected based on the plurality of output layers.
  • Layer and the characteristics of each region can be identified according to the class score of each region included in the FC layer.
  • the image processor may acquire the FC layer by summing values of positions corresponding to each other in the plurality of output layers.
  • the image processor may obtain the FC layer by comparing values of positions corresponding to each other in the plurality of output layers and collecting values having the largest value.
  • the processor may control the image processor to collectively transmit parameter values and instructions used for the filtering together with the integration matrix to the image processor to perform the filtering.
  • the processor may control the image processor to repeatedly perform the filtering a plurality of times.
  • an electronic device control method when an image is received, converting matrices representing color components constituting each pixel of the image into one unified matrix, CNN (Convolution Neural Network) Performing filtering on the image using the trained weight matrix and the integration matrix and outputting the filtering result, wherein the performing of the filtering comprises: the integration matrix; And performing a matrix multiplication on the weight matrix to obtain a convolution matrix, and filtering characteristics of respective pixel regions of the image using the convolution matrix, wherein the weight matrix is a plurality of CNN-learned matrices. Is an interleaved matrix The integrated matrix, the matrix having the weighting matrix and the calculation of the total number of rows and columns.
  • CNN Convolution Neural Network
  • the plurality of cores may perform a matrix multiplication between each row constituting the unified matrix and a corresponding column of the weight matrix.
  • the performing of the filtering may include adding a bias matrix to the convolution matrix.
  • performing the filtering may include selectively adding one of a first and a second bias matrix to the convolution matrix, wherein the first bias matrix is a matrix consisting of one and the second bias matrix. May be a matrix composed of zeros.
  • the performing of the filtering may include applying an activation function to a convolution matrix obtained by adding one of the first and second bias matrices, to obtain a plurality of output layers, and based on the plurality of output layers.
  • the method may include obtaining a (fully-connected) layer and identifying characteristics of each region according to a class score of each region included in the FC layer.
  • the FC layer may be obtained by summing values of positions corresponding to each other in the plurality of output layers.
  • the FC layer may be obtained by comparing values of positions corresponding to each other in the plurality of output layers and collecting values having the largest value.
  • the method may further include collectively transmitting parameter values and instructions used for the filtering together with the integration matrix to the image processor, wherein the filtering may be performed by the image processor.
  • the filtering may be performed by repeating the filtering a plurality of times.
  • the operation may include: Converting matrices representing the color components constituting each pixel of the image into one unified matrix, a convolutional neural network (CNN) trained weight matrix, and filtering the image using the unified matrix And outputting the filtering result, and the performing of the filtering may include performing a matrix product of the integration matrix and the weight matrix to obtain a convolution matrix, using the convolution matrix.
  • CNN convolutional neural network
  • the weight matrix is a matrix obtained by integrating a plurality of CNN-learned matrices in an interleaved form, and wherein the integration matrix has a number of rows and columns that can be calculated with the weight matrix. It can be a matrix.
  • an electronic device may provide a minimum delay time due to data transmission and reception between a processor and an image processor by using a weight matrix and a bias matrix trained by a convolutional neural network (CNN).
  • CNN convolutional neural network
  • FIG. 1 is a block diagram illustrating an electronic device according to an embodiment of the present disclosure.
  • FIG. 2 is a block diagram illustrating a detailed configuration of an electronic device according to an embodiment of the present disclosure.
  • FIG. 3 is a diagram for describing a matrix product according to an exemplary embodiment.
  • FIG. 4 is a diagram for describing an activation function, according to an exemplary embodiment.
  • FIG. 5 is a flowchart illustrating an operating method for obtaining a filtering result according to an exemplary embodiment.
  • FIG. 6 is a diagram for describing a command for obtaining a filtering result according to an exemplary embodiment.
  • FIG. 7 is a diagram for describing a command for obtaining a filtering result according to an exemplary embodiment.
  • FIG. 8 is a flowchart illustrating a control method of an electronic device according to an embodiment of the present disclosure.
  • Embodiments of the present disclosure may be variously modified and have various embodiments, and specific embodiments will be illustrated in the drawings and described in detail in the written description. However, this is not intended to limit the scope to the specific embodiments, it should be understood to include all transformations, equivalents, and substitutes included in the scope of the disclosed spirit and technology. In describing the embodiments, when it is determined that the detailed description of the related known technology may obscure the gist, the detailed description thereof will be omitted.
  • first and second may be used to describe various components, but the components should not be limited by the terms. The terms are only used to distinguish one component from another.
  • a "module” or “unit” performs at least one function or operation, and may be implemented in hardware or software or in a combination of hardware and software.
  • a plurality of “modules” or a plurality of “units” may be integrated into at least one module except for "modules” or “units”, which need to be implemented with specific hardware, and are implemented with at least one processor (not shown). Can be.
  • FIG. 1 is a block diagram illustrating an electronic device 100 according to an embodiment of the present disclosure.
  • the electronic device 100 includes a memory 110, a processor 120, an image processor 130, and a display 140.
  • the electronic device 100 may be a device capable of artificial intelligence learning.
  • a user terminal device a display device, a set-top box, a tablet personal computer, a smart phone, an e-book reader, a desktop PC ), A laptop PC, a workstation, a server, a personal digital assistant, a portable multimedia player, a MP3 player, and the like.
  • the electronic device 100 may mean a system itself in which a cloud computing environment is built.
  • the present invention is not limited thereto, and the electronic device 100 may be any device as long as the device is capable of artificial intelligence learning.
  • the memory 110 may store a weight matrix trained by a convolutional neural network (CNN).
  • CNN is a multilayer neural network with a special connection structure designed for speech processing, image processing, and the like.
  • the CNN may filter the image in various ways and recognize the characteristics of the image by preprocessing the pixel.
  • the memory 110 may store an image processing model including a CNN trained matrix as basic data including a plurality of images.
  • the matrix learned from the basic data may be called variously, such as a filter, a kernel, a weight matrix, etc.
  • the matrix is collectively referred to as a weight matrix.
  • the memory 110 may further include a bias matrix.
  • the bias matrix means a matrix composed of constants.
  • the electronic device 100 may obtain a filtering result by using a bias matrix in the filtering process for the image.
  • the bias matrix is configured to prevent overfitting of the image processing model including the CNN trained weight matrix.
  • the electronic device 100 obtains the characteristics of the image by applying the weight matrix to the image included in the basic data, the characteristics of the acquired image and the actual characteristics of the image match, whereas other images ( For example, an image obtained by applying a weighting matrix to an image received in real time means that a case in which the characteristic of the image does not match the actual characteristic of the image is frequently issued.
  • the processor 120 controls the overall operation of the electronic device 100.
  • the processor 120 may be implemented as a digital signal processor (DSP), a microprocessor, or a time controller (TCON), but is not limited thereto.
  • DSP digital signal processor
  • CPU central processing unit
  • MCU microcontroller unit
  • MPU micro processing unit
  • controller application processor
  • CP communication processor
  • ARM processor ARM processor
  • the processor 140 may be implemented by a System on Chip (SoC), a large scale integration (LSI), or an FPGA (Integrated Processing Algorithm). Field Programmable Gate Array) may be implemented.
  • SoC System on Chip
  • LSI large scale integration
  • FPGA Integrated Processing Algorithm
  • Field Programmable Gate Array may be implemented.
  • the processor 120 may convert matrices representing the color components constituting each pixel of the image into one unified matrix.
  • the image refers to various types of images, such as an image and content that the electronic device 100 receives in real time.
  • the color component may mean a pixel value corresponding to each pixel of the image. For example, when each pixel of the received image is represented through 8 bits, one pixel has one of a total of 256 color components of 0 to 255. Accordingly, the processor 120 may convert the received image into a matrix using each pixel value.
  • the processor 120 may obtain a matrix for each channel and convert the obtained plurality of matrices into one unified matrix.
  • the received image is three channel data of R, G, and B, and the processor 120 may obtain a matrix corresponding to each of R, G, and B. A detailed description thereof will be provided with reference to FIG. 3.
  • the processor 120 may control the image processor 130 to perform filtering on the received image.
  • the display 140 may be controlled to output the filtering result.
  • the image processor 130 may be a special purpose processor for the processing of graphic data.
  • the image processor 130 may perform filtering on the image using the transformed integrated matrix.
  • the image processor 130 is a GPU (Graphic Processing Unit), but may be implemented as a component that is distinct from the processor 120, but is not limited thereto. Various embodiments of the present disclosure may be performed by the processor 120. For example, the graphic processor of the processor 120 may perform filtering on the received image according to various embodiments of the present disclosure.
  • the image processor 130 generates a screen including various objects by using a calculator (not shown) and a renderer (not shown).
  • the calculating unit calculates attribute values such as coordinate values, shapes, sizes, colors, and the like in which objects are displayed according to the layout of the screen based on the received control command.
  • the renderer generates screens of various layouts including objects based on the attribute values calculated by the calculator. The screen generated by the renderer is displayed in the display area of the display 140.
  • the image processor 130 is a component that performs processing on image data.
  • the image processor 130 may perform various image processing such as decoding, scaling, noise filtering, frame rate conversion, resolution conversion, and the like on the image data.
  • the image processor 130 may obtain a convolution matrix by performing convolution on the integration matrix and the weight matrix.
  • the convolution means that the weight matrix performs matrix multiplication while shifting the matrix for the image by region, and calculates a result value according to the matrix multiplication.
  • the weight matrix performs matrix multiplication by shifting by region within the matrix for the image and obtains an output matrix of 3 ⁇ 3.
  • the output matrix obtained according to the convolution will be collectively referred to as a convolution matrix.
  • the size of the matrix is one embodiment, but is not limited thereto.
  • the matrix may have various sizes depending on the received image.
  • the padding and the stride may be performed in the process of performing the convolution so that the size may be variously adjusted.
  • padding means filling a specific pixel value by a predetermined size in all directions of the received image. If padding is performed, the matrix and the convolution matrix for the image may have the same size.
  • the image processor 130 may not shift the weight matrix and the matrix for the image for each region in order to perform convolution.
  • the transformed unified matrix can be a matrix having rows and columns that can be matrix multiplied by the weight matrix.
  • the weight matrix stored in the memory 110 may be an integrated matrix in an interleaved form.
  • the interleaved matrix may be a matrix having rows and columns capable of matrix multiplication with the transformed integrated matrix.
  • the processor 110 may convert the integrated image into a 4 ⁇ 8 matrix.
  • the image processor 130 may obtain a convolution matrix by performing matrix multiplication with a matrix of 4 ⁇ 8 and a weight matrix stored in the memory 110.
  • the weight matrix may be an interleaved form capable of performing matrix multiplication with a 4 ⁇ 8 integrated matrix, that is, an 8 ⁇ 2 matrix.
  • the image processor 130 may obtain a 4 ⁇ 2 convolution matrix by performing matrix multiplication between the integration matrix and the weight matrix. A detailed description thereof will be provided with reference to FIG. 3.
  • the image processor 130 may include a plurality of cores.
  • the image processor 130 may perform a matrix product between each row constituting the unified matrix and the corresponding column of the weight matrix in parallel using a plurality of cores.
  • the convolution between the integration matrix and the weight matrix may mean performing matrix multiplication between the integration matrix and the weight matrix, or applying a filter or kernel to the image.
  • the image processor 130 performs matrix multiplication between a 4 ⁇ 8 integrated matrix and an 8 ⁇ 2 weighted matrix.
  • Matrix multiplication between one row of the integration matrix and one column of the weight matrix may be performed by the first core, and matrix multiplication between two rows of the integration matrix and two columns of the weight matrix may be performed by the second core.
  • a total of eight matrix products may be performed in parallel by each of the first to eighth cores. Accordingly, the time required to obtain the convolution matrix can be reduced.
  • NVIDIA® GPUs can include 3,584 CUDA® cores, which can be arithmetic performed in parallel by 3,584 operations.
  • the image processor 130 may add the bias matrix to the convolution matrix.
  • the bias matrix may be a matrix having a predetermined value of 1 ⁇ 1.
  • the image processor 130 may add all of the elements included in the convolution matrix to a predetermined value included in the bias matrix.
  • the image processor 130 may selectively apply any one of the first and second bias matrices to the convolution matrix.
  • the first bias matrix may be a 1 ⁇ 1 matrix composed of 1s
  • the second bias matrix may be a 1 ⁇ 1 matrix composed of 0s.
  • the image processor 130 may selectively sum any one of the first and second bias matrices into the convolution matrix based on various purposes.
  • the image processor 140 may apply an activation function to the convolution matrix in which the bias matrix is summed.
  • various types of functions such as an activation function, an identity function, a logistic sigmoid function, a hyperbolic tangent (tanh) function, a relu function, and a leaky relu function may be applied.
  • the image processor 130 may apply the RELU function max (0, x) to all elements.
  • the image processor 140 may apply an activation function to obtain a plurality of output layers and to obtain a fully-connected (FC) layer based on the output layer.
  • the FC layer is an output layer and may identify characteristics of each region according to class scores of respective regions included in the FC layer.
  • the class score may mean an amount activated after the activation function is applied, and the image processor 130 may identify a category corresponding to each activation amount.
  • the identified category may mean a characteristic of each region. For example, objects (eg, cars, boats, cats, etc.) included in each area may be identified according to class scores of each area included in the FC layer.
  • the image processor 130 may acquire the FC layer by summing values of positions corresponding to each other in the plurality of output layers.
  • the image processor 130 may obtain values of the FC layer by comparing values of positions corresponding to each other in the plurality of output layers and collecting the values having the largest values.
  • the display 140 may be a variety of displays such as a liquid crystal display (LCD), an organic light emitting diode (OLED), a liquid crystal on silicon (LCoS), or a digital light processing (DLP). Can be implemented. However, the present invention is not limited thereto and may be implemented as various types of displays capable of displaying images.
  • LCD liquid crystal display
  • OLED organic light emitting diode
  • LCDoS liquid crystal on silicon
  • DLP digital light processing
  • the present invention is not limited thereto and may be implemented as various types of displays capable of displaying images.
  • the display 140 may output the filtering result of the image processor 130 under the control of the processor 120.
  • FIG. 2 is a block diagram illustrating a detailed configuration of an electronic device 100 according to an embodiment of the present disclosure.
  • the electronic device 100 may include a memory 110, a processor 120, an image processor 130, a display 140, a communication unit 150, a user interface unit 160, and an audio processing unit 170. Include. A detailed description of parts overlapping with those shown in FIG. 1 among the elements shown in FIG. 2 will be omitted.
  • the processor 120 controls the overall operation of the electronic device 100 using various programs stored in the memory 110.
  • the processor 120 may access the RAM 121, the ROM 122, the main CPU 123, the graphics processor 124, the first to n interfaces 125-1 to 125-n, and the bus 126. Include.
  • the RAM 121, the ROM 122, the main CPU 123, the graphics processor 124, and the first to n-interfaces 125-1 to 125-n may be connected to each other through the bus 126.
  • the first to n interfaces 125-1 to 125-n are connected to the various components described above.
  • One of the interfaces may be a network interface connected to an external device via a network.
  • the main CPU 123 accesses the memory 110 and performs booting using an operating system stored in the memory 110. In addition, various operations are performed using various programs stored in the memory 110.
  • the ROM 122 stores a command set for system booting.
  • the main CPU 123 copies the O / S stored in the memory 110 to the RAM 121 according to the command stored in the ROM 122, and executes the O / S.
  • Boot up When the booting is completed, the main CPU 123 copies various application programs stored in the memory 110 to the RAM 121 and executes the application programs copied to the RAM 121 to perform various operations.
  • the processor 120 may collectively transmit parameter values and instructions used by the image processor 130 to perform filtering together with the integration matrix to the image processor 130. Accordingly, delay time due to data transmission and reception between the processor 120 and the image processor 130 may be minimized. Detailed description thereof will be made with reference to FIGS. 5 to 7.
  • the processor 120 may control the image processor to repeatedly perform filtering a plurality of times.
  • the above-described operation of the processor 120 may be performed by a program stored in the memory 110.
  • the memory 110 stores various data such as an operating system (O / S) software module for driving the electronic device 100, an image processing model including a weight matrix and a bias matrix, a CNN learning module, and the like.
  • O / S operating system
  • image processing model including a weight matrix and a bias matrix
  • CNN learning module a CNN learning module
  • the memory 110 may be implemented as an internal memory such as a ROM or a RAM included in the processor 120 or may be implemented as a memory separate from the processor 120.
  • the memory 110 may be implemented in the form of a memory embedded in the electronic device 100 according to a data storage purpose, or may be implemented in the form of a memory detachable to the electronic device 100.
  • data for driving the electronic device 100 is stored in a memory embedded in the electronic device 100, and data for expansion function of the electronic device 100 is detachable from the electronic device 100. Possible memory can be stored.
  • the memory embedded in the electronic device 100 may be implemented in the form of a nonvolatile memory, a volatile memory, a hard disk drive (HDD), or a solid state drive (SSD), and may be attached or detached to the electronic device 100.
  • the memory card may be implemented in the form of a memory card (eg, micro SD card, USB memory, etc.), an external memory (eg, USB memory) connectable to a USB port.
  • the communication unit 150 is a component that performs communication with various types of external devices according to various types of communication methods.
  • the communicator 150 includes a Wi-Fi chip 151, a Bluetooth chip 152, a wireless communication chip 153, an NFC chip 154, and the like.
  • the processor 120 communicates with various external devices using the communication unit 150.
  • the Wi-Fi chip 151 and the Bluetooth chip 152 communicate with each other by WiFi and Bluetooth.
  • various connection information such as SSID and session key may be transmitted and received first, and then various communication information may be transmitted and received using the same.
  • the wireless communication chip 153 refers to a chip that performs communication according to various communication standards such as IEEE, Zigbee, 3rd Generation (3G), 3rd Generation Partnership Project (3GPP), Long Term Evoloution (LTE), and the like.
  • the NFC chip 154 refers to a chip operating in a near field communication (NFC) method using a 13.56 MHz band among various RF-ID frequency bands such as 135 kHz, 13.56 MHz, 433 MHz, 860-960 MHz, 2.45 GHz, and the like.
  • NFC near field communication
  • the processor 120 may receive an image processing model including an image, a weight matrix, a bias matrix, and an activation function from the external device through the communication unit 150.
  • the user interface unit 160 receives various user interactions.
  • the user interface 160 may be implemented in various forms according to the implementation example of the electronic device 100.
  • the user interface 160 may be a button provided in the electronic device 100, a microphone for receiving a user voice, a camera for detecting a user motion, or the like.
  • the electronic device 100 is implemented as a touch-based electronic device
  • the user interface 160 may be implemented in the form of a touch screen that forms a mutual layer structure with the touch pad. In this case, the user interface 160 may be used as the display 140 described above.
  • the audio processor 160 is a component that performs processing on audio data.
  • the audio processor 160 may perform various processing such as decoding, amplification, noise filtering, and the like on the audio data.
  • FIG. 3 is a diagram for describing a matrix product according to an exemplary embodiment.
  • a plurality of matrices 10 for the image representing the color components constituting each pixel of the image may be obtained.
  • the processor 120 may convert the plurality of matrices 10 for the image into one unified matrix 10-1.
  • the image processor 130 may convert the weight matrix 20 into an interleaved matrix 20-1 to perform matrix multiplication between the integration matrix 10-1 and the weight matrix 20.
  • the electronic device 100 may prestore the weight matrix 20 as the interleaved matrix 20-1. Accordingly, the image processor 130 may perform matrix multiplication using the pre-stored interleaved matrix 20-1 without having to convert the weight matrix 20 into the interleaved matrix 20-1. Can be.
  • the processor 120 may convert a 3 ⁇ 3 ⁇ 2 matrix 10 into a 4 ⁇ 8 ⁇ 1 unified matrix 10-1.
  • the interleaved matrix 20-1 has a size of 8x4x1.
  • the image processor 130 may perform matrix multiplication using the pre-stored interleaved matrix 20-1 without changing the size of the weight matrix 20 from 2 ⁇ 2 ⁇ 2 to 8 ⁇ 2 ⁇ 1. have.
  • the convolution between the matrix 10 and the weight matrix 20 for the image requires a shift of the weight matrix 20 and has a disadvantage in that the calculation process is complicated.
  • the computation time and resources required to obtain the output layer 30 are high.
  • the matrix multiplication between the unified matrix 10-1 and the interleaved matrix 20-1 performs only the matrix multiplication of the rows of the unified matrix 10-1 with the columns of the interleaved matrix 20-1. Less computation time and resources are required to obtain (30-1).
  • the image processor 130 may include a plurality of cores. Each of the plurality of cores may perform a matrix product of the rows of the integrated mattress 10-1 and the columns of the interleaved matrix 20-1 in parallel.
  • the image processor 130 may acquire the output layer 30 based on the convolution matrix 30-1.
  • FIG. 4 is a diagram for describing an activation function, according to an exemplary embodiment.
  • the bias matrix may be added to the convolution matrix 30-1.
  • the bias matrix may be a matrix having a predetermined value of 1 ⁇ 1.
  • the image processor 130 may add all the elements included in the convolution matrix 30-1 to a predetermined value included in the bias matrix.
  • the image processor 130 may apply an activation function to the convolution matrix 30-1.
  • an activation function to a convolution matrix (or a feature map) obtained through matrix multiplication (or convolution, filter, kernel)
  • the ReLu function may be applied to the CNN model.
  • the RELU function may treat max (0, x) and all negative numbers as zero.
  • the present invention is not limited thereto, and the sigmoid (or tanh) activation function may be applied.
  • FIG. 5 is a flowchart illustrating an operating method for obtaining a filtering result according to an exemplary embodiment.
  • matrices representing color components constituting each pixel of the image may be converted into one unified matrix (S520).
  • the processor 120 may convert the matrix 10 for the image into the unified matrix 10-1 using the im2col command.
  • the image processor 130 performs matrix multiplication on the integrated matrix 10-1 and the interleaved weight matrix 20-1 to obtain the convolution matrix 30-1, and then the convolution matrix 30-1. ),
  • the bias matrix may be added, and an activation function may be applied (S530).
  • the processor 120 transmits the parameter values and the instructions used in the step S530 together with the integrated matrix 10-1 to the image processor 130 so that the image processor 130 may perform the step S530.
  • the image processor may be controlled to perform the operation. Accordingly, delay time due to data transmission and reception between the processor 120 and the image processor 130 may be minimized.
  • the electronic device 100 may output a filtering result of the image processor 130 obtained in operation S530 (S540).
  • 6 and 7 are diagrams for describing an instruction for obtaining a filtering result according to an exemplary embodiment.
  • the weight matrix 20 can be converted into an interleaved matrix 20-1.
  • the image processor 130 may apply the ReLu function to the convolution matrix obtained by adding the bias matrix.
  • each step requires transmission of instructions, parameters, and the like of the processor 120 to the image processor 130.
  • Delay time occurs according to the transmission and reception of instructions, parameters, data, and the like between the processor 120 and the image processor 130.
  • the weight matrix 20 and the bias matrix may be pre-stored in the form of an integral matrix, a matrix product and a summation, respectively. Accordingly, the image processor 130 may not require command and parameter transmission of the processor 120 to perform the Transpose, Interleave, and Bias GEMM steps of FIG. 5.
  • the delay time may be reduced as the command, parameter, and data are minimized between the processor 120 and the image processor 130.
  • FIG. 8 is a flowchart illustrating a control method of an electronic device according to an embodiment of the present disclosure.
  • a convolution matrix is obtained by performing matrix multiplication on the integration matrix and the CNN trained weight matrix (S820).
  • the characteristics of the respective pixel regions of the image are filtered using the convolution matrix (S830).
  • the electronic device may include a plurality of cores each performing a matrix product between each row constituting the unified matrix and a corresponding column of the weight matrix in parallel.
  • step S830 of performing filtering may include adding a bias matrix to a convolution matrix.
  • the step S830 of performing filtering may include selectively adding one of the first and second bias matrices to the convolution matrix, wherein the first bias matrix is a matrix composed of ones and the second bias matrix is zero. It may be a constructed matrix.
  • filtering may be performed by applying an activation function to a convolution matrix obtained by adding one of the first and second bias matrices to obtain a plurality of output layers. -connecting) obtaining the layer and identifying the characteristics of each region according to the class score of each region included in the FC layer.
  • the FC layer may be obtained by summing values of positions corresponding to each other in the plurality of output layers.
  • the FC layer may be obtained by comparing values of positions corresponding to each other in the plurality of output layers and collecting the values having the largest values.
  • It also includes the step of sending the parameter values and instructions used for filtering together with the integrated matrix to the image processor, wherein the filtering may be performed by the image processor.
  • the filtering may be repeated a plurality of times.
  • the various embodiments described above may be implemented in a recording medium readable by a computer or a similar device by using software, hardware, or a combination thereof.
  • the embodiments described herein may be implemented by the processor itself.
  • embodiments such as the procedures and functions described herein may be implemented as separate software modules. Each of the software modules may perform one or more functions and operations described herein.
  • computer instructions for performing a processing operation according to various embodiments of the present disclosure described above may be stored in a non-transitory computer-readable medium.
  • the computer instructions stored in the non-transitory computer readable medium may cause the specific device to perform the processing operations according to the above-described various embodiments when executed by the processor.
  • a non-transitory computer readable medium refers to a medium that stores data semi-permanently and is read by a device, not a medium storing data for a short time such as a register, a cache, a memory, and the like.
  • Specific examples of non-transitory computer readable media may include CD, DVD, hard disk, Blu-ray disk, USB, memory card, ROM, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

전자 장치가 개시된다. 전자 장치는, CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스가 저장된 메모리, 이미지가 수신되면, 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환하는 프로세서, 프로세서에서 변환된 통합 매트릭스를 이용하여 이미지에 대한 필터링을 수행하는 이미지 프로세서 및 프로세서의 제어에 따라, 이미지 프로세서의 필터링 결과를 출력하는 디스플레이를 포함한다.

Description

전자 장치 및 그 제어 방법
본 발명은 딥러닝 등의 기계 학습 알고리즘을 활용하여 인간 두뇌의 인지, 판단 등의 기능을 모사하는 인공지능(Artificial Intelligence, AI) 시스템 및 그 응용 중 이미지 처리 모델을 제공하는 전자 장치 및 제어 방법들에 대한 것으로, 더욱 상세하게는 CNN(Convolution Neural Network) 학습(training)된 이미지 처리 모델을 이용하는 전자 장치 및 그 제어 방법에 대한 것이다.
인공지능(Artificial Intelligence, AI) 시스템은 인간 수준의 지능을 구현하는 컴퓨터 시스템이며, 기존 Rule 기반 스마트 시스템과 달리 기계가 스스로 학습하고 판단하며 똑똑해지는 시스템이다. 인공지능 시스템은 사용할수록 인식률이 향상되고 사용자 취향을 보다 정확하게 이해할 수 있게 되어, 기존 Rule 기반 스마트 시스템은 점차 딥러닝 기반 인공지능 시스템으로 대체되고 있다.
인공지능 기술은 기계학습(딥러닝) 및 기계학습을 활용한 요소 기술들로 구성된다.
기계학습은 입력 데이터들의 특징을 스스로 분류/학습하는 알고리즘 기술이며, 요소기술은 딥러닝 등의 기계학습 알고리즘을 활용하여 인간 두뇌의 인지, 판단 등의 기능을 모사하는 기술로서, 언어적 이해, 시각적 이해, 추론/예측, 지식 표현, 동작 제어 등의 기술 분야로 구성된다.
인공지능 기술이 응용되는 다양한 분야는 다음과 같다. 언어적 이해는 인간의 언어/문자를 인식하고 응용/처리하는 기술로서, 자연어 처리, 기계 번역, 대화시스템, 질의 응답, 음성 인식/합성 등을 포함한다. 시각적 이해는 사물을 인간의 시각처럼 인식하여 처리하는 기술로서, 객체 인식, 객체 추적, 영상 검색, 사람 인식, 장면 이해, 공간 이해, 영상 개선 등을 포함한다. 추론 예측은 정보를 판단하여 논리적으로 추론하고 예측하는 기술로서, 지식/확률 기반 추론, 최적화 예측, 선호 기반 계획, 추천 등을 포함한다. 지식 표현은 인간의 경험정보를 지식데이터로 자동화 처리하는 기술로서, 지식 구축(데이터 생성/분류), 지식 관리(데이터 활용) 등을 포함한다. 동작 제어는 차량의 자율 주행, 로봇의 움직임을 제어하는 기술로서, 움직임 제어(항법, 충돌, 주행), 조작 제어(행동 제어) 등을 포함한다.
예를 들어, 인공지능 시스템은 다양한 이미지를 학습하고, 학습 결과에 따른 이미지 처리 모델의 생성에 적용될 수 있다. 또한, 생성된 이미지 모델에 기초하여 학습과 유사한 과정을 통해 새로운 이미지가 수신되면 이미지를 필터링 및 분류하여 제공할 수 있다.
다만, 이미지 처리 모델의 차원이 높아질수록 처리가 요구되는 데이터량이 기하급수적으로 증가하게 되며, 프로세서와 이미지 프로세서 간의 데이터 송수신에 따른 딜레이 시간이 발생하는 문제가 있었다.
본 발명은 상술한 필요성에 따른 것으로, 본 발명의 목적은 CNN(Convolution Neural Network) 학습(training)된 가중치 매트릭스 및 바이어스 매트릭스를 이용하여 성능 저하 없이 필터링 결과를 제공하는 전자 장치 및 그 제어 방법들을 제공함에 있다.
상술한 목적을 달성하기 위한 본 발명의 일 실시 예에 따른 전자 장치는 CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스가 저장된 메모리, 이미지가 수신되면, 상기 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환하는 프로세서, 상기 프로세서에서 변환된 상기 통합 매트릭스를 이용하여 상기 이미지에 대한 필터링을 수행하는 이미지 프로세서 및 상기 프로세서의 제어에 따라, 상기 이미지 프로세서의 필터링 결과를 출력하는 디스플레이를 포함하며, 상기 이미지 프로세서는, 상기 통합 매트릭스와 상기 가중치 매트릭스에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득하고, 컨벌루션 매트릭스를 이용하여 상기 이미지의 각 픽셀 영역들의 특성을 필터링하고, 상기 가중치 매트릭스는, CNN 학습된 복수의 매트릭스를 인터리브드(interleaved) 형태로 통합한 매트릭스이고, 상기 통합 매트릭스는 상기 가중치 매트릭스와 연산이 가능한 개수의 행 및 열을 가지는 매트릭스이다.
또한, 상기 이미지 프로세서는, 상기 통합 매트릭스를 구성하는 각 행과, 상기 가중치 매트릭스의 대응되는 열 간의 행렬 곱을 각각 병렬적으로 수행하는 복수의 코어를 포함할 수 있다.
여기서, 상기 메모리는, 바이어스 매트릭스를 더 포함하며, 상기 이미지 프로세서는, 상기 컨벌루션 매트릭스에 상기 바이어스 매트릭스를 상기 컨벌루션 매트릭스에 합산할 수 있다.
또한, 상기 메모리는, 제1 바이어스 매트릭스 및 제2 바이어스 매트릭스를 더 포함하며, 상기 이미지 프로세서는, 상기 제1 및 상기 제2 바이어스 매트릭스 중 하나를 선택적으로 상기 컨벌루션 매트릭스에 합산할 수 있다.
여기서, 상기 이미지 프로세서는, 상기 제1 및 제2 바이어스 매트릭스 중 하나가 합산된 컨벌루션 매트릭스에 활성화 함수를 적용하여, 복수의 출력 레이어를 획득하고, 상기 복수의 출력 레이어에 기초하여 FC(fully-connected) 레이어를 획득하며, 상기 FC 레이어에 포함된 각 영역들의 클래스 점수에 따라, 각 영역들의 특성을 식별할 수 있다.
여기서, 상기 이미지 프로세서는, 상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 합산하여, 상기 FC 레이어를 획득할 수 있다.
또한, 상기 이미지 프로세서는, 상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 비교하고, 가장 큰 값을 가지는 값들을 집산하여, 상기 FC 레이어를 획득할 수 있다.
또한, 상기 프로세서는, 상기 필터링에 사용되는 파라미터값들 및 명령어를 상기 통합 매트릭스와 함께 상기 이미지 프로세서로 일괄 전송하여 상기 필터링을 수행하도록 상기 이미지 프로세서를 제어할 수 있다.
또한, 상기 프로세서는, 상기 필터링을 복수 회 반복하여 수행하도록 상기 이미지 프로세서를 제어할 수 있다.
한편, 본 개시의 일 실시 예에 따른 전자 장치의 제어 방법에 있어서, 이미지가 수신되면, 상기 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환하는 단계, CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스 및 상기 통합 매트릭스를 이용하여 상기 이미지에 대한 필터링을 수행하는 단계 및 상기 필터링 결과를 출력하는 단계를 포함하며, 상기 필터링을 수행하는 단계는, 상기 통합 매트릭스와 상기 가중치 매트릭스에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득하는 단계, 상기 컨벌루션 매트릭스를 이용하여 상기 이미지의 각 픽셀 영역들의 특성을 필터링하는 단계를 포함하며, 상기 가중치 매트릭스는, CNN 학습된 복수의 매트릭스를 인터리브드(interleaved) 형태로 통합한 매트릭스이고, 상기 통합 매트릭스는, 상기 가중치 매트릭스와 연산이 가능한 개수의 행 및 열을 가지는 매트릭스이다.
또한, 상기 통합 매트릭스를 구성하는 각 행과, 상기 가중치 매트릭스의 대응되는 열 간의 행렬 곱을 각각 병렬적으로 수행하는 복수의 코어를 포함할 수 있다.
여기서, 상기 필터링을 수행하는 단계는, 바이어스 매트릭스를 상기 컨벌루션 매트릭스에 합산하는 단계를 포함할 수 있다.
또한, 상기 필터링을 수행하는 단계는, 제1 및 제2 바이어스 매트릭스 중 하나를 선택적으로 상기 컨벌루션 매트릭스에 합산하는 단계를 포함하고, 상기 제1 바이어스 매트릭스는 1로 구성된 매트릭스이고, 상기 제2 바이어스 매트릭스는 0으로 구성된 매트릭스일 수 있다.
여기서, 상기 필터링을 수행하는 단계는, 상기 제1 및 제2 바이어스 매트릭스 중 하나가 합산된 컨벌루션 매트릭스에 활성화 함수를 적용하여, 복수의 출력 레이어를 획득하는 단계, 상기 복수의 출력 레이어에 기초하여 FC(fully-connected) 레이어를 획득하는 단계 및 상기 FC 레이어에 포함된 각 영역들의 클래스 점수에 따라, 각 영역들의 특성을 식별하는 단계를 포함할 수 있다.
또한, 상기 FC 레이어를 획득하는 단계는, 상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 합산하여, 상기 FC 레이어를 획득할 수 있다.
또한, 상기 FC 레이어를 획득하는 단계는, 상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 비교하고, 가장 큰 값을 가지는 값들을 집산하여, 상기 FC 레이어를 획득할 수 있다.
또한, 상기 필터링에 사용되는 파라미터값들 및 명령어를 상기 통합 매트릭스와 함께 이미지 프로세서로 일괄 전송하는 단계를 포함하고, 상기 필터링은 상기 이미지 프로세서에 의해 수행될 수 있다.
또한, 상기 필터링을 수행하는 단계는, 상기 필터링을 복수 회 반복하여 수행할 수 있다.
한편, 본 개시의 일 실시 예에 따른 전자 장치의 프로세서에 의해 실행되는 경우 상기 전자 장치가 동작을 수행하도록 컴퓨터 명령을 저장하는 비일시적 컴퓨터 판독 가능 매체에 있어서, 상기 동작은, 이미지가 수신되면, 상기 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환하는 단계, CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스 및 상기 통합 매트릭스를 이용하여 상기 이미지에 대한 필터링을 수행하는 단계 및 상기 필터링 결과를 출력하는 단계를 포함하며, 상기 필터링을 수행하는 단계는, 상기 통합 매트릭스와 상기 가중치 매트릭스에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득하는 단계, 상기 컨벌루션 매트릭스를 이용하여 상기 이미지의 각 픽셀 영역들의 특성을 필터링하는 단계를 포함하며, 상기 가중치 매트릭스는, CNN 학습된 복수의 매트릭스를 인터리브드(interleaved) 형태로 통합한 매트릭스이고, 상기 통합 매트릭스는, 상기 가중치 매트릭스와 연산이 가능한 개수의 행 및 열을 가지는 매트릭스일 수 있다.
이상과 같은 본 발명의 다양한 실시 예에 따르면, 전자 장치는 CNN(Convolution Neural Network) 학습(training)된 가중치 매트릭스 및 바이어스 매트릭스를 이용하여 프로세서와 이미지 프로세서 간 데이터 송수신에 따른 딜레이 시간을 최소화하면서 제공할 수 있다.
도 1은 본 개시의 일 실시 예에 따른 전자 장치를 설명하기 위한 블록도이다.
도 2는 본 개시의 일 실시 예에 따른 전자 장치의 세부 구성을 나타내는 블록도이다.
도 3은 본 개시의 일 실시 예에 따른 행렬 곱을 설명하기 위한 도면이다.
도 4는 본 개시의 일 실시 예에 따른 활성화 함수를 설명하기 위한 도면이다.
도 5는 본 개시의 일 실시 예에 따른 필터링 결과를 획득하기 위한 동작 방법을 설명하기 위한 흐름도이다.
도 6은 본 개시의 일 실시 예에 따른 필터링 결과를 획득하기 위한 명령어를 설명하기 위한 도면이다.
도 7은 본 개시의 일 실시 예에 따른 필터링 결과를 획득하기 위한 명령어를 설명하기 위한 도면이다.
도 8는 본 발명의 일 실시 예에 따른 전자 장치의 제어 방법을 설명하기 위한 흐름도이다.
-
본 명세서에서 사용되는 용어에 대해 간략히 설명하고, 본 개시에 대해 구체적으로 설명하기로 한다. 
본 개시의 실시 예에서 사용되는 용어는 본 개시에서의 기능을 고려하면서 가능한 현재 널리 사용되는 일반적인 용어들을 선택하였으나, 이는 당 분야에 종사하는 기술자의 의도 또는 판례, 새로운 기술의 출현 등에 따라 달라질 수 있다. 또한, 특정한 경우는 출원인이 임의로 선정한 용어도 있으며, 이 경우 해당되는 개시의 설명 부분에서 상세히 그 의미를 기재할 것이다. 따라서 본 개시에서 사용되는 용어는 단순한 용어의 명칭이 아닌, 그 용어가 가지는 의미와 본 개시의 전반에 걸친 내용을 토대로 정의되어야 한다.
본 개시의 실시 예들은 다양한 변환을 가할 수 있고 여러 가지 실시 예를 가질 수 있는바, 특정 실시 예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나 이는 특정한 실시 형태에 대해 범위를 한정하려는 것이 아니며, 개시된 사상 및 기술 범위에 포함되는 모든 변환, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 실시 예들을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.
제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 구성요소들은 용어들에 의해 한정되어서는 안 된다. 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "구성되다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.
본 개시에서 "모듈" 혹은 "부"는 적어도 하나의 기능이나 동작을 수행하며, 하드웨어 또는 소프트웨어로 구현되거나 하드웨어와 소프트웨어의 결합으로 구현될 수 있다. 또한, 복수의 "모듈" 혹은 복수의 "부"는 특정한 하드웨어로 구현될 필요가 있는 "모듈" 혹은 "부"를 제외하고는 적어도 하나의 모듈로 일체화되어 적어도 하나의 프로세서(미도시)로 구현될 수 있다.
아래에서는 첨부한 도면을 참고하여 본 개시의 실시 예에 대하여 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 개시는 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시 예에 한정되지 않는다. 그리고 도면에서 본 개시를 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.
도 1은 본 개시의 일 실시 예에 따른 전자 장치(100)를 설명하기 위한 블록도이다.
도 1에 도시된 바와 같이 전자 장치(100)는 메모리(110), 프로세서(120), 이미지 프로세서(130), 디스플레이(140)를 포함한다.
본 개시의 일 실시 예에 따른 전자 장치(100)는 인공 지능 학습이 가능한 장치일 수 있다. 예를 들어, 사용자 단말 장치, 디스플레이 장치, 셋톱 박스(set-top box), 태블릿 PC(tablet personal computer), 스마트 폰(smart phone), 전자책 리더기(e-book reader), 데스크탑 PC (desktop PC), 랩탑 PC(laptop PC), 워크스테이션(workstation), 서버, PDA(personal digital assistant), PMP(portable multimedia player), MP3 플레이어 등일 수 있다. 또는, 전자 장치(100)는 클라우딩 컴퓨팅 환경이 구축된 시스템 자체를 의미할 수도 있다. 다만, 이에 한정되는 것은 아니며, 전자 장치(100)는 인공 지능 학습이 가능한 장치라면 어떤 장치라도 무방하다.
메모리(110)는 CNN(Convolution Neural Network, 컨볼루션 신경망) 학습(training)된 가중치(Weight) 매트릭스를 저장할 수 있다. 여기서, CNN은 음성처리, 이미지 처리 등을 위해 고안된 특수한 연결구조를 가진 다층신경망이다. 특히, CNN은 픽셀에 전처리를 통하여 이미지를 다양하게 필터링하고, 이미지의 특성을 인식할 수 있다.
메모리(110)는 복수의 이미지를 포함하는 기본 데이터로 CNN 학습된 매트릭스를 포함하는 이미지 처리 모델을 저장할 수 있다. 기본 데이터로부터 학습된 매트릭스는 필터, 커널, 가중치 매트릭스 등 다양하게 불릴 수 있으나, 이하에서는 설명의 편의를 위해 가중치 매트릭스로 통칭하도록 한다.
본 개시의 일 실시 예에 따른 메모리(110)는 바이어스(bias) 매트릭스를 더 포함할 수 있다. 여기서, 바이어스 매트릭스는 상수로 구성된 매트릭스를 의미한다. 일 실시 예에 따른 전자 장치(100)는 이미지에 대한 필터링 과정에서 바이어스 매트릭스를 이용하여 필터링 결과를 획득할 수 있다. 여기서, 바이어스 매트릭스는 CNN 학습된 가중치 매트릭스를 포함하는 이미지 처리 모델이 과적합(overfitting)되는 것을 방지하기 위한 구성이다. 여기서, 과적합은 전자 장치(100)가 기본 데이터에 포함된 이미지에 가중치 매트릭스를 적용하여 이미지의 특성을 획득한 경우에는, 획득된 이미지의 특성과 이미지의 실제 특성이 일치하는데 반하여, 다른 이미지(예를 들어, 실시간으로 수신된 이미지)에 가중치 매트릭스를 적용하여 획득한 이미지의 특성은 이미지의 실제 특성과 일치하지 않는 경우가 빈번하게 발행하는 것을 의미한다.
프로세서(120)는 전자 장치(100)의 동작을 전반적으로 제어한다.
일 실시 예에 따라 프로세서(120)는 디지털 시그널 프로세서(digital signal processor(DSP), 마이크로 프로세서(microprocessor), TCON(Time controller)으로 구현될 수 있다. 다만, 이에 한정되는 것은 아니며, 중앙처리장치(central processing unit(CPU)), MCU(Micro Controller Unit), MPU(micro processing unit), 컨트롤러(controller), 어플리케이션 프로세서(application processor(AP)), 또는 커뮤니케이션 프로세서(communication processor(CP)), ARM 프로세서 중 하나 또는 그 이상을 포함하거나, 해당 용어로 정의될 수 있다. 또한, 프로세서(140)는 프로세싱 알고리즘이 내장된 SoC(System on Chip), LSI(large scale integration)로 구현될 수도 있고, FPGA(Field Programmable gate array) 형태로 구현될 수도 있다.
프로세서(120)는 이미지가 수신되면, 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환할 수 있다. 여기서, 이미지는 전자 장치(100)가 실시간으로 수신하는 영상, 컨텐츠 등 다양한 유형의 이미지를 의미한다. 색성분은 이미지의 각 픽셀에 대응되는 픽셀값을 의미할 수 있다. 예를 들어, 수신된 이미지의 각 픽셀이 8bit를 통해 표현되는 경우, 하나의 픽셀은 0~255의 총 256개의 색성분 중 하나를 갖는다. 이에 따라, 프로세서(120)는 수신된 이미지를 각 픽셀값을 이용하여 매트릭스로 변환할 수 있다.
본 개시의 일 실시 예에 따른 프로세서(120)는 수신된 이미지가 다 채널의 데이터이면, 각 채널 별 매트릭스를 획득하고, 획득된 복수의 매트릭스를 하나의 통합 매트릭스로 변환할 수 있다. 일 예로, 수신된 이미지는 R, G, B의 3 채널 데이터이고, 프로세서(120)는 R, G, B 각각에 대응되는 매트릭스를 획득할 수 있다. 이에 대한 구체적인 설명은 도 3에서 하도록 한다.
본 개시의 일 실시 예에 따른 프로세서(120)는 이미지 프로세서(130)가 수신된 이미지에 대한 필터링을 수행하도록 제어할 수 있다. 또한, 필터링 결과를 출력하도록 디스플레이(140)를 제어할 수 있다.
이미지 프로세서(130)는 그래픽 데이터의 처리를 위한 특수 목적 프로세서일 수 있다. 특히, 이미지 프로세서(130)는 변환된 통합 매트릭스를 이용하여 이미지에 대한 필터링을 수행할 수 있다.
이미지 프로세서(130)는 GPU(Graphic Processing Unit)로서, 프로세서(120)와 구별되는 구성 요소로 구현될 수 있으나, 이에 한정되는 것은 아니다. 본 개시의 다양한 실시 예는 프로세서(120)에 의해 수행될 수도 있다. 일 예로, 프로세서(120)의 그래픽 처리부가 본 개시의 다양한 실시 예에 따른 수신된 이미지에 대한 필터링을 수행할 수도 있음은 물론이다.
이미지 프로세서(130)는 연산부(미도시) 및 렌더링부(미도시)를 이용하여 다양한 객체를 포함하는 화면을 생성한다. 연산부는 수신된 제어 명령에 기초하여 화면의 레이아웃에 따라 각 객체들이 표시될 좌표값, 형태, 크기, 컬러 등과 같은 속성값을 연산한다. 렌더링부는 연산부에서 연산한 속성값에 기초하여 객체를 포함하는 다양한 레이아웃의 화면을 생성한다. 렌더링부에서 생성된 화면은 디스플레이(140)의 디스플레이 영역 내에 표시된다.
또한, 이미지 프로세서(130)는 이미지 데이터에 대한 처리를 수행하는 구성요소이다. 이미지 프로세서(130)에서는 이미지 데이터에 대한 디코딩, 스케일링, 노이즈 필터링, 프레임 레이트 변환, 해상도 변환 등과 같은 다양한 이미지 처리를 수행할 수 있다.
특히, 이미지 프로세서(130)는 통합 매트릭스와 가중치 매트릭스에 대한 컨벌루션을 수행하여 컨벌루션 매트릭스를 획득할 수 있다. 여기서, 컨벌루션은 가중치 매트릭스가 이미지에 대한 매트릭스를 영역 별로 시프트하면서 행렬 곱을 수행하고, 행렬 곱에 따른 결과값을 산출하는 것을 의미한다. 일 예로, 수신된 이미지에 대한 매트릭스가 7 × 7 이고, 가중치 매트릭스가 3 × 3이면, 가중치 매트릭스는 이미지에 대한 매트릭스 내에서 영역 별로 시프트하면서 행렬 곱을 수행하고, 3 × 3의 출력 매트릭스를 획득할 수 있다. 이하에서는 컨벌루션에 따라 획득된 출력 매트릭스를 컨벌루션 매트릭스로 통칭하도록 한다.
매트릭스의 사이즈는 일 실시 예이며, 이에 한정되는 것은 아니다. 예를 들어, 수신된 이미지에 따라 매트릭스는 다양한 사이즈를 가질 수 있다. 또한, 컨벌루션을 수행하는 과정에서 패딩(padding), 스트라이드(stride)가 수행되어 사이즈가 다양하게 조절될 수도 있음은 물론이다. 여기서, 패딩은 수신된 이미지의 사방에 기설정된 사이즈만큼 특정한 픽셀 값을 채우는 것을 의미한다. 패딩이 수행되면, 이미지에 대한 매트릭스와 컨벌루션 매트릭스가 동일한 사이즈를 가질 수도 있다. 스트라이드는 가중치 매트릭스의 시프트 간격을 의미한다. 예를 들어, 스타라이드(stride=3)이면, 이미지 프로세서(130)는 매트릭스 내에서 세 칸씩 시프트하면서 컨벌루션을 수행할 수 있다.
다만, 본 개시의 일 실시 예에 따른 이미지 프로세서(130)는 컨벌루션을 수행하기 위해 가중치 매트릭스를 이미지에 대한 매트릭스를 영역 별로 시프트하지 않을 수 있다. 변환된 통합 매트릭스는 가중치 매트릭스와 행렬 곱이 가능한 행 및 열을 가지는 매트릭스일 수 있다. 메모리(110)에 저장된 가중치 매트릭스는 인터리브드(interleaved) 형태로 통합된 매트릭스일 수 있다. 여기서, 인터리브드 형태의 매트릭스는 변환된 통합 매트릭스와 행렬 곱이 가능한 행 및 열을 가지는 매트릭스일 수 있다.
일 예로, 프로세서(110)는 수신된 이미지가 2차원의 3×3 매트릭스이면, 4×8의 통합 매트릭스로 변환할 수 있다. 이미지 프로세서(130)는 4×8의 통합 매트릭스와 메모리(110)에 저장된 가중치 매트릭스와 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득할 수 있다. 여기서, 가중치 매트릭스는 4×8의 통합 매트릭스와 행렬 곱을 수행할 수 있는 인터리브드 형태 즉, 8×2의 매트릭스 일 수 있다. 이미지 프로세서(130)는 통합 매트릭스와 가중치 매트릭스 간의 행렬 곱을 수행하여 4×2의 컨벌루션 매트릭스를 획득할 수 있다. 이에 대한 구체적인 설명은 도 3에서 하도록 한다.
본 개시의 일 실시 예에 따른 이미지 프로세서(130)는 복수의 코어를 포함할 수 있다. 이미지 프로세서(130)는 복수의 코어를 이용하여 통합 매트릭스를 구성하는 각 행과 가중치 매트릭스의 대응되는 열 간의 행렬 곱을 각각 병렬적으로 수행할 수 있다. 통합 매트릭스와 가중치 매트릭스 간의 컨벌루션은 통합 매트릭스와 가중치 매트릭스 간의 행렬 곱을 수행하거나, 이미지에 필터 또는 커널을 적용한 것을 의미할 수 있다.
일 예로, 이미지 프로세서(130)가 4×8의 통합 매트릭스와 8×2의 가중치 매트릭스간의 행렬 곱을 수행하는 경우을 상정할 수 있다. 통합 매트릭스의 1행과 가중치 매트릭스의 1열 간의 행렬 곱은 제1 코어에 의해 수행되고, 통합 매트릭스의 1행과 가중치 매트릭스의 2열 간의 행렬 곱은 제2 코어에 의해 수행될 수 있다. 이와 같이, 총 8번의 행렬 곱이 제1 내지 제8 코어 각각에 의해 병렬적으로 수행될 수 있다. 이에 따라, 컨벌루션 매트릭스를 획득하는데 요구되는 시간이 감소할 수 있다. 일 예로, NVIDIA® 社의 GPU는 3,584개의 CUDA® 코어를 포함할 수 있으며, 산술적으로 3,584개의 연산이 병렬적으로 수행할 수 있다.
본 개시의 일 실시 예에 따른 이미지 프로세서(130)는 컨벌루션 매트릭스에 바이어스 매트릭스를 합산할 수 있다. 일 예로, 바이어스 매트릭스는 1×1의 기설정된 값을 가지는 매트릭스일 수 있다. 이미지 프로세서(130)는 컨벌루션 매트릭스에 포함된 모든 원소에 바이어스 매트릭스에 포함된 기설정된 값을 합산할 수 있다.
다른 예로, 이미지 프로세서(130)는 제1 및 제2 바이어스 매트릭스 중 어느 하나를 선택적으로 컨벌루션 매트릭스에 적용할 수 있다. 일 예로, 제1 바이어스 매트릭스는 1로 구성된 1×1의 매트릭스이고, 제2 바이어스는 0으로 구성된 1×1의 매트릭스일 수 있다. 이미지 프로세서(130)는 다양한 목적에 기초하여 제1 및 제2 바이어스 매트릭스 중 어느 하나를 선택적으로 컨벌루션 매트릭스에 합산할 수 있다.
본 개시의 일 실시 예에 따른 이미지 프로세서(140)는 바이어스 매트릭스가 합산된 컨벌루션 매트릭스에 활성화 함수를 적용할 수 있다. 여기서, 활성화 함수(Activation function) Identity Function, Logistic Sigmoid Function, Hyperbolic Tangent(tanh) Function, ReLU Function, Leaky ReLU Function 등 다양한 유형의 함수가 적용될 수 있다. 일 예로, 이미지 프로세서(130)는 RELU 함수 max(0,x)를 모든 요소에 적용할 수 있다.
이미지 프로세서(140)는 활성화 함수를 적용하여 복수의 출력 레이어를 획득하고, 출력 레이어에 기초하여 FC(fully-connected, 완전 연결) 레이어를 획득할 수 있다. 여기서, FC 레이어는 출력 층으로서, FC 레이어에 포함된 각 영역들의 클래스 점수에 따라 각 영역들의 특성을 식별할 수 있다. 일 예로, 클래스 점수는 활성화 함수가 적용된 후 활성화된 양을 의미하고, 이미지 프로세서(130)는 각 활성화 양에 대응되는 카테고리를 식별할 수 있다. 여기서, 식별된 카테고리는 각 영역의 특성을 의미할 수 있다. 예를 들어, FC 레이어에 포함된 각 영역의 클래스 점수에 따라, 각 영역에 포함된 오브젝트(예를 들어, 자동차, 배, 고양이 등)를 식별할 수 있다.
본 개시의 일 실시 예에 따른 이미지 프로세서(130)는 복수의 출력 레이어에서 서로 대응되는 위치의 값을 합산하여, FC 레이어를 획득할 수 있다.
다른 예로, 이미지 프로세서(130)는, 복수의 출력 레이어에서 서로 대응되는 위치의 값을 비교하고, 가장 큰 값을 가지는 값들을 집산하여, FC 레이어를 획득할 수 있다.
디스플레이(140)는 액정 표시 장치(Liquid Crystal Display, LCD), 유기 전기 발광 다이오드(Organic Light Emiiting Display, OLED), LCoS(Liquid Crystal on Silicon) 또는 DLP(Digital Light Processing) 등과 같은 다양한 형태의 디스플레이로 구현될 수 있다. 다만, 이에 한정되는 것은 아니며 이미지를 디스플레이 할 수 있는 다양한 유형의 디스플레이로 구현될 수 있음은 물론이다.
특히, 디스플레이(140)는 프로세서(120)의 제어에 따라 이미지 프로세서(130)의 필터링 결과를 출력할 수 있다.
도 2는 본 개시의 일 실시 예에 따른 전자 장치(100)의 세부 구성을 나타내는 블록도이다.
도 2에 따르면, 전자 장치(100)는 메모리(110), 프로세서(120), 이미지 프로세서(130), 디스플레이(140), 통신부(150), 사용자 인터페이스부(160), 오디오 처리부(170)를 포함한다. 도 2에 도시된 구성요소들 중 도 1에 도시된 구성요소와 중복되는 부분에 대해서는 자세한 설명을 생략하도록 한다.
프로세서(120)는 메모리(110)에 저장된 각종 프로그램을 이용하여 전자 장치(100)의 동작을 전반적으로 제어한다.
구체적으로, 프로세서(120)는 RAM(121), ROM(122), 메인 CPU(123), 그래픽 처리부(124), 제1 내지 n 인터페이스(125-1 ~ 125-n), 버스(126)를 포함한다.
RAM(121), ROM(122), 메인 CPU(123), 그래픽 처리부(124), 제1 내지 n 인터페이스(125-1 ~ 125-n) 등은 버스(126)를 통해 서로 연결될 수 있다.
제1 내지 n 인터페이스(125-1 내지 125-n)는 상술한 각종 구성요소들과 연결된다. 인터페이스들 중 하나는 네트워크를 통해 외부 장치와 연결되는 네트워크 인터페이스가 될 수도 있다.
메인 CPU(123)는 메모리(110)에 액세스하여, 메모리(110)에 저장된 O/S를 이용하여 부팅을 수행한다. 그리고, 메모리(110)에 저장된 각종 프로그램 등을 이용하여 다양한 동작을 수행한다.
ROM(122)에는 시스템 부팅을 위한 명령어 세트 등이 저장된다. 턴온 명령이 입력되어 전원이 공급되면, 메인 CPU(123)는 ROM(122)에 저장된 명령어에 따라 메모리(110)에 저장된 O/S를 RAM(121)에 복사하고, O/S를 실행시켜 시스템을 부팅시킨다. 부팅이 완료되면, 메인 CPU(123)는 메모리(110)에 저장된 각종 어플리케이션 프로그램을 RAM(121)에 복사하고, RAM(121)에 복사된 어플리케이션 프로그램을 실행시켜 각종 동작을 수행한다.
본 개시의 일 실시 예에 따른 프로세서(120)는 이미지 프로세서(130)가 필터링을 수행하는데 사용되는 파라미터값들 및 명령어를 통합 매트릭스와 함께 이미지 프로세서(130)로 일괄 전송할 수 있다. 이에 따라, 프로세서(120)와 이미지 프로세서(130) 간의 데이터 송수신으로 인한 딜레이 시간을 최소화시킬 수 있다. 이에 대한 구체적인 설명은 도 5 내지 7에서 하도록 한다.
본 개시의 일 실시 예에 따른 프로세서(120)는, 필터링을 복수 회 반복하여 수행하도록 이미지 프로세서를 제어할 수 있다.
한편, 상술한 프로세서(120)의 동작은 메모리(110)에 저장된 프로그램에 의해 이루어질 수 있다.
메모리(110)는 전자 장치(100)를 구동시키기 위한 O/S(Operating System) 소프트웨어 모듈, 가중치 매트릭스 및 바이어스 매트릭스를 포함하는 이미지 처리 모델, CNN 학습 모듈 등과 같이 다양한 데이터를 저장한다.
메모리(110)는 프로세서(120)에 포함된 롬(ROM), 램(RAM) 등의 내부 메모리로 구현되거나, 프로세서(120)와 별도의 메모리로 구현될 수도 있다. 이 경우, 메모리(110)는 데이터 저장 용도에 따라 전자 장치(100)에 임베디드된 메모리 형태로 구현되거나, 전자 장치(100)에 탈부착이 가능한 메모리 형태로 구현될 수도 있다. 예를 들어, 전자 장치(100)의 구동을 위한 데이터의 경우 전자 장치(100)에 임베디드된 메모리에 저장되고, 전자 장치(100)의 확장 기능을 위한 데이터의 경우 전자 장치(100)에 탈부착이 가능한 메모리에 저장될 수 있다. 한편, 전자 장치(100)에 임베디드된 메모리의 경우 비휘발성 메모리, 휘발성 메모리, 하드 디스크 드라이브(HDD) 또는 솔리드 스테이트 드라이브(SSD) 등과 같은 형태로 구현되고, 전자 장치(100)에 탈부착이 가능한 메모리의 경우 메모리 카드(예를 들어, micro SD 카드, USB 메모리 등), USB 포트에 연결가능한 외부 메모리(예를 들어, USB 메모리) 등과 같은 형태로 구현될 수 있다.
통신부(150)는 다양한 유형의 통신방식에 따라 다양한 유형의 외부 장치와 통신을 수행하는 구성이다. 통신부(150)는 와이파이 칩(151), 블루투스 칩(152), 무선 통신 칩(153), NFC 칩(154) 등을 포함한다. 프로세서(120)는 통신부(150)를 이용하여 각종 외부 장치와 통신을 수행한다.
와이파이 칩(151), 블루투스 칩(152)은 각각 WiFi 방식, 블루투스 방식으로 통신을 수행한다. 와이파이 칩(151)이나 블루투스 칩(152)을 이용하는 경우에는 SSID 및 세션 키 등과 같은 각종 연결 정보를 먼저 송수신하여, 이를 이용하여 통신 연결한 후 각종 정보들을 송수신할 수 있다. 무선 통신 칩(153)은 IEEE, 지그비(zigbee), 3G(3rd Generation), 3GPP(3rd Generation Partnership Project), LTE(Long Term Evoloution) 등과 같은 다양한 통신 규격에 따라 통신을 수행하는 칩을 의미한다. NFC 칩(154)은 135kHz, 13.56MHz, 433MHz, 860~960MHz, 2.45GHz 등과 같은 다양한 RF-ID 주파수 대역들 중에서 13.56MHz 대역을 사용하는 NFC(Near Field Communication) 방식으로 동작하는 칩을 의미한다.
프로세서(120)는 통신부(150)를 통해 외부 장치로부터 이미지, 가중치 매트릭스, 바이어스 매트릭스 및 활성화 함수를 포함하는 이미지 처리 모델을 수신할 수도 있다.
사용자 인터페이스부(160)는 다양한 사용자 인터랙션(interaction)을 수신한다. 여기서, 사용자 인터페이스부(160)는 전자 장치(100)의 구현 예에 따라 다양한 형태로 구현 가능하다. 예를 들어, 사용자 인터페이스부(160)는 전자 장치(100)에 구비된 버튼, 사용자 음성을 수신하는 마이크, 사용자 모션을 감지하는 카메라 등일 수 있다. 또는, 전자 장치(100)가 터치 기반의 전자 장치로 구현되는 경우 사용자 인터페이스부(160)는 터치패드와 상호 레이어 구조를 이루는 터치 스크린 형태로 구현될 수도 있다. 이 경우, 사용자 인터페이스부(160)는 상술한 디스플레이(140)로 사용될 수 있게 된다.
오디오 처리부(160)는 오디오 데이터에 대한 처리를 수행하는 구성요소이다. 오디오 처리부(160)에서는 오디오 데이터에 대한 디코딩이나 증폭, 노이즈 필터링 등과 같은 다양한 처리가 수행될 수 있다.
도 3은 본 개시의 일 실시 예에 따른 행렬 곱을 설명하기 위한 도면이다.
도 3에 따르면, 수신된 이미지가 다 차원이면, 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 이미지에 대한 복수의 매트릭스(10)를 획득할 수 있다. 예를 들어, 수신된 이미지가 2차원이면 이미지에 대한 매트릭스를 2개 획득할 수 있다. 프로세서(120)는 이미지에 대한 복수의 매트릭스(10)를 하나의 통합 매트릭스(10-1)로 변환할 수 있다.
이미지 프로세서(130)는 통합 매트릭스(10-1)와 가중치 매트릭스(20) 간에 행렬 곱을 수행하기 위해 가중치 매트릭스(20)를 인터리브드(interleaved) 형태의 매트릭스(20-1)로 변환할 수 있다. 다만, 본 발명의 일 실시 예에 따른 전자 장치(100)는 가중치 매트릭스(20)를 인터리브드 형태의 매트릭스(20-1)로 기저장하고 있을 수 있다. 이에 따라, 이미지 프로세서(130)는 가중치 매트릭스(20)를 인터리브드 형태의 매트릭스(20-1)로 변환할 필요 없이, 기저장된 인터리브드 형태의 매트릭스(20-1)를 이용하여 행렬 곱을 수행할 수 있다.
예를 들어, 프로세서(120)는 3 ×3 ×2의 매트릭스(10)를 4 ×8 ×1의 통합 매트릭스(10-1)로 변환할 수 있다. 인터리브드 형태의 매트릭스(20-1)는 8×4 ×1의 사이즈를 가진다. 이미지 프로세서(130)는 가중치 매트릭스(20)의 사이즈를 2 ×2 ×2에서 8×2 ×1로 변형하는 과정 없이 기저장된 인터리브드 형태의 매트릭스(20-1)를 이용하여 행렬 곱을 수행할 수 있다.
한편, 이미지에 대한 매트릭스(10)와 가중치 매트릭스(20) 간의 컨벌루션은 가중치 매트릭스(20)의 시프트가 요구되며 연산 과정이 복잡한 단점이 있다. 출력 레이어(30)를 획득하기 위해 요구되는 연산 시간 및 리소스가 높다.
통합 매트릭스(10-1)와 인터리브드 형태의 매트릭스(20-1) 간의 행렬 곱은 통합 매트릭스(10-1)의 행과 인터리브드 형태의 매트릭스(20-1)의 열의 행렬 곱만 수행하므로, 컨벌루션 매트릭스(30-1)를 획득하기 위해 요구되는 연산 시간 및 리소스가 적다.
본 개시의 일 실시 예에 따른 이미지 프로세서(130)는 복수의 코어를 포함하고 있을 수 있다. 복수의 코어 각각이 통합 매트리스(10-1)의 행과 인터리브드 형태의 매트릭스(20-1)의 열의 행렬 곱을 병렬적으로 수행할 수 있다.
본 개시의 일 실시 예에 따른 이미지 프로세서(130)는 컨벌루션 매트릭스(30-1)에 기초하여 출력 레이어(30)를 획득할 수 있다.
이하에서는, 컨벌루션 매트릭스(30-1)에 바이어스 매트릭스 및 활성화 함수를 적용하는 실시 예에 대해 설명하도록 한다.
도 4는 본 개시의 일 실시 예에 따른 활성화 함수를 설명하기 위한 도면이다.
컨벌루션 매트릭스(30-1)에 바이어스 매트릭스를 합산할 수 있다. 일 예로, 바이어스 매트릭스는 1×1의 기설정된 값을 가지는 매트릭스일 수 있다. 이미지 프로세서(130)는 컨벌루션 매트릭스(30-1)에 포함된 모든 원소에 바이어스 매트릭스에 포함된 기설정된 값을 합산할 수 있다.
이미지 프로세서(130)는 컨벌루션 매트릭스(30-1)에 활성화 함수를 적용할 수 있다. 행렬 곱(또는, 컨벌루션, 필터, 커널)을 통해 획득한 컨벌루션 매트릭스(또는, 특성 맵, Feature map)에 활성화 함수를 적용함에 따라 이미지에 특정한 오브젝트가 포함되어 있는지 유무를 식별할 수 있다. 일 예로, CNN 모델에서 ReLu 함수를 적용할 수 있다. RELU 함수는 도 4에 도시된 바와 같이 max(0,x), 음수들을 모두 0으로 처리할 수 있다. 다만, 이에 한정되는 것은 아니며 Sigmoid(또는 tanh) 활성화 함수를 적용할 수도 있음은 물론이다.
도 5는 본 개시의 일 실시 예에 따른 필터링 결과를 획득하기 위한 동작 방법을 설명하기 위한 흐름도이다.
도 5에 따르면, 이미지가 수신되면(S510), 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환할 수 있다(S520). 일 예로, 프로세서(120)는 im2col 명령어를 이용하여 이미지에 대한 매트릭스(10)를 통합 매트릭스(10-1)로 변환할 수 있다.
이어서, 이미지 프로세서(130)는 통합 매트릭스(10-1)와 인터리브드 형태의 가중치 매트릭스(20-1)에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스(30-1)를 획득하고, 컨벌루션 매트릭스(30-1)에 바이어스 매트릭스를 합산하고, 활성화 함수를 적용할 수 있다(S530).
본 개시의 일 실시 예에 따른 프로세서(120)는 S530 단계에 사용되는 파라미터값들 및 명령어를 통합 매트릭스(10-1)와 함께 이미지 프로세서(130)로 일괄 전송하여 이미지 프로세서(130)가 S530 단계를 수행하도록 이미지 프로세서를 제어할 수 있다. 이에 따라, 프로세서(120)와 이미지 프로세서(130) 간의 데이터 송수신에 따른 딜레이 시간을 최소화할 수 있다.
전자 장치(100)는 S530 단계에서 획득한 이미지 프로세서(130)의 필터링 결과를 출력할 수 있다(S540).
도 6 및 도 7은 본 개시의 일 실시 예에 따른 필터링 결과를 획득하기 위한 명령어를 설명하기 위한 도면이다.
도 6에 따르면, S510 단계에서 프로세서(130)는 a = im2con(input) 명령어에 따라 이미지에 대한 복수의 매트릭스(10)를 하나의 통합 매트릭스(10-1)로 변환할 수 있다.
도 5 및 도 6에 따르면, transpose 단계에서 프로세서(100)의 제어에 따라 이미지 프로세서(130)는 통합 매트릭스에 대해 aTrans = trans(a)를 수행하고, interleave 단계에서 b = interleave(weights)를 수행하여 가중치 매트릭스(20)를 인터리브드 형태의 매트릭스(20-1)로 변환할 수 있다.
이어서, 프로세서(120)의 제어에 따라 이미지 프로세서(130)는 convolution 단계에서 c=gemm(aTrans, b, 1, 0)에 따라 컨벌루션을 수행하고, 컨벌루션 매트릭스(30-1)를 획득할 수 있다. 이어서, 프로세서(120)의 제어에 따라 이미지 프로세서(130)는 Bias GEMM 단계에서 biasMatrix = gemm(bias, constants, 1, 0)에 따라 컨벌루션 매트릭스(30-1)와 합산 가능한 형태의 바이어스 매트릭스를 획득할 수 있다.
이어서, 프로세서(120)의 제어에 따라 이미지 프로세서(130)는 바이어스 매트릭스가 합산된 컨벌루션 매트릭스에 ReLu 함수를 적용할 수 있다.
이와 같이, 각 단계가 이미지 프로세서(130)에 대한 프로세서(120)의 명령어, 파라미터 등의 전송이 요구된다. 프로세서(120)와 이미지 프로세서(130) 간의 명령어, 파라미터 및 데이터 등의 송수신에 따라 딜레이 시간이 발생하게 된다.
이하에서는 본 개시의 일 실시 예에 따른 이미지 프로세서(130)의 필터링 수행 방법을 설명하도록 한다.
도 7에 따르면, S510 단계에서 프로세서(130)는 a = im2con(input) 명령어에 따라 이미지에 대한 복수의 매트릭스(10)를 하나의 통합 매트릭스(10-1)로 변환할 수 있다.
도 5 및 도 7에 따르면, S530 단계에서 프로세서(100)의 제어에 따라 이미지 프로세서(130)는 통합 매트릭스에 대해 output = cbr(a, interleaved Weights, bias) 수행하여 출력 레이어(30)를 획득할 수 있다.
가중치 매트릭스(20) 및 바이어스 매트릭스가 각각 통합 매트릭스와 행렬 곱 및 합산 가능한 형태로 기저장되어 있을 수 있다. 이에 따라, 이미지 프로세서(130)는 도 5의 Transpose, Interleave, Bias GEMM 단계를 수행하기 위한 프로세서(120)의 명령어 및 파라미터 전송이 요구되지 않을 수 있다.
프로세서(120)는 필터링에 사용되는 파라미터값들 및 명령어(예를 들어, output = cbr(a, interleaved Weights, bias))를 통합 매트릭스와 함께 이미지 프로세서로 일괄 전송하고, 이미지 프로세서(130)는 프로세서(120)의 추가적인 명령어 및 파라미터 전송 없이도 필터링을 수행하여 필터링 결과(예를 들어, 출력 레이어)를 획득할 수 있다. 프로세서(120)와 이미지 프로세서(130) 간의 명령어, 파라미터 및 데이터 등의 송수신에 최소화됨에 따라 딜레이 시간이 줄어들 수 있다.
도 8는 본 발명의 일 실시 예에 따른 전자 장치의 제어 방법을 설명하기 위한 흐름도이다.
도 8에 도시된 전자 장치의 제어 방법에 따르면, 이미지가 수신되면, 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환한다(S810).
이어서, 통합 매트릭스와 CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득한다(S820).
이어서, 컨벌루션 매트릭스를 이용하여 이미지의 각 필셀 영역들의 특성을 필터링을 수행한다(S830).
이어서, 필터링 결과를 출력한다(S840).
여기서, 전자 장치는 통합 매트릭스를 구성하는 각 행과, 가중치 매트릭스의 대응되는 열 간의 행렬 곱을 각각 병렬적으로 수행하는 복수의 코어를 포함할 수 있다.
또한, 필터링을 수행하는 S830 단계는, 바이어스 매트릭스를 컨벌루션 매트릭스에 합산하는 단계를 포함할 수 있다.
또한, 필터링을 수행하는 S830 단계는, 제1 및 제2 바이어스 매트릭스 중 하나를 선택적으로 컨벌루션 매트릭스에 합산하는 단계를 포함하고, 제1 바이어스 매트릭스는 1로 구성된 매트릭스이고, 제2 바이어스 매트릭스는 0으로 구성된 매트릭스일 수 있다.
여기서, 필터링을 수행하는 S830 단계는, 제1 및 제2 바이어스 매트릭스 중 하나가 합산된 컨벌루션 매트릭스에 활성화 함수를 적용하여, 복수의 출력 레이어를 획득하는 단계, 복수의 출력 레이어에 기초하여 FC(fully-connected) 레이어를 획득하는 단계 및 FC 레이어에 포함된 각 영역들의 클래스 점수에 따라, 각 영역들의 특성을 식별하는 단계를 포함할 수 있다.
여기서, FC 레이어를 획득하는 단계는, 복수의 출력 레이어에서 서로 대응되는 위치의 값을 합산하여, FC 레이어를 획득할 수 있다.
또한, FC 레이어를 획득하는 단계는, 복수의 출력 레이어에서 서로 대응되는 위치의 값을 비교하고, 가장 큰 값을 가지는 값들을 집산하여, FC 레이어를 획득할 수 있다.
또한, 필터링에 사용되는 파라미터값들 및 명령어를 통합 매트릭스와 함께 이미지 프로세서로 일괄 전송하는 단계를 포함하고, 필터링은 이미지 프로세서에 의해 수행될 수 있다.
또한, 필터링을 수행하는 S830 단계는, 필터링을 복수 회 반복하여 수행할 수 있다.
한편, 이상에서 설명된 다양한 실시 예들은 소프트웨어(software), 하드웨어(hardware) 또는 이들의 조합을 이용하여 컴퓨터(computer) 또는 이와 유사한 장치로 읽을 수 있는 기록 매체 내에서 구현될 수 있다. 일부 경우에 있어 본 명세서에서 설명되는 실시 예들이 프로세서 자체로 구현될 수 있다. 소프트웨어적인 구현에 의하면, 본 명세서에서 설명되는 절차 및 기능과 같은 실시 예들은 별도의 소프트웨어 모듈들로 구현될 수 있다. 소프트웨어 모듈들 각각은 본 명세서에서 설명되는 하나 이상의 기능 및 작동을 수행할 수 있다.
한편, 상술한 본 개시의 다양한 실시 예들에 따른 처리 동작을 수행하기 위한 컴퓨터 명령어(computer instructions)는 비일시적 컴퓨터 판독 가능 매체(non-transitory computer-readable medium) 에 저장될 수 있다. 이러한 비일시적 컴퓨터 판독 가능 매체에 저장된 컴퓨터 명령어는 프로세서에 의해 실행되었을 때 상술한 다양한 실시 예에 따른 처리 동작을 특정 기기가 수행하도록 할 수 있다.
비일시적 컴퓨터 판독 가능 매체란 레지스터, 캐쉬, 메모리 등과 같이 짧은 순간 동안 데이터를 저장하는 매체가 아니라 반영구적으로 데이터를 저장하며, 기기에 의해 판독(reading)이 가능한 매체를 의미한다. 비일시적 컴퓨터 판독 가능 매체의 구체적인 예로는, CD, DVD, 하드 디스크, 블루레이 디스크, USB, 메모리카드, ROM 등이 있을 수 있다.
이상에서는 본 개시의 바람직한 실시 예에 대하여 도시하고 설명하였지만, 본 개시는 상술한 특정의 실시 예에 한정되지 아니하며, 청구범위에서 청구하는 본 개시의 요지를 벗어남이 없이 당해 개시에 속하는 기술분야에서 통상의 지식을 가진자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 개시의 기술적 사상이나 전망으로부터 개별적으로 이해되어져서는 안될 것이다.

Claims (15)

  1. CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스가 저장된 메모리;
    이미지가 수신되면, 상기 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환하는 프로세서;
    상기 프로세서에서 변환된 상기 통합 매트릭스를 이용하여 상기 이미지에 대한 필터링을 수행하는 이미지 프로세서; 및
    상기 프로세서의 제어에 따라, 상기 이미지 프로세서의 필터링 결과를 출력하는 디스플레이;를 포함하며,
    상기 이미지 프로세서는,
    상기 통합 매트릭스와 상기 가중치 매트릭스에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득하고, 상기 컨벌루션 매트릭스를 이용하여 상기 이미지의 각 픽셀 영역들의 특성을 필터링하고,
    상기 가중치 매트릭스는, CNN 학습된 복수의 매트릭스를 인터리브드(interleaved) 형태로 통합한 매트릭스이고,
    상기 통합 매트릭스는 상기 가중치 매트릭스와 연산이 가능한 개수의 행 및 열을 가지는 매트릭스인, 전자 장치.
  2. 제1항에 있어서,
    상기 이미지 프로세서는,
    상기 통합 매트릭스를 구성하는 각 행과, 상기 가중치 매트릭스의 대응되는 열 간의 행렬 곱을 각각 병렬적으로 수행하는 복수의 코어를 포함하는, 전자 장치.
  3. 제1항에 있어서,
    상기 메모리는, 바이어스 매트릭스를 더 포함하며,
    상기 이미지 프로세서는, 상기 컨벌루션 매트릭스에 상기 바이어스 매트릭스를 상기 컨벌루션 매트릭스에 합산하는, 전자 장치.
  4. 제1항에 있어서,
    상기 메모리는, 제1 바이어스 매트릭스 및 제2 바이어스 매트릭스를 더 포함하며,
    상기 이미지 프로세서는, 상기 제1 및 상기 제2 바이어스 매트릭스 중 하나를 선택적으로 상기 컨벌루션 매트릭스에 합산하는, 전자 장치.
  5. 제4항에 있어서,
    상기 이미지 프로세서는,
    상기 제1 및 제2 바이어스 매트릭스 중 하나가 합산된 컨벌루션 매트릭스에 활성화 함수를 적용하여, 복수의 출력 레이어를 획득하고,
    상기 복수의 출력 레이어에 기초하여 FC(fully-connected) 레이어를 획득하며,
    상기 FC 레이어에 포함된 각 영역들의 클래스 점수에 따라, 각 영역들의 특성을 식별하는, 전자 장치.
  6. 제5항에 있어서,
    상기 이미지 프로세서는,
    상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 합산하여, 상기 FC 레이어를 획득하는, 전자 장치.
  7. 제5항에 있어서,
    상기 이미지 프로세서는,
    상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 비교하고, 가장 큰 값을 가지는 값들을 집산하여, 상기 FC 레이어를 획득하는, 전자 장치.
  8. 제1항에 있어서,
    상기 프로세서는,
    상기 필터링에 사용되는 파라미터값들 및 명령어를 상기 통합 매트릭스와 함께 상기 이미지 프로세서로 일괄 전송하여 상기 필터링을 수행하도록 상기 이미지 프로세서를 제어하는, 전자 장치.
  9. 제1항에 있어서,
    상기 프로세서는,
    상기 필터링을 복수 회 반복하여 수행하도록 상기 이미지 프로세서를 제어하는, 전자 장치.
  10. 이미지를 처리하기 위한 전자 장치의 제어 방법에 있어서,
    이미지가 수신되면, 상기 이미지의 각 픽셀을 구성하는 색성분들을 나타내는 매트릭스들을 하나의 통합 매트릭스로 변환하는 단계;
    CNN(Convolution Neural Network) 학습(training)된 가중치(weight) 매트릭스 및 상기 통합 매트릭스를 이용하여 상기 이미지에 대한 필터링을 수행하는 단계; 및
    상기 필터링 결과를 출력하는 단계;를 포함하며,
    상기 필터링을 수행하는 단계는,
    상기 통합 매트릭스와 상기 가중치 매트릭스에 대한 행렬 곱을 수행하여 컨벌루션 매트릭스를 획득하는 단계;
    상기 컨벌루션 매트릭스를 이용하여 상기 이미지의 각 픽셀 영역들의 특성을 필터링하는 단계;를 포함하며,
    상기 가중치 매트릭스는, CNN 학습된 복수의 매트릭스를 인터리브드(interleaved) 형태로 통합한 매트릭스이고,
    상기 통합 매트릭스는, 상기 가중치 매트릭스와 연산이 가능한 개수의 행 및 열을 가지는 매트릭스인, 제어 방법.
  11. 제10항에 있어서,
    상기 통합 매트릭스를 구성하는 각 행과, 상기 가중치 매트릭스의 대응되는 열 간의 행렬 곱을 각각 병렬적으로 수행하는 복수의 코어를 포함하는, 전자 장치.
  12. 제10항에 있어서,
    상기 필터링을 수행하는 단계는,
    바이어스 매트릭스를 상기 컨벌루션 매트릭스에 합산하는 단계를 포함하는, 제어 방법.
  13. 제10항에 있어서,
    상기 필터링을 수행하는 단계는,
    제1 및 제2 바이어스 매트릭스 중 하나를 선택적으로 상기 컨벌루션 매트릭스에 합산하는 단계를 포함하고,
    상기 제1 바이어스 매트릭스는 1로 구성된 매트릭스이고,
    상기 제2 바이어스 매트릭스는 0으로 구성된 매트릭스인, 제어 방법.
  14. 제13항에 있어서,
    상기 필터링을 수행하는 단계는,
    상기 제1 및 제2 바이어스 매트릭스 중 하나가 합산된 컨벌루션 매트릭스에 활성화 함수를 적용하여, 복수의 출력 레이어를 획득하는 단계;
    상기 복수의 출력 레이어에 기초하여 FC(fully-connected) 레이어를 획득하는 단계; 및
    상기 FC 레이어에 포함된 각 영역들의 클래스 점수에 따라, 각 영역들의 특성을 식별하는 단계;를 포함하는, 제어 방법
  15. 제14항에 있어서,
    상기 FC 레이어를 획득하는 단계는,
    상기 복수의 출력 레이어에서 서로 대응되는 위치의 값을 합산하여, 상기 FC 레이어를 획득하는, 전자 장치.
PCT/KR2019/001510 2018-02-05 2019-02-07 전자 장치 및 그 제어 방법 WO2019151841A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020180013954A KR102161690B1 (ko) 2018-02-05 2018-02-05 전자 장치 및 그 제어 방법
KR10-2018-0013954 2018-02-05

Publications (1)

Publication Number Publication Date
WO2019151841A1 true WO2019151841A1 (ko) 2019-08-08

Family

ID=67478873

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2019/001510 WO2019151841A1 (ko) 2018-02-05 2019-02-07 전자 장치 및 그 제어 방법

Country Status (2)

Country Link
KR (1) KR102161690B1 (ko)
WO (1) WO2019151841A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012208597A (ja) * 2011-03-29 2012-10-25 Canon Inc パターン識別装置、パターン識別方法及びプログラム
US20170103309A1 (en) * 2015-10-08 2017-04-13 International Business Machines Corporation Acceleration of convolutional neural network training using stochastic perforation
WO2017129325A1 (en) * 2016-01-29 2017-08-03 Fotonation Limited A convolutional neural network
KR20170091140A (ko) * 2015-04-02 2017-08-08 텐센트 테크놀로지(센젠) 컴퍼니 리미티드 컨볼루션 신경망 모델의 트레이닝 방법 및 장치

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012208597A (ja) * 2011-03-29 2012-10-25 Canon Inc パターン識別装置、パターン識別方法及びプログラム
KR20170091140A (ko) * 2015-04-02 2017-08-08 텐센트 테크놀로지(센젠) 컴퍼니 리미티드 컨볼루션 신경망 모델의 트레이닝 방법 및 장치
US20170103309A1 (en) * 2015-10-08 2017-04-13 International Business Machines Corporation Acceleration of convolutional neural network training using stochastic perforation
WO2017129325A1 (en) * 2016-01-29 2017-08-03 Fotonation Limited A convolutional neural network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MUNSHI, AAFTAB ET AL.: "OpenGLES 2.0 Programming Guide", August 2008 (2008-08-01), XP0055628556, Retrieved from the Internet <URL:https://usermanual.wiki/Pdf/OpenGL20ES202020Programming20Guide.197713012/helpp> *

Also Published As

Publication number Publication date
KR102161690B1 (ko) 2020-10-05
KR20190100487A (ko) 2019-08-29

Similar Documents

Publication Publication Date Title
EP3742388B1 (en) Electronic device, image processing method thereof, and computer-readable recording medium
US11651214B2 (en) Multimodal data learning method and device
WO2019164237A1 (ko) 시스톨릭 배열을 이용하여 딥 러닝 연산을 수행하는 방법 및 장치
WO2019172546A1 (en) Electronic apparatus and control method thereof
WO2020017875A1 (en) Electronic apparatus, method for processing image and computer-readable recording medium
WO2020116768A1 (ko) 영상 처리 장치 및 그 동작방법
CN112200062A (zh) 一种基于神经网络的目标检测方法、装置、机器可读介质及设备
WO2021101134A1 (en) Electronic apparatus and control method thereof
WO2020149601A1 (ko) 3d cnn을 이용한 고속 영상 인식 방법 및 장치
WO2023224298A1 (ko) 카메라 모듈을 이용한 클라우드 기반 피부 분석 시스템 및 방법
WO2018212584A2 (ko) 딥 뉴럴 네트워크를 이용하여 문장이 속하는 클래스를 분류하는 방법 및 장치
WO2020055181A1 (ko) 영상 처리 장치 및 그 동작방법
CN114925320B (zh) 一种数据处理方法及相关装置
WO2024014706A1 (ko) 화질 개선을 수행하는 신경망 모델을 학습시키는 전자 장치 및 그 제어 방법
WO2018080204A1 (ko) 영상처리장치, 영상처리방법 및 컴퓨터 판독가능 기록 매체
WO2019151841A1 (ko) 전자 장치 및 그 제어 방법
WO2022108008A1 (en) Electronic apparatus and controlling method thereof
WO2020222378A1 (en) Convolution streaming engine for deep neural networks
WO2019198900A1 (en) Electronic apparatus and control method thereof
CN113222050B (zh) 图像分类方法、装置、可读介质及电子设备
WO2021045434A1 (ko) 전자 장치 및 이의 제어 방법
WO2021015403A1 (en) Electronic apparatus and controlling method thereof
KR20230013989A (ko) 이미지 처리 장치, 이의 동작 방법 및, 이를 포함하는 이미지 처리 시스템
WO2021054572A1 (ko) 디스플레이 장치 및 이의 영상 처리 방법
WO2019231254A1 (en) Processor, electronics apparatus and control method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19747191

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19747191

Country of ref document: EP

Kind code of ref document: A1