Table of Contents
1.1 Data Loading and Preperation
1.2 Mean and Variance Normalization
2. Model Selection and construction
3. Model training and prediction
3.3 Performance evaluation function
Introduction
The project is to classify mixed patterns of proteins in microscope images. More specifically, the project is to predict protein organelle localization labels for each sample. The dataset is provided by The Human Protein Atlas. There are 28 different labels present in the dataset as shown in Table 1. All image samples are represented by four filters, the protein (green) and three cellular landmarks: nucleus (blue), microtubules (red), endoplasmic reticulum (yellow). Therefore, green filters should be used to predict labels and other filters used as references[1].
Table 1 Categories and corresponding labels
label | Category |
0 | Nucleoplasm |
1 | Nuclear membrane |
2 | Nucleoli |
3 | Nucleoli fibrillar center |
4 | Nuclear speckles |
5 | Nuclear bodies |
6 | Endoplasmic reticulum |
7 | Golgi apparatus |
8 | Peroxisomes |
9 | Endosomes |
10 | Lysosomes |
11 | Intermediate filaments |
12 | Actin filaments |
13 | Focal adhesion sites |
14 | Microtubles |
15 | Microtubule ends |
16 | Cytokinetic bridge |
17 | Mitotic spindle |
18 | Microtubule organizing center |
19 | Centrosome |
20 | Lipid droplets |
21 | Plasma membrane |
22 | Cell junctions |
23 | Mitochondria |
24 | Aggresome |
25 | Cytosol |
26 | Cytoplasmic bodies |
27 | Rods&rings |
The code to get the image and four images of one sample are shown below (size of the image in each channel: (512, 512, 3)).
test_img_sample=cv2.imread("../input/human-protein-atlas-image-classification/train/7030d472-bb9a-11e8-b2b9-ac1f6b6435d0_blue.png")
plt.imshow(test_img_sample)
test_img_sample.shape
Figure 1 (a) Yellow filter, (b) Blue filter , (c) Green filter, (d) Red filter
1. Data Pre-processing
In machine learning, data and features determine the upper limit of the results, model selection and optimization is to approach this upper limit. Feature engineering is used to remove impurities and redundancy from the original data, allowing the model to fit quickly. Unlike traditional machine learning, there's no need to artificially synthesize advanced complex features in deep learning. It only needs human's prior knowledge to process first-order features, and then deep learning will learn relevant complex features by itself.
1.1 Data Loading and Preperation
The images and their corresponding targets are stored in the following format:
path_to_train = '../input/human-protein-atlas-image-classification/train'
data = pd.read_csv('../input/human-protein-atlas-image-classification/train.csv')
print(data)
Convert the data into array using the following code:
train_dataset_info = []
for name, la