{"id":18244215,"url":"https://github.com/hayatiyrtgl/cell_classification_cnn","last_synced_at":"2025-04-08T18:33:26.805Z","repository":{"id":234282645,"uuid":"788574938","full_name":"HayatiYrtgl/Cell_Classification_CNN","owner":"HayatiYrtgl","description":" This code trains a CNN in Keras to classify cell images (infected/uninfected). It sets up data generators, defines model architecture with convolutional layers, applies regularization, configures callbacks, and trains the model for binary classification.","archived":false,"fork":false,"pushed_at":"2024-04-18T17:21:49.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T14:51:40.500Z","etag":null,"topics":["cnn","cnn-architecture","cnn-classification","cnn-for-visual-recognition","cnn-keras","cnn-model","convolutional","convolutional-layers","convolutional-neural-network","convolutional-neural-networks","python","python-classifiers","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HayatiYrtgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-18T17:21:05.000Z","updated_at":"2024-04-18T17:23:12.000Z","dependencies_parsed_at":"2024-04-18T19:08:53.995Z","dependency_job_id":null,"html_url":"https://github.com/HayatiYrtgl/Cell_Classification_CNN","commit_stats":null,"previous_names":["hayatiyrtgl/cell_classification_cnn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HayatiYrtgl%2FCell_Classification_CNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HayatiYrtgl%2FCell_Classification_CNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HayatiYrtgl%2FCell_Classification_CNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HayatiYrtgl%2FCell_Classification_CNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HayatiYrtgl","download_url":"https://codeload.github.com/HayatiYrtgl/Cell_Classification_CNN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247902145,"owners_count":21015401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","cnn-architecture","cnn-classification","cnn-for-visual-recognition","cnn-keras","cnn-model","convolutional","convolutional-layers","convolutional-neural-network","convolutional-neural-networks","python","python-classifiers","python3"],"created_at":"2024-11-05T09:15:48.093Z","updated_at":"2025-04-08T18:33:26.779Z","avatar_url":"https://github.com/HayatiYrtgl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Explanation of the code line by line:\n\n1. `from keras.layers import *`: Imports all layers from the Keras library. This allows you to use any layer without specifying the module.\n\n2. `from keras.models import Sequential`: Imports the Sequential model from Keras. Sequential is a linear stack of layers.\n\n3. `from keras.utils import to_categorical`: Imports a utility function to convert class vector (integers) to binary class matrix.\n\n4. `import numpy as np`: Imports the numpy library with the alias np.\n\n5. `from keras.regularizers import l1`: Imports L1 regularization.\n\n6. `from keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard`: Imports various callbacks used during training.\n\n7. `from keras.preprocessing.image import ImageDataGenerator`: Imports the ImageDataGenerator class from Keras for real-time data augmentation.\n\n8. `train_path = \"../DATASET/cell_images/train\"`: Specifies the path to the training data directory.\n\n9. `test_path = \"../DATASET/cell_images/test\"`: Specifies the path to the test data directory.\n\n10. `train_generator = ImageDataGenerator(...)`: Creates an ImageDataGenerator object for training data augmentation.\n\n11. `test_generator = ImageDataGenerator(...)`: Creates an ImageDataGenerator object for test data preprocessing.\n\n12. `train_set = train_generator.flow_from_directory(...)`: Generates batches of augmented data for training from the specified directory.\n\n13. `test_set = test_generator.flow_from_directory(...)`: Generates batches of augmented data for testing from the specified directory.\n\n14. `early_stopping = EarlyStopping(...)`: Defines the early stopping criteria for training.\n\n15. `tensorboard = TensorBoard(...)`: Configures TensorBoard for visualization during training.\n\n16. `model_checkpoint = ModelCheckpoint(...)`: Configures model checkpointing to save the best model during training.\n\n17. `callbacks_list = [early_stopping, tensorboard, model_checkpoint]`: Creates a list of callbacks to be used during training.\n\n18. `model = Sequential()`: Creates a Sequential model.\n\n19. `model.add(Conv2D(...))`: Adds a convolutional layer to the model with specified parameters.\n\n20. `model.add(MaxPooling2D(...))`: Adds a max pooling layer to the model.\n\n21. `model.add(BatchNormalization())`: Adds a batch normalization layer to the model.\n\n22. `model.add(Flatten())`: Flattens the input to a one-dimensional array.\n\n23. `model.add(Dense(...))`: Adds a fully connected dense layer to the model.\n\n24. `model.summary()`: Prints a summary of the model architecture.\n\n25. `model.compile(...)`: Compiles the model with specified loss function, optimizer, and metrics.\n\n26. `model.fit(...)`: Trains the model using the training data generator, with specified parameters such as number of epochs, batch size, validation split, and callbacks.\n\nThat's a comprehensive overview of what each line of the code does. Let me know if you need further clarification on any specific part!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhayatiyrtgl%2Fcell_classification_cnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhayatiyrtgl%2Fcell_classification_cnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhayatiyrtgl%2Fcell_classification_cnn/lists"}