Face Recognition: The Design of Hybrid Solutions

Published:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Chapter Four

The Design of Hybrid Solution

  1. Introduction:-

In general, any Hybrid solutions used resources in optimum way so; many of these resources have difficult in executed phase that caused why the system needs more experience for management in design and code.

The hybrid solution mean two or more methods or parts combined together to perform the one solution without mediators or integrations just suitable ways to deal with each part for solution without any problem.

  1. The Detailed Design of the Hybrid Solution Modules:-

As any system the Hybrid solution have many of modules and sub modules. The main modules of this system as the following:-

  1. Capture Images

Any systems need input to extract output so, our solutions need input such as image to do some process to detect if it can recognize as face or not.

  1. Filters and Resize

To do some process in this image must has specific size defined by our system and apply some filters on it to increase the quality and chance for work in good situations.

  1. Face detection

This part is working in GPU to upload the image to the GPU then apply Haar cascades algorithms to detect the face dimensions.

  1. Face recognition

This part is working in CPU part to extract features face then compare with other to find the real face.

  1. Tools for design and Implementation:-

The details are for these tools as shown in fig (4.1).

  1. Windows Form Microsoft .Net C# 2010

Microsoft Visual Studio is an Integrated Development Environment (IDE) from Microsoft. It can be used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all platforms supported by Microsoft Windows, Windows Phone, Windows CE, .NET Framework, .NET Compact Framework and Microsoft Silverlight.

  1. C#

C# is pronounced “see sharp”. C# is an object-oriented programming language and part of the .NET family from Microsoft. The most recent version is C# 4.0 and it is part of Visual Studio 2010. C# is very similar to C++ and Java. C# is developed by Microsoft and works only on the Windows platform.

  1. .NET Framework

The .NET Framework (pronounced “dot net”) is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allow language interoperability (each language can use code written in other languages). The .NET library is available to all the programming languages that .NET supports. Programs written for the .NET Framework execute in a software environment, known as the Common Language Runtime (CLR), an application virtual machine that provides important services such as security, memory management, and exception handling. The class library and the CLR together constitute the .NET Framework.

  1. Open CV 2.4.8

OpenCV is released under a BSD license and hence it’s free for both academic and commercial use. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing. Enabled with OpenCL, it can take advantage of the hardware acceleration of the underlying heterogeneous compute platform. Adopted all around the world, OpenCV has more than 47 thousand people of user community and estimated number of downloads exceeding 7 million. Usage ranges from interactive art, to mines inspection, stitching maps on the web or through advanced robotics.

  1. Emgucv-windows-universal-cuda2.9.0.1922. Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library. Allowing OpenCV functions to be called from .NET compatible languages such as C#, VB, VC++, Iron-Python etc. The wrapper can be compiled in Mono and run on Windows, Linux, Mac OS X, iPhone, iPad and Android devices.
  1. NVIDIA GPU and CUDA.

CUDA™ is a parallel computing platform and programming model that enables dramatic increases in computing performance by harnessing the power of the graphics processing unit (GPU).

Since its introduction in 2006, CUDA has been widely deployed through thousands of applications and published research papers, and supported by an installed base of over 300 million CUDA-enabled GPUs in notebooks, workstations, compute clusters and supercomputers. Learn more about GPU-accelerated applications available for astronomy, biology, chemistry, physics, data mining, manufacturing, finance, and more on the software solutions page.

Software developers, scientists and researchers can add support for GPU acceleration in their own applications using one of three simple approaches:

Drop in a GPU-accelerated library to replace or augment CPU-only libraries such as MKL BLAS, IPP, FFTW and other widely-used libraries

Automatically parallelize loops in FORTRAN or C code using opencast directives for accelerators

Develop custom parallel algorithms and libraries using a familiar programming language such as C, C++, C#, FORTRAN, Java, Python, etc.

Figure (4.1): Dataflow structure of hybrid algorithm for face recognition

  1. Concepts of Algorithms

Algorithm is method that can be used by a computer for the solution of a problem. The main problem in Face Recognition is the speed factor so; we focus in this issue as a major problem in our thesis and we design the algorithm as the following:-

  1. Main Design:

Figure (4.2): Flow chart of hybrid algorithm

  • As shown in the fig (4.2) above, we execute hybrid solution by using GPU and CPU at the sequence to release some overhead on CPU by sharing GPU in this process.
  • In other hand, we apply parallel solution in CPU work in part of face recognitions by loading train face parallel ways in the Random Access Memory (RAM) and extract features from there before go to find face phase to compare all features from all train faces with the new face to detect if this face is unknown or defined before. (See chapter 3 to see parallel solution in our thesis).
    1. Activity flow in algorithm design:
  • Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams are intended to model both computational and organizational processes (i.e. workflows). Activity diagrams show the overall flow of control.
  • Activity diagrams are constructed from a limited number of shapes, connected with arrows
  • In our algorithm the main activity is in recognition phase and the other one is train phase.
  1. In train face model

