LEE- Bilgisayar Bilimleri-Yüksek Lisans

Bu koleksiyon için kalıcı URI

Gözat

Son Başvurular

Şimdi gösteriliyor 1 - 2 / 2
  • Öge
    Tek sahneli sıkıştırılmış videoda anomali tespiti
    (Lisansüstü Eğitim Enstitüsü, 2022-02-14) Çavaş, Sümeyye ; Töreyin, Behçet Uğur ; 704181019 ; Bilgisayar Bilimleri
    Sürekli olarak gelişen dünyamız sağladığı birçok kolaylık ile birlikte bunların bir sonucu olarak ortaya çözülmesi gereken yeni problemler çıkarmaktadır. Bu durum, teknolojinin sürekli olarak gelişmesi ihtiyacını doğurmuştur. Bu teknolojik gelişmenin bir parçası olarak, günden güne gelişen, yeni özelliklere sahip olan, giderek daha küçük bir boyuta sığdırılan ve erişebilirliği tüm dünyayı kapsamış olan kameraları gözümüzü çevirdiğimiz her tarafta görebilmekteyiz. Bu kadar etrafımızda olan kameralardan her bir gün veri kaydının gerçekleştirildiğini düşündüğümüzde, kaydolan bu veri miktarının muazzam seviyelere ulaşabileceğini çok rahat bir şekilde söyleyebiliriz. Ortaya çıkan bu verilerin insanlar tarafından sürekli olarak takip edilip kontrol altına alınması mümkün değildir. Bu noktada, çözüm olarak birçok sektörde insandan bağımsız akıllı sistemler geliştirilmiştir ve halen geliştirilmeye devam edilmektedir. Örnek olarak, pazarlama sektöründe bir ürüne olan talebin daha çok nasıl artırılabileceği gibi yada sağlık sektöründe bir hastalık için daha doğru karar veren sistemlerin nasıl geliştirilebileceği gibi yada savunma sektöründe daha güvenli sistemlerin nasıl oluşturulabileceği ve yolunda gitmeyen birşeyler olduğunda nasıl farkedilebileceği gibi çeşitli sorulara akıllı cevaplar sunan sistemler düşünülebilir. Bu tezde, kameralardan toplanan veriler üzerinde akıllı bir çıkarım yapma çalışması gerçekleştirilmiştir. Bu çıkarım, kameradan alınan bir video verisinin, normal seyrinde hareket edip etmediğini veya anormal herhangi bir durum içerip içermediğini tespit etmek şeklindedir. Bu çalışma, bir videonun çerçeve bazlı düzenlilik değerini grafik üzerinde gösterme ve tüm test videolarını kapsayacak şekilde modelin performansını değerlendirme şeklinde oluşturulmuştur. Videoda anomali tespiti üzerine şuana kadar birçok çalışma gerçekleştirilmiştir. Bu çalışmayı diğerlerin ayıran en önemli özellik, çalışmanın sıkıştırılmış video alanında ortaya çıkan hareket vektörleri kullanılarak gerçekleştirilmiş olmasıdır. Video sıkıştırma üzerine birçok standart geliştirilmiştir. Bu çalışmada, günümüzde yaygın olarak kullılan video sıkıştırma standartlarından biri olan H.265 standardına göre sıkıştırılmış olan videolar kullanılmıştır. Çalışma boyunca veri kümesi olarak, UCSD Pedestrian veri kümesi kullanılmıştır. Bu veri kümesinde, yaya yolu üzerindeki iki ayrı kameradan elde edilen videolar çerçeveler halinde sunulmuştur. Bu çerçeveler üzerindeki hareket vektörlerini çıkarabilmek için çeşitli işlemler gerçekleştirilmiştir. İlk olarak, bu çerçeveler bir araya getirilerek videolar oluşturulmuştur. Daha sonra her bir videonun sıkıştırılması amaçlanmıştır. Bunun için International Telecommunication Union (ITU) tarafından paylaşılan açık kaynak kod kullanılmıştır. Bu kaynak kodun derlenmesi sonucunda ortaya çıkan çalıştırılabilir dosya kullanılarak videolar üzerinde sıkıştırma işlemi gerçekleştirilmiştir. Sıkıştırma işleminden sonra, H.265 standardında, diğer bir ismi ile High Efficiency Video Coding (HEVC) standardında oluşmuş, .hevc uzantılı video verileri elde edilmiştir. Sıkıştırılan .hevc uzantılı videolar yine açık kaynak kodlu, GitlHevcAnalyzer analiz aracı kullanılarak incelenmiştir. Bu analiz aracı sıkıştırılmış videoya ait çeşitli bilgileri videonun çerçeveleri üzerinde göstermektedir. Ayrıca bu çerçeveleri üzerinde yer alan bilgiler ile indirmeye olanak sağlamaktadır. Bu araç sayesinde, sıkıştırılmış video üzerindeki hareket vektörleri videonun çerçeveleri üzerinde gösterilip, hareket vektörlerinin yer aldığı çerçeveler indirilerek kullanılmak üzere dışarıdaki bir ortama aktarılabilmektedir. Ayrıca bu araç açık kaynak kodlu olduğu için geliştirilip özelleştirilebilir hale getirilebilmesi de mümkündür. Örnek olarak, araç tarafından her bir çerçevenin tek tek indirilmesi mümkündür. Bizim çalışmamızda kullandığımız veri kümesinde ise 9210 tane çerçeve yer almaktadır. Bunların hepsinin araç üzerinden tek tek indirilmesi oldukça zahmetli ve uzun süren bir iş olacaktır. Bu süreci kolaylaştırmak amacıyla, bir videonun tüm çerçevelerini üzerindeki bilgiler ile birlikte tek seferde indirip dış ortama aktaracak kod geliştirilmiştir. GitlHevcAnalyzer aracı bu şekilde özelleştirilerek veri çıkarma sürecinin kolaylaşması sağlanmıştır. Hareket vektörlerini içeren çerçeveler model tarafından kullanılabilir hale gelmesi için çeşitli önişleme adımladından geçirilmiştir. İlk olarak sıkıştırma sonucunda hareket vektörlerinin asıl ortaya çıktığı 8 ve 8'in katı olan çerçeveler seçilmiştir. Diğer çerçeveler elenerek veri kümesine dahil edilmemiştir. Sonrasında, çerçeveler üzerindeki hareket vektörlerinin daha net bir şekilde görünmesi için, çerçevelerin yükseklik ve genişliği 480x720 olacak şekilde artırılmıştır. Daha sonra, hareket vektörleri dışındaki pikseller beyaz olacak şekilde tüm çerçeveler düzenlenmiştir. Böylece, çerçeveler üzerinde sadece hareket vektörleri bilgisinin yer alması sağlanmıştır. Son olarakta görüntüler grayscale formatına getirilmiştir. Bu işlem ile birlikte çerçeveler üzerindeki önişlemeler tamamlanarak model tarafından kullanılabilir hale getirilmiştir. Videoda anomali tespiti gerçekleştirmek için varyasyonel otomatik kodlayıcı tabanlı model kullanılmıştır. Bu varyasyonel otomatik kodlayıcıya, hareket vektörlerini içeren çerçeveler üçerli gruplar halinde verilmiştir. Böylece modelin geçmiş çerçevelerden de öğrenebilmesi sağlanmıştır. Varyasyonel otomatik kodlayıcının ilk katmanlarını konvolüsyonel katmanlar oluşmaktadır. Bu sayede, video çerçevelerindeki uzamsal bilgilerin öğrenilmesi amaçlanmıştır. Sonraki katmanlarını ise konvolüsyonel LSTM katmanlarından oluşmaktadır. Bu sayede ise, video çerçeveleri arasındaki zamansal bilgilerin öğrenilmesi amaçlanmıştır. Böylece, videodaki anomalinin, uzam-zamansal bir öğrenme gerçekleştiren varyasyonel otomatik kodlayıcının temelinde yer alan yeniden oluşturma hatasına dayalı olarak tespit edilmesi amaçlanmıştır. İlk olarak, tamamen normal videolardan oluşan eğitim kümesi ile model eğitilmiştir. Sonrasında, gerçekleştirilen eğitim sonucunda oluşan yeniden oluşturulma hatasının dağılımından yararlanılarak eşik değer seçimi yapılmıştır. Çerçeve bazlı anomali tespiti yaparken bu eşik değer kullanılmıştır. Model performansını değerlendirmek için iki farklı yöntem kullanılmıştır. İlk olarak, her bir test videosu için çerçeve bazlı düzenlilik skoru grafiği çıkarılmıştır. Bu grafik sayesinde videonun hangi çerçevesinden itibaren anormal bir durum gerçekleştiği, hangi çerçevelerden itibaren normale dönüldüğü gözlemlenebilmektedir. Test veri kümesinde normal ve anormal olacak şekilde çerçeve bazlı bir etiketleme mevcuttur. Bu çalışmada da, test veri kümesinde yer alan her bir videonun çerçeveleri için seçilen eşik değere göre tahminleme yapılmıştır. Böylece, ikinci olarak da, model tarafından yapılan tahminleme ile gerçek veri etiketleri kullanılarak modelin çerçeve bazlı tahminleme performansı değerlendirilmiştir. Oluşturulan düzenlilik skoru grafikleri incelendiğinde video akışına göre genel olarak tutarlı sonuçlar gösterdiği gözlemlenmiştir. Çerçeve bazlı etiketlemenin sonuçaları incelendiğinde ise, UCSD Ped1 veri kümesinde anormal çerçevelerin %60'lık kısmının, UCSD Ped2 veri kümesinde ise anormal çerçevelerin %78'lik kısmının tespit edilebilidiği görülmüştür. Sonuç olarak, bir videonun çerçevelerindeki tüm bilgileri kullanmak yerine, sadece bu çerçevelerdeki hareket vektörleri kullanılarak yapılmış olan bu çalışmanın etkin sonuçlar çıkardığı görülmüştür.
  • Öge
    Accelerating molecular docking using machine learning methods
    (Graduate School, 2022-09-12) Bande, Abdulsalam Yazid ; Baday, Sefer ; 704191001 ; Computer Science
    Drug discovery is a very challenging process that is not only time-consuming but also highly expensive and billions of dollars are invested in its research and development. Not only is the process expensive, the quality and safety of the final product also needs to be addressed. Computer Aided Drug Design (CADD) refers to computational techniques that are used to design and develop new compounds. An example of CADD is virtual screening (VS). VS is one of the well-established approaches in drug discovery that speeds up the search for a bioactive molecule and reduces costs associated with experiments. It is essentially a technique to search libraries of small molecules with the goal of finding the ones that bind onto a particular target biomolecule. The target can be a protein, nucleic acid etc. There are two types of VS: structure-based virtual screening (SBVS) and ligand-based virtual screening (LBVS). SBVS is used when the 3D structure of the target protein is known, in this case, usually docking calculation is used to find the complex structure of ligand with the drug target. Docking calculations are one of the commonly used and highly appreciated structure-based drug discovery methods. Moreover, different ligands can have different binding affinities when docked on receptors, so scoring functions are used in ranking the ligands during the VS process. The scoring functions take into account different factors of molecules and are categorised into knowledge-based, force-field-based and empirical based. Different scoring functions can be used in software tools like AutoDock-Vina. Moreover, for a ligand to be docked onto a receptor, there can be a high number of conformational degrees of freedom of both the molecules and computation can increase exponentially. So, sampling methods are applied to select conformations of ligands in the active site of the protein. There are a variety of algorithms used in sampling and they all have different characteristics. Genetic algorithms (GA) and Monte Carlo (MC) are some of some algorithms based on stochastic search and the different algorithms can also be accessed from software tools such as AutoDock-Vina. In docking, the flexibility of both ligand and the receptor can be taken into account. In general, there are two forms of docking, and they are flexible receptor-flexible ligand and rigid receptor-flexible ligand. When the 3D structure is not known, LBVS is used and different searching algorithms such as similarity search, pharmacophore searching can be applied to identify structures that bind onto a target. Quantitative Structure-Activity Relationships (QSAR) modelling is also a computational method that is used in LBVS and it is used in finding relationships between structural properties and bioactivities of compounds. Furthermore, VS helps to narrow down the search space of chemical space and allows the selecting fewer and more probable candidate compounds for experimental testing. Databases for chemical structures of small molecules have been growing rapidly. For example, the ZINC database contains 230 million molecules ready to purchase. However, docking millions of molecules comes with many challenges, for example a good computing infrastructure and expertise in the HPC environment are needed. The aim of this work is to accelerate molecular docking calculations by predicting docking scores without explicitly performing docking calculations. For example, instead of docking 4 million molecules onto a target, only 7k of the 4 million molecules could be docked and the docking results can be used to train a machine learning model that can be used to predict the docking results of the remaining molecules. This approach saves a significant amount of computation resources and time. This work makes use of multiple machine learning models that includes a deep neural network based model, which is a long short term memory neural network model (LSTM). Neural networks models, which were originally inspired by the biological brain, contain a series of layers and in each layer a mathematical operation is performed, and the result is fed into a subsequent layer. A final layer then outputs a single scalar. In the case of this work, the final output is a docking score. Furthermore, each layer extracts a certain information from the original input. In this work, the neural network (LSTM) is coupled with an attention mechanism which helps the model focus more on the more important part of the input. The neural network model is implemented using the popular machine learning framework which is Pytorch. Other models used in this research are XGBoost which is implemented from the XGBoost python library, decision tree regressor and stochastic gradient descent regressor from the scikit-learn python library. We worked on two datasets that were produced in our group. In one dataset a ligand library of 3.5 million molecules were docked into three different targets, in the second dataset 400.000 molecules were docked into four targets. The ligands from all the datasets are represented in Simplified molecular-input line-entry system (SMILES) and the unit of the docking scores is kcal/mol. The SMILES are converted to a numeric form using one or a concatenation of three descriptors used in the system. Molecular ACCess System (MACCS) is one of the descriptors used. This descriptor starts with a 167-bit vector of zeros and each position is indexed with one if it satisfies a condition, for example, the condition can be if the molecule contains a nitrogen atom. The second descriptor used is One Hot Encoding, it also starts with a vector of zeros and then indexed with one if a condition is satisfied at any position. The final descriptor used is Extended Connectivity Circular Fingerprints (ECFPs). This particular descriptor also encodes SMILES into bits of ones and zeros, but unlike the other ones, it uses more chemical information of molecules for the encoding process. Furthermore, concatenated descriptors have also been experimented with and it was this technique that led to the best results. We achieved an astonishing R2 of 0.90 in target two using an LSTM. In general, the results were also good in terms of the MSE and MAE metric. For example, in all the different cases of different models and different training set sizes, the average MSE was below 0.30 and the MAE was below 0.45. Furthermore, the results of the second dataset were surprising to us as training using 7k using LSTM resulted in R2 less than 0.78 in all the targets and the results of the other models were even worse. A deep analysis between the dataset was conducted in order to explain the difference of results. Furthermore, we did not encounter overfitting issues in training, in many cases results for the models training phase were the same as the ones in the testing phase. For instance, in target one, training and testing on LSTM for 7k achieved an R2 of 0.83 for both cases. Moreover, the system is designed with ease of use in mind. All the user needs to provide is a csv file containing smiles and their respective docking scores of a specific target, the system then outputs a model that the user can use for future smiles predictions. In terms of the training times of the models, apart from the LSTM model, most of the models training was in less than a minute as this was due to optimizations of the XGBoost and the scikit-learn libraries. Training on LSTM using a size of 7k was in less than 2 minutes and testing up to 3.5 molecules was accomplished in approximately an hour. In conclusion, docking of huge chemical libraries requires good computational power and coding expertise that some researchers lack. In this work, the methodology we proposed can be used to accelerate screening of very large libraries easily even on a personal computer. Using just a small percentage of millions of molecules, some of the models on some targets achieved good results. The importance of molecular descriptors was also demonstrated and even powerful models like neural networks are impacted by the descriptors.