text: # import the necessary packages
  from keras.models import Sequential
  from keras.layers.convolutional import Conv2D, MaxPooling2D
  from keras.layers.normalization import BatchNormalization
  from keras.layers.core import Activation, Flatten, Dropout, Dense
  from keras.regularizers import l2
  from keras import backend as K
  
  
  class AlexNet:
      @staticmethod
      def build(width, height, depth, classes, reg=0.0002):
          # initlaize the model along with the input shape to be
          # 'channels last' and the chennels dimension itself
          model = Sequential()
          inputShape = (height, width, depth)
          chanDim = -1
  
          # if we are using 'channels first', update the input shape
          # and channel dimension
          if K.image_data_format() == 'channels_first':
              inputShape = (depth, height, width)
              chanDim = 1
          # Block #1: first CONV => ReLU => POOL layer set
          model.add(Conv2D(96, (11, 11), strides=(4, 4), input_shape=inputShape, padding='same', kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization(axis=chanDim))
          model.add(MaxPooling2D(pool_size=(3, 3), strides=(2, 2)))
          model.add(Dropout(0.25))
  
          # Block #2: first CONV => ReLU => POOL layer set
          model.add(Conv2D(256, (5, 5), strides=(4, 4), padding='same', kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization(axis=chanDim))
          model.add(MaxPooling2D(pool_size=(3, 3), strides=(2, 2)))
          model.add(Dropout(0.25))
  
          # Block #3: first CONV => ReLU => POOL layer set
          model.add(Conv2D(384, (3, 3), padding='same', kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization(axis=chanDim))
          model.add(Conv2D(384, (3, 3), padding='same', kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization(axis=chanDim))
          model.add(Conv2D(256, (3, 3), padding='same', kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization(axis=chanDim))
          model.add(MaxPooling2D(pool_size=(3, 3), strides=(2, 2)))
          model.add(Dropout(0.25))
  
          # Block #4: first set of FC => ReLU layers
          model.add(Flatten())
          model.add(Dense(4096, kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization())
          model.add(Dropout(0.5))
  
          # Block #5 second set of FC => ReLU layers
          model.add(Dense(4096, kernel_regularizer=l2(reg)))
          model.add(Activation('relu'))
          model.add(BatchNormalization())
          model.add(Dropout(0.5))
  
          # softmax classifier
          model.add(Dense(classes, kernel_regularizer=l2(reg)))
          model.add(Activation('softmax'))
  
          # return the constructed model
          return model
  