Figure (4.3): Activity of train phase in hybrid algorithm

Step

Number

Activities

1

GUI sends Image from folder to start module work

2

Image resizing in fix size determine by admin then apply in some image processing filters to increase image quality.

3

New Image applies haar cascades algorithms to detect the face and remove other part of image.

4

Only face clone in other image memory stream and insert in object has name of person face and random number to avoid redundancy.

5

Create file in hard disk to new image and insert other informations like image path and image name in XML DB

Table (4.1): Activity Table of train phase in hybrid algorithm

Pseudo code for train phase

  1. Initialization

Select how get image

If choose camera  open cam

Else open file dialog to select image

Create Bitmap  P

Put new image in P

Send P , image-viewer width , height and quality=72 to Resize new image and set its quality 72

Calculate time

Add log DB

  1. GPU part (Face detection)

Open new bitmap in GPU memory P-GPU

Send P  P-GPU

Load Haar cascades XML and objects  H

Hdetect(P-GPU)

Create new CPU bitmap P_CPU

Send H.result  P_CPU

Calculate time

Add log

  1. CPU part (Face saving)

If (P_CPU not = empty) then

P_gray  P_CPU. grayscale

Take face name from GUI P_name

Create image file P_file

P_file  P_gray

P_file.name = P_name + random Numebr

Save P_file in Hard Disk

Calculate time

Add log

  1. In face recognition model

Figure (4.4): Activity of recognition phase in hybrid algorithm

Step

Number

Activities

1

GUI sends Image from folder to start module work

2

Image resizing in fix size determine by admin then apply in some image processing filters to increase image quality.

3

New Image goes to GPU to apply haar cascades algorithms to detect the face and remove other parts of image and return to CPU.

4

Load train image from DB and extract features for them in parallel way then new face return to CPU to extract face features and compare with other faces in DB.

5

If find face from DB most close with new face print name in the GUI else print unknown

Table (4.2): Activity Table of train phase in hybrid algorithm

Pseudo code for recognition phase

  1. Initialization

Select how get image

open file dialog to select image

Create Bitmap  P

Put new image in P

Send P , image-viewer width , height and quality=72 to Resize new image and set its quality 72

Calculate time

Add log

  1. GPU part (Face detection)

Open new bitmap in GPU memory P-GPU

Send P  P-GPU

Load Haar cascades XML and objects  H

Hdetect(P-GPU)

Create new CPU bitmap P_CPU

Send H.result  P_CPU

Calculate time

Add log

  1. CPU part (Face recognition)

Create object from faceReco class P_Reco

If (P_CPU not = empty) then

Open Parallel Case

{

P_Reco load All Train Face

P_Reco Extract features face for All Train Face

}

P_Reco find P_CPU

Extract P_CPU features

Compare all features faces with P_CPU features

If find = true

Print P_CPU.name on screen

Else Print “Unknown” on screen

Calculate time

Add log

Writing Services

Essay Writing
Service

Find out how the very best essay writing service can help you accomplish more and achieve higher marks today.

Assignment Writing Service

From complicated assignments to tricky tasks, our experts can tackle virtually any question thrown at them.

Dissertation Writing Service

A dissertation (also known as a thesis or research project) is probably the most important piece of work for any student! From full dissertations to individual chapters, we’re on hand to support you.

Coursework Writing Service

Our expert qualified writers can help you get your coursework right first time, every time.

Dissertation Proposal Service

The first step to completing a dissertation is to create a proposal that talks about what you wish to do. Our experts can design suitable methodologies - perfect to help you get started with a dissertation.

Report Writing
Service

Reports for any audience. Perfectly structured, professionally written, and tailored to suit your exact requirements.

Essay Skeleton Answer Service

If you’re just looking for some help to get started on an essay, our outline service provides you with a perfect essay plan.

Marking & Proofreading Service

Not sure if your work is hitting the mark? Struggling to get feedback from your lecturer? Our premium marking service was created just for you - get the feedback you deserve now.

Exam Revision
Service

Exams can be one of the most stressful experiences you’ll ever have! Revision is key, and we’re here to help. With custom created revision notes and exam answers, you’ll never feel underprepared again.