If the value of Feature Map is greater than 0, it will keep as it is. Now what ReLu activation function does in CNN? ReLu just convert negative number in feature map to 0. ReLu operation is adding nonlinearity in convolution neural network model. Once we calculate the feature map (output of convolution operation/ convolution layer), we need to apply ReLu activation function to each (Box filter, Vertical filter and Diagonal filter) feature map. # Output after applying Diagonal line Filter with stride 1įeatureMap_Diagonal = conv2d(input_data_matrix, Diagonal_line_Filter_matrix) # -įeatureMap_Box = conv2d(input_data_matrix, box_filter_matrix)įeatureMap_Vertical = conv2d(input_data_matrix, vertical_line_Filter_matrix) ![]() Return (featureMap_Output / total_number_of_element_in_filter_matrix) Total_number_of_element_in_filter_matrix = kernal_matrix.shape * kernal_matrix.shape # Taking average with divided by 9 (total number of element in filter matrix) Window = strided4D_v2(input_matrix, kernal_matrix, 1)įeatureMap_Output = np.sum(np.multiply(kernal_matrix, window)) # Create blank featureMap matrix for stride 1įeatureMap_Output = np.zeros((featureMap_row, featureMap_col)) # Function to Calculate featuremap matrix for box filter # Calculate shape of the feature map (output matrix from convolution layer)įeatureMap_row = strided4D_v2(input_data_matrix, box_filter_matrix, 1).shapeįeatureMap_col = strided4D_v2(input_data_matrix, box_filter_matrix, 1).shape Return view_as_windows(input_image_matrix, kernal_matrix.shape, step=stride) # Extract each window from input matrix by stride operationĭef strided4D_v2(input_image_matrix,kernal_matrix,stride): Vertical_line_Filter_matrix = np.asarray(vertical_line_Filter_list, dtype=np.float32)ĭiagonal_line_Filter_matrix = np.asarray(Diagonal_line_Filter_list, dtype=np.float32) # Convolution layer (convolution operation)īox_filter_matrix = np.asarray(box_filter_list, dtype=np.float32) If you are working with 64圆4x3 (3 is bands: Red, Green, Blue in short RGB band) images, that means you will have 12288 (64* 64*3) input features. Given a image you need to classify that image is dog or not. Let’s say we are doing image classification. One of the challenges you will face while solving computer vision problem with basic neural network is that input size. Advantages of CNN over Basic Neural Network Object Detection: Detect any real world object like person, phone etc.Face Detection: Now a days almost each phone have this feature in it’s camera.Recommendation engines: Amazon uses CNN image recognition to suggest in the “you might also like” section. ![]() Image Search: Google image search is an example of Visual Search. ![]() Image tag is a word or a word combination that describes the images Image tagging: It is one of the foundation elements of visual search.Let’s see some real world application of CNN: Application of CNNįorm OCR (Optical Character Recognition) to self-driving cars, every where Convolution Neural Network is used. In this CNN deep learning tutorial I will give you a very basic explanation of Convolutional Neural Network (ConvNet/ CNN), so that it can be understandable easily. Convolutional Neural Network(CNN/ ConvNet) is a deep learning algorithm for image analysis and Computer Vision.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